/* ============================================================
   SwipeFit per EXXSTORE — stylesheet
   Aesthetic: bianco / nero / rosso brand (#E5141C)
   Typography: Bebas Neue (display caps) + Inter (body) + JetBrains Mono
   ============================================================ */

/* ----- Reset & base ----- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior: none;
  overflow: hidden;
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100dvh;
}
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
img { display: block; max-width: 100%; }

/* ----- Design tokens ----- */
:root {
  /* Palette: bianco / nero / rosso brand */
  --bg: #ffffff;
  --bg-2: #f5f5f5;
  --bg-3: #ebebeb;
  --fg: #0a0a0a;
  --fg-2: #404040;
  --muted: #737373;
  --line: rgba(10, 10, 10, 0.08);
  --line-strong: rgba(10, 10, 10, 0.16);

  /* Rosso brand (dal logo bw-red-line) */
  --brand: #E5141C;
  --brand-hover: #c81017;

  /* Accenti gesture */
  --cart: #16A34A;          /* verde "go" per il carrello */
  --cart-hover: #128039;
  --like: var(--cart);      /* destra = carrello = verde */
  --pass: #737373;          /* sinistra = skip = grigio */
  --save: #0a0a0a;          /* giù = preferiti = nero */
  --details: #404040;       /* su = dettagli = grigio scuro */

  /* Tipografia */
  --font-display: 'Bebas Neue', 'Anton', 'Impact', sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  /* Layout */
  --max-w: 480px;
  --header-h: 64px;
  --action-h: 88px;
  --nav-h: 68px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bot: env(safe-area-inset-bottom, 0px);
  --radius: 6px;
  --radius-sm: 4px;
}

/* ----- App container (centrato su desktop, fullscreen mobile) ----- */
.app {
  position: relative;
  width: 100%;
  max-width: var(--max-w);
  height: 100dvh;
  margin: 0 auto;
  background: var(--bg);
  overflow: hidden;
}
@media (min-width: 600px) {
  body { background: #e5e5e5; }
  .app {
    box-shadow:
      0 1px 0 var(--line),
      0 30px 80px -20px rgba(10, 10, 10, 0.3);
  }
}

/* ============================================================
   HEADER
   ============================================================ */
.app-header {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: calc(var(--header-h) + var(--safe-top));
  padding: var(--safe-top) 18px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  color: var(--fg);
}
.app-header .brand-fallback { color: var(--fg); }
.app-header .icon-btn:hover,
.app-header .icon-btn:focus-visible { background: var(--bg-2); }
.header-actions { display: flex; align-items: center; gap: 4px; }
.brand {
  display: flex;
  align-items: center;
  gap: 2px;
}
.brand-logo {
  height: 28px;
  width: auto;
  filter: invert(1) hue-rotate(180deg);
}
.brand-fallback {
  display: flex;
  align-items: center;
  font-family: var(--font-display);
  font-size: 24px;
  letter-spacing: 0.04em;
  color: var(--fg);
}
.brand-fallback::after {
  content: '';
  display: block;
  width: 18px;
  height: 3px;
  background: var(--brand);
  margin-left: 4px;
}

.icon-btn {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  transition: background 160ms;
}
.icon-btn:hover, .icon-btn:focus-visible { background: var(--bg-2); }
.icon-btn svg { width: 22px; height: 22px; }

/* ============================================================
   VIEWS
   ============================================================ */
.view {
  position: absolute;
  inset: 0;
  padding-top: calc(var(--header-h) + var(--safe-top));
  padding-bottom: calc(var(--nav-h) + var(--safe-bot));
  display: flex;
  flex-direction: column;
}
.view[hidden] { display: none; }

.view-discover {
  align-items: center;
  justify-content: center;
}

/* ============================================================
   CARD STACK
   ============================================================ */
.card-stack {
  position: relative;
  flex: 1;
  width: 100%;
  max-width: 380px;
  padding: 14px 18px;
  display: grid;
  place-items: center;
}

.card {
  position: absolute;
  width: calc(100% - 36px);
  aspect-ratio: 2 / 3;     /* foto exxstore sono 2:3 */
  background: var(--bg-2);
  overflow: hidden;
  box-shadow:
    0 1px 2px rgba(10, 10, 10, 0.04),
    0 12px 32px -12px rgba(10, 10, 10, 0.25);
  transform-origin: center bottom;
  will-change: transform, opacity;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}
.card.is-top { z-index: 3; cursor: grab; }
.card.is-top:active { cursor: grabbing; }
.card.is-second { z-index: 2; transform: scale(0.95) translateY(10px); opacity: 0.7; }
.card.is-third  { z-index: 1; transform: scale(0.9)  translateY(20px); opacity: 0.4; }

.card.flying { transition: transform 420ms cubic-bezier(0.16, 1, 0.3, 1), opacity 420ms; }
.card.snapping { transition: transform 380ms cubic-bezier(0.34, 1.56, 0.64, 1); }

.card-image {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  pointer-events: none;
}
.card-image-fallback {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  padding: 20px;
  text-align: center;
}

.card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0) 55%,
    rgba(0,0,0,0.7) 100%
  );
  pointer-events: none;
}

