/* --- Global Reset & Variables --- */
:root {
    --primary-yellow: #f6d04d;
    --primary-teal: #108575;
    --dark-blue: #1c2b4a;
    --text-dark: #333333;
    --text-light: #ffffff;
    --gray-bg: #f9f9f9;
    --border-color: #eaeaea;
    --discount-red: #d32f2f;
    --font-main: 'Poppins', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    color: var(--text-dark);
    background-color: #ffffff;
    line-height: 1.5;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

.container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- Top Bar Marquee --- */
.top-bar {
    background-color: var(--primary-yellow);
    color: #000;
    padding: 8px 0;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
    overflow: hidden;
    position: relative;
    white-space: nowrap;
}

.marquee-track {
    display: inline-block;
    animation: scroll-left 20s linear infinite;
}

.marquee-track span {
    padding-right: 50px;
}

@keyframes scroll-left {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); } 
}

/* --- Header --- */
.header {
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    position: relative;
    z-index: 100;
    padding: 15px 0;
}

.header-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
}

.logos {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo {
    font-weight: 800;
    font-size: 16px;
    text-transform: uppercase;
}

.main-logo {
    background: var(--primary-yellow);
    padding: 5px 10px;
    border-radius: 20px;
    color: #000;
}

.sub-logo {
    color: var(--primary-teal);
    font-size: 14px;
}

.header-center {
    flex: 1;
    max-width: 600px;
}

.search-bar {
    display: flex;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.category-select {
    padding: 10px;
    border: none;
    background: var(--gray-bg);
    border-right: 1px solid var(--border-color);
    outline: none;
    font-family: var(--font-main);
    font-size: 13px;
    cursor: pointer;
}

.search-bar input {
    flex: 1;
    padding: 10px 15px;
    border: none;
    outline: none;
    font-family: var(--font-main);
}

.search-bar button {
    background: #fff;
    border: none;
    padding: 0 15px;
    cursor: pointer;
    color: var(--text-dark);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.icon-link {
    font-size: 20px;
    color: var(--text-dark);
    position: relative;
}

.cart-icon .cart-count {
    position: absolute;
    top: -8px;
    right: -10px;
    background: #e53935;
    color: #fff;
    font-size: 10px;
    font-weight: bold;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

/* --- Mobile Sidebar Menu --- */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100%;
    background-color: #ffffff;
    z-index: 1000;
    box-shadow: 2px 0 15px rgba(0, 0, 0, 0.15);
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.mobile-sidebar.open {
    left: 0;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.close-sidebar-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-dark);
    cursor: pointer;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-sidebar-btn:hover {
    color: var(--discount-red);
}

.sidebar-content {
    padding: 15px 0;
}

.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav li a {
    display: flex;
    align-items: center;
    padding: 12px 25px;
    font-size: 16px;
    color: var(--text-dark);
    font-weight: 500;
    transition: background-color 0.2s, color 0.2s;
    gap: 15px;
}

.sidebar-nav li a:hover {
    background-color: var(--gray-bg);
    color: var(--primary-teal);
}

.sidebar-divider {
    border: 0;
    height: 1px;
    background-color: var(--border-color);
    margin: 15px 25px;
}

.sidebar-bottom-nav li a {
    color: #555;
    font-size: 15px;
}

.sidebar-bottom-nav li a i {
    width: 20px;
    text-align: center;
    color: var(--primary-teal);
    font-size: 18px;
}

.sidebar-cart-badge {
    background: #e53935;
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    padding: 2px 8px;
    border-radius: 12px;
    margin-left: 10px;
}

body.no-scroll {
    overflow: hidden;
}

/* --- Hero Auto Slider Improvements --- */
.hero-section {
    position: relative;
    height: 500px;
    overflow: hidden;
}

.hero-slider {
    width: 100%;
    height: 100%;
    position: relative;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease-in-out, background-color 1s ease-in-out;
    z-index: 1;
    display: flex;
    align-items: center;
}

.slide.active {
    opacity: 1;
    z-index: 2;
}

.hero-content {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    height: 100%;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--text-light);
}

.hero-text {
    max-width: 500px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
}

.hero-title {
    color: var(--primary-yellow);
    font-size: 5rem;
    line-height: 1;
    font-weight: 800;
    margin-bottom: 5px;
}

.hero-subtitle {
    font-size: 3.5rem;
    line-height: 1.1;
    font-weight: 700;
    margin-bottom: 15px;
}

.hero-feature {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.hero-feature i {
    color: var(--primary-yellow);
    font-size: 1.2rem;
}

.hero-launch {
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 30px;
    opacity: 0.9;
}

.btn-primary {
    background-color: var(--dark-blue);
    color: #fff;
    padding: 12px 25px;
    border-radius: 25px;
    font-weight: 600;
    transition: background 0.3s ease;
    display: inline-block;
}

.btn-primary:hover {
    background-color: #111a2f;
}

.hero-image-wrapper {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    height: 100%;
}

.product-img-transparent {
    max-width: 100%;
    max-height: 400px;
    width: auto;
    height: auto;
    object-fit: contain; 
    filter: drop-shadow(0 20px 30px rgba(0,0,0,0.3)); 
}

/* Hero Animations */
.slide.active .hero-title,
.slide.active .hero-subtitle,
.slide.active .hero-feature,
.slide.active .hero-launch,
.slide.active .btn-primary {
    animation: fadeUp 0.8s ease forwards;
    opacity: 0;
}

.slide.active .hero-subtitle { animation-delay: 0.1s; }
.slide.active .hero-feature { animation-delay: 0.2s; }
.slide.active .hero-launch { animation-delay: 0.3s; }
.slide.active .btn-primary { animation-delay: 0.4s; }

.slide.active .product-img-transparent {
    opacity: 0;
    animation: 
        imgPopUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards, 
        imgFloat 3s ease-in-out infinite alternate 0.8s;
}

@keyframes fadeUp {
    0% { transform: translateY(30px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

@keyframes imgPopUp {
    0% { transform: translateY(50px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

@keyframes imgFloat {
    0% { transform: translateY(0); }
    100% { transform: translateY(-12px); }
}

/* --- Ticker --- */
.ticker-wrap {
    width: 100%;
    overflow: hidden;
    background-color: #fff;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.ticker {
    display: flex;
    white-space: nowrap;
    animation: ticker 25s linear infinite;
}

.ticker__item {
    font-size: 13px;
    font-weight: 500;
    color: #555;
    padding: 0 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ticker__item.divider {
    color: var(--primary-yellow);
}

@keyframes ticker {
    0% { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(-50%, 0, 0); }
}

/* --- Promo Banners --- */
.promo-banners {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 40px;
    margin-bottom: 40px;
}

.banner-img {
    border-radius: 12px;
    padding: 40px 30px;
    color: #fff;
    display: flex;
    align-items: center;
    min-height: 220px;
    position: relative;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    cursor: pointer;
}

.banner-img::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to right, rgba(0,0,0,0.8), rgba(0,0,0,0.2));
    transition: background 0.3s ease;
    z-index: 1;
}

.banner-img:hover {
    background-size: 105%; 
}

.banner-img:hover::before {
    background: linear-gradient(to right, rgba(0,0,0,0.9), rgba(0,0,0,0.3));
}

.banner-content {
    position: relative;
    z-index: 2;
    transition: transform 0.3s ease;
}

.banner-img:hover .banner-content {
    transform: scale(1.05);
}

.banner h2 {
    font-size: 28px;
    line-height: 1.2;
    margin-bottom: 15px;
    font-weight: 800;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.banner-link {
    font-size: 14px;
    font-weight: 600;
    border-bottom: 2px solid #fff;
    padding-bottom: 2px;
}

/* --- Shop Category & Bestsellers & Carousel --- */
.shop-category, .bestsellers {
    margin-bottom: 60px;
}

.section-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--dark-blue);
    margin-bottom: 20px;
}

.category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.tab {
    background: none;
    border: none;
    font-family: var(--font-main);
    font-size: 15px;
    font-weight: 600;
    color: #777;
    cursor: pointer;
    padding-bottom: 10px;
    position: relative;
}

.tab.active {
    color: var(--dark-blue);
}

.tab.active::after {
    content: '';
    position: absolute;
    bottom: -11px;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--dark-blue);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 30px;
}

.subtitle {
    color: #666;
    font-size: 14px;
}

.view-all {
    font-size: 14px;
    font-weight: 600;
    color: var(--dark-blue);
}

/* Carousel Setup */
.carousel-container {
    position: relative;
    display: flex;
    align-items: center;
}

.carousel-track-wrap {
    overflow: hidden;
    width: 100%;
}

.carousel-track {
    display: flex;
    gap: 15px;
    transition: transform 0.5s ease-in-out;
}

.carousel-item {
    flex: 0 0 calc(20% - 12px); 
    min-width: calc(20% - 12px);
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: #fff;
    border: 1px solid var(--border-color);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    z-index: 10;
    color: var(--dark-blue);
    font-size: 18px;
    transition: all 0.3s;
}

.carousel-btn:hover {
    background: var(--dark-blue);
    color: #fff;
}

.prev-btn { left: -20px; }
.next-btn { right: -20px; }

/* Product Cards */
.product-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.product-card:hover {
    transform: translateY(-5px);
}

.card-image-wrap {
    position: relative;
    height: 250px;
    background: #f4f4f4;
    overflow: hidden;
}

.img-primary, .img-secondary {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.img-secondary {
    opacity: 0;
}

.product-card:hover .img-primary {
    opacity: 0;
}

.product-card:hover .img-secondary {
    opacity: 1;
    transform: scale(1.05); 
}

.discount-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #fff;
    color: var(--text-dark);
    font-size: 10px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    z-index: 5;
}

.quick-view {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #fff;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    color: #555;
    z-index: 5;
}

.card-details {
    background: var(--dark-blue);
    color: #fff;
    padding: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card-details h3 {
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 15px;
    line-height: 1.4;
    height: 36px;
    overflow: hidden;
}

.price-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.price {
    display: flex;
    flex-direction: column;
}

.current-price {
    font-size: 14px;
    font-weight: 700;
}

.old-price {
    font-size: 11px;
    color: #aaa;
    text-decoration: line-through;
}

.add-to-cart {
    background: #fff;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--dark-blue);
    transition: background 0.2s ease;
}

.add-to-cart:hover {
    background: var(--primary-yellow);
}

/* --- Improved Footer --- */
.modern-footer {
    background-color: #f4f7f6;
    padding: 60px 0 20px;
    border-top: 1px solid var(--border-color);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-logo {
    font-size: 24px;
    font-weight: 800;
    color: var(--dark-blue);
    margin-bottom: 15px;
    background: var(--primary-yellow);
    display: inline-block;
    padding: 5px 15px;
    border-radius: 20px;
}

.footer-brand p {
    font-size: 14px;
    color: #555;
    margin-bottom: 20px;
    line-height: 1.6;
}

.social-icons a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--dark-blue);
    color: #fff;
    border-radius: 50%;
    margin-right: 10px;
    transition: transform 0.3s ease;
}

.social-icons a:hover {
    transform: translateY(-3px);
    background: var(--primary-teal);
}

.footer-links h3, .footer-newsletter h3 {
    font-size: 18px;
    color: var(--dark-blue);
    margin-bottom: 20px;
    font-weight: 600;
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: #555;
    font-size: 14px;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--primary-teal);
}

.footer-newsletter p {
    font-size: 14px;
    color: #555;
    margin-bottom: 15px;
}

.newsletter-form {
    display: flex;
}

.newsletter-form input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ccc;
    border-radius: 4px 0 0 4px;
    outline: none;
    font-family: var(--font-main);
}

.newsletter-form button {
    background: var(--dark-blue);
    color: #fff;
    border: none;
    padding: 0 15px;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s;
}

.newsletter-form button:hover {
    background: var(--primary-teal);
}

.footer-bottom {
    text-align: center;
    border-top: 1px solid #ddd;
    padding-top: 20px;
    font-size: 13px;
    color: #777;
}

/* =========================================
   Consolidated Responsive Design (@media)
========================================= */

@media (max-width: 1200px) {
    .carousel-item {
        flex: 0 0 calc(25% - 11.25px); /* 4 items */
        min-width: calc(25% - 11.25px);
    }
}

@media (max-width: 992px) {
    /* Hero mobile fixes */
    .hero-section {
        height: 650px; 
    }
    .hero-content {
        flex-direction: column;
        text-align: center;
        justify-content: center;
        padding-top: 40px;
    }
    .hero-text {
        align-items: center; 
        margin-bottom: 20px;
    }
    .hero-image-wrapper {
        justify-content: center;
        align-items: flex-start;
        width: 100%;
    }
    .product-img-transparent {
        max-width: 80%;
        max-height: 280px; 
    }
    .hero-title { font-size: 3.5rem; }
    .hero-subtitle { font-size: 2.2rem; }

    /* General responsive grids */
    .carousel-item {
        flex: 0 0 calc(33.333% - 10px); /* 3 items */
        min-width: calc(33.333% - 10px);
    }
    .promo-banners {
        grid-template-columns: repeat(2, 1fr);
    }
    .banner-img:last-child {
        grid-column: span 2;
    }
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    /* --- Perfected Mobile Header Grid Layout --- */
    .header {
        padding: 12px 0;
    }
    .header-container {
        display: grid;
        grid-template-columns: 1fr auto 1fr; 
        grid-template-areas: 
            "menu logo cart"
            "search search search";
        align-items: center;
        gap: 15px 0;
    }
    .header-left {
        display: contents; 
    }
    .mobile-menu-btn {
        display: block;
        grid-area: menu;
        justify-self: start;
        font-size: 24px;
    }
    .logos {
        grid-area: logo;
        justify-self: center;
        gap: 0;
    }
    .logo.main-logo {
        font-size: 18px; 
        padding: 4px 12px;
    }
    .sub-logo {
        display: none; 
    }
    .header-right {
        display: flex !important; 
        grid-area: cart;
        justify-self: end;
        align-items: center;
    }
    .header-right .icon-link:not(.cart-icon) {
        display: none; 
    }
    .header-right .cart-icon {
        display: inline-flex;
        font-size: 22px;
    }
    .header-center {
        display: block; 
        grid-area: search;
        width: 100%;
    }
    .search-bar {
        width: 100%;
        display: flex;
        border-radius: 8px;
        overflow: hidden;
        border: 1px solid var(--border-color);
    }
    .category-select {
        max-width: 105px; 
        padding: 10px;
        font-size: 13px;
        text-overflow: ellipsis;
        border-right: 1px solid var(--border-color);
        background: var(--gray-bg);
    }
    .search-bar input {
        width: 100%;
        padding: 10px 12px;
        font-size: 14px;
        border: none;
        outline: none;
    }
    .search-bar button {
        padding: 0 15px;
        background: #fff;
        border: none;
        color: var(--text-dark);
    }

    /* General responsive grids */
    .promo-banners {
        grid-template-columns: 1fr;
    }
    .banner-img:last-child {
        grid-column: span 1;
    }
    .carousel-item {
        flex: 0 0 calc(50% - 7.5px); /* 2 items */
        min-width: calc(50% - 7.5px);
    }
}

@media (max-width: 480px) {
    .carousel-item {
        flex: 0 0 100%; /* 1 item */
        min-width: 100%;
    }
    .footer-grid {
        grid-template-columns: 1fr;
    }
    .hero-section {
        height: 600px;
    }
    .product-img-transparent {
        max-width: 90%;
        max-height: 220px;
    }
}