/* ===== Standard Sized Header Logo ===== */
.logo,
.site-header .logo {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    flex-shrink: 0;
    line-height: 1;
    text-decoration: none;
}

.logo img,
.site-header .logo img {
    height: var(--header-logo-height, 48px) !important;
    max-height: var(--header-logo-height, 48px) !important;
    width: auto !important;
    max-width: var(--header-logo-width, 210px) !important;
    object-fit: contain !important;
    display: block;
}

@media (max-width: 991px) {
    .logo img,
    .site-header .logo img {
        height: calc(var(--header-logo-height, 48px) * 0.92) !important;
        max-height: calc(var(--header-logo-height, 48px) * 0.92) !important;
        max-width: calc(var(--header-logo-width, 210px) * 0.92) !important;
    }
}

@media (max-width: 768px) {
    .app-home .logo,
    .logo,
    .site-header .logo {
        justify-self: center !important;
        justify-content: center !important;
    }

    .logo img,
    .app-home .logo img,
    .site-header .logo img {
        height: var(--header-logo-mobile-height, 40px) !important;
        max-height: var(--header-logo-mobile-height, 40px) !important;
        max-width: var(--header-logo-mobile-width, 160px) !important;
    }
}

@media (max-width: 400px) {
    .logo img,
    .app-home .logo img,
    .site-header .logo img {
        height: calc(var(--header-logo-mobile-height, 40px) * 0.9) !important;
        max-height: calc(var(--header-logo-mobile-height, 40px) * 0.9) !important;
        max-width: calc(var(--header-logo-mobile-width, 160px) * 0.9) !important;
    }
}

/* ===== Flexible / Adjustable Search Bar ===== */
/* Make search fill all space between logo and cart actions */
.header-inner {
    flex-wrap: nowrap;
}

.mobile-search {
    flex: 1 1 auto;       /* grow to fill available space */
    max-width: none;      /* remove the 400px cap */
    min-width: 120px;
    margin: 0 12px;
    height: 44px;
    border-radius: 25px;
    padding: 0 16px;
    border: 2px solid var(--primary);
}

.mobile-search input {
    font-size: 14.5px;
    padding-right: 95px !important;
}

/* Search icon becomes a clickable submit button */
.mobile-search .search-icon {
    font-size: 16px;
    padding: 6px 8px;
    margin-right: -8px;
    border-radius: 0 25px 25px 0;
    cursor: pointer;
    transition: color 0.2s;
}

.mobile-search .search-icon:hover {
    color: var(--primary-dark, var(--primary));
}

/* On smaller desktops, give it a sensible max so it doesn't over-stretch */
@media (min-width: 901px) and (max-width: 1280px) {
    .mobile-search {
        max-width: 520px;
    }
}

/* Restore full-width on mobile */
@media (max-width: 900px) {
    .mobile-search {
        max-width: none;
        margin: 0 8px;
        border-radius: 8px;
        height: 40px;
    }
}



/* Horizontal promo banners: full image on mobile */
.promo-banner,
.app-home .promo-banner {
    min-height: 0 !important;
    height: auto !important;
    overflow: visible !important;
    background: none !important;
    background-image: none !important;
}

.promo-banner-img,
.app-home .promo-banner-img {
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    object-fit: contain !important;
    object-position: center !important;
    display: block !important;
}

/* Fallback if old background-image markup still exists */
.promo-banner[style*="background-image"] {
    min-height: 0 !important;
    aspect-ratio: 16 / 5;
    background-size: contain !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
}

@media (max-width: 900px) {
    .promo-banner[style*="background-image"] {
        aspect-ratio: 16 / 7;
    }
}

/* ===== Menu Toggle Button (Mobile Only, Hidden in Computer/Desktop View) ===== */
.menu-toggle,
.app-home .menu-toggle {
    display: none !important;
}

