/* ──────────────────────────────────────────
   HAMBURGER BUTTON  (injected by responsive.js)
   ────────────────────────────────────────── */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-dark);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: var(--transition);
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
}
.mobile-menu-btn:hover {
    background: var(--gray-light);
    color: var(--primary);
}

/* ──────────────────────────────────────────
   SIDEBAR OVERLAY
   ────────────────────────────────────────── */
.mobile-sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.52);
    z-index: 1500;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.mobile-sidebar-overlay.open {
    opacity: 1;
    pointer-events: all;
}

/* ──────────────────────────────────────────
   SIDEBAR PANEL
   ────────────────────────────────────────── */
.mobile-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: 275px;
    max-width: 85vw;
    background: var(--white);
    z-index: 1600;
    transform: translateX(-100%);
    transition: transform 0.35s cubic-bezier(.4, 0, .2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 28px rgba(0, 0, 0, 0.15);
}
.mobile-sidebar.open {
    transform: translateX(0);
}

/* Sidebar header */
.mobile-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.1rem;
    border-bottom: 1px solid var(--gray-border);
    background: var(--gray-light);
    flex-shrink: 0;
}
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}
.sidebar-brand-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--primary);
    flex-shrink: 0;
}
.sidebar-brand-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #fff;
}
.sidebar-brand-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
}
.sidebar-brand-name span { color: var(--accent); }

.mobile-sidebar-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-light);
    cursor: pointer;
    padding: 0.3rem 0.5rem;
    border-radius: 6px;
    transition: var(--transition);
    line-height: 1;
}
.mobile-sidebar-close:hover {
    background: var(--gray-border);
    color: var(--text-dark);
}

/* Sidebar nav list */
.mobile-sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0.6rem 0;
}
.mobile-sidebar-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.mobile-sidebar-nav li { margin: 0; }

/* Nav items */
.msb-link,
.msb-parent-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.82rem 1.25rem;
    color: var(--text-dark);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    background: none;
    border: none;
    border-left: 3px solid transparent;
    cursor: pointer;
    text-align: left;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
    gap: 0.5rem;
}
.msb-link:hover,
.msb-parent-btn:hover {
    background: rgba(44, 85, 48, 0.07);
    color: var(--primary);
    border-left-color: var(--primary);
}
.msb-link.active {
    background: rgba(44, 85, 48, 0.1);
    color: var(--primary);
    border-left-color: var(--primary);
    font-weight: 600;
}

.msb-arrow {
    font-size: 0.72rem;
    transition: transform 0.25s ease;
    flex-shrink: 0;
}
.msb-parent-btn.expanded .msb-arrow {
    transform: rotate(180deg);
}

/* Sub-menu */
.msb-sub {
    display: none;
    background: var(--gray-light);
    border-left: 3px solid var(--primary-light);
}
.msb-sub.open { display: block; }
.msb-sub a {
    display: block;
    padding: 0.65rem 1.25rem 0.65rem 2rem;
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 400;
    border-left: none;
    transition: background 0.2s, color 0.2s;
}
.msb-sub a:hover {
    color: var(--primary);
    background: rgba(44, 85, 48, 0.05);
}

/* ──────────────────────────────────────────
   HEADER — RESPONSIVE TWEAKS
   ────────────────────────────────────────── */
@media (max-width: 900px) {
    .search-bar { max-width: 360px; }
}