.card-meta {
  position: absolute;
  left: 18px; right: 18px; bottom: 18px;
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
}
.card-meta-brand {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.95;
}
.card-meta-name {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 32px;
  line-height: 0.95;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}
.card-meta-row {
  margin-top: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.card-meta-price {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 0.02em;
  background: var(--brand);
  color: #fff;
  padding: 2px 8px 0;
  line-height: 1.2;
}
.card-meta-cat {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.85;
}

/* Card action overlays */
.card-stamp {
  position: absolute;
  top: 28px;
  padding: 14px 22px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 44px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 5px solid #ffffff;
  border-radius: 10px;
  color: #ffffff;
  opacity: 0;
  pointer-events: none;
  line-height: 1;
  white-space: nowrap;
  box-shadow:
    0 12px 28px -8px rgba(0, 0, 0, 0.45),
    0 0 0 2px rgba(0, 0, 0, 0.12);
  transition: opacity 80ms linear, transform 180ms cubic-bezier(.2,.8,.2,1);
  will-change: opacity, transform;
}
.card-stamp.is-armed {
  animation: stampPulse 420ms ease-out;
}
@keyframes stampPulse {
  0%   { transform: var(--stamp-tf, none) scale(1); }
  35%  { transform: var(--stamp-tf, none) scale(1.18); }
  100% { transform: var(--stamp-tf, none) scale(1.08); }
}

.card-stamp-like {
  right: 22px;
  background: var(--cart);    /* verde "go" carrello */
  --stamp-tf: rotate(10deg);
  transform: rotate(10deg);
}
.card-stamp-pass {
  left: 22px;
  background: #0a0a0a;        /* nero pieno */
  --stamp-tf: rotate(-10deg);
  transform: rotate(-10deg);
}
.card-stamp-up {
  left: 50%; top: 32px;
  background: #404040;
  font-size: 32px;
  padding: 10px 18px;
  --stamp-tf: translateX(-50%);
  transform: translateX(-50%);
}
.card-stamp-down {
  left: 50%; top: auto; bottom: 32px;
  background: #0a0a0a;        /* nero pieno = preferiti */
  --stamp-tf: translateX(-50%);
  transform: translateX(-50%);
}
.card-stamp.is-armed.card-stamp-like   { transform: rotate(10deg) scale(1.08); }
.card-stamp.is-armed.card-stamp-pass   { transform: rotate(-10deg) scale(1.08); }
.card-stamp.is-armed.card-stamp-up,
.card-stamp.is-armed.card-stamp-down   { transform: translateX(-50%) scale(1.08); }

/* ============================================================
   ACTION BAR
   ============================================================ */
.action-bar {
  height: var(--action-h);
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 0 18px;
}
.action-btn {
  width: 50px; height: 50px;
  border-radius: 50%;
  background: #fff;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  box-shadow:
    0 1px 2px rgba(10, 10, 10, 0.04),
    0 4px 12px -6px rgba(10, 10, 10, 0.15);
  transition: transform 140ms;
}
.action-btn svg { width: 20px; height: 20px; }
.action-btn:active { transform: scale(0.92); }
.action-pass { color: var(--pass); }
.action-save { color: var(--save); }
.action-details {
  color: var(--details);
  width: 44px; height: 44px;
}
.action-details svg { width: 18px; height: 18px; }
.action-like {
  color: #fff;
  background: var(--cart);
  border-color: var(--cart);
  width: 60px; height: 60px;
}
.action-like svg { width: 26px; height: 26px; }

/* ============================================================
   GESTURE HINTS
   ============================================================ */
.gesture-hints { display: none; }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 40px;
  text-align: center;
}
.empty-state[hidden] { display: none; }
.empty-display {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 44px;
  line-height: 0.95;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.empty-display em {
  font-style: normal;
  background: var(--brand);
  color: #fff;
  padding: 0 8px;
}
.empty-body {
  color: var(--muted);
  font-size: 14px;
  max-width: 260px;
  line-height: 1.5;
}

/* ============================================================
   GENERIC: TITLES, BUTTONS
   ============================================================ */
.view-header {
  padding: 22px 18px 14px;
  border-bottom: 1px solid var(--line);
}
.view-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 38px;
  line-height: 0.95;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.view-title em {
  font-style: normal;
  color: var(--brand);
}
.view-sub {
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 50px;
  padding: 0 22px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 18px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: transform 140ms, opacity 140ms, background 200ms;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: var(--fg);
  color: #fff;
}
.btn-primary:hover { background: var(--brand); }
.btn-secondary {
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--fg);
}
.btn-secondary:hover { background: var(--fg); color: #fff; }
.btn-full { width: 100%; }

.link-btn {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: underline;
  text-underline-offset: 4px;
  color: var(--fg);
}
.link-center {
  display: block;
  margin: 16px auto 0;
}

/* ============================================================
   GRID (wishlist)
   ============================================================ */
.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding: 14px 18px 24px;
  overflow-y: auto;
  flex: 1;
  -webkit-overflow-scrolling: touch;
}
.grid-card {
  position: relative;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: var(--bg-2);
  cursor: pointer;
}
.grid-card img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.grid-card-meta {
  position: absolute;
  inset: auto 0 0 0;
  padding: 8px 10px;
  background: linear-gradient(to top, rgba(0,0,0,0.75), transparent);
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px;
}
.grid-card-name {
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.grid-card-price {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  flex-shrink: 0;
}
.grid-card-remove {
  position: absolute;
  top: 6px; right: 6px;
  width: 26px; height: 26px;
  background: rgba(255,255,255,0.95);
  display: grid; place-items: center;
}
.grid-card-remove svg { width: 12px; height: 12px; stroke: var(--fg); }

.empty-inline {
  position: relative;
  inset: auto;
  flex: 1;
}

/* ============================================================
   CART
   ============================================================ */
.cart-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 18px;
  -webkit-overflow-scrolling: touch;
}
.cart-row {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.cart-row img {
  width: 72px; height: 108px;
  object-fit: cover;
}
.cart-row-info { min-width: 0; }
.cart-row-brand {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}
.cart-row-name {
  font-family: var(--font-display);
  font-size: 18px;
  line-height: 1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin-top: 4px;
}
.cart-row-size {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}
.cart-row-size-select {
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 24px 0 10px;
  background: var(--brand);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2'><path d='M6 9l6 6 6-6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 12px;
}
.cart-row-size-select option {
  background: var(--bg);
  color: var(--fg);
}
.cart-row-price {
  font-family: var(--font-display);
  font-size: 18px;
}
.cart-row-remove {
  margin-top: 6px;
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.cart-footer {
  padding: 16px 18px calc(16px + var(--safe-bot));
  border-top: 1px solid var(--line-strong);
  background: var(--bg);
}
.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 14px;
}
.cart-total-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.cart-total-amount {
  font-family: var(--font-display);
  font-size: 36px;
  letter-spacing: 0.02em;
}

/* ============================================================
   PROFILE
   ============================================================ */
.profile-section {
  padding: 4px 18px;
  border-bottom: 1px solid var(--line);
}
.profile-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.profile-row:last-child { border-bottom: none; }
.profile-row span:first-child { color: var(--muted); }
.profile-row .mono { font-family: var(--font-mono); font-size: 12px; }
.profile-note {
  padding: 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}
.profile-tagline {
  margin: 22px 18px;
  padding: 22px;
  background: var(--fg);
  color: #fff;
  text-align: center;
}
.profile-tagline-headline {
  font-family: var(--font-display);
  font-size: 28px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  line-height: 1;
}
.profile-tagline-headline em {
  font-style: normal;
  color: var(--brand);
}
.profile-tagline-sub {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.7;
}

/* ============================================================
   BOTTOM NAV
   ============================================================ */
.bottom-nav {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: calc(var(--nav-h) + var(--safe-bot));
  padding: 0 6px var(--safe-bot);
  background: var(--bg);
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  z-index: 5;
}
.nav-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 160ms;
}
.nav-btn svg { width: 20px; height: 20px; }
.nav-btn.active { color: var(--fg); }
.nav-btn.active::before {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 24px; height: 2px;
  background: var(--brand);
}
.nav-badge {
  position: absolute;
  top: 8px; right: 50%;
  transform: translateX(18px);
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--brand);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  display: grid;
  place-items: center;
}

