/* MUPAS Worldwide — Store page (/store) styles.
   All classes are `.store-*` prefixed so they never affect the portal or landing.
   Relies on the design tokens in mupas.css and the nav/footer/button classes in
   mupas_home.css. */

.store-page { min-height: 100vh; }

/* Hero */
.store-hero { padding: 118px 24px 30px; text-align: center; position: relative; }
.store-hero-inner { max-width: 760px; margin: 0 auto; }
.store-hero-title { font-family: var(--font-serif); font-weight: 700;
  font-size: clamp(30px, 4.6vw, 50px); line-height: 1.05; margin: 10px 0 14px;
  color: var(--text-primary); }
.store-hero-sub { font-size: clamp(15px, 1.6vw, 18px); color: var(--text-secondary);
  max-width: 620px; margin: 0 auto; line-height: 1.55; }

/* Sections + grid */
.store-main { max-width: 1160px; margin: 0 auto; padding: 20px 24px 70px; }
.store-section { margin-top: 46px; scroll-margin-top: 90px; }
.store-section-title { font-family: var(--font-serif); font-weight: 700;
  font-size: clamp(22px, 3vw, 30px); color: var(--text-primary);
  margin: 0 0 20px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.store-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }

/* Product card */
.store-card { display: flex; flex-direction: column; background: var(--bg-surface);
  border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden;
  transition: transform var(--transition), border-color var(--transition),
    box-shadow var(--transition); }
.store-card:hover { transform: translateY(-4px); border-color: var(--border-accent);
  box-shadow: var(--shadow-card); }
.store-card-media { aspect-ratio: 16/10; display: flex; align-items: center;
  justify-content: center; background: var(--bg-elevated); overflow: hidden; }
.store-card-img { width: 100%; height: 100%; object-fit: contain; padding: 14px; }
/* Device photographs fill the card; make_device_photos.py frames them so the
   device clears the 4:3 -> 16:10 trim. */
.store-card-img--photo { object-fit: cover; padding: 0; }
.store-card-media--icon { aspect-ratio: 16/7; }
.store-card-iconwrap { width: 58px; height: 58px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-dim); border: 1px solid var(--border-accent); }
.store-card-body { display: flex; flex-direction: column; gap: 10px; padding: 20px 20px 22px;
  flex: 1; }
.store-card-head { display: flex; align-items: baseline; justify-content: space-between;
  gap: 10px; }
.store-card-name { font-size: 17px; font-weight: 700; color: var(--text-primary); margin: 0; }
.store-card-price { font-size: 19px; font-weight: 700; color: var(--accent); white-space: nowrap; }
.store-card-unit { font-size: 12.5px; font-weight: 600; color: var(--text-muted); margin-left: 2px; }
.store-card-tag { font-size: 13.5px; color: var(--text-secondary); margin: 0; }
.store-card-blurb { font-size: 14px; color: var(--text-secondary); margin: 0; flex: 1; }
.store-card-specs { list-style: none; margin: 2px 0 0; padding: 0; display: flex;
  flex-direction: column; gap: 7px; flex: 1; }
.store-card-specs li { display: flex; align-items: flex-start; gap: 7px; font-size: 13px;
  color: var(--text-secondary); }
.store-add-btn { justify-content: center; margin-top: 6px; padding: 11px 16px; font-size: 14px; }

/* Floating cart button */
/* z-index kept BELOW Mantine's modal layer (~200) so the reused login gate and its
   sub-modals open ABOVE the cart drawer (nav is z:50; drawer is z:120 below). */
.store-cart-fab { position: fixed; right: 22px; bottom: 22px; z-index: 90;
  width: 56px; height: 56px; border-radius: 50%; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center; color: #04211d;
  background: var(--accent); box-shadow: 0 12px 30px rgba(0,0,0,.4), var(--shadow-accent);
  transition: transform var(--transition); }
.store-cart-fab:hover { transform: translateY(-2px) scale(1.05); }
.store-cart-count { position: absolute; top: -4px; right: -4px; min-width: 22px; height: 22px;
  padding: 0 6px; border-radius: 11px; background: #fa5252; color: #fff; font-size: 12px;
  font-weight: 700; align-items: center; justify-content: center; border: 2px solid var(--bg-base); }