@media (max-width: 768px) {
    /* Show hamburger */
    .mobile-menu-btn { display: flex; }

    /* Modal scrollable */
    .modal-content {
        margin: 3% auto;
        padding: 1.1rem;
        width: 96%;
        max-height: 92dvh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Hide desktop nav bar */
    .main-nav { display: none !important; }

    /* Header row stays horizontal */
    .header-content {
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: center;
        gap: 0.55rem;
        padding: 0.7rem 0;
    }
    .logo h1 { font-size: 1.15rem; }
    .logo-icon { width: 34px !important; height: 34px !important; font-size: 1rem; }

    /* Search bar fills available space */
    .search-bar {
        flex: 1 1 0;
        max-width: none;
        min-width: 0;
    }
    .search-bar input { font-size: 0.85rem; padding: 0.6rem 0.8rem; }
    .search-bar button { padding: 0.4rem 0.7rem; }

    .header-actions { gap: 0.4rem; flex-shrink: 0; }
    .action-btn { font-size: 1rem; padding: 0.4rem; }

    /* ── SLIDER ── */
    .slider { height: 240px; margin: 0.8rem 0; }
    .slide-content { left: 5%; max-width: 88%; }
    .slide-content h2 { font-size: 1.25rem; margin-bottom: 0.4rem; }
    .slide-content p  { font-size: 0.85rem; margin-bottom: 0.8rem; }
    .btn { padding: 0.55rem 1.1rem; font-size: 0.85rem; }

    /* ── TRENDING SLIDER ── */
    .trending-slider-container { padding: 0 38px; }
    .slider-nav-btn { width: 36px; height: 36px; font-size: 0.85rem; }

    /* ── PRODUCTS GRID ── */
    .products-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
    .product-image { height: 190px; }
    .product-info  { padding: 0.9rem; }
    .product-title { font-size: 0.88rem; }
    .current-price { font-size: 1rem; }
    .btn-add-cart  { padding: 0.55rem 0.7rem; font-size: 0.8rem; gap: 0.3rem; }

    /* ── CATEGORIES ── */
    .categories-grid { grid-template-columns: 1fr; gap: 1.2rem; }
    .category-image img { height: 200px; }

    /* ── SECTION TYPOGRAPHY ── */
    .section-title    { font-size: 1.5rem; }
    .section-subtitle { font-size: 0.92rem; }
    .section-header   { margin-bottom: 1.5rem; }

    /* ── ABOUT / COMPANY ── */
    .section-grid   { grid-template-columns: 1fr; gap: 1.5rem; }
    .section-image img { height: 220px; }
    .section-text h2   { font-size: 1.55rem; }
    .section-text p    { font-size: 0.95rem; }
    .section-text      { padding: 0 !important; }

    /* ── CONTACT ── */
    .contact-info { grid-template-columns: 1fr 1fr; gap: 1rem; }
    .contact-card { padding: 1.1rem; }

    /* ── COMPANY STATS ── */
    .company-stats { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
    .stat-number   { font-size: 2.2rem; }

    /* ── MODALS ── */
    .product-modal-content { grid-template-columns: 1fr; gap: 1rem; }
    .product-modal-image img { height: 240px; }
    .product-modal-info h1   { font-size: 1.4rem; }
    .product-modal-price      { font-size: 1.5rem; }
    .modal-actions {
        flex-direction: column;
        align-items: center;
        gap: 0.6rem;
    }
    .modal-actions > * {
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    /* ── CART / WISHLIST ── */
    .cart-item       { flex-wrap: wrap; gap: 0.6rem; }
    .cart-item-image { width: 60px; height: 60px; }
    .cart-item-actions { width: 100%; justify-content: space-between; }

    .wishlist-item          { flex-wrap: wrap; gap: 0.7rem; }
    .wishlist-item-image    { width: 60px; height: 60px; }
    .wishlist-item-actions  { width: 100%; }
    .wishlist-item-actions .btn-add-cart { flex: 1; }

    /* ── FOOTER ── */
    .footer-content { grid-template-columns: 1fr; gap: 1.5rem; }
    .footer         { padding: 2rem 0 1.5rem; margin-top: 2rem; }

    /* ── TERMS / POLICY ── */
    .terms-section,  .policy-section  { max-height: none; overflow-y: visible; }
    .terms-content,  .policy-content  { padding: 1.5rem 1rem; margin: 0; border-radius: 0; }
    .terms-content h1, .policy-content h1 { font-size: 1.8rem; }
}

@media (max-width: 480px) {
    /* Hide logo text, keep icon */
    .logo h1 { display: none; }
    .logo    { flex-shrink: 0; }

    /* Single-column products */
    .products-grid { grid-template-columns: 1fr; }
    .product-image { height: 230px; }
    .product-actions { opacity: 1; transform: none; } /* always visible on touch */

    /* Slider */
    .slider { height: 195px; }
    .slide-content h2 { font-size: 1.05rem; }
    .slide-content p  { display: none; }

    /* Trending */
    .trending-slider-container { padding: 0 30px; }
    .slider-nav-btn { width: 30px; height: 30px; font-size: 0.75rem; }

    /* Category image */
    .category-image img { height: 160px; }

    /* Contact 1-col */
    .contact-info { grid-template-columns: 1fr; }

    /* Modal full-screen */
    .modal-content {
        margin: 0 auto;
        width: 100%;
        border-radius: 0;
        height: 100dvh;
        max-height: 100dvh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    .product-modal-image img { height: 195px; }

    /* Terms / Policy */
    .terms-page, .policy-page { padding: 1rem 0; }
    .terms-section p, .policy-section p { font-size: 0.95rem; }
    .policy-list { margin-left: 1.2rem; }
}

/* Prevent body scroll when sidebar open */
body.sidebar-open { overflow: hidden; }