:root {
    --primary-color: #0066cc;
    --primary-dark: #004999;
    --secondary-color: #ff6b00;
    --dark-bg: #1a1a1a;
    --light-bg: #f8f9fa;
    --text-dark: #2c3e50;
    --text-light: #ffffff;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    overflow-x: hidden;
}

.navbar {
    backdrop-filter: blur(10px);
    background-color: rgba(26, 26, 26, 0.95) !important;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
}

.navbar-brand {
    font-size: 1.5rem;
    letter-spacing: -0.5px;
}

.navbar .btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border: none;
    border-radius: 50px;
    padding: 0.5rem 1.5rem;
    transition: var(--transition);
}

.navbar .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 102, 204, 0.4);
}

.hero-section {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-image: url('/static/modern_car_parts_aut_15e634ab.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    overflow: visible;
    z-index: 100;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 102, 204, 0.9) 0%, rgba(0, 73, 153, 0.8) 100%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    color: var(--text-light);
    padding: 2rem;
    margin-top: 70px;
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-weight: 800;
    margin-bottom: 1.5rem;
    line-height: 1.2;
    text-shadow: 2px 4px 8px rgba(0, 0, 0, 0.3);
}

.hero-subtitle {
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    margin-bottom: 2.5rem;
    opacity: 0.95;
    font-weight: 300;
}

.hero-buttons {
    transition: opacity 0.3s ease, visibility 0.3s ease;
    position: relative;
    z-index: 1;
}

.hero-buttons.searching {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.hero-buttons .btn {
    border-radius: 50px;
    padding: 1rem 2.5rem;
    font-weight: 600;
    font-size: 1.1rem;
    transition: var(--transition);
    margin: 0.5rem;
}

.hero-buttons .btn-primary {
    background: var(--text-light);
    color: var(--primary-color);
    border: none;
}

.hero-buttons .btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(255, 255, 255, 0.3);
}

.hero-buttons .btn-outline-light {
    border: 2px solid var(--text-light);
    color: var(--text-light);
}

.hero-buttons .btn-outline-light:hover {
    background: var(--text-light);
    color: var(--primary-color);
    transform: translateY(-3px);
}

.hero-scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    animation: bounce 2s infinite;
}

.hero-scroll-indicator i {
    font-size: 2rem;
    color: var(--text-light);
    opacity: 0.8;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    40% {
        transform: translateX(-50%) translateY(-10px);
    }
    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}

.animate-fade-in {
    animation: fadeInUp 0.8s ease-out;
}

.animate-fade-in-delay {
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.animate-fade-in-delay-2 {
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.animate-fade-in-delay-3 {
    animation: fadeInUp 0.8s ease-out 0.6s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.categories-section {
    padding: 5rem 0;
    position: relative;
    z-index: 1;
}

.section-title {
    font-size: 2.8rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.section-subtitle {
    font-size: 1.2rem;
    color: #6c757d;
    margin-bottom: 3rem;
}

.category-card {
    border-radius: 20px;
    overflow: hidden;
    transition: var(--transition);
    height: 500px;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.category-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.category-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

.category-image {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    position: relative;
}

.category-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.7) 100%);
    display: flex;
    align-items: flex-end;
    padding: 3rem;
    transition: var(--transition);
}

.category-card:hover .category-overlay {
    background: linear-gradient(to bottom, rgba(0, 102, 204, 0.7) 0%, rgba(0, 73, 153, 0.9) 100%);
}

.category-content {
    color: var(--text-light);
}

.category-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    display: block;
}

.category-title {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.category-description {
    font-size: 1.1rem;
    opacity: 0.95;
    margin-bottom: 1rem;
}

.category-content .btn {
    border-radius: 50px;
    padding: 0.75rem 2rem;
    font-weight: 600;
}

.features-section {
    background: var(--light-bg);
    padding: 5rem 0;
}

.feature-card {
    padding: 2.5rem;
    background: white;
    border-radius: 15px;
    transition: var(--transition);
    height: 100%;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.feature-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
}

.feature-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.feature-icon i {
    font-size: 2rem;
    color: white;
}

.feature-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.feature-text {
    font-size: 1.1rem;
    color: #6c757d;
    line-height: 1.8;
}

.cta-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--text-light);
    padding: 5rem 0;
}

.cta-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
}

.cta-text {
    font-size: 1.3rem;
    opacity: 0.95;
    margin-bottom: 2rem;
}

.cta-section .btn {
    border-radius: 50px;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    background: white;
    color: var(--primary-color);
    border: none;
    transition: var(--transition);
}

.cta-section .btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(255, 255, 255, 0.3);
}

.footer-section {
    padding: 2rem 0;
}

