/* ================================================================
   HEADER — Mobile Responsive CSS (max-width: 768px)
   ================================================================ */

@media (max-width: 768px) {
    /* Hide desktop-only elements */
    .header-top,
    .header-bottom { display: none; }

    /* ── Main Header — compact mobile ── */
    .header-main { padding: 8px 0; }
    .main-container {
        gap: 10px;
        padding: 0 14px;
        flex-wrap: nowrap;
        justify-content: space-between;
    }

    /* Burger button (mobile only) */
    .burger-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        background: none;
        border: none;
        font-size: 1.3rem;
        color: var(--text-color, #333);
        cursor: pointer;
        padding: 6px;
        flex-shrink: 0;
    }

    /* Logo — smaller on mobile, full name visible */
    .logo img { max-height: 34px; }
    .logo h1 {
        font-size: 0.92rem;
        white-space: nowrap;
        overflow: visible;
        text-overflow: unset;
        max-width: none;
    }

    /* User icon (mobile only) */
    .mob-user-icon {
        display: flex !important;
        position: relative;
        flex-direction: column;
        align-items: center;
    }
    .mob-user-icon .val {
        font-size: 1.35rem !important;
    }
    .logged-in-dot {
        display: block !important;
        position: absolute;
        top: -2px;
        right: -4px;
        width: 9px;
        height: 9px;
        background: #25d366;
        border-radius: 50%;
        border: 2px solid var(--header-bg, #fff);
    }

    /* Search — full width below header on mobile */
    .search-container {
        display: none; /* Hidden in header, shown in mobile search */
    }

    /* Mobile search bar (toggled) */
    .mobile-search {
        display: block;
        padding: 8px 12px 10px;
        background: var(--header-bg, #fff);
        border-bottom: 1px solid var(--border-color, #eee);
    }
    .mobile-search form {
        display: flex;
        position: relative;
    }
    .mobile-search input {
        width: 100%;
        padding: 10px 14px;
        padding-right: 44px;
        border: 1.5px solid var(--border-color, #e0e0e0);
        border-radius: 10px;
        font-size: 0.88rem;
        background: var(--bg-color, #f5f5f5);
        color: var(--text-color, #333);
        outline: none;
    }
    .mobile-search input:focus {
        border-color: var(--primary-color);
    }
    .mobile-search .search-btn {
        position: absolute;
        right: 4px;
        top: 4px;
        bottom: 4px;
        width: 36px;
        border-radius: 8px;
        background: var(--primary-color);
        color: #fff;
        border: none;
        font-size: 0.9rem;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Header Actions — hide Account & Orders dropdowns on mobile, keep only cart */
    .header-actions { gap: 14px; }
    .header-actions > .action-item:not(.cart-action):not(.mob-user-icon) {
        display: none;
    }
    .cart-action { display: flex !important; }
    .mob-user-icon { display: flex !important; }

    /* Dropdowns hidden on mobile (Account/Orders in bottom nav) */
    .pro-dropdown {
        display: none !important;
    }

    /* Cart — bigger icon, adjusted badge for mobile */
    .cart-action .cart-icon {
        font-size: 1.5rem !important;
    }
    .cart-count {
        top: -8px;
        right: -10px;
        font-size: 0.65rem;
        padding: 2px 6px;
    }

    /* Announcement bar — mobile */
    .announcement-bar {
        font-size: 0.76rem;
        padding: 8px 14px;
    }
}

/* ── Mobile Bottom Navigation Bar ── */
.mob-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--card-bg, #fff);
    border-top: 1px solid var(--border-color, #eee);
    display: flex;
    height: 60px;
    z-index: 2500;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.06);
}
.mob-bottom-nav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--text-muted, #999);
    font-size: 0.62rem;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s;
    position: relative;
    letter-spacing: 0.3px;
}
.mob-bottom-nav a i {
    font-size: 1.2rem;
    transition: transform 0.2s;
}
.mob-bottom-nav a.active,
.mob-bottom-nav a:hover {
    color: var(--primary-color, #3498db);
}
.mob-bottom-nav a.active i {
    transform: scale(1.1);
}
.mob-bottom-nav .mob-badge {
    position: absolute;
    top: 5px;
    right: calc(50% - 18px);
    background: #e74c3c;
    color: #fff;
    font-size: 0.55rem;
    padding: 1px 5px;
    border-radius: 20px;
    font-weight: 800;
    min-width: 16px;
    text-align: center;
    line-height: 1.4;
}

/* ── Burger Drawer (mobile only) ── */
.burger-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 3000;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.burger-overlay.open {
    display: block;
    opacity: 1;
}
.burger-drawer {
    position: fixed;
    top: 0;
    left: -280px;
    width: 270px;
    height: 100%;
    background: var(--card-bg, #fff);
    z-index: 3100;
    transition: left 0.3s ease;
    overflow-y: auto;
    box-shadow: 4px 0 20px rgba(0,0,0,0.15);
}
.burger-drawer.open {
    left: 0;
}
.burger-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border-color, #eee);
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--text-color, #333);
}
.burger-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--text-muted, #999);
    cursor: pointer;
    padding: 4px 8px;
}
.burger-drawer-links {
    padding: 10px 0;
}
.burger-drawer-links a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 20px;
    color: var(--text-color, #333);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 600;
    border-bottom: 1px solid var(--border-color, #f0f0f0);
    transition: background 0.2s, color 0.2s;
}
.burger-drawer-links a:hover {
    background: var(--primary-light, #f0f0ff);
    color: var(--primary-color, #3498db);
}
.burger-drawer-links a i {
    width: 20px;
    text-align: center;
    color: var(--primary-color, #3498db);
}

/* Hide mobile bottom nav on desktop */
@media (min-width: 769px) {
    .mob-bottom-nav { display: none; }
    .mobile-search { display: none !important; }
    .burger-btn { display: none !important; }
    .mob-user-icon { display: none !important; }
    .burger-overlay, .burger-drawer { display: none !important; }
}

/* Extra small screens */
@media (max-width: 380px) {
    .logo h1 { font-size: 0.82rem; }
    .logo img { max-height: 28px; }
    .header-actions { gap: 10px; }
    .burger-btn { font-size: 1.15rem; }
    .mob-bottom-nav { height: 56px; }
    .mob-bottom-nav a { font-size: 0.58rem; }
    .mob-bottom-nav a i { font-size: 1.1rem; }
}
