/* ===========================================================
   MOBILE-ONLY LAYER — customer site
   -----------------------------------------------------------
   The store is a phone app. On a desktop it is not stretched
   across the screen: it stays inside a centred phone frame, so
   there is exactly one layout to design, test and support.

   Loaded AFTER ios.css, store pages only (the panel stays wide).
   =========================================================== */

:root {
  --app-w: 460px;                      /* the phone width */
  --app-pad: 16px;
}

/* ---------- the frame ---------- */
body {
  padding-bottom: calc(var(--tab-h) + 18px);
}

.wrap,
.brandline,
.nav-in,
.auth {
  max-width: var(--app-w) !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* on anything wider than a phone, draw the device */
@media (min-width: 540px) {
  body::after {
    content: "";
    position: fixed; inset: 0;
    pointer-events: none; z-index: 0;
    background:
      linear-gradient(to right, transparent calc(50% - var(--app-w)/2 - 1px),
        var(--sep) calc(50% - var(--app-w)/2 - 1px), var(--sep) calc(50% - var(--app-w)/2),
        transparent calc(50% - var(--app-w)/2)),
      linear-gradient(to left, transparent calc(50% - var(--app-w)/2 - 1px),
        var(--sep) calc(50% - var(--app-w)/2 - 1px), var(--sep) calc(50% - var(--app-w)/2),
        transparent calc(50% - var(--app-w)/2));
  }
  .wrap { padding-left: var(--app-pad); padding-right: var(--app-pad); }
}

/* ---------- nav + tab bar stay on the phone ---------- */
.nav {
  position: fixed; top: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: var(--app-w);
  border-left: 1px solid var(--sep); border-right: 1px solid var(--sep);
}
.nav-in { padding-left: var(--app-pad); padding-right: var(--app-pad); }
body { padding-top: 58px; }            /* the nav is fixed now */

.tabbar {
  left: 50% !important; right: auto !important;
  transform: translateX(-50%);
  width: 100%; max-width: var(--app-w);
  border-left: 1px solid var(--sep); border-right: 1px solid var(--sep);
  border-radius: 20px 20px 0 0;
}

.progress { left: 50%; transform: translateX(-50%); max-width: var(--app-w); }

/* chat button hugs the right edge of the phone, never the screen */
.chat-fab {
  right: max(16px, calc(50% - var(--app-w) / 2 + 16px));
  width: 50px; height: 50px; font-size: 20px;
}

/* ---------- phone proportions at EVERY width ---------- */
.grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px; }
.grid-wide { grid-template-columns: 1fr !important; }
.feat { grid-template-columns: 1fr 1fr; }

.title-lg { font-size: 30px; margin-top: 16px; }
.sec-head h2 { font-size: 20px; }
.hero { padding: 20px; border-radius: 24px; }
.hero h1 { font-size: 26px; }
.hero p { font-size: 14px; }
.hero-stats { gap: 16px; }
.hero-stats div b { font-size: 18px; }

.p-card { padding: 14px 10px 12px; }
.p-card .p-logo { width: 68px !important; height: 68px !important; border-radius: 20px !important; }
.p-name { font-size: 13.5px; }
.p-meta { font-size: 11px; }
.price { font-size: 15px; }
.buy { padding: 7px 11px; font-size: 12px; }

.cat { width: 86px; }
.cat .ic { width: 58px; height: 58px; border-radius: 18px; }

.row { padding: 13px 14px; }
.card { padding: 14px; }

/* ---------- sheets: always from the bottom, always draggable ---------- */
@media (min-width: 760px) {
  .sheet {
    left: 50%; right: auto; bottom: 0; top: auto;
    width: 100%; max-width: var(--app-w);
    transform: translate(-50%, 104%) scale(1);
    border-radius: 26px 26px 0 0;
    opacity: 1; max-height: 90vh;
  }
  .sheet.open { transform: translate(-50%, 0) scale(1); opacity: 1; }
}

/* ---------- login page: one column, card first ---------- */
.auth { grid-template-columns: 1fr !important; gap: 16px; padding-top: 16px; }
.auth-card { position: static !important; order: 1; }
.showcase { order: 2; }
.logo-wall { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
.logo-wall span { font-size: 10px; }

/* ---------- touch comfort ---------- */
.btn { padding: 15px 20px; font-size: 16px; border-radius: 16px; }
.btn-sm { padding: 10px 14px; font-size: 13.5px; border-radius: 12px; }
.input, select.input, textarea.input { padding: 14px; font-size: 16px; }  /* 16px = no iOS zoom */
.icon-btn { width: 38px; height: 38px; }
.seg button { padding: 9px 15px; }

/* ---------- no desktop scrollbars anywhere ---------- */
* { scrollbar-width: none; }
::-webkit-scrollbar, #vlist::-webkit-scrollbar, .chat-body::-webkit-scrollbar { width: 0; height: 0; }

/* chat button sits above the tab bar, clear of the cards */
.chat-fab { bottom: calc(var(--tab-h) + 20px); }
