/* ==========================================================================
   HEADER SYSTEM (Unified & Fixed v2.2.5)
   ========================================================================== */

:root {
    --z-header: 1000;
    --z-sticky: 1100;
    --z-mega: 1200;
    --z-overlay: 1300;
    --z-mobile-menu: 1400;
    --z-cart-dropdown: 1500;
}

/* Global Reset for Header */
body { background: #fff !important; }
.site-header { width: 100% !important; max-width: none !important; margin: 0 !important; position: relative; background: #fff; z-index: var(--z-header); }

.container { 
    max-width: var(--container-max) !important; 
    margin: 0 auto !important; 
    padding: 0 var(--container-padding) !important; 
    width: 100% !important;
}

/* === TOP BAR === */
.top-bar { 
    background: #f5f5f5; 
    padding: 10px 0; 
    border-bottom: 1px solid #eee; 
    font-size: 14px;
    color: #666;
}
.top-bar .container { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
}

.top-bar-nav { display: flex; gap: 28px; list-style: none; padding: 0; margin: 0; }
.top-bar-nav a { color: inherit; text-decoration: none; transition: color 0.2s; font-weight: 500; }
.top-bar-nav a:hover { color: var(--color-primary); }

.top-bar-right { display: flex; align-items: center; gap: 24px; }
.top-bar-email { display: flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; transition: color 0.2s; }
.top-bar-email:hover { color: var(--color-primary); }
.top-bar-email svg { width: 18px; height: 18px; color: var(--color-primary); flex-shrink: 0; }

.top-bar-socials { display: flex; align-items: center; gap: 14px; }
.top-bar-socials a { color: #888; display: flex; align-items: center; transition: color 0.2s; }
.top-bar-socials a:hover { color: var(--color-primary); }
.top-bar-socials svg { width: 20px; height: 20px; }

.top-bar-phone { display: flex; align-items: center; gap: 8px; color: #333; text-decoration: none; font-weight: 700; font-size: 15px; transition: color 0.2s; white-space: nowrap; }
.top-bar-phone:hover { color: var(--color-primary); }
.top-bar-phone svg { width: 18px; height: 18px; color: var(--color-primary); flex-shrink: 0; }
.top-bar-phone span { font-weight: 700; }

/* === MAIN HEADER === */
.main-header { 
    background: #fff; 
    padding: 15px 0; 
}
.main-header .container { 
    display: flex; 
    align-items: center; 
    justify-content: space-between;
    gap: 30px; 
}

/* Logo */
.site-logo { text-decoration: none; flex-shrink: 0; display: flex; align-items: center; gap: 10px; }
.site-logo-text { font-size: 24px; font-weight: 800; color: #000; text-transform: uppercase; letter-spacing: -0.5px; }
.site-logo-text span { color: var(--color-primary); }
.site-logo-img { height: 44px; width: 44px; display: block; object-fit: cover; border-radius: 50%; }
.site-logo img { height: 44px; width: 44px; display: block; border-radius: 50%; object-fit: cover; }

/* Catalog Button */
.catalog-btn { 
    background: var(--color-primary); color: #fff; border: none; padding: 12px 24px; 
    border-radius: 4px; font-weight: 700; cursor: pointer; 
    display: flex; align-items: center; gap: 10px; transition: all 0.2s;
    font-family: inherit; font-size: 14px; position: relative;
}
.catalog-btn svg { width: 18px; height: 18px; transition: transform 0.3s ease; }
.catalog-btn:hover { background: var(--color-primary-hover); transform: translateY(-1px); }
.catalog-btn.active { background: #1a1a1a; }
.catalog-btn .catalog-icon-close { display: none; }
.catalog-btn.active .catalog-icon-menu { display: none; }
.catalog-btn.active .catalog-icon-close { display: block; }

/* Search */
.header-search { flex: 1; position: relative; max-width: 600px; }
.header-search form { display: flex; }
.header-search input { 
    flex: 1; padding: 12px 20px; border: 2px solid #f0f0f0; 
    border-radius: 4px 0 0 4px; border-right: none; font-size: 14px;
    font-family: inherit; outline: none; transition: border-color 0.2s;
}
.header-search input:focus { border-color: var(--color-primary); }
.header-search-btn { 
    background: var(--color-primary); color: #fff; border: none; padding: 0 20px; 
    border-radius: 0 4px 4px 0; cursor: pointer; transition: background 0.2s;
}
.header-search-btn svg { width: 18px; height: 18px; }

/* Live Search Dropdown */
.search-results { 
    position: absolute; top: 100%; left: 0; right: 0; 
    background: #fff; border-radius: 0 0 8px 8px; 
    box-shadow: 0 10px 40px rgba(0,0,0,0.15); 
    z-index: 2000; display: none; max-height: 400px; overflow-y: auto;
    border-top: 2px solid var(--color-primary);
}
.search-results.active { display: block; }
.search-result-item { 
    display: flex; align-items: center; gap: 12px; 
    padding: 12px 16px; text-decoration: none; color: #333; 
    transition: background 0.15s; border-bottom: 1px solid #f5f5f5;
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: #f8f9fa; }
.search-result-item img { width: 50px; height: 50px; object-fit: contain; border-radius: 4px; flex-shrink: 0; }
.search-result-item .name { font-size: 13px; font-weight: 600; line-height: 1.3; }
.search-result-item .price { font-size: 14px; font-weight: 700; color: var(--color-primary); margin-top: 2px; }

/* Phone & Icons */
.header-phone { display: flex; align-items: center; gap: 8px; white-space: nowrap; font-weight: 700; font-size: 15px; }
.header-phone a { color: #000; text-decoration: none; transition: color 0.2s; }
.header-phone a:hover { color: var(--color-primary); }
.header-phone svg { width: 18px; height: 18px; color: var(--color-primary); flex-shrink: 0; }

.header-icons { display: flex; align-items: center; gap: 20px; }
.header-wishlist-icon { position: relative; color: #000; display: flex; align-items: center; }
.header-wishlist-icon svg { width: 24px; height: 24px; transition: color 0.2s; }
.header-wishlist-icon:hover svg { color: var(--color-red); }
.header-wishlist-count { 
    position: absolute; top: -5px; right: -8px; background: var(--color-red); 
    color: #fff; font-size: 10px; min-width: 18px; height: 18px; 
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-weight: 700; padding: 0 4px;
}
.header-cart-wrapper { position: relative !important; }
.header-cart-icon { color: #000; display: block; position: relative; }
.header-cart-icon svg { width: 28px; height: 28px; }
.header-cart-count { 
    position: absolute; top: -5px; right: -5px; background: var(--color-primary); 
    color: #fff; font-size: 10px; width: 18px; height: 18px; 
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-weight: 700; user-select: none; -webkit-user-select: none; caret-color: transparent; pointer-events: none;
}

/* === NAV BAR === */
.nav-bar { 
    background: var(--color-primary); 
    height: 48px; 
}
.nav-bar .container { height: 100%; display: flex; align-items: center; justify-content: space-between; }
.nav-bar-left { 
    display: flex; align-items: center; height: 100%; 
    list-style: none; padding: 0; margin: 0; gap: 0;
}
.nav-bar-right {
    display: flex; align-items: center; height: 100%;
    list-style: none; padding: 0; margin: 0; gap: 0;
}
.nav-bar-left a, .nav-bar-right a { 
    color: #fff; 
    text-decoration: none; 
    font-size: 13px; 
    font-weight: 700; 
    padding: 0 18px; 
    height: 48px; 
    display: flex; 
    align-items: center; 
    text-transform: uppercase;
    letter-spacing: 0.3px;
    transition: all 0.2s;
    white-space: nowrap;
}
.nav-bar-left a:hover, .nav-bar-right a:hover { background: rgba(0,0,0,0.15); }
.nav-bar-sep { color: rgba(255,255,255,0.3); font-size: 12px; padding: 0 4px; }

/* === STICKY HEADER === */
.site-header.sticky .main-header { 
    position: fixed; top: 0; left: 0; right: 0; 
    z-index: var(--z-sticky); 
    box-shadow: 0 4px 15px rgba(0,0,0,0.1); 
    animation: slideDown 0.3s ease; 
}
.site-header.sticky .nav-bar { max-height: 0; overflow: hidden; border: none; padding: 0; transition: none; }
.nav-bar { max-height: 48px; }

@keyframes slideDown { from { transform: translateY(-100%); } to { transform: translateY(0); } }

/* === MEGA MENU === */
.mega-menu { 
    display: none;
    background: #fff; 
    z-index: var(--z-mega); box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.mega-menu.active { 
    display: block;
    opacity: 1;
    visibility: visible;
}
.mega-menu-scroll {
    height: 100%; overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin; scrollbar-color: #bbb #f0f0f0;
    padding-bottom: 30px;
}
.mega-menu-scroll::-webkit-scrollbar { width: 8px; }
.mega-menu-scroll::-webkit-scrollbar-track { background: #f0f0f0; }
.mega-menu-scroll::-webkit-scrollbar-thumb { background: #bbb; border-radius: 4px; }
.mega-menu-scroll::-webkit-scrollbar-thumb:hover { background: #999; }
.mega-menu-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4); z-index: calc(var(--z-mega) - 1);
    opacity: 0; visibility: hidden; transition: opacity 0.3s, visibility 0.3s;
}
.mega-menu-overlay.active { opacity: 1; visibility: visible; }

/* === MEGA MENU INTERNALS (rikasale-style) === */
.mega-menu-grid { display: grid; grid-template-columns: 1fr 220px; gap: 20px; padding: 25px 0; }
.mega-menu-cats-area { column-count: 4; column-gap: 0; }
.mega-menu-col { break-inside: avoid; padding: 8px 15px 12px; border-right: 1px solid #f5f5f5; margin-bottom: 4px; }
.mega-menu-col-title { display: flex; align-items: center; gap: 8px; font-weight: 800; text-transform: uppercase; color: #000; font-size: 13px; margin-bottom: 6px; transition: color 0.2s; line-height: 1.3; }
.mega-menu-col-title:hover { color: var(--color-primary); }
.mega-col-thumb { width: 70px; height: 50px; object-fit: contain; flex-shrink: 0; background: #f8f8f8; border-radius: 4px; padding: 4px; box-sizing: border-box; }
.mega-menu-product-link { display: block; padding: 2px 0; padding-left: 12px; color: #555; font-size: 12px; transition: color 0.2s; position: relative; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.5; }
.mega-menu-product-link::before { content: '›'; position: absolute; left: 2px; color: #aaa; font-weight: bold; }
.mega-menu-product-link:hover { color: var(--color-primary); }
.mega-menu-product-link:hover::before { color: var(--color-primary); }
.mega-menu-product-link:hover::before { color: var(--color-primary); }
/* Brands sidebar */
.mega-menu-brands-area { border-left: 1px solid #eee; padding-left: 20px; }
.mega-menu-brands-title { font-weight: 800; text-transform: uppercase; font-size: 13px; margin-bottom: 15px; color: #333; }
.mega-menu-brands-grid { display: flex; flex-direction: column; gap: 8px; }
.mega-menu-brand-item { display: flex; align-items: center; justify-content: center; padding: 8px 10px; border: 1px solid #f0f0f0; border-radius: 6px; transition: all 0.2s; min-height: 45px; }
.mega-menu-brand-item:hover { border-color: var(--color-primary); background: rgba(61,90,53,0.04); transform: translateY(-1px); box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.mega-menu-brand-item img { max-height: 35px; max-width: 160px; object-fit: contain; }
.mega-menu-brand-item span { font-weight: 600; font-size: 13px; color: #333; }

/* === MINI CART DROPDOWN === */
.mini-cart { position: absolute; top: calc(100% + 10px); right: -20px; width: 360px; background: #fff; border-radius: 8px; box-shadow: 0 10px 40px rgba(0,0,0,0.15); border-top: 3px solid var(--color-primary); z-index: 2000; display: none; max-height: 400px; overflow-y: auto; }
.mini-cart.active { display: block; }
.mini-cart-title { display: none; }
.mini-cart-close { display: none; } /* Hidden on desktop, shown via mobile media query */
.mini-cart-items { padding: 15px; }
.mini-cart-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid #f0f0f0; }
.mini-cart-item:last-child { border-bottom: none; }
.mini-cart-item img { width: 50px; height: 50px; object-fit: contain; border-radius: 4px; flex-shrink: 0; }
.mini-cart-item-info { flex: 1; min-width: 0; }
.mini-cart-item-name { font-size: 13px; font-weight: 600; color: #333; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mini-cart-item-qty { font-size: 12px; color: #999; margin-top: 2px; }
.mini-cart-item-price { font-size: 14px; font-weight: 700; color: var(--color-primary); margin-top: 2px; }
.mini-cart-item-remove { background: none; border: none; color: #ccc; cursor: pointer; padding: 4px; flex-shrink: 0; transition: color 0.2s; }
.mini-cart-item-remove:hover { color: #e62e2e; }
.mini-cart-empty { padding: 30px 20px; text-align: center; color: #999; font-size: 14px; }

/* Quantity controls */
.mini-cart-item-qty-controls { display: flex; align-items: center; gap: 0; margin-top: 6px; }
.qty-btn { width: 28px; height: 28px; border: 1px solid #eee; background: #fafafa; cursor: pointer; font-size: 16px; display: flex; align-items: center; justify-content: center; transition: all 0.2s; color: #333; }
.qty-btn:hover { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.qty-minus { border-radius: 4px 0 0 4px; }
.qty-plus { border-radius: 0 4px 4px 0; }
.qty-value { width: 36px; height: 28px; border-top: 1px solid #eee; border-bottom: 1px solid #eee; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; user-select: none; -webkit-user-select: none; caret-color: transparent; cursor: default; }

/* Mini cart footer */
.mini-cart-footer { padding: 15px; border-top: 2px solid #f0f0f0; background: #fafafa; }
.mini-cart-total { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid #eee; }
.mini-cart-total span:first-child { font-size: 14px; font-weight: 600; color: #333; }
.mini-cart-total-price { font-size: 18px; font-weight: 800; color: var(--color-primary); }
.mini-cart-btn { display: block; width: 100%; text-align: center; margin-bottom: 8px; padding: 12px; font-size: 14px; font-weight: 700; border-radius: 6px; text-decoration: none; transition: all 0.2s; position: relative; z-index: 10; cursor: pointer; -webkit-tap-highlight-color: rgba(0,0,0,0.1); }
.mini-cart-btn:last-child { margin-bottom: 0; }
.mini-cart-btn.btn-outline { border: 1px solid #ddd; color: #333; background: #fff; }
.mini-cart-btn.btn-outline:hover, .mini-cart-btn.btn-outline:active { border-color: var(--color-primary); color: var(--color-primary); }
.mini-cart-btn.btn-primary { background: var(--color-primary); color: #fff; border: none; }
.mini-cart-btn.btn-primary:hover, .mini-cart-btn.btn-primary:active { background: var(--color-primary-hover); color: #fff !important; }

/* === MOBILE MENU PANEL === */
.mobile-menu { position: fixed; top: 0; right: 0; width: 320px; height: 100vh; height: 100dvh; background: #fff; z-index: 3000; transform: translateX(100%); transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); box-shadow: -10px 0 40px rgba(0,0,0,0.15); overflow: hidden; will-change: transform; display: flex; flex-direction: column; }
.mobile-menu.active { transform: translateX(0); }
.mobile-menu-header { padding: 20px; border-bottom: 1px solid #eee; display: flex; justify-content: space-between; align-items: center; }
.mobile-menu-header span { font-weight: 800; font-size: 16px; text-transform: uppercase; }
.mobile-menu-header button { background: none; border: none; font-size: 36px; cursor: pointer; color: #666; line-height: 1; padding: 8px; min-width: 44px; min-height: 44px; display: flex; align-items: center; justify-content: center; }
.mobile-menu-body { padding: 20px; }
.mobile-menu-body ul { list-style: none; padding: 0; margin: 0; }
.mobile-menu-body li { border-bottom: 1px solid #f5f5f5; }
.mobile-menu-body a { display: block; padding: 12px 0; font-size: 15px; font-weight: 500; color: #333; }
.mobile-menu-body a:hover { color: var(--color-primary); }

/* Mobile menu search */
.mobile-menu-search { padding: 15px 20px; border-bottom: 1px solid #eee; }
.mobile-menu-search form { display: flex; }
.mobile-menu-search input { flex: 1; padding: 10px 15px; border: 1px solid #eee; border-radius: 4px 0 0 4px; border-right: none; font-size: 14px; outline: none; }
.mobile-menu-search button { background: var(--color-primary); color: #fff; border: none; padding: 0 15px; border-radius: 0 4px 4px 0; cursor: pointer; }
.mobile-menu-search button svg { width: 18px; height: 18px; }
.mobile-search-results { display: none; max-height: 300px; overflow-y: auto; background: #fff; border: 1px solid #eee; border-top: none; border-radius: 0 0 4px 4px; }
.mobile-search-results.active { display: block; }
.mobile-search-results .search-result-item { display: flex; align-items: center; gap: 12px; padding: 10px 15px; text-decoration: none; color: #333; border-bottom: 1px solid #f5f5f5; }
.mobile-search-results .search-result-item:hover { background: #f9f9f9; }
.mobile-search-results .search-result-item img { width: 40px; height: 40px; object-fit: contain; flex-shrink: 0; }
.mobile-search-results .search-result-item .name { font-size: 13px; font-weight: 600; }
.mobile-search-results .search-result-item .price { font-size: 12px; color: var(--color-primary); font-weight: 700; }

/* Mobile tabs */
.mobile-menu-tabs { display: flex; border-bottom: 2px solid #eee; }
.mobile-tab { flex: 1; padding: 12px; text-align: center; font-weight: 700; font-size: 14px; text-transform: uppercase; background: none; border: none; cursor: pointer; color: #999; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all 0.2s; }
.mobile-tab.active { color: var(--color-primary); border-bottom-color: var(--color-primary); }

/* Mobile tab content */
.mobile-menu-content { display: none; padding: 15px 20px; overflow-y: auto; flex: 1; min-height: 0; }
.mobile-menu-content.active { display: block; }
.mobile-menu-content ul { list-style: none; padding: 0; margin: 0; }
.mobile-menu-content li { border-bottom: 1px solid #f5f5f5; }
.mobile-menu-content a { display: block; padding: 12px 0; font-size: 15px; font-weight: 500; color: #333; text-decoration: none; }
.mobile-menu-content a:hover { color: var(--color-primary); }
.mobile-menu-links { margin-top: 15px; padding-top: 15px; border-top: 1px solid #eee; }
.mobile-menu-links a { font-size: 13px; color: #999; font-weight: 400; }

/* Mobile catalog — accordion */
.mobile-catalog-list { list-style: none; padding: 0; margin: 0; }
.mobile-catalog-list > li { border-bottom: 1px solid #f0f0f0; }
.mobile-cat-header { display: flex; align-items: center; justify-content: space-between; }
.mobile-cat-header > a { flex: 1; display: block; padding: 14px 0; font-weight: 700; font-size: 15px; color: #333; text-decoration: none; }
.mobile-cat-toggle { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; background: none; border: none; cursor: pointer; color: #999; flex-shrink: 0; transition: transform 0.3s ease; }
.mobile-cat-toggle svg { width: 18px; height: 18px; pointer-events: none; }
.mobile-cat-toggle.open { transform: rotate(180deg); color: var(--color-primary); }
.mobile-catalog-sub { list-style: none; padding: 0 0 10px 15px; margin: 0; display: none; }
.mobile-catalog-sub.open { display: block; }
.mobile-catalog-sub li a { padding: 8px 0; font-size: 14px; font-weight: 400; color: #666; display: block; text-decoration: none; }
.mobile-catalog-sub li a:hover { color: var(--color-primary); }

/* Mobile phone */
.mobile-menu-phone { padding: 15px 20px; border-top: 1px solid #eee; flex-shrink: 0; }
.mobile-menu-phone a { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 700; color: var(--color-primary); text-decoration: none; }
.mobile-menu-phone svg { width: 22px; height: 22px; }

.mobile-menu-socials { display: flex; align-items: center; gap: 16px; padding: 15px 20px; border-top: 1px solid #eee; flex-shrink: 0; }
.mobile-menu-socials a { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; background: #f5f5f5; color: #555; text-decoration: none; transition: all 0.2s; }
.mobile-menu-socials a:hover { background: var(--color-primary); color: #fff; }
.mobile-menu-socials svg { width: 20px; height: 20px; }

.mobile-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 2500; opacity: 0; visibility: hidden; transition: opacity 0.3s ease, visibility 0.3s; }
.mobile-overlay.active { opacity: 1; visibility: visible; }

/* === MOBILE SYSTEM === */
.mobile-menu-toggle { display: none; background: #f5f5f5; border: none; width: 44px; height: 44px; border-radius: 4px; align-items: center; justify-content: center; cursor: pointer; }
.mobile-menu-toggle svg { width: 24px; height: 24px; }

/* === BREADCRUMBS === */
.breadcrumbs { padding: 15px 0; font-size: 13px; color: #999; background: #fafafa; border-bottom: 1px solid #f0f0f0; }
.breadcrumbs a { color: #666; }
.breadcrumbs a:hover { color: var(--color-primary); }
.breadcrumbs .current { color: #333; }

@media (max-width: 1024px) {
    .header-search, .header-phone, .top-bar-nav, .nav-bar { display: none !important; }
    .mobile-menu-toggle { display: flex; flex-shrink: 0; }
    .main-header .container { justify-content: space-between; height: 60px; gap: 15px; overflow: visible; }
    .header-icons { gap: 16px; flex-shrink: 0; flex-wrap: nowrap; }
    .site-logo { flex-shrink: 1; min-width: 0; }
    .site-logo-text { font-size: 18px; }
    .site-logo-img { height: 36px; width: 36px; }
    .catalog-btn { display: none !important; }
    .top-bar-email span { display: none; }
    /* Bigger social icons on mobile for easier tapping */
    .top-bar-socials { gap: 14px; }
    .top-bar-socials a { min-width: 32px; min-height: 32px; justify-content: center; }
    .top-bar-socials svg { width: 22px; height: 22px; }
    .top-bar-email svg { width: 22px; height: 22px; }
    .mega-menu-grid { grid-template-columns: 1fr; }
    .mega-menu-cats-area { grid-template-columns: repeat(2, 1fr); }
    .mega-menu-brands-area { border-left: none; border-top: 1px solid #eee; padding-left: 0; padding-top: 20px; }
    
    /* Mobile mini-cart: slide-up from bottom, flex column layout */
    .mini-cart {
        position: fixed !important;
        top: auto !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        max-height: 80vh !important;
        border-radius: 16px 16px 0 0 !important;
        box-shadow: 0 -10px 40px rgba(0,0,0,0.25) !important;
        z-index: 9999 !important;
        display: flex !important;
        flex-direction: column !important;
        visibility: hidden;
        transform: translateY(100%) !important;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s 0.3s !important;
        border-top: none !important;
        overflow: hidden !important;
        background: #fff !important;
    }
    .mini-cart.active {
        visibility: visible;
        transform: translateY(0) !important;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s 0s !important;
        pointer-events: auto !important;
        /* Fullscreen dark overlay via box-shadow — NOT a DOM element, CANNOT block clicks */
        box-shadow: 0 0 0 200vmax rgba(0,0,0,0.5), 0 -10px 40px rgba(0,0,0,0.25);
    }
    .mini-cart.active * {
        pointer-events: auto !important;
    }
    /* Mobile mini-cart title — fixed at top */
    .mini-cart-title {
        display: block !important;
        padding: 16px 20px 12px;
        font-size: 16px;
        font-weight: 800;
        text-transform: uppercase;
        border-bottom: 1px solid #f0f0f0;
        text-align: center;
        letter-spacing: 0.5px;
        flex-shrink: 0;
    }
    /* Scrollable body — takes remaining space */
    .mini-cart .mini-cart-body {
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        min-height: 0;
    }
    /* Footer — always at bottom, never scrolled away */
    .mini-cart .mini-cart-footer {
        flex-shrink: 0;
        position: relative;
        bottom: auto;
        background: #fafafa;
        border-top: 2px solid #f0f0f0;
    }
    /* Truncate long product names in mini cart */
    .mini-cart-item-name {
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        word-break: break-word !important;
        max-height: 2.6em !important;
        line-height: 1.3 !important;
    }
    /* Close button — visible on mobile */
    .mini-cart-close {
        display: flex !important;
        position: absolute !important;
        top: 10px !important;
        right: 12px !important;
        left: auto !important;
        width: 36px !important;
        height: 36px !important;
        align-items: center !important;
        justify-content: center !important;
        border: none !important;
        background: #eee !important;
        border-radius: 50% !important;
        color: #333 !important;
        cursor: pointer !important;
        z-index: 100 !important;
        padding: 0 !important;
        margin: 0 !important;
        transition: background 0.2s !important;
    }
    .mini-cart-close svg { width: 18px !important; height: 18px !important; }
    .mini-cart-close:active { background: #ddd !important; }
    /* Drag indicator bar */
    .mini-cart::before {
        content: '';
        position: absolute;
        top: 6px;
        left: 50%;
        transform: translateX(-50%);
        width: 36px;
        height: 4px;
        background: #ddd;
        border-radius: 2px;
        z-index: 10;
    }
}

@media (max-width: 768px) {
    .mega-menu-cats-area { grid-template-columns: 1fr; }
}

/* Darkening when mini-cart open — body just blocks scroll */
body.minicart-open {
    overflow: hidden;
}
/* NO ::before, NO overlay element. Darkening via box-shadow on mini-cart itself. */