@media (max-width: 900px) {
    .menu-toggle,
    .app-home .menu-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        background: var(--primary) !important;
        color: #ffffff !important;
        border: none;
        border-radius: 10px;
        font-size: 18px;
        cursor: pointer;
        box-shadow: 0 2px 8px rgba(0,0,0,0.12);
        transition: background 0.2s ease, transform 0.15s ease;
    }

    .menu-toggle:hover,
    .menu-toggle:active,
    .app-home .menu-toggle:hover,
    .app-home .menu-toggle:active {
        background: var(--primary-dark, var(--primary)) !important;
        color: #ffffff !important;
        transform: scale(1.02);
    }

    .menu-toggle i,
    .app-home .menu-toggle i {
        color: #ffffff !important;
    }
}

/* Hide desktop main-nav from header flow on computer view */
@media (min-width: 901px) {
    .main-nav,
    .app-home .main-nav {
        display: none !important;
    }
}

/* ===== Category Bar (Pill Chips Style - Theme Appearance Active Color) ===== */
.category-bar {
    background: #ffffff !important;
    border-bottom: 1px solid #edf2f7;
    padding: 10px 0;
    width: 100%;
    position: relative;
    z-index: 120;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
    overflow: visible !important;
}

.category-bar-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    overflow: visible !important;
    padding: 2px 0;
}

.category-bar .nav-cat-item {
    position: relative;
    flex-shrink: 0;
}

.category-bar .nav-cat-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 18px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 500;
    color: #334155;
    background: #f1f4f9;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    line-height: 1.4;
    border: 1px solid transparent;
    opacity: 1;
}

.category-bar .nav-cat-link:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.category-bar .nav-cat-link.active {
    background: var(--primary) !important;
    color: #ffffff !important;
    font-weight: 600;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
}

/* Subcategory Dropdown */
.category-bar .nav-sub-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 230px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.14), 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid #edf2f7;
    padding: 8px 0;
    z-index: 1000;
}

.category-bar .nav-sub-dropdown::before {
    content: "";
    position: absolute;
    top: -8px;
    left: 0;
    right: 0;
    height: 8px;
}

.category-bar .nav-cat-item.has-children:hover > .nav-sub-dropdown,
.category-bar .nav-cat-item.has-children:focus-within > .nav-sub-dropdown {
    display: block !important;
    animation: catDropFade 0.18s ease;
}

.category-bar .nav-sub-item {
    position: relative;
}

.category-bar .nav-sub-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 18px;
    font-size: 13.5px;
    font-weight: 500;
    color: #334155;
    text-decoration: none;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.category-bar .nav-sub-link:hover,
.category-bar .nav-sub-item:hover > .nav-sub-link {
    background: #f8fafc;
    color: var(--primary) !important;
    padding-left: 22px;
}

.category-bar .nav-sub-arrow {
    font-size: 11px;
    color: #94a3b8;
    margin-left: auto;
    transition: transform 0.15s ease, color 0.15s ease;
}

.category-bar .nav-sub-item:hover > .nav-sub-link .nav-sub-arrow {
    color: var(--primary) !important;
    transform: translateX(2px);
}

/* Childcategory Dropdown (Flyout) */
.category-bar .nav-child-dropdown {
    display: none;
    position: absolute;
    top: -6px;
    left: calc(100% + 4px);
    min-width: 210px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.14), 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid #edf2f7;
    padding: 8px 0;
    z-index: 1010;
}

.category-bar .nav-child-dropdown::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: -8px;
    width: 8px;
}

.category-bar .nav-sub-item:hover > .nav-child-dropdown {
    display: block !important;
    animation: catDropFade 0.18s ease;
}