@media (max-width: 768px) {
    .hero-section {
        height: 80vh;
        background-attachment: scroll;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.2rem;
    }
    
    .hero-buttons .btn {
        display: block;
        width: 100%;
        margin: 0.5rem 0;
    }
    
    .category-card {
        height: 400px;
        margin-bottom: 1.5rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .cta-title {
        font-size: 2rem;
    }
    
    .navbar-brand {
        font-size: 1.2rem;
    }
}

@media (max-width: 576px) {
    .category-overlay {
        padding: 2rem;
    }
    
    .category-title {
        font-size: 1.8rem;
    }
    
    .category-icon {
        font-size: 2.5rem;
    }
}

.language-switcher-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 1000;
}

/* Hero Search Bar */
.hero-search {
    max-width: 700px;
    margin: 2.5rem auto;
    position: relative;
}

.search-container {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    transition: var(--transition);
}

.search-container:focus-within {
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}

.search-input {
    flex: 1;
    border: none;
    padding: 1.2rem 2rem;
    font-size: 1.1rem;
    background: transparent;
    outline: none;
}

.search-input::placeholder {
    color: #999;
}

.btn-search {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border: none;
    padding: 1.2rem 2rem;
    color: white;
    cursor: pointer;
    transition: var(--transition);
}

.btn-search:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
}

.btn-search i {
    font-size: 1.2rem;
}

/* Search Results */
.search-results {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(700px, 90vw);
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s ease, opacity 0.4s ease, transform 0.4s ease;
    z-index: 99999;
}

.search-results.show {
    max-height: min(700px, 85vh);
    opacity: 1;
    overflow-y: auto;
}

/* Responsive adjustments for smaller screens and zoom */
@media (max-height: 700px) {
    .search-results.show {
        max-height: 75vh;
    }
}

@media (max-height: 500px) {
    .search-results.show {
        max-height: 65vh;
    }
}

@media (max-width: 768px) {
    .search-results {
        width: 95vw;
        border-radius: 15px;
    }
    
    .search-results.show {
        max-height: 80vh;
    }
}

@media (max-width: 480px) {
    .search-results {
        width: 98vw;
        border-radius: 10px;
    }
    
    .search-results.show {
        max-height: 70vh;
    }
}

/* Search backdrop - visual only, doesn't block clicks */
.search-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 99998;
}

.search-backdrop.show {
    opacity: 1;
    pointer-events: none;
}

.search-results::-webkit-scrollbar {
    width: 10px;
}

.search-results::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.search-results::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

.search-results::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

.products-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
}

.search-product-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 12px;
    transition: var(--transition);
}

.search-product-card.clickable {
    cursor: pointer;
}