/* ----- Shop nudge (richiamo verso ecommerce tradizionale) ----- */
.nav-btn.is-nudged { color: var(--fg); }
.nav-btn.is-nudged > svg {
  animation: nudge-icon-bounce 1.4s ease-in-out infinite;
}
.nav-btn.is-nudged::after {
  content: '';
  position: absolute;
  top: 6px;
  left: 50%;
  width: 34px;
  height: 34px;
  margin-left: -17px;
  border-radius: 50%;
  border: 2px solid var(--brand);
  opacity: 0;
  pointer-events: none;
  animation: nudge-ring 1.8s ease-out infinite;
}
.nav-nudge {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 220ms ease, transform 280ms cubic-bezier(0.2, 0.9, 0.3, 1.2);
  z-index: 6;
}
.nav-nudge.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  animation: nudge-float 2.4s ease-in-out infinite;
}
.nav-nudge-label {
  display: block;
  padding: 7px 10px 6px;
  background: var(--brand);
  color: #fff;
  font-family: var(--font-display);
  font-size: 12px;
  line-height: 1.05;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
  border-radius: 6px;
  box-shadow: 0 6px 18px rgba(229, 20, 28, 0.35), 0 2px 6px rgba(10, 10, 10, 0.12);
  white-space: nowrap;
}
.nav-nudge-arrow {
  width: 0;
  height: 0;
  margin-top: -1px;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 7px solid var(--brand);
  filter: drop-shadow(0 2px 2px rgba(229, 20, 28, 0.25));
}