.category-bar .nav-child-link {
    display: block;
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 500;
    color: #475569;
    text-decoration: none;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.category-bar .nav-child-link:hover {
    background: #f8fafc;
    color: var(--primary) !important;
    padding-left: 22px;
}

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

/* Mobile category scroll pill chips */
.mobile-category-scroll {
    background: #ffffff;
    border-bottom: 1px solid #edf2f7;
    padding: 8px 12px;
}

.category-chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 13.5px;
    font-weight: 500;
    color: #334155;
    background: #f1f4f9;
    text-decoration: none;
    flex-shrink: 0;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.category-chip:hover,
.category-chip:active {
    background: #e2e8f0;
}

.category-chip.active {
    background: var(--primary) !important;
    color: #ffffff !important;
    font-weight: 600;
}

@media (max-width: 900px) {
    .category-bar {
        display: none !important;
    }
}

/* ===== WhatsApp Order Button ===== */
.btn-whatsapp {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #25D366;
    color: #ffffff !important;
    border: 2px solid #25D366;
    flex: 1 1 100%;
    width: 100%;
    margin-top: 4px;
    text-align: center;
    padding: 14px 24px;
    border-radius: 5px;
    font-size: 15px;
    font-weight: 600;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    text-decoration: none !important;
    cursor: pointer;
}

.btn-whatsapp:hover {
    background: #1da851;
    border-color: #1da851;
    color: #ffffff !important;
}

.btn-whatsapp i {
    font-size: 18px;
}

@media (max-width: 767px) {
    .btn-whatsapp {
        width: 100%;
        margin-top: 6px;
    }
}

/* ===== 6 Products Per Line on Desktop Grid ===== */
:root {
    --container: 1380px;
}

.product-grid,
.app-home .product-grid,
.product-section .product-grid,
.flash-sale-section .product-grid,
.hot-deal-section .product-grid {
    display: grid !important;
    grid-template-columns: repeat(6, 1fr) !important;
    gap: 12px !important;
}

@media (min-width: 992px) {
    .product-grid,
    .app-home .product-grid,
    .product-section .product-grid,
    .flash-sale-section .product-grid,
    .hot-deal-section .product-grid {
        display: grid !important;
        grid-template-columns: repeat(6, 1fr) !important;
        gap: 12px !important;
    }
}

@media (max-width: 991px) and (min-width: 768px) {
    .product-grid,
    .app-home .product-grid,
    .product-section .product-grid,
    .flash-sale-section .product-grid,
    .hot-deal-section .product-grid {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 10px !important;
    }
}

@media (max-width: 767px) {
    .product-grid,
    .app-home .product-grid,
    .product-section .product-grid,
    .flash-sale-section .product-grid,
    .hot-deal-section .product-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }
}

/* ===== Modern Pagination Styling ===== */
.shop-pagination,
.pagination-wrapper {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    margin: 32px 0 24px 0 !important;
    width: 100% !important;
}

.shop-pagination nav,
.pagination-wrapper nav {
    display: block !important;
    width: auto !important;
}