/* Cart drawer */
.store-cart-drawer { position: fixed; inset: 0; z-index: 120; display: none; }
.store-cart-drawer.is-open { display: block; }
.store-cart-backdrop { position: absolute; inset: 0; background: rgba(2,6,10,.72);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); cursor: pointer; }
.store-cart-panel { position: absolute; top: 0; right: 0; height: 100%; width: min(420px, 92vw);
  display: flex; flex-direction: column; background: var(--bg-surface);
  border-left: 1px solid var(--border); box-shadow: -30px 0 80px rgba(0,0,0,.5);
  animation: storeCartIn .26s cubic-bezier(0.4,0,0.2,1); }
@keyframes storeCartIn { from { transform: translateX(30px); opacity: .4; } to { transform: none; opacity: 1; } }
.store-cart-header { display: flex; align-items: center; justify-content: space-between;
  padding: 20px 22px; border-bottom: 1px solid var(--border); }
.store-cart-title { font-size: 18px; font-weight: 700; margin: 0; color: var(--text-primary); }
.store-cart-close { width: 36px; height: 36px; border-radius: 50%; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center; color: var(--text-secondary);
  background: var(--bg-elevated); transition: all var(--transition); }
.store-cart-close:hover { color: var(--text-primary); background: var(--border); }

.store-cart-items { flex: 1; overflow-y: auto; padding: 12px 16px; }
.store-cart-empty { color: var(--text-muted); text-align: center; padding: 40px 0; font-size: 14px; }
.store-cart-line { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 6px; border-bottom: 1px solid var(--border); }
.store-cart-line-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.store-cart-line-name { font-size: 14.5px; font-weight: 600; color: var(--text-primary); }
.store-cart-line-price { font-size: 13px; color: var(--text-muted); }
.store-cart-qty { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.store-qty-btn { width: 28px; height: 28px; border-radius: 7px; border: 1px solid var(--border);
  background: var(--bg-elevated); color: var(--text-primary); font-size: 16px; line-height: 1;
  cursor: pointer; transition: all var(--transition); }
.store-qty-btn:hover { border-color: var(--border-accent); color: var(--accent); }
.store-qty-val { min-width: 20px; text-align: center; font-size: 14px; font-weight: 600;
  color: var(--text-primary); }
.store-qty-remove { width: 28px; height: 28px; border-radius: 7px; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center; color: var(--text-muted);
  background: transparent; transition: color var(--transition); }
.store-qty-remove:hover { color: #fa5252; }

.store-cart-footer { padding: 16px 20px 20px; border-top: 1px solid var(--border);
  background: var(--bg-base); }
.store-cart-totalrow { display: flex; align-items: baseline; justify-content: space-between;
  font-size: 15px; color: var(--text-secondary); margin-bottom: 12px; }
.store-cart-total { font-size: 22px; font-weight: 700; color: var(--text-primary); }
.store-checkout-btn { width: 100%; justify-content: center; }
.store-checkout-btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; transform: none; }
.store-checkout-msg { font-size: 13px; color: var(--accent); margin-bottom: 10px; min-height: 0; }
.store-checkout-msg:empty { display: none; }
.store-cart-fine { font-size: 12px; color: var(--text-muted); text-align: center; margin: 10px 0 0; }

/* Responsive */
@media (max-width: 900px) {
  .store-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 620px) {
  .store-grid { grid-template-columns: 1fr; }
  .store-hero { padding-top: 96px; }
}

/* ── Card → detail links + actions row ────────────────────────────────────── */
.store-card-media { cursor: pointer; }
.store-card-namelink { text-decoration: none; color: inherit; }
.store-card-namelink:hover .store-card-name { color: var(--accent); }
.store-card-actions { display: flex; align-items: center; gap: 12px; margin-top: 6px; }
.store-add-btn { flex: 1; }
.store-card-details { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap;
  font-size: 13px; font-weight: 600; color: var(--text-secondary); text-decoration: none;
  transition: color var(--transition); }
.store-card-details:hover { color: var(--accent); }

/* ── Product detail page (/store/<id>) ────────────────────────────────────── */
.store-detail-wrap { max-width: 1120px; margin: 0 auto; padding: 108px 24px 72px; }
.store-detail-back { display: inline-flex; align-items: center; gap: 5px; font-size: 14px;
  font-weight: 600; color: var(--text-secondary); text-decoration: none; margin-bottom: 22px;
  transition: color var(--transition); }
.store-detail-back:hover { color: var(--accent); }
.store-detail { display: grid; grid-template-columns: 1.05fr 1fr; gap: 44px; align-items: start; }
.store-detail-media { background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden; display: flex; align-items: center;
  justify-content: center; aspect-ratio: 4/3; }
.store-detail-img { width: 100%; height: 100%; object-fit: contain; padding: 22px; }
.store-detail-video { width: 100%; height: 100%; object-fit: contain; background: #000; }

/* ── Detail page: photo gallery (products with a catalogue `gallery`) ─────────
   A scroll-snap strip: swipe and trackpad work with no script.  Arrows, thumbs,
   counter and keys come from mupas_store_gallery.js.  min-width:0 on the column
   is load-bearing - a grid item defaults to min-width:auto, and a strip of six
   100%-wide slides would otherwise push the column six photos wide. */
.store-gallery { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.store-gallery-frame { position: relative; display: block; }
.store-gallery-track { display: flex; width: 100%; height: 100%; overflow-x: auto;
  overflow-y: hidden; scroll-snap-type: x mandatory; scroll-behavior: smooth;
  overscroll-behavior-x: contain; scrollbar-width: none; }
.store-gallery-track::-webkit-scrollbar { display: none; }
.store-gallery-track:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.store-gallery-slide { flex: 0 0 100%; height: 100%; margin: 0; position: relative;
  scroll-snap-align: start; scroll-snap-stop: always; }
.store-gallery-img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* Fixed colours, not tokens: these sit ON a photograph, which does not change
   with the theme. */
.store-gallery-caption { position: absolute; left: 12px; bottom: 12px; max-width: calc(100% - 24px);
  padding: 6px 10px; border-radius: 6px; background: rgba(0,0,0,.66); color: #fff;
  font-size: 13px; line-height: 1.35; }
.store-gallery-arrow { position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; padding: 0; cursor: pointer; color: #fff;
  background: rgba(0,0,0,.48); border: 1px solid rgba(255,255,255,.35);
  transition: opacity var(--transition), background var(--transition); }
.store-gallery-arrow:hover { background: rgba(0,0,0,.68); }
.store-gallery-arrow:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.store-gallery-arrow:disabled { opacity: 0; pointer-events: none; }
.store-gallery-arrow--prev { left: 10px; }
.store-gallery-arrow--next { right: 10px; }
.store-gallery-count { position: absolute; top: 12px; right: 12px; padding: 3px 9px;
  border-radius: 999px; background: rgba(0,0,0,.55); color: #fff; font-size: 12px;
  font-variant-numeric: tabular-nums; pointer-events: none; }
.store-gallery-thumbs { position: relative; display: flex; gap: 8px; overflow-x: auto;
  padding: 3px; scrollbar-width: thin; }
.store-gallery-thumb { flex: 0 0 auto; width: 80px; height: 60px; padding: 0; overflow: hidden;
  border: 2px solid transparent; border-radius: 8px; background: var(--bg-elevated);
  cursor: pointer; opacity: .72; transition: opacity var(--transition), border-color var(--transition); }
.store-gallery-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.store-gallery-thumb:hover { opacity: 1; }
.store-gallery-thumb.is-active { opacity: 1; border-color: var(--accent); }
.store-gallery-thumb:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  .store-gallery-track { scroll-behavior: auto; }
}
.store-detail-iconwrap { width: 132px; height: 132px; border-radius: 50%; display: flex;
  align-items: center; justify-content: center; background: var(--accent-dim);
  border: 1px solid var(--border-accent); }
.store-detail-info { display: flex; flex-direction: column; gap: 14px; }
.store-detail-name { font-family: var(--font-serif); font-weight: 700;
  font-size: clamp(26px, 3.4vw, 40px); line-height: 1.08; color: var(--text-primary); margin: 4px 0 0; }
.store-detail-price { font-size: 30px; font-weight: 700; color: var(--accent); }
.store-detail-unit { font-size: 15px; font-weight: 600; color: var(--text-muted); margin-left: 3px; }
.store-detail-desc { font-size: 15.5px; line-height: 1.65; color: var(--text-secondary); margin: 0; }
.store-detail-specs { list-style: none; margin: 4px 0 2px; padding: 0; display: flex;
  flex-direction: column; gap: 9px; }
.store-detail-specs li { display: flex; align-items: flex-start; gap: 8px; font-size: 14.5px;
  color: var(--text-secondary); }
.store-detail-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; }
.store-detail-add { min-width: 190px; justify-content: center; }
.store-notfound { text-align: center; padding: 60px 0; display: flex; flex-direction: column;
  align-items: center; gap: 14px; }

@media (max-width: 800px) {
  .store-detail { grid-template-columns: 1fr; gap: 26px; }
  .store-detail-wrap { padding-top: 92px; }
}

/* ── Detail page: full-width spec sections (Mini / Biometric) ─────────────── */
.store-detail-more { margin-top: 50px; border-top: 1px solid var(--border); padding-top: 6px; }
.store-detail-block { margin-top: 34px; }
.store-detail-h2 { font-family: var(--font-serif); font-weight: 700;
  font-size: clamp(19px, 2.5vw, 25px); color: var(--text-primary); margin: 0 0 15px; }
.store-detail-p { font-size: 15.5px; line-height: 1.65; color: var(--text-secondary);
  margin: 0; max-width: 840px; }
.store-detail-list { list-style: none; margin: 2px 0 0; padding: 0; display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px 30px; max-width: 900px; }
.store-detail-list li { display: flex; align-items: flex-start; gap: 8px; font-size: 14.5px;
  color: var(--text-secondary); }
.store-spec-table { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 44px; max-width: 940px; }
.store-spec-row { display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; padding: 11px 2px; border-bottom: 1px solid var(--border); }
.store-spec-name { font-size: 14.5px; color: var(--text-secondary); }
.store-spec-val { font-size: 14px; font-weight: 600; color: var(--text-primary);
  text-align: right; white-space: nowrap; }
@media (max-width: 700px) {
  .store-detail-list, .store-spec-table { grid-template-columns: 1fr; }
}

/* Order status banner shown when returning from Stripe checkout */
.store-order-banner { max-width: 1160px; margin: 92px auto 0; padding: 14px 22px;
  border: 1px solid var(--border-accent); border-radius: var(--radius-md);
  background: var(--accent-dim); color: var(--text-primary); font-size: 15px;
  font-weight: 600; text-align: center; }
.store-order-banner:empty { display: none; }


/* ── Contract signing modal ────────────────────────────────────────────────
   The BoldSign document is embedded in an iframe, so the surrounding chrome
   has to stay out of its way: no padding that would squeeze the page, and a
   viewport-relative height so the signature block is reachable without a
   nested scrollbar on a laptop screen. */
.store-sign-intro { margin: 0 0 14px; color: var(--text-primary);
  font-size: 15px; line-height: 1.5; }
.store-sign-intro p { margin: 0 0 8px; }
.store-sign-note { color: var(--text-secondary); font-size: 13px; }

.store-sign-frame { border: 1px solid var(--border); border-radius: var(--radius-md);
  overflow: hidden; background: #fff; min-height: 200px; }
/* White, not a themed surface: the document itself is a white page, and a dark
   frame around it reads as a rendering fault rather than a design. */
.store-sign-frame:empty { display: none; }

.store-sign-actions { display: flex; gap: 10px; align-items: center;
  margin-top: 14px; }
.store-sign-status { margin-top: 10px; font-size: 14px; min-height: 20px; }
.store-sign-ok { color: var(--accent); font-weight: 600; }
.store-sign-wait { color: var(--text-secondary); }

/* The portal's prompt to come back and sign. Deliberately an accent bar rather
   than a warning colour: they have done nothing wrong, there is simply a step
   left. */
.portal-sign-banner { display: flex; gap: 12px; align-items: center;
  justify-content: center; flex-wrap: wrap;
  margin: 0 auto; padding: 10px 18px;
  border: 1px solid var(--border-accent); border-radius: var(--radius-md);
  background: var(--accent-dim); color: var(--text-primary);
  font-size: 14px; font-weight: 600; }
.portal-sign-banner:empty { display: none; }
.portal-sign-banner a { color: var(--accent); text-decoration: underline;
  font-weight: 700; }

/* Device monitoring & AI access (2026-10-05): the fee sentence, beside the
   price on the card, the product page and the cart line - read where the price
   is read. */
.store-fee-note { margin: 6px 0 10px; font-size: 13px; line-height: 1.45;
  color: var(--text-secondary); }
.store-fee-note--cart { margin: 4px 0 0; font-size: 12px; }