@keyframes nudge-float {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%      { transform: translateX(-50%) translateY(-4px); }
}
@keyframes nudge-icon-bounce {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-3px); }
}
@keyframes nudge-ring {
  0%   { transform: scale(0.85); opacity: 0.7; }
  70%  { transform: scale(1.45); opacity: 0; }
  100% { transform: scale(1.45); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .nav-nudge.visible,
  .nav-btn.is-nudged > svg,
  .nav-btn.is-nudged::after { animation: none; }
}

/* ============================================================
   PRODUCT DETAIL SHEET
   ============================================================ */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 20;
  opacity: 0;
  transition: opacity 240ms;
}
.sheet-backdrop.visible { opacity: 1; }
.sheet-backdrop[hidden] { display: none; }

.product-sheet {
  position: fixed;
  bottom: 0; left: 50%;
  transform: translate(-50%, 100%);
  width: 100%;
  max-width: var(--max-w);
  max-height: 96dvh;
  background: var(--bg);
  z-index: 25;
  display: flex;
  flex-direction: column;
  transition: transform 360ms cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}
.product-sheet.visible { transform: translate(-50%, 0); }
.product-sheet[hidden] { display: none; }

.sheet-handle {
  width: 36px; height: 4px;
  background: var(--line-strong);
  margin: 6px auto 0;
  flex-shrink: 0;
}
.sheet-close {
  position: absolute;
  top: 12px; right: 12px;
  width: 36px; height: 36px;
  display: grid; place-items: center;
  background: rgba(255,255,255,0.95);
  z-index: 2;
  border: 1px solid var(--line);
}
.sheet-close svg { width: 16px; height: 16px; }
.sheet-content {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(20px + var(--safe-bot));
}