.shop-pagination ul.pagination,
.pagination-wrapper ul.pagination,
ul.pagination {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.shop-pagination .page-item,
.pagination-wrapper .page-item,
ul.pagination .page-item {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: inline-block !important;
}

.shop-pagination .page-link,
.pagination-wrapper .page-link,
ul.pagination .page-link {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 38px !important;
    height: 38px !important;
    padding: 0 14px !important;
    border: 1px solid var(--border, #dedfde) !important;
    border-radius: 8px !important;
    background: #ffffff !important;
    color: var(--text, #111311) !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    transition: all 0.2s ease-in-out !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06) !important;
    cursor: pointer !important;
    line-height: 1 !important;
}

.shop-pagination .page-item.active .page-link,
.pagination-wrapper .page-item.active .page-link,
ul.pagination .page-item.active .page-link {
    background: var(--primary, #df2d4d) !important;
    border-color: var(--primary, #df2d4d) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    box-shadow: 0 3px 8px rgba(223, 45, 77, 0.35) !important;
}

.shop-pagination .page-link:hover,
.pagination-wrapper .page-link:hover,
ul.pagination .page-link:hover {
    background: var(--primary, #df2d4d) !important;
    border-color: var(--primary, #df2d4d) !important;
    color: #ffffff !important;
    transform: translateY(-1px) !important;
}

.shop-pagination .page-item.disabled .page-link,
.pagination-wrapper .page-item.disabled .page-link,
ul.pagination .page-item.disabled .page-link {
    opacity: 0.45 !important;
    background: #f5f5f5 !important;
    border-color: #e0e0e0 !important;
    color: #999999 !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
}

/* Fix SVG sizing in pagination links */
.shop-pagination svg,
.pagination-wrapper svg,
ul.pagination svg {
    width: 16px !important;
    height: 16px !important;
    fill: currentColor !important;
    display: inline-block !important;
    vertical-align: middle !important;
}

/* ===== Hero Slider Fixes ===== */
.hero-banner {
    margin-top: 14px;
    margin-bottom: 8px;
}
.hero-slider {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    background: #f0f0f0;
    width: 100%;
    transition: height 0.3s ease;
}
.hero-track {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: flex-start !important;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1) !important;
    will-change: transform;
    width: 100%;
}
.hero-slide {
    flex: 0 0 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    width: 100% !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
}
.hero-slide a {
    display: block !important;
    width: 100% !important;
    line-height: 0 !important;
}
.hero-img {
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
    display: block !important;
    border-radius: 8px !important;
    object-fit: contain !important;
    object-position: center !important;
}
.hero-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    color: var(--primary, #df2d4d);
    font-size: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
    opacity: 0;
    transition: opacity 0.25s, background 0.2s, transform 0.2s;
    z-index: 5;
}
.hero-slider:hover .hero-nav {
    opacity: 1;
}
.hero-prev {
    left: 14px;
}
.hero-next {
    right: 14px;
}
.hero-dots {
    position: absolute;
    bottom: 12px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 7px;
    z-index: 5;
}
.hero-dot {
    width: 9px;
    height: 9px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: width 0.25s, background 0.25s, border-radius 0.25s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.hero-dot.active {
    width: 24px;
    border-radius: 5px;
    background: #ffffff;
}
@media (max-width: 768px) {
    .hero-banner {
        margin-top: 8px;
        margin-bottom: 6px;
    }
    .hero-slider, .hero-img {
        border-radius: 6px !important;
    }
    .hero-nav {
        display: none !important;
    }
    .hero-dots {
        bottom: 8px;
    }
    .hero-dot {
        width: 7px;
        height: 7px;
    }
    .hero-dot.active {
        width: 18px;
    }
}

/* ==========================================================================
   Google PageSpeed Insights & Core Web Vitals (CWV) Optimizations
   ========================================================================== */

/* 1. Prevent Layout Shift (CLS) on Hero Banner (aspect-ratio dynamically provided by markup and image) */
.hero-slider {
    min-height: 120px;
}
@media (max-width: 768px) {
    .hero-slider {
        min-height: 90px;
    }
}
.hero-img {
    width: 100% !important;
    height: auto !important;
    object-fit: contain !important;
    display: block !important;
}

/* 2. Prevent Layout Shift (CLS) on Product Cards */
.product-thumb {
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    overflow: hidden;
    position: relative;
}
.product-thumb img {
    aspect-ratio: 1 / 1;
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    content-visibility: visible !important;
    transition: transform 0.25s ease;
}

/* 3. Prevent Layout Shift (CLS) on Brands & Promos */
.brand-logo-card {
    aspect-ratio: 2 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
}
.brand-logo-card img {
    max-width: 85%;
    max-height: 70%;
    object-fit: contain;
}
.promo-banner {
    aspect-ratio: 1200 / 250;
    overflow: hidden;
    border-radius: 8px;
    background: #f0f4f8;
}
.promo-banner-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 4. Font Display & Smooth Rendering */
body, input, button, textarea, select {
    font-display: swap;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

/* Ensure all images render immediately without waiting for hover/interaction */
img {
    content-visibility: visible !important;
}




