/* ============================================================
   BACK TO BACHPAN — MOBILE & RESPONSIVE STYLES
   Mobile-first responsive layer on top of the design system
   ============================================================ */

/* ── MOBILE BOTTOM NAV (mobile only) ────────────────────── */
.mobile-bottom-nav { display: none; }

@media (max-width: 768px) {
    /* Body padding for bottom nav */
    body { padding-bottom: 70px; }

    /* Bottom Nav */
    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--surface-strong);
        backdrop-filter: blur(var(--glass-blur));
        -webkit-backdrop-filter: blur(var(--glass-blur));
        border-top: 1px solid var(--border-soft);
        z-index: 9998;
        padding: 0.5rem 0 calc(0.5rem + env(safe-area-inset-bottom, 0px));
        justify-content: space-around;
        box-shadow: 0 -4px 24px rgba(0,0,0,0.06);
    }
    .mobile-bottom-nav a {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-decoration: none;
        color: var(--text-muted);
        font-size: 10px;
        font-weight: 500;
        padding: 0.25rem 0.75rem;
        border-radius: var(--radius);
        transition: var(--transition);
        min-width: 44px;
        min-height: 44px;
        justify-content: center;
        gap: 2px;
    }
    .mobile-bottom-nav a.active { color: var(--primary); }
    .mobile-bottom-nav a:hover  { color: var(--primary); }
    .mobile-bottom-nav svg {
        width: 22px; height: 22px;
        stroke: currentColor; fill: none; stroke-width: 2;
    }

    /* ── NAVBAR MOBILE ADJUSTMENTS ── */
    .navbar {
        height: auto;
        flex-direction: column;
        padding: 0;
    }
    .navbar > .container {
        height: 60px;
        padding: 0;
    }
    .nav-logo { font-size: 1.25rem; }

    /* Mobile buttons shown */
    .mobile-search-icon,
    .mobile-menu-btn {
        display: flex !important;
    }

    /* Desktop search bar hidden on mobile */
    .search-bar.d-md-flex { display: none !important; }

    /* Mobile search bar (shown below header) */
    .mobile-search-bar {
        display: flex !important;
        padding: 0 1rem 0.625rem;
        background: var(--surface);
        backdrop-filter: blur(var(--glass-blur));
        -webkit-backdrop-filter: blur(var(--glass-blur));
        border-bottom: 1px solid var(--border-soft);
    }
    .mobile-search-bar .search-bar {
        width: 100%;
        padding: 0.5rem 0.875rem;
    }

    /* Desktop-only links hidden on mobile */
    .d-md-flex   { display: none !important; }
    .d-md-inline { display: none !important; }
    .d-md-block  { display: none !important; }
    .d-md-none   { display: flex !important; }

    /* Show mobile-only elements */
    .d-md-none.mobile-search-icon { display: flex !important; }

    /* Main content top offset */
    main.container { padding-top: 1rem !important; }

    /* ── TYPOGRAPHY ── */
    h1 { font-size: clamp(1.5rem, 5vw, 2rem) !important; }
    h2 { font-size: clamp(1.25rem, 4vw, 1.75rem) !important; }

    /* ── HERO ── */
    .hero { padding: 2rem 0; }
    .hero__card {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    .hero__visual { order: -1; }
    .hero__image-tile {
        max-width: 280px;
        margin: 0 auto;
        padding: 1.75rem;
    }
    .hero__headline {
        font-size: clamp(1.5rem, 6vw, 2rem) !important;
    }
    .hero__sub { font-size: 0.9375rem; }
    .hero__actions { flex-direction: column; gap: 0.75rem; }
    .hero__actions .btn { width: 100%; justify-content: center; }
    .hero__break { display: none; }

    /* ── TRUST BAR ── */
    .trust-bar {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    .trust-item { padding: 1rem 0.75rem; }
    .trust-item-icon { width: 40px; height: 40px; }

    /* ── PRODUCT GRID ── */
    .product-grid,
    .product-grid-2 { grid-template-columns: repeat(2, 1fr) !important; gap: 0.75rem !important; }
    .product-grid-3 { grid-template-columns: repeat(2, 1fr) !important; gap: 0.75rem !important; }
    .product-grid-4 { grid-template-columns: repeat(2, 1fr) !important; gap: 0.75rem !important; }

    /* Mobile product card adjustments */
    .product-card-glass { border-radius: var(--radius-lg); }
    .product-card-glass .image-wrapper { padding: 1rem; }
    .product-card-glass .info-wrapper { padding: 0.875rem; }
    .product-card-glass .title { font-size: 0.875rem; }
    .product-card-glass .price { font-size: 1rem; }

    /* Always show wishlist button on mobile (no hover) */
    .product-card-glass .wishlist-btn-float {
        opacity: 1 !important;
        transform: none !important;
    }

    /* ── FILTERS ── */
    .filter-sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: min(85%, 340px);
        height: 100vh;
        background: var(--surface-strong);
        backdrop-filter: blur(var(--glass-blur));
        -webkit-backdrop-filter: blur(var(--glass-blur));
        z-index: 10000;
        overflow-y: auto;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        padding: 1.5rem;
        border-radius: 0 var(--radius-xl) var(--radius-xl) 0;
        box-shadow: 4px 0 32px rgba(0,0,0,0.12);
        border-right: 1px solid var(--border-soft);
    }
    .filter-sidebar.active { left: 0; }

    .filter-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.4);
        backdrop-filter: blur(2px);
        -webkit-backdrop-filter: blur(2px);
        z-index: 9999;
    }
    .filter-overlay.active { display: block; }

    .mobile-filter-btn {
        display: inline-flex;
        align-items: center;
        gap: 0.4rem;
        padding: 0.5rem 1rem;
        background: var(--surface-strong);
        border: 1px solid var(--border-soft);
        border-radius: var(--radius-pill);
        color: var(--text-primary);
        font-weight: 600;
        font-size: 0.875rem;
        cursor: pointer;
        box-shadow: var(--shadow-xs);
        transition: var(--transition);
    }
    .mobile-filter-btn:hover { background: var(--white); }

    /* Hide desktop-only filter sidebar on mobile */
    .desktop-filter { display: none !important; }

    /* ── FOOTER ── */
    .footer-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 2rem !important;
    }

    /* ── MISC ── */
    .hide-mobile { display: none !important; }
    .container { padding: 0; }
    .section-gap { margin-bottom: 2.5rem; }
    .search-overlay { padding: 1rem; align-items: flex-start; }
    .cart-drawer { width: 100%; max-width: 100%; }
}