.gallery {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.gallery::-webkit-scrollbar { display: none; }
.gallery-img {
  flex: 0 0 100%;
  scroll-snap-align: start;
  aspect-ratio: 2 / 3;
  background: var(--bg-2);
}
.gallery-img img { object-fit: contain; }
.gallery-img img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.gallery-dots {
  display: flex;
  gap: 6px;
  justify-content: center;
  padding: 6px 0 4px;
}
.gallery-dot {
  width: 16px; height: 2px;
  background: var(--line-strong);
  transition: background 200ms;
}
.gallery-dot.active { background: var(--brand); }

.sheet-body {
  padding: 14px 18px 22px;
}
.sheet-brand {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}
.sheet-name {
  margin-top: 6px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 36px;
  line-height: 0.95;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.sheet-price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.sheet-price {
  font-family: var(--font-display);
  font-size: 28px;
  letter-spacing: 0.02em;
}
.sheet-availability {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #16a34a;
  display: flex;
  align-items: center;
  gap: 6px;
}
.sheet-availability::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.sheet-desc {
  margin-top: 18px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--fg-2);
}

.sheet-sizes {
  margin-top: 20px;
}
.sheet-sizes-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}
.size-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.size-chip {
  min-width: 44px;
  height: 44px;
  padding: 0 14px;
  background: transparent;
  border: 1px solid var(--line-strong);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  transition: all 160ms;
}
.size-chip:hover { border-color: var(--fg); }
.size-chip.selected {
  background: var(--fg);
  color: #fff;
  border-color: var(--fg);
}

.sheet-actions {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tryon-cta {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 52px;
  padding: 0 24px;
  background: transparent;
  border: 1px solid var(--fg);
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 18px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  overflow: hidden;
  transition: transform 140ms;
}
.tryon-cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--brand);
  transform: translateX(-101%);
  transition: transform 320ms cubic-bezier(0.65, 0, 0.35, 1);
  z-index: -1;
}
.tryon-cta:hover::before { transform: translateX(0); }
.tryon-cta:hover {
  color: #fff;
  border-color: var(--brand);
}
.tryon-cta:active { transform: scale(0.98); }
.tryon-cta-icon {
  font-size: 22px;
  line-height: 1;
}

/* ============================================================
   TRY-ON MODAL
   ============================================================ */
.tryon-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 400ms cubic-bezier(0.16, 1, 0.3, 1);
}
.tryon-modal.visible { transform: translateY(0); }
.tryon-modal[hidden] { display: none; }

.tryon-inner {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: calc(20px + var(--safe-top)) 18px calc(20px + var(--safe-bot));
}
.tryon-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.tryon-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 32px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  line-height: 0.95;
}
.tryon-title em {
  font-style: normal;
  color: var(--brand);
}

