/* =====================================================
   Shop.all / GameVault — Mobile polish
   Loaded LAST on every page. Desktop styles are untouched;
   everything here lives behind max-width media queries and
   only refines the phone / small-tablet experience.
   ===================================================== */

/* ---------- Touch niceties (all sizes) ---------- */
@media (hover: none) and (pointer: coarse) {
  * { -webkit-tap-highlight-color: transparent; }
  button, a { touch-action: manipulation; }
}

/* =====================================================
   ≤ 768px — phones & small tablets
   ===================================================== */
@media (max-width: 768px) {

  html { -webkit-text-size-adjust: 100%; }
  body { overflow-x: hidden; }

  /* iOS zooms into any focused input under 16px — never allow that. */
  input, select, textarea { font-size: 16px !important; }

  /* ---------- GameVault navbar (store/game/search/categories) ---------- */
  .navbar { padding-left: max(0px, env(safe-area-inset-left)); padding-right: max(0px, env(safe-area-inset-right)); }
  .navbar-inner { height: 60px; gap: 12px; }
  .logo-text { font-size: 17px; }
  .nav-links { top: 60px; z-index: 90; box-shadow: 0 18px 30px rgba(0,0,0,0.45); }
  .nav-links a { font-size: 15px; }
  .nav-actions { gap: 8px; }
  .nav-actions .btn { height: 38px; padding: 0 14px; font-size: 13px; }
  .menu-toggle { width: 42px; height: 42px; }

  /* ---------- Store hero ---------- */
  .hero { height: 360px; border-radius: 0 0 18px 18px; }
  .hero-content { padding: 0 20px; }
  .hero-kicker { font-size: 11px; letter-spacing: 0.14em; }
  .hero-title { font-size: 30px; line-height: 1.15; }
  .hero-desc { font-size: 14px; line-height: 1.6; max-width: 100%; }
  .hero-actions { flex-wrap: wrap; gap: 10px; }
  .hero-actions .btn { height: 44px; padding: 0 18px; font-size: 14px; }
  /* Keep the slider dots clear of the (possibly wrapped) action buttons. */
  .hero-content { padding-bottom: 40px; }
  .hero-dots { bottom: 12px; }

  /* ---------- Store sections ---------- */
  .container { padding-left: 18px; padding-right: 18px; }
  .section { margin-top: 38px; }
  .section-head { margin-bottom: 16px; align-items: baseline; }
  .section-head h2 { font-size: 19px; }
  .view-all { font-size: 12.5px; white-space: nowrap; }

  /* Two-column card grid reads like a real app store on a phone. */
  .games-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 12px; }
  .game-cover { height: 120px; }
  .cover-name { font-size: 13px; }
  .game-body { padding: 12px; }
  .game-name { font-size: 13.5px; line-height: 1.35; }
  .rating { font-size: 12px; }
  .game-foot { margin-top: 8px; }
  .price { font-size: 13.5px; }
  .old-price { font-size: 11px; }
  .add-cart { width: 34px; height: 34px; }
  .discount-badge { font-size: 10.5px; padding: 3px 7px; }

  .offers-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 12px; }
  .promo-card { grid-column: span 2 !important; padding: 22px; }
  .promo-title { font-size: 22px; }

  .categories-grid { grid-template-columns: repeat(4, 1fr) !important; gap: 10px; }
  .category-card { padding: 14px 8px; border-radius: 12px; }
  .cat-icon { width: 40px; height: 40px; }
  .cat-icon .icon { width: 18px; height: 18px; }
  .cat-name { font-size: 11.5px; }

  .features { padding: 20px; gap: 14px; }
  .feature { gap: 12px; }
  .feature-icon { width: 40px; height: 40px; flex: none; }

  /* ---------- Footer ---------- */
  .footer { margin-top: 44px; }
  .footer-grid { gap: 24px; }
  .newsletter-form input { min-width: 0; }
  .footer-bottom { gap: 10px; text-align: center; }

  /* ---------- Game page ---------- */
  .breadcrumb { font-size: 12px; flex-wrap: wrap; row-gap: 4px; }
  .game-layout { gap: 20px; }
  .media-main { height: 210px; border-radius: 14px; }
  .media-thumbs { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 6px; scrollbar-width: none; }
  .media-thumbs::-webkit-scrollbar { display: none; }
  .thumb { flex: 0 0 84px; height: 52px; }

  .game-head h1 { font-size: 22px; line-height: 1.25; }
  .meta-row { flex-wrap: wrap; gap: 10px; font-size: 12.5px; }

  .price-box { padding: 18px; border-radius: 14px; }
  .price-now { font-size: 26px; }
  .buy-row .btn { height: 48px; font-size: 15px; }
  .assurance { flex-wrap: wrap; gap: 10px; font-size: 12px; }

  /* Tabs scroll sideways instead of squeezing. */
  .tabs {
    overflow-x: auto; flex-wrap: nowrap; gap: 20px;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
    margin-left: -18px; margin-right: -18px;
    padding-left: 18px; padding-right: 18px;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { white-space: nowrap; padding-bottom: 12px; font-size: 14px; }

  .info-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .detail-grid { gap: 20px; }

  .also-wrap { margin-top: 34px; }
  .mini-card { flex-basis: calc(50% - 8px); }
  .mini-cover { height: 92px; }
  .also-nav { display: none; }
  .also-track { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .also-track::-webkit-scrollbar { display: none; }
  .also-track .mini-card { flex: 0 0 150px; }

  /* ---------- Search & categories ---------- */
  .cats-layout, .search-layout { gap: 18px; }
  .result-row { padding: 14px; border-radius: 14px; }
  .result-title { font-size: 15px; }
  .result-buy .btn { height: 42px; }

  /* ---------- Checkout / dash pages ---------- */
  .dash-topbar { height: 60px; padding: 0 16px; }
  .dash-main { padding: 18px 16px calc(24px + env(safe-area-inset-bottom)); }

  /* Sidebar becomes a slim horizontal chip strip. */
  .dash-side {
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    overflow-x: auto;
    gap: 4px;
    padding: 10px 12px !important;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .dash-side::-webkit-scrollbar { display: none; }
  .side-link { white-space: nowrap; border-radius: 999px; padding: 9px 14px !important; }

  .stepper { gap: 8px; margin-bottom: 22px; }
  .step { font-size: 12px; gap: 7px; white-space: nowrap; }
  .step-num { width: 26px; height: 26px; font-size: 12px; }
  .step-line { min-width: 14px; }

  .checkout-layout { gap: 16px; }
  .pay-panel { padding: 20px !important; }
  .order-summary { padding: 20px; border-radius: 14px; }
  .order-summary .btn { height: 48px; }

  .pm-card { border-radius: 12px; }
  .pm-head { padding: 14px 16px; }

  /* ---------- Admin (GameVault admin.html) ---------- */
  .kpi-row { gap: 12px; }
  .kpi-card { padding: 16px; }
  .kpi-value { font-size: 22px; }
  .panel { padding: 16px; border-radius: 14px; }
  .chart-svg { width: 100%; height: auto; }

  /* ---------- Shop.all control panel (dashboard.html) ---------- */
  .db-main { padding: 16px 14px calc(24px + env(safe-area-inset-bottom)); }
  .db-head { margin-bottom: 16px; }
  .db-head h1 { font-size: 19px; }
  .db-btn { height: 42px; }

  /* Sidebar → sticky horizontal chip bar. */
  .db-shell { grid-template-columns: 1fr !important; }
  .db-side {
    position: sticky !important;
    top: 0;
    z-index: 60;
    height: auto !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center;
    overflow-x: auto;
    gap: 6px;
    padding: 10px 12px;
    border-inline-end: none !important;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .db-side::-webkit-scrollbar { display: none; }
  .db-brand { font-size: 16px; margin: 0 8px 0 0; flex: none; }
  .db-nav-item {
    flex: none;
    white-space: nowrap;
    border-radius: 999px;
    padding: 9px 14px;
    margin: 0;
    font-size: 13px;
  }
  .db-nav-sep { display: none; }
  .db-status { flex: none; width: auto !important; margin: 0 0 0 4px; }

  .db-kpis { grid-template-columns: repeat(2, 1fr) !important; gap: 10px; }
  .db-kpi { padding: 14px; }
  .db-kpi b { font-size: 20px; }

  .db-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 10px; }
  .db-card-img { height: 96px; }
  .db-card-body { padding: 10px 12px; }
  .db-card-body h4 { font-size: 13px; }
  .db-card-actions { padding: 8px 10px 12px; flex-wrap: wrap; }
  .db-mini { min-height: 34px; }

  .db-panel { padding: 16px; border-radius: 14px; }

  /* Editor modal becomes a full-screen sheet — vital for the long
     game editor with its upload fields. */
  .db-modal { padding: 0; align-items: stretch; }
  .db-modal-card {
    width: 100%;
    min-height: 100%;
    border-radius: 0;
    padding: 18px 16px calc(28px + env(safe-area-inset-bottom));
  }
  .db-modal-foot {
    position: sticky;
    bottom: 0;
    margin: 22px -16px calc(-28px - env(safe-area-inset-bottom));
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: rgba(23,27,40,0.96);
    backdrop-filter: blur(8px);
    border-top: 1px solid rgba(255,255,255,0.08);
  }
  .db-modal-foot .db-btn { height: 46px; }

  .db-up-box { flex-wrap: wrap; }
  .db-up-info { flex-basis: 100%; order: 3; }
  .db-up-thumb { width: 56px; height: 42px; }
  .db-up-actions { margin-left: auto; }

  .db-stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .db-stat { padding: 14px; }
  .db-stat b { font-size: 20px; }
  .db-spark { height: 70px; gap: 3px; }
  .db-spark-col span { font-size: 8.5px; }
  .db-table { font-size: 12.5px; }
  .db-table th, .db-table td { padding: 8px 8px; }

  .db-gate-card { padding: 24px 20px; }

  /* The floating language pill sat on top of the sticky chip nav —
     park it at the bottom corner instead, clear of everything. */
  .lang-float {
    top: auto;
    bottom: calc(18px + env(safe-area-inset-bottom));
    inset-inline-end: 16px;
  }
  .lang-float .lang-menu { top: auto; bottom: calc(100% + 8px); }
  /* …and never let it cover a modal's sticky footer. */
  body:has(.db-modal.open) .lang-float,
  body:has(.qv-overlay.open) .lang-float { display: none; }

  /* ---------- Fashion world ---------- */
  .f-container { padding-left: 18px; padding-right: 18px; }
  .f-nav-inner { height: 58px; }
  .f-logo { font-size: 19px; }
  .f-hero { gap: 22px; padding-top: 18px; }
  /* The hero sits outside .f-container, so it needs its own gutters. */
  .f-hero-copy { padding: 6px 18px 0; }
  .f-hero-art { margin: 0 18px; }
  .f-title { font-size: 30px !important; line-height: 1.15; }
  .f-desc { font-size: 14px; }
  .f-btn-dark { height: 46px; padding: 0 22px; }
  .f-hero-art { min-height: 180px; border-radius: 14px; }

  .f-section { margin-top: 38px; }
  .f-section-head h2 { font-size: 20px; }

  .f-cats { grid-template-columns: repeat(2, 1fr) !important; gap: 10px; }
  .f-cat-img { height: 120px; }
  .f-drops { grid-template-columns: repeat(2, 1fr) !important; gap: 10px; }
  .f-drop-img { height: 150px; }
  .f-drop-body { padding: 10px 12px 12px; }
  .f-drop-body b { font-size: 13px; }
  .f-price { font-size: 13px; }
  .f-add { height: 38px; font-size: 12.5px; }

  .f-news { padding: 26px 20px; }
  .f-footer-grid { grid-template-columns: 1fr 1fr; gap: 20px; }

  .qv-card { width: min(480px, calc(100vw - 24px)); max-height: 88vh; overflow: auto; }
  .qv-img { min-height: 180px; }
  .qv-body { padding: 18px; }
  .qv-add { height: 46px; }

  /* Fashion cart / checkout */
  .f-cart-item { flex-wrap: wrap; gap: 10px; padding: 14px; }
  .f-cart-img { width: 72px; height: 88px; }
  .f-cart-info h4 { font-size: 14px; }
  .f-cart-price { margin-inline-start: auto; font-size: 14px; }
  .f-summary { padding: 18px; }
  .f-btn-full { height: 48px; }

  /* ---------- Cinema world ---------- */
  .c-container { padding-left: 18px; padding-right: 18px; }
  .c-nav-inner { height: 56px; }
  .c-hero { min-height: 430px; }
  .c-hero-inner { padding: 46px 20px; max-width: 100%; }
  .c-tvplus { font-size: 24px; }
  .c-hero h1 { font-size: 27px !important; line-height: 1.2; }
  .c-hero-inner p { font-size: 14px; }
  .c-btn-red { height: 46px; padding: 0 26px; }
  .c-hero-note { font-size: 12px; }

  .c-feats { grid-template-columns: 1fr !important; gap: 10px; }
  .c-feat { padding: 14px; }

  .c-row h2 { font-size: 19px; }
  .c-poster { flex-basis: 150px !important; flex-grow: 0; }
  .c-strip { -webkit-overflow-scrolling: touch; }

  .c-cta { padding: 26px 20px; }
  .c-footer-links { gap: 14px 18px; }

  /* Cinema checkout */
  .cc-grid { gap: 16px; }
  .cc-plan { padding: 18px; }
  .cc-btn { height: 48px; }

  /* ---------- Portal (index) ---------- */
  .portal-cards { padding: 28px 18px calc(40px + env(safe-area-inset-bottom)); gap: 18px; }
  .portal-card { height: 360px; border-radius: 20px; }
  .portal-logo { font-size: 38px; }
}

/* =====================================================
   ≤ 420px — compact phones
   ===================================================== */
@media (max-width: 420px) {

  .hero { height: 330px; }
  .hero-title { font-size: 26px; }

  .categories-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .category-card { display: flex; flex-direction: row; align-items: center; gap: 10px; padding: 12px 14px; text-align: left; }
  .cat-icon { margin: 0; width: 36px; height: 36px; }

  .game-cover { height: 105px; }

  .media-main { height: 180px; }
  .game-head h1 { font-size: 20px; }

  .info-grid { grid-template-columns: 1fr; }

  .db-kpis { grid-template-columns: 1fr 1fr !important; }
  .db-stat-grid { grid-template-columns: 1fr 1fr; }
  .db-row2 { grid-template-columns: 1fr !important; }

  .f-title { font-size: 26px !important; }
  .f-cat-img { height: 104px; }
  .f-drop-img { height: 128px; }

  .c-hero { min-height: 390px; }
  .c-hero h1 { font-size: 24px !important; }
  .c-poster { flex-basis: 132px !important; }

  .portal-card { height: 330px; }
  .portal-logo { font-size: 32px; }

  .step { font-size: 0; gap: 0; }            /* number-only stepper */
  .step .step-num { margin: 0; }
  .step.active { font-size: 12px; gap: 7px; } /* current step keeps its label */
}
