/* ============================================================
   SOUL MC — responsive.css (mobile + tablet)
   The mobile site is DESIGNED for mobile, not a shrunken desktop.
   Breakpoints:
     ≤ 900px  → mobile experience (hamburger, tab bar, 1-col grids)
     901–1200 → tablet adjustments
   ============================================================ */

/* ==================== TABLET ==================== */
@media (max-width: 1200px) and (min-width: 901px) {
  .why-grid { grid-template-columns: repeat(2, 1fr); }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
  .cart-layout, .checkout-layout { grid-template-columns: 1fr 320px; }
  /* tighter nav so the centered links never collide with logo/actions */
  .desktop-nav { gap: 2px; }
  .desktop-nav a { padding: 10px 8px; font-size: 14px; }
  .header-inner { padding: 0 16px; gap: 20px; }
}

/* ==================== MOBILE ==================== */
@media (max-width: 900px) {

  :root { --header-h: 64px; }

  body { font-size: 16px; }
  .container { padding: 0 16px; }
  main { padding-bottom: 88px; } /* room for bottom tab bar */

  /* ---------- HEADER ---------- */
  .desktop-nav { display: none; }
  .hamburger { display: flex; }
  .account-btn { display: none; } /* simplify mobile header */
  .header-inner { padding: 0 16px; gap: 12px; }
  .brand img { width: 38px; height: 38px; }
  .wordmark { font-size: 19px; }
  .icon-btn { width: 48px; height: 48px; }

  /* ---------- MOBILE MENU (slide-in drawer) ---------- */
  .mobile-menu-overlay {
    display: block;
    position: fixed; inset: 0; z-index: 150;
    background: rgba(0, 0, 0, 0.65);
    opacity: 0; pointer-events: none;
    transition: opacity 0.28s ease;
  }
  .mobile-menu-overlay.open { opacity: 1; pointer-events: auto; }
  .mobile-menu {
    position: absolute; top: 0; right: 0; bottom: 0;
    width: min(84vw, 340px);
    background: var(--bg2);
    border-left: 1px solid var(--purple-dim);
    padding: 20px;
    display: flex; flex-direction: column; gap: 8px;
    transform: translateX(100%);
    transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1);
    box-shadow: -12px 0 40px rgba(0, 0, 0, 0.6);
  }
  .mobile-menu-overlay.open .mobile-menu { transform: translateX(0); }
  .mobile-menu-head {
    display: flex; align-items: center; justify-content: space-between;
    padding-bottom: 16px; margin-bottom: 8px; border-bottom: 1px solid var(--border);
  }
  .mobile-nav { display: flex; flex-direction: column; gap: 2px; margin-bottom: 16px; }
  .mobile-nav a {
    color: var(--muted); font-family: var(--font-head); font-weight: 700;
    font-size: 17px; padding: 14px 12px; border-radius: 10px;
    border-left: 3px solid transparent;
  }
  .mobile-nav a:hover { color: #fff; background: rgba(139,92,246,.08); }
  .mobile-nav a.active {
    color: #fff; background: rgba(139,92,246,.14);
    border-left-color: var(--purple);
  }
  .mobile-menu .btn-block { margin-top: auto; }

  /* ---------- BOTTOM TAB BAR ---------- */
  .tab-bar {
    display: flex;
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 120;
    background: rgba(8, 6, 12, 0.96);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .tab-bar a {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
    color: var(--muted); font-size: 11px; font-weight: 600;
    padding: 8px 4px; border-radius: 10px; position: relative;
    min-height: 56px; justify-content: center;
  }
  .tab-bar a.active { color: var(--purple-bright); }
  .tab-bar a.active svg { filter: drop-shadow(0 0 6px rgba(168,85,247,.7)); }
  .tab-badge {
    position: absolute; top: 2px; right: calc(50% - 22px);
  }

  /* ---------- HERO (compact mobile hero) ---------- */
  .hero { min-height: 420px; }
  .hero-content { padding: 64px 16px 48px; }
  .hero-kicker { font-size: 9px; }
  .hero h1 { font-size: 52px; }
  .hero .hero-sub { font-size: 15px; letter-spacing: 0.2em; }
  .hero .hero-text { font-size: 15.5px; margin-bottom: 26px; }
  .hero-cta { flex-direction: column; align-items: stretch; max-width: 340px; margin: 0 auto; }
  .hero-cta .btn { width: 100%; min-height: 54px; }

  /* ---------- SECTIONS ---------- */
  .section { padding: 48px 0; }
  .section-head h2 { font-size: 27px; }
  .section-head p { font-size: 15.5px; }

  /* ---------- PRODUCT CARDS (one column) ---------- */
  .product-grid { grid-template-columns: 1fr; gap: 18px; }
  .product-card { flex-direction: row; }
  .card-media { width: 132px; min-width: 132px; aspect-ratio: 1 / 1; }
  .card-body { padding: 14px 14px; gap: 6px; }
  .card-title { font-size: 17px; }
  .card-desc {
    font-size: 13.5px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }
  .price-now { font-size: 19px; }
  .card-actions .btn-sm { padding: 10px 8px; font-size: 12px; min-height: 46px; }

  /* ---------- CHECKOUT UPI QR (stack on mobile) ---------- */
  .upi-qr-row { flex-direction: column; align-items: flex-start; gap: 12px; }
  .upi-qr { width: 180px; height: 180px; }

  /* ---------- ADMIN (stack fields on mobile) ---------- */
  .admin-row { grid-template-columns: repeat(2, 1fr); }
  .admin-bar { bottom: 84px; flex-direction: column-reverse; align-items: stretch; }
  .admin-bar .btn { width: 100%; }

  /* ---------- AUTH (mobile) ---------- */
  .auth-box { padding: 24px 18px 18px; }
  .order-head { flex-direction: column; align-items: flex-start; }

  /* ---------- SERVER PANEL ---------- */
  .server-panel { padding: 32px 18px; }
  .server-panel h2 { font-size: 26px; }
  .ip-row { display: flex; width: 100%; }
  .ip-row code { font-size: 15px; padding: 14px 12px; flex: 1; overflow-x: auto; white-space: nowrap; }
  .ip-row button { padding: 14px 18px; min-height: 52px; }
  .server-stats { gap: 10px; }
  .stat-box { flex: 1 1 45%; min-width: 0; padding: 12px 10px; }
  .stat-box .stat-val { font-size: 17px; }

  /* ---------- WHY / CTA ---------- */
  .why-grid { grid-template-columns: 1fr 1fr; gap: 14px; }
  .why-card { padding: 20px 14px; }
  .why-card h3 { font-size: 16px; }
  .why-card p { font-size: 13px; }
  .why-icon { width: 48px; height: 48px; margin-bottom: 12px; }
  .cta-banner { padding: 36px 20px; }
  .cta-banner h2 { font-size: 24px; }
  .cta-banner .btn-row { flex-direction: column; align-items: stretch; }
  .cta-banner .btn { min-height: 54px; }

  /* ---------- FOOTER ---------- */
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 28px; padding: 40px 16px 24px; }
  .footer-brand { grid-column: 1 / -1; text-align: center; }
  .footer-brand .brand { justify-content: center; }

  /* ---------- STORE CONTROLS ---------- */
  .store-controls { flex-direction: column; align-items: stretch; }
  .search-box { max-width: none; }
  .sort-select { width: 100%; }
  .store-count { margin-left: 0; align-self: flex-start; }
  .cat-tabs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; margin: 0 -16px 24px; padding-left: 16px; padding-right: 16px; scrollbar-width: none; }
  .cat-tabs::-webkit-scrollbar { display: none; }
  .cat-tab { flex: 0 0 auto; white-space: nowrap; }

  /* ---------- CATEGORY HERO ---------- */
  .cat-hero { padding: 44px 0; }
  .cat-hero h1 { font-size: 34px; }
  .page-title h1 { font-size: 32px; }

  /* ---------- PRODUCT DETAIL ---------- */
  .product-layout { grid-template-columns: 1fr; gap: 24px; margin-bottom: 40px; }
  .product-info h1 { font-size: 30px; }
  .price-lg { font-size: 26px; }
  .buy-row .btn { flex: 1; min-height: 54px; }
  .qty-stepper button { width: 48px; height: 48px; }
  /* sticky bottom buy bar */
  .mobile-buy-bar {
    display: flex; align-items: center; gap: 14px;
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 119;
    background: rgba(8, 6, 12, 0.97);
    border-top: 1px solid var(--purple-dim);
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    backdrop-filter: blur(12px);
  }
  .mobile-buy-price { font-family: var(--font-head); font-size: 21px; font-weight: 700; white-space: nowrap; }
  .mobile-buy-bar .btn { min-height: 52px; }
  body[data-page="product"] .tab-bar { display: none; } /* buy bar replaces tab bar */
  body[data-page="product"] main { padding-bottom: 100px; }

  /* ---------- CART ---------- */
  .cart-layout { grid-template-columns: 1fr; }
  .cart-item { grid-template-columns: 84px 1fr; grid-template-rows: auto auto; }
  .cart-thumb { width: 84px; height: 84px; grid-row: span 2; }
  .cart-name { font-size: 16px; }
  .cart-line-total { grid-column: 2; justify-self: start; font-size: 18px; }
  .cart-summary { position: static; }
  .cart-summary .btn-block { min-height: 54px; }

  /* ---------- CHECKOUT ---------- */
  .checkout-layout { grid-template-columns: 1fr; }
  .checkout-summary-col { order: -1; } /* summary first on mobile */
  .radio-row { flex-direction: column; }
  .radio-pill { min-height: 52px; }
  .pay-option { min-height: 64px; }
  #place-order { min-height: 58px; }

  /* ---------- CONTACT / LEGAL ---------- */
  .contact-grid { grid-template-columns: 1fr; }
  .contact-card .btn { min-height: 52px; }

  /* ---------- 404 ---------- */
  .notfound { padding: 72px 16px; }
  .notfound h1 { font-size: 44px; }
  .notfound .btn-row { flex-direction: column; align-items: stretch; max-width: 320px; margin: 0 auto; }
  .notfound .btn { min-height: 54px; }

  /* ---------- MISC ---------- */
  .toast { bottom: 96px; }
  .btn { min-height: 48px; }
}