.tryon-step {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.tryon-step[hidden] { display: none; }

.tryon-instructions {
  color: var(--fg-2);
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 22px;
}

.upload-zone {
  flex: 1;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1.5px dashed var(--line-strong);
  cursor: pointer;
  transition: background 200ms, border-color 200ms;
}
.upload-zone:hover { background: var(--bg-2); border-color: var(--brand); }
.upload-icon {
  width: 56px; height: 56px;
  background: var(--fg);
  color: #fff;
  display: grid;
  place-items: center;
}
.upload-icon svg { width: 24px; height: 24px; }
.upload-label {
  font-family: var(--font-display);
  font-size: 26px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-top: 8px;
}
.upload-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.tryon-preview {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}
.preview-side {
  position: relative;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: var(--bg-2);
}
.preview-side img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.preview-label {
  position: absolute;
  top: 6px; left: 6px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  background: var(--brand);
  color: #fff;
  padding: 3px 7px;
}
.preview-plus {
  font-family: var(--font-display);
  font-size: 32px;
  color: var(--muted);
}

.tryon-step-loading {
  align-items: center;
  justify-content: center;
}
.loading-orb {
  width: 120px;
  height: 120px;
  display: grid;
  place-items: center;
  margin-bottom: 32px;
}
.orb {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--brand);
  animation: pulse 1.6s ease-in-out infinite;
  box-shadow:
    0 0 0 0 rgba(229, 20, 28, 0.4),
    0 0 60px rgba(229, 20, 28, 0.25);
}
@keyframes pulse {
  0%, 100% { transform: scale(0.85); }
  50% { transform: scale(1.05); }
}
.loading-message {
  font-family: var(--font-display);
  font-size: 26px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin-bottom: 8px;
  min-height: 28px;
}
.loading-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.result-image {
  position: relative;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: var(--bg-2);
  margin-bottom: 18px;
}
.result-image img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.result-image-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  padding: 20px;
  background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 50%);
  color: #fff;
}
.result-image-overlay-text {
  font-family: var(--font-display);
  font-size: 26px;
  line-height: 0.95;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.result-image-overlay-text em {
  font-style: normal;
  background: var(--brand);
  padding: 0 6px;
}
.result-thumb {
  position: absolute;
  top: 10px; left: 10px;
  width: 56px;
  aspect-ratio: 2/3;
  overflow: hidden;
  border: 2px solid #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}
.result-thumb img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.result-disclaimer {
  padding: 10px 12px;
  background: var(--bg-2);
  border-left: 3px solid var(--brand);
  font-size: 11px;
  color: var(--fg-2);
  line-height: 1.5;
  margin-bottom: 18px;
}
.result-disclaimer strong { color: var(--fg); }
.result-actions {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 8px;
}

/* ============================================================
   TOAST
   ============================================================ */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-h) + var(--safe-bot) + 16px);
  transform: translate(-50%, 16px);
  z-index: 100;
  background: var(--fg);
  color: #fff;
  padding: 10px 18px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 12px 28px -8px rgba(10, 10, 10, 0.4);
  opacity: 0;
  transition: opacity 220ms, transform 220ms;
  pointer-events: none;
  white-space: nowrap;
}
.toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}
.toast[hidden] { display: none; }

/* ============================================================
   SHOP VIEW
   ============================================================ */
.view-shop {
  display: flex;
  flex-direction: column;
}
.view-header-shop {
  flex-shrink: 0;
}
.shop-chip-row {
  flex-shrink: 0;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 18px 14px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
}
.shop-chip-row::-webkit-scrollbar { display: none; }
.shop-chip {
  flex-shrink: 0;
  padding: 8px 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg);
  background: var(--bg-2);
  border: 1.5px solid transparent;
  border-radius: 999px;
  white-space: nowrap;
  cursor: pointer;
  transition: background 140ms, color 140ms, border-color 140ms;
  scroll-snap-align: start;
}
.shop-chip:hover { background: var(--bg-3); }
.shop-chip.is-active {
  background: #0a0a0a;
  color: #ffffff;
}