.search-product-card:hover {
    background: #e9ecef;
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.product-image {
    width: 90px;
    height: 90px;
    background-size: cover;
    background-position: center;
    background-color: white;
    border-radius: 8px;
    flex-shrink: 0;
}

.product-details {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.product-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
}

.product-number {
    font-size: 0.85rem;
    color: #6c757d;
    margin-bottom: 0.25rem;
}

.product-description {
    font-size: 0.85rem;
    color: #495057;
    margin-bottom: 0.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0.25rem 0 0 0;
}

.product-login-required {
    font-size: 0.9rem;
    color: #dc3545;
    font-weight: 600;
    margin: 0.25rem 0 0 0;
}

.product-login-required i {
    font-size: 0.85rem;
}

.login-prompt {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 1rem;
    text-align: center;
    border-radius: 10px;
    margin: 0 1rem 1rem;
    font-weight: 500;
}

.no-results,
.search-error {
    padding: 2rem;
    text-align: center;
    color: #6c757d;
    font-size: 1.1rem;
}

.search-error {
    color: #dc3545;
}

/* Responsive product cards */
@media (max-width: 768px) {
    .products-grid {
        padding: 0.75rem;
        gap: 0.5rem;
    }
    
    .search-product-card {
        gap: 0.75rem;
        padding: 0.6rem;
    }
    
    .product-image {
        width: 70px;
        height: 70px;
    }
    
    .product-name {
        font-size: 0.9rem;
    }
    
    .product-number,
    .product-description {
        font-size: 0.75rem;
    }
    
    .product-price {
        font-size: 1rem;
    }
    
    .login-prompt {
        font-size: 0.9rem;
        padding: 0.75rem;
    }
}

@media (max-width: 480px) {
    .products-grid {
        padding: 0.5rem;
    }
    
    .search-product-card {
        gap: 0.5rem;
        padding: 0.5rem;
    }
    
    .product-image {
        width: 60px;
        height: 60px;
    }
    
    .product-name {
        font-size: 0.85rem;
    }
    
    .product-number,
    .product-description {
        font-size: 0.7rem;
    }
    
    .product-price {
        font-size: 0.9rem;
    }
}

/* High zoom / very small height adjustments */
@media (max-height: 500px) {
    .products-grid {
        padding: 0.5rem;
        gap: 0.4rem;
    }
    
    .search-product-card {
        padding: 0.5rem;
        gap: 0.6rem;
    }
    
    .product-image {
        width: 60px;
        height: 60px;
    }
    
    .product-name {
        font-size: 0.85rem;
        margin-bottom: 0.15rem;
    }
    
    .product-number,
    .product-description {
        font-size: 0.7rem;
        margin-bottom: 0.15rem;
    }
    
    .product-price {
        font-size: 0.9rem;
    }
    
    .login-prompt {
        padding: 0.6rem;
        font-size: 0.85rem;
        margin: 0 0.5rem 0.5rem;
    }
    
    .no-results,
    .search-error {
        padding: 1rem;
        font-size: 0.95rem;
    }
}

/* Responsive Search */
@media (max-width: 768px) {
    .hero-search {
        max-width: 100%;
        margin: 1.5rem 0;
    }
    
    .search-input {
        font-size: 1rem;
        padding: 1rem 1.5rem;
    }
    
    .btn-search {
        padding: 1rem 1.5rem;
    }
    
    .products-grid {
        gap: 0.5rem;
        padding: 0.75rem;
    }
    
    .search-product-card {
        padding: 0.6rem;
    }
    
    .product-image {
        width: 70px;
        height: 70px;
    }
    
    .product-name {
        font-size: 0.9rem;
    }
    
    .product-number {
        font-size: 0.75rem;
    }
}

@media (max-width: 576px) {
    .search-results.show {
        max-height: 75vh;
    }
}

/* Facebook Ads Carousel Styles */
.facebook-ads-section {
    background: linear-gradient(135deg, #1a1a1a 0%, #2c2c2c 100%);
    position: relative;
    overflow: hidden;
}

.facebook-carousel {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-loading {
    text-align: center;
    padding: 3rem;
}

.carousel-inner {
    position: relative;
    width: 100%;
    height: 100%;
}

.carousel-slide {
    display: none;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    width: 100%;
}

.carousel-slide.active {
    display: block;
    opacity: 1;
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ad-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    min-height: 400px;
}

.ad-image {
    width: 100%;
    height: 300px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.ad-content {
    padding: 2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: white;
}

.ad-content.no-image {
    padding: 3rem;
    min-height: 400px;
    justify-content: center;
}

.ad-message {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #333;
    margin-bottom: 1.5rem;
    flex: 1;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.ad-link {
    align-self: flex-start;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    text-decoration: none;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #1877f2, #145dbf);
    border: none;
    font-weight: 600;
}

.ad-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(24, 119, 242, 0.4);
}

/* Carousel Controls */
.carousel-control {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.carousel-control:hover {
    background: white;
    transform: translateY(-50%) scale(1.1);
}

.carousel-control-prev {
    left: -25px;
}

.carousel-control-next {
    right: -25px;
}

.carousel-control i {
    font-size: 1.5rem;
    color: #333;
}

/* Carousel Indicators */
.carousel-indicators {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.carousel-indicators .indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.carousel-indicators .indicator:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: scale(1.2);
}

.carousel-indicators .indicator.active {
    background: white;
    width: 30px;
    border-radius: 6px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .facebook-carousel {
        max-width: 95%;
        min-height: 350px;
    }
    
    .ad-card {
        min-height: 350px;
    }
    
    .ad-image {
        height: 200px;
    }
    
    .ad-content {
        padding: 1.5rem;
    }
    
    .ad-content.no-image {
        padding: 2rem;
        min-height: 350px;
    }
    
    .ad-message {
        font-size: 1rem;
    }
    
    .carousel-control {
        width: 40px;
        height: 40px;
    }
    
    .carousel-control-prev {
        left: 10px;
    }
    
    .carousel-control-next {
        right: 10px;
    }
    
    .carousel-control i {
        font-size: 1.2rem;
    }
}

@media (max-width: 576px) {
    .facebook-carousel {
        min-height: 300px;
    }
    
    .ad-card {
        min-height: 300px;
    }
    
    .ad-image {
        height: 150px;
    }
    
    .ad-content {
        padding: 1rem;
    }
    
    .ad-content.no-image {
        padding: 1.5rem;
        min-height: 300px;
    }
    
    .ad-message {
        font-size: 0.95rem;
        margin-bottom: 1rem;
    }
    
    .carousel-control {
        width: 35px;
        height: 35px;
    }
    
    .carousel-indicators {
        margin-top: 1.5rem;
    }
}