@media (max-width: 480px) {
    /* Extra small screens */
    .footer-grid { grid-template-columns: 1fr !important; }
    .product-grid, .product-grid-2, .product-grid-3, .product-grid-4 {
        gap: 0.6rem !important;
    }
    .hero__image-tile { max-width: 220px; padding: 1.25rem; }
    .trust-bar { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
    .hero__trust { gap: 0.3rem; }
    .hero__trust-sep { display: none; }
}

@media (max-width: 360px) {
    .container { padding: 0 0.75rem; }
    .product-card-glass .info-wrapper { padding: 0.7rem; }
}

/* ── DESKTOP OVERRIDES ───────────────────────────────────── */
@media (min-width: 769px) {
    .mobile-bottom-nav   { display: none !important; }
    .mobile-filter-btn   { display: none !important; }
    .filter-overlay      { display: none !important; }
    .mobile-search-bar   { display: none !important; }
    .mobile-search-icon  { display: none !important; }
    .mobile-menu-btn     { display: none !important; }
    .desktop-filter      { display: block; }
    .d-md-flex           { display: flex !important; }
    .d-md-inline         { display: inline !important; }
    .d-md-block          { display: block !important; }
}

/* ── TABLET ADJUSTMENTS ─────────────────────────────────── */
@media (min-width: 769px) and (max-width: 1024px) {
    .footer-grid { grid-template-columns: 1fr 1fr !important; }
    .trust-bar { grid-template-columns: repeat(2, 1fr); }
    .hero__card { gap: 2rem; }
    .hero__image-tile { max-width: 320px; }
}

/* ── SAFE AREA SUPPORT (notched phones) ─────────────────── */
@supports (padding: max(0px)) {
    .mobile-bottom-nav {
        padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
    }
    body { padding-bottom: max(70px, calc(70px + env(safe-area-inset-bottom))); }
}

/* ── ACCOUNT LAYOUT MOBILE ──────────────────────────── */
@media (max-width: 768px) {
    /* Account mobile tab navigation */
    .account-mobile-tabs {
        display: flex;
        overflow-x: auto;
        gap: 0;
        background: #fff;
        border-bottom: 1px solid #e2e8f0;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        margin-bottom: 1.5rem;
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    }
    .account-mobile-tabs::-webkit-scrollbar { display: none; }
    .account-mobile-tab {
        display: flex; flex-direction: column;
        align-items: center; gap: 0.25rem;
        padding: 0.75rem 1rem;
        font-size: 0.75rem; font-weight: 600;
        color: var(--text-muted); text-decoration: none;
        white-space: nowrap; border-bottom: 2px solid transparent;
        transition: var(--transition); min-width: 60px;
    }
    .account-mobile-tab.active {
        color: var(--primary);
        border-bottom-color: var(--primary);
    }
    .account-mobile-tab svg, .account-mobile-tab i { width: 18px; height: 18px; }

    /* Hide desktop sidebar on mobile */
    .account-sidebar { display: none; }

    /* Cart mobile */
    .cart-layout { display: flex; flex-direction: column; gap: 1.5rem; }
    .cart-summary-sticky { position: static !important; }

    /* Checkout mobile */
    .checkout-layout { display: flex; flex-direction: column; gap: 1.5rem; }
    .checkout-summary-sticky { position: static !important; }

    /* Promo banner mobile */
    .promo-banner { padding: 1.5rem 1.25rem; }

    /* Products layout mobile */
    .products-layout { display: flex; flex-direction: column; gap: 1rem; }
}