.shop-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 24px;
  scroll-behavior: smooth;
}
.shop-section {
  padding: 8px 0 18px;
}
.shop-section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 14px 18px 10px;
}
.shop-section-title {
  font-family: var(--font-display);
  font-size: 24px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg);
  line-height: 1;
}
.shop-section-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.08em;
}
.shop-section-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding: 0 18px;
}
/* shop-card riusa look di .grid-card ma senza il pulsante remove */
.shop-card {
  position: relative;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: var(--bg-2);
  cursor: pointer;
}
.shop-card img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 320ms ease;
}
.shop-card:hover img { transform: scale(1.03); }
.shop-card-meta {
  position: absolute;
  inset: auto 0 0 0;
  padding: 10px 10px 10px;
  background: linear-gradient(to top, rgba(0,0,0,0.78), transparent);
  color: #fff;
}
.shop-card-brand {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.8;
  margin-bottom: 2px;
}
.shop-card-name {
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.shop-card-price {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  margin-top: 2px;
}
.shop-card-soldout {
  position: absolute;
  top: 8px; left: 8px;
  background: rgba(255,255,255,0.95);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 4px;
}

/* ============================================================
   ACTION FLASH (stamp centrato che resta fermo mentre la card vola)
   ============================================================ */
.action-flash {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.action-flash[hidden] { display: none; }

.action-flash-label {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 56px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #ffffff;
  padding: 18px 28px;
  border: 6px solid #ffffff;
  border-radius: 12px;
  line-height: 1;
  white-space: nowrap;
  box-shadow:
    0 20px 50px -10px rgba(0,0,0,0.55),
    0 0 0 3px rgba(0,0,0,0.18);
  opacity: 0;
  transform: scale(0.7) rotate(var(--flash-rot, 0deg));
  will-change: transform, opacity;
}
.action-flash.show .action-flash-label {
  animation: flashPop 560ms cubic-bezier(.2,.8,.2,1) forwards;
}
@keyframes flashPop {
  0%   { opacity: 0; transform: scale(0.6) rotate(var(--flash-rot, 0deg)); }
  18%  { opacity: 1; transform: scale(1.16) rotate(var(--flash-rot, 0deg)); }
  40%  { opacity: 1; transform: scale(1.0)  rotate(var(--flash-rot, 0deg)); }
  78%  { opacity: 1; transform: scale(1.0)  rotate(var(--flash-rot, 0deg)); }
  100% { opacity: 0; transform: scale(0.96) rotate(var(--flash-rot, 0deg)); }
}

.action-flash-label.flash-like { background: var(--cart);  --flash-rot: 8deg; }
.action-flash-label.flash-pass { background: #0a0a0a;    --flash-rot: -8deg; }
.action-flash-label.flash-save { background: #0a0a0a;    --flash-rot: 0deg; }

/* ============================================================
   UTILITIES
   ============================================================ */
.mono { font-family: var(--font-mono); }

/* ============================================================
   TUTORIAL OVERLAY
   ============================================================ */
.tutorial {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
}
.tutorial[hidden] { display: none; }
.tutorial-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 10, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 220ms ease;
}
.tutorial-card {
  position: relative;
  width: 100%;
  max-width: 360px;
  background: #ffffff;
  border-radius: 14px;
  padding: 28px 22px 22px;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,0.5);
  transform: translateY(16px) scale(0.98);
  opacity: 0;
  transition: transform 240ms cubic-bezier(.2,.8,.2,1), opacity 220ms ease;
}
.tutorial.open .tutorial-backdrop { opacity: 1; }
.tutorial.open .tutorial-card { transform: none; opacity: 1; }

.tutorial-title {
  font-family: var(--font-display);
  font-size: 32px;
  letter-spacing: 0.02em;
  text-align: center;
  color: var(--fg);
  line-height: 1;
}
.tutorial-sub {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  margin-top: 6px;
  margin-bottom: 22px;
}

.tutorial-diagram {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  grid-template-rows: auto auto auto;
  grid-template-areas:
    ".    up    ."
    "left card right"
    ".    down  .";
  align-items: center;
  justify-items: center;
  gap: 10px 8px;
  margin-bottom: 22px;
}
.cell-up    { grid-area: up; }
.cell-down  { grid-area: down; }
.cell-left  { grid-area: left; }
.cell-right { grid-area: right; }

.gesture-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg);
}
.cell-left, .cell-right {
  flex-direction: row;
  gap: 6px;
}
.g-arrow {
  font-family: var(--font-mono);
  font-size: 22px;
  line-height: 1;
  color: var(--fg);
}
.cell-right .g-arrow { color: var(--cart); }
.cell-right .g-label { color: var(--cart); }
.g-label {
  font-size: 11px;
  letter-spacing: 0.06em;
}

.tutorial-card-demo {
  grid-area: card;
  width: 92px;
  height: 124px;
  border-radius: 10px;
  background: linear-gradient(135deg, #f5f5f5 0%, #ebebeb 100%);
  border: 1.5px dashed var(--line-strong);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
  animation: demoWiggle 2.6s ease-in-out infinite;
}
.demo-text {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 0.08em;
  color: var(--fg);
}
.demo-tap {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-align: center;
  padding: 0 6px;
}

@keyframes demoWiggle {
  0%, 100% { transform: translateX(0) rotate(0deg); }
  20%      { transform: translateX(10px) rotate(3deg); }
  40%      { transform: translateX(0) rotate(0deg); }
  60%      { transform: translateX(-10px) rotate(-3deg); }
  80%      { transform: translateX(0) rotate(0deg); }
}

.tutorial-cta {
  display: block;
  width: 100%;
  padding: 14px;
  background: #0a0a0a;
  color: #ffffff;
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 0.08em;
  border-radius: 8px;
  transition: background 160ms;
}
.tutorial-cta:hover,
.tutorial-cta:focus-visible { background: #1f1f1f; }

/* ============================================================
   SIZE CONFIG OVERLAY (riusa look del tutorial)
   ============================================================ */
.size-config {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
}
.size-config[hidden] { display: none; }
.size-config-card {
  position: relative;
  width: 100%;
  max-width: 380px;
  background: #ffffff;
  border-radius: 14px;
  padding: 26px 22px 18px;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,0.5);
  transform: translateY(16px) scale(0.98);
  opacity: 0;
  transition: transform 240ms cubic-bezier(.2,.8,.2,1), opacity 220ms ease;
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
}
.size-config.open .tutorial-backdrop { opacity: 1; }
.size-config.open .size-config-card { transform: none; opacity: 1; }

.size-group {
  margin-top: 18px;
}
.size-group-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.size-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.size-chip-btn {
  min-width: 44px;
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--fg);
  background: #ffffff;
  border: 1.5px solid var(--line-strong);
  border-radius: 8px;
  transition: background 140ms, border-color 140ms, color 140ms, transform 80ms;
}
.size-chip-btn:active { transform: scale(0.96); }
.size-chip-btn.is-active {
  background: #0a0a0a;
  border-color: #0a0a0a;
  color: #ffffff;
}

.size-config-actions {
  display: flex;
  gap: 10px;
  align-items: stretch;
  margin-top: 22px;
}
.size-config-skip {
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  background: transparent;
  border: 1.5px solid var(--line-strong);
  border-radius: 8px;
  transition: color 140ms, border-color 140ms;
  white-space: nowrap;
}
.size-config-skip:hover,
.size-config-skip:focus-visible {
  color: var(--fg);
  border-color: var(--fg);
}
.size-config-actions .tutorial-cta {
  flex: 1;
}
