/* ============================================================
   ROOT TOKENS — Brand Righello
   ============================================================
   SPACING: 8-point grid (4, 8, 16, 24, 32, 40, 48, 64, 80, 96)
   GOLDEN RATIO φ≈1.618 per le relazioni verticali tra sezioni
   TYPE SCALE: Major Third ×1.25 (12 → 14 → 16 → 20 → 24 → 32 → 40)
   TOUCH TARGETS: min 44px per tutti gli elementi interattivi
   ============================================================ */
:root {
  /* Palette */
  --bg:          #080808;
  --bg-card:     #111111;
  --bg-card-h:   #161616;
  --bg-panel:    #080808;
  --bg-gate:     #050505;
  --accent:      #ffffff;
  --accent-sub:  #c8c8c8;
  --accent-dim:  #666666;
  --accent-brand: #c084fc;
  --accent-brand-dim: rgba(192,132,252,.15);
  --text:        #f0f0f0;
  --text-dim:    #888888;
  --text-muted:  #444444;
  --border:      #1a1a1a;
  --border-h:    #2a2a2a;

  /* Shape */
  --radius:    8px;
  --radius-sm: 4px;
  --radius-xs: 3px;

  /* Shadow */
  --shadow: 0 8px 64px rgba(0,0,0,.9);

  /* Layout */
  --panel-w:   280px;

  /* Transition */
  --transition: .2s cubic-bezier(.4,0,.2,1);

  /* Typography */
  --font: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;

  /* -------------------------------------------------------
     SPACING SCALE — 8pt grid
     s1=4  s2=8  s3=12  s4=16  s5=24  s6=32  s7=40  s8=48
     s9=64  s10=80  s11=96  s12=128
     ------------------------------------------------------- */
  --s1:  4px;
  --s2:  8px;
  --s3:  12px;
  --s4:  16px;
  --s5:  24px;
  --s6:  32px;
  --s7:  40px;
  --s8:  48px;
  --s9:  64px;
  --s10: 80px;
  --s11: 96px;

  /* -------------------------------------------------------
     TYPE SCALE — Major Third ×1.25
     xs=12  sm=14  base=16  md=20  lg=24  xl=32  2xl=40
     ------------------------------------------------------- */
  --type-xs:   0.75rem;   /* 12px — labels, muted hints */
  --type-sm:   0.8125rem; /* 13px — secondary labels */
  --type-base: 1rem;      /* 16px — body */
  --type-md:   1.125rem;  /* 18px — subtitle */
  --type-lg:   1.375rem;  /* 22px — section title */
  --type-xl:   1.75rem;   /* 28px — page title */
  --type-2xl:  2.25rem;   /* 36px — hero */
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
img { display: block; max-width: 100%; }
.hidden { display: none !important; }

/* ============================================================
   LOGO
   ============================================================ */
.logo-img {
  height: var(--s7); /* 40px — dimensione minima percepibile del brand */
  width: auto;
  display: block;
  object-fit: contain;
}
.logo-img--gate {
  height: var(--s8); /* 48px — più grande nel gate per impatto */
  margin: 0 auto;
}

/* ============================================================
   PASSWORD GATE
   ============================================================
   Relazioni golden ratio:
   - Logo margin-bottom: 48px
   - Divider: margin 24px auto 40px (24 × φ ≈ 39 → 40)
   - Gate padding laterale: 24px
   ============================================================ */
#password-gate,
#admin-gate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg-gate);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s5); /* 24px */
}

.gate-card {
  width: 100%;
  max-width: 360px;
  text-align: center;
}

.gate-logo {
  margin-bottom: var(--s8); /* 48px — respiro netto tra brand e contenuto */
}

.gate-divider {
  width: var(--s7); /* 40px */
  height: 1px;
  background: var(--border-h);
  margin: var(--s5) auto var(--s7); /* 24px top, 40px bottom (24 × φ ≈ 40) */
}

.gate-title {
  font-size: var(--type-lg);    /* 22px */
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.25;
  color: var(--text);
  margin-bottom: var(--s2);     /* 8px — strettamente legato al subtitle */
}

.gate-subtitle {
  font-size: var(--type-xs);    /* 12px */
  color: var(--text-dim);
  line-height: 1.6;
  margin-bottom: var(--s7);     /* 40px — separazione chiara prima del form */
  letter-spacing: .01em;
}

.gate-input-wrap {
  display: flex;
  flex-direction: column;
  gap: var(--s2);                /* 8px — elementi dello stesso gruppo = gap minimo */
}

.gate-input {
  width: 100%;
  height: 48px;                  /* 48px touch target = 3×s2 × 2 ≈ ottimo */
  background: transparent;
  border: 1px solid var(--border-h);
  border-radius: var(--radius-sm);
  padding: 0 var(--s4);          /* 0 16px — pad laterale base */
  font-size: var(--type-base);   /* 16px — leggibile, evita zoom su iOS */
  font-family: var(--font);
  color: var(--text);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  text-align: center;
  letter-spacing: .08em;
}
.gate-input:focus {
  border-color: var(--accent-dim);
  box-shadow: 0 0 0 3px rgba(255,255,255,.06);
}
.gate-input::placeholder { color: var(--text-muted); }

.gate-btn {
  height: 48px;                  /* 48px — stesso del campo per allineamento visivo */
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0 var(--s5);          /* 0 24px */
  font-size: var(--type-sm);     /* 13px */
  font-weight: 700;
  font-family: var(--font);
  letter-spacing: .12em;
  text-transform: uppercase;
  transition: opacity var(--transition), transform var(--transition);
}
.gate-btn:hover  { opacity: .88; transform: translateY(-1px); }
.gate-btn:active { transform: translateY(0); opacity: .78; }

.gate-error {
  color: #e05555;
  font-size: var(--type-xs);    /* 12px */
  margin-top: var(--s2);        /* 8px */
  min-height: var(--s4);        /* 16px — riserva spazio anche vuota */
}

.gate-hint {
  font-size: var(--type-xs);    /* 12px */
  color: var(--text-muted);
  margin-top: var(--s6);        /* 32px — separato dal form */
  letter-spacing: .01em;
}

/* ============================================================
   HEADER PUBBLICO
   ============================================================
   Ritmo verticale golden ratio:
   - Padding top: 64px
   - Padding bottom: 40px (64 / φ ≈ 39.5 → 40)
   - Logo → Title: 32px
   - Title bar: 12px top, 16px bottom
   - Subtitle → Booth: 24px
   ============================================================ */
.site-header {
  padding: var(--s10) var(--s5) var(--s8);
  text-align: center;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(ellipse 100% 60% at 50% -5%, rgba(192,132,252,.09) 0%, transparent 65%),
    var(--bg);
  position: relative;
  overflow: hidden;
}
.site-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.03'/%3E%3C/svg%3E");
  background-size: 256px 256px;
  pointer-events: none;
  opacity: .6;
}

.header-inner {
  max-width: 640px;
  margin: 0 auto;
  position: relative;
}

.header-brand {
  margin-bottom: var(--s7);
  display: flex;
  justify-content: center;
}

.gallery-eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--accent-brand);
  margin-bottom: var(--s4);
  opacity: .8;
}

.gallery-title {
  font-size: clamp(2.5rem, 7vw, 4.5rem);
  font-weight: 900;
  letter-spacing: -.04em;
  line-height: 1.0;
  color: var(--text);
  margin-bottom: 0;
}

.header-bar {
  width: 48px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-brand), transparent);
  margin: var(--s5) auto;
  opacity: .7;
}

.gallery-subtitle {
  font-size: var(--type-sm);
  color: var(--text-dim);
  max-width: 400px;
  margin: 0 auto;
  line-height: 1.8;
  letter-spacing: .01em;
}

/* ============================================================
   SEARCH BAR
   ============================================================ */
/* ============================================================
   FOLDER TABS
   ============================================================ */
.folder-tabs-wrap {
  display: flex;
  justify-content: center;
  padding: var(--s5) var(--s5) 0;
  margin-top: var(--s5);
}
.folder-tabs-wrap.hidden { display: none; }

.folder-tabs {
  display: flex;
  gap: var(--s2);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px;
}

.folder-tab {
  padding: 6px 20px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: var(--type-sm);
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.folder-tab:hover {
  background: rgba(255,255,255,.06);
  color: var(--text);
}
.folder-tab.active {
  background: var(--accent);
  color: #000;
  font-weight: 700;
}
.folder-tab--private {
  cursor: default;
  opacity: .7;
}
.folder-tab--private:hover {
  background: rgba(255,255,255,.06);
}

/* ============================================================
   SELEZIONE IN EVIDENZA
   ============================================================ */
.featured-strip {
  margin: var(--s7) auto 0;
  max-width: 1400px;
  padding: var(--s6) var(--s5);
  background:
    linear-gradient(180deg, rgba(192,132,252,.05) 0%, transparent 100%);
  border-top: 1px solid rgba(192,132,252,.12);
  border-bottom: 1px solid rgba(192,132,252,.07);
  position: relative;
}
.featured-strip::before {
  content: '';
  position: absolute;
  top: 0; left: 50%; transform: translateX(-50%);
  width: 60%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(192,132,252,.4), transparent);
}
.featured-strip.hidden { display: none; }

.featured-strip-header {
  display: flex;
  align-items: baseline;
  gap: var(--s3);
  margin-bottom: var(--s5);
}

.featured-strip-icon {
  font-size: 14px;
  color: var(--accent-brand);
  line-height: 1;
  flex-shrink: 0;
  animation: featured-pulse 4s ease-in-out infinite;
}
@keyframes featured-pulse {
  0%, 100% { opacity: 1; text-shadow: 0 0 8px rgba(192,132,252,.8); }
  50% { opacity: .4; text-shadow: none; }
}

.featured-strip-title {
  font-size: var(--type-sm);
  font-weight: 800;
  color: var(--text);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.featured-strip-desc {
  font-size: var(--type-xs);
  color: var(--text-muted);
  margin-left: auto;
  letter-spacing: .04em;
}

.featured-strip-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(192,132,252,.2),
    0 12px 40px rgba(0,0,0,.5),
    0 0 80px rgba(192,132,252,.04);
}
@media (min-width: 480px) { .featured-strip-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 700px) { .featured-strip-grid { grid-template-columns: repeat(4, 1fr); } }

/* Card featured */
.featured-card .card-select-btn.selected {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}
.featured-card.selected {
  outline-color: var(--accent-brand) !important;
}
.featured-card.selected .card-code {
  background: var(--accent-brand);
  color: #000;
}

.search-bar-wrap {
  max-width: 460px;
  margin: var(--s7) auto 0; /* 40px top — separazione dalla sezione hero */
  padding: 0 var(--s5);     /* 0 24px */
}

.search-bar-inner {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: var(--s4);           /* 16px dal bordo */
  width: var(--s4);          /* 16px */
  height: var(--s4);
  color: var(--text-muted);
  pointer-events: none;
  flex-shrink: 0;
}

.search-input {
  width: 100%;
  height: 48px;              /* 48px touch target */
  background: var(--bg-card);
  border: 1px solid var(--border-h);
  border-radius: var(--radius-xs);
  padding: 0 var(--s7) 0 var(--s8); /* 0 40px 0 48px — spazio per icone */
  font-size: var(--type-sm);         /* 13px */
  font-family: var(--font);
  color: var(--text);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  letter-spacing: .02em;
}
.search-input:focus {
  border-color: var(--accent-dim);
  box-shadow: 0 0 0 2px rgba(255,255,255,.05);
}
.search-input::placeholder { color: var(--text-muted); }

.search-clear {
  position: absolute;
  right: var(--s3);          /* 12px dal bordo */
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: var(--type-xs);
  width: var(--s5);          /* 24px area target */
  height: var(--s5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition);
  pointer-events: none;
  line-height: 1;
}
.search-clear.visible { opacity: 1; pointer-events: auto; }
.search-clear:hover { color: var(--text-dim); }

.search-count {
  text-align: center;
  font-size: var(--type-xs);  /* 12px */
  color: var(--text-muted);
  margin-top: var(--s2);      /* 8px — close coupling con la search */
  min-height: var(--s4);      /* 16px */
  letter-spacing: .04em;
}

/* ============================================================
   GALLERY GRID
   ============================================================
   Gap minimo (2px) per stile editoriale fotografico:
   le immagini sono il contenuto, non i gap
   ============================================================ */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2px;
  padding: var(--s5) 2px;    /* 24px verticale */
  max-width: 1280px;
  margin: 0 auto;
}
@media (min-width: 480px)  { .gallery-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 720px)  { .gallery-grid { grid-template-columns: repeat(4, 1fr); gap: 2px; padding: var(--s6) 2px; } }
@media (min-width: 960px)  { .gallery-grid { grid-template-columns: repeat(5, 1fr); } }
@media (min-width: 1200px) { .gallery-grid { grid-template-columns: repeat(6, 1fr); } }

/* ============================================================
   PHOTO CARD
   ============================================================ */
.photo-card {
  position: relative;
  background: var(--bg-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  outline: 1px solid var(--border);
  outline-offset: -1px;
  transition: outline-color var(--transition), transform var(--transition);
}
.photo-card:hover {
  outline-color: #3a3a3a;
  z-index: 1;
}
.photo-card.selected {
  outline: 2px solid rgba(255,255,255,.85);
  outline-offset: -2px;
  z-index: 2;
}

.card-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 3/4;
  overflow: hidden;
  background: #0a0a0a;
  flex-shrink: 0;
}
.card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s cubic-bezier(.25,.46,.45,.94);
  display: block;
}
.photo-card:hover .card-img-wrap img { transform: scale(1.06); }

/* Gradient overlay — rivela bottone su hover */
.card-img-wrap::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 55%;
  background: linear-gradient(to top,
    rgba(0,0,0,.82) 0%,
    rgba(0,0,0,.4)  40%,
    transparent     100%);
  opacity: 0;
  transition: opacity .35s ease;
  pointer-events: none;
  z-index: 1;
}
.photo-card:hover .card-img-wrap::after { opacity: 1; }

/* Watermark */
.card-watermark {
  position: absolute;
  inset: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  overflow: hidden;
}
.card-watermark span {
  font-size: .5rem;
  font-weight: 800;
  letter-spacing: .16em;
  color: rgba(255,255,255,.18);
  transform: rotate(-35deg);
  white-space: nowrap;
  padding: var(--s2) var(--s2); /* 8px 8px */
  user-select: none;
  font-family: var(--font);
}

/* Code badge — sempre visibile, 8pt dal bordo */
.card-code {
  position: absolute;
  top: var(--s2);              /* 8px */
  left: var(--s2);             /* 8px */
  background: rgba(0,0,0,.78);
  color: rgba(255,255,255,.92);
  font-size: var(--type-xs);   /* 12px — leggibile su mobile */
  font-weight: 700;
  letter-spacing: .1em;
  padding: var(--s1) var(--s2); /* 4px 8px */
  border-radius: var(--radius-xs);
  backdrop-filter: blur(8px);
  pointer-events: none;
  z-index: 2;
  font-family: var(--font);
  text-transform: uppercase;
}
.photo-card.selected .card-code {
  background: rgba(255,255,255,.92);
  color: #000;
}

/* Orario di scatto */
.card-time {
  position: absolute;
  bottom: var(--s2);
  left: var(--s2);
  background: rgba(0,0,0,.72);
  color: rgba(255,255,255,.82);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .08em;
  padding: 2px var(--s2);
  border-radius: var(--radius-xs);
  backdrop-filter: blur(8px);
  pointer-events: none;
  z-index: 2;
  font-family: var(--font);
  display: flex;
  align-items: center;
  gap: 3px;
}
.card-time::before {
  content: "⏱";
  font-size: 9px;
  opacity: .7;
}

/* Expand icon */
.card-expand {
  position: absolute;
  top: var(--s2);              /* 8px */
  right: var(--s2);            /* 8px */
  background: rgba(0,0,0,.55);
  color: rgba(255,255,255,.5);
  width: var(--s5);            /* 24px */
  height: var(--s5);           /* 24px */
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--type-xs);
  opacity: 0;
  transition: opacity var(--transition);
  pointer-events: none;
  z-index: 2;
}
.photo-card:hover .card-expand { opacity: 1; }

/* Selected checkmark */
.card-check {
  position: absolute;
  bottom: 56px;                /* altezza footer card */
  right: var(--s2);            /* 8px */
  width: var(--s5);            /* 24px */
  height: var(--s5);           /* 24px */
  background: #fff;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 3;
}
.photo-card.selected .card-check { display: flex; }
.card-check svg { width: var(--s3); height: var(--s3); } /* 12px */

/* Card footer */
.card-footer {
  padding: 6px var(--s2);
  flex-shrink: 0;
  background: var(--bg-card);
}
.card-select-btn {
  width: 100%;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border-h);
  color: var(--text-muted);
  border-radius: var(--radius-xs);
  padding: 0 var(--s2);
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font);
  letter-spacing: .12em;
  text-transform: uppercase;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}
.card-select-btn:hover {
  border-color: rgba(255,255,255,.2);
  color: var(--text);
  background: rgba(255,255,255,.05);
}
.card-select-btn.selected {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
  letter-spacing: .08em;
}

/* ============================================================
   NO RESULTS
   ============================================================ */
.no-results {
  text-align: center;
  color: var(--text-muted);
  font-size: var(--type-sm);   /* 13px */
  padding: var(--s9) var(--s5); /* 64px 24px — sezione vuota ha grande respiro */
  letter-spacing: .02em;
}

/* ============================================================
   INSTRUCTIONS SECTION
   ============================================================
   Padding verticale golden ratio:
   - Top: 64px
   - Bottom: 96px (mobile extra per panel sticky)
   64 × φ ≈ 103 → 96 è il valore 8pt più vicino
   ============================================================ */
.instructions-section {
  border-top: 1px solid var(--border);
  padding: var(--s9) var(--s5); /* 64px 24px */
  padding-bottom: var(--s11);   /* 96px — lascia spazio al panel sticky mobile */
}
@media (min-width: 768px) {
  .instructions-section { padding-bottom: var(--s9); } /* 64px — panel scompare lato */
}

.instructions-inner {
  max-width: 480px;
  margin: 0 auto;
  text-align: center;
}

.instructions-title {
  font-size: var(--type-lg);    /* 22px */
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.25;
  margin-bottom: var(--s7);     /* 40px — titolo sezione → lista: separazione forte */
  color: var(--text);
}

.steps-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--s5);               /* 24px tra step — respiro giusto per scansione */
  text-align: left;
  margin-bottom: var(--s8);     /* 48px prima del booth banner */
}

.steps-list li {
  display: flex;
  align-items: flex-start;
  gap: var(--s4);               /* 16px tra numero e testo */
  font-size: var(--type-sm);    /* 13px */
  color: var(--text-dim);
  line-height: 1.6;
}

.step-num {
  flex-shrink: 0;
  width: var(--s6);             /* 32px — touch target decente, gerarchia chiara */
  height: var(--s6);            /* 32px */
  border-radius: 50%;
  border: 1px solid var(--border-h);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--type-xs);    /* 12px */
  font-weight: 700;
  color: var(--accent-sub);
  flex-shrink: 0;
  letter-spacing: 0;
}

/* ============================================================
   FAB — pulsante flottante apri/chiudi pannello
   ============================================================ */
.panel-fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 601;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #c084fc 0%, #a855f7 55%, #9333ea 100%);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(168,85,247,.4), 0 0 0 1px rgba(255,255,255,.08) inset;
  transition: transform .2s cubic-bezier(.34,1.56,.64,1), box-shadow .2s ease;
}
.panel-fab:hover {
  transform: translateY(-2px) scale(1.06);
  box-shadow: 0 8px 32px rgba(168,85,247,.55), 0 0 0 1px rgba(255,255,255,.1) inset;
}
.panel-fab:active {
  transform: scale(.96);
}
.panel-fab-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  transition: opacity .15s, transform .15s;
}
.panel-fab-icon.hidden { display: none; }

.panel-fab-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #fff;
  color: #000;
  font-size: 10px;
  font-weight: 800;
  font-family: var(--font);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid #080808;
  line-height: 1;
}
.panel-fab-badge.hidden { display: none; }

/* ============================================================
   BACKDROP — scurisce il contenuto quando il panel è aperto
   ============================================================ */
.panel-backdrop {
  position: fixed;
  inset: 0;
  z-index: 599;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
}
.panel-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

/* ============================================================
   SELECTION PANEL — drawer da destra (tutte le dimensioni)
   ============================================================ */
.selection-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: min(380px, 100vw);
  height: 100vh;
  height: 100dvh;
  z-index: 600;
  background: #0c0c0c;
  border-left: 1px solid var(--border);
  padding: var(--s6) var(--s5);
  display: flex;
  flex-direction: column;
  gap: var(--s5);
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform .32s cubic-bezier(.4,0,.2,1);
  box-shadow: -32px 0 80px rgba(0,0,0,.7);
}
.selection-panel.open {
  transform: translateX(0);
}

.panel-header {
  display: flex;
  flex-direction: column;
  gap: var(--s2);
  padding-bottom: var(--s5);
  border-bottom: 1px solid var(--border);
}

.panel-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-title {
  font-size: var(--type-xs);
  font-weight: 700;
  letter-spacing: .16em;
  color: var(--text-muted);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: var(--s2);
}
.panel-icon { width: var(--s4); height: var(--s4); }

.panel-close-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-h);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  flex-shrink: 0;
}
.panel-close-btn:hover {
  background: rgba(255,255,255,.06);
  color: var(--text);
  border-color: rgba(255,255,255,.14);
}

.panel-count {
  font-size: var(--type-xs);
  font-weight: 700;
  color: var(--accent-brand);
  letter-spacing: .04em;
}

/* Code tags — sempre visibili nel drawer */
.panel-codes {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s1);
  flex: 1;
  align-content: flex-start;
  min-height: 40px;
}

.panel-empty {
  font-size: var(--type-xs);   /* 12px */
  color: var(--text-muted);
  letter-spacing: .02em;
}

.code-tag {
  background: transparent;
  border: 1px solid var(--border-h);
  border-radius: var(--radius-xs);
  padding: var(--s1) var(--s2); /* 4px 8px */
  font-size: var(--type-xs);    /* 12px */
  font-weight: 600;
  color: var(--accent-sub);
  letter-spacing: .06em;
  font-family: var(--font);
}

/* Panel action buttons */
.panel-actions {
  display: flex;
  gap: var(--s2);               /* 8px tra pulsanti */
}

.panel-btn {
  flex: 1;
  height: 40px;                  /* 40px — touch target sufficiente in contesto compatto */
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);               /* 8px icon-label */
  border-radius: var(--radius-xs);
  padding: 0 var(--s2);
  font-size: var(--type-xs);    /* 12px */
  font-weight: 600;
  font-family: var(--font);
  letter-spacing: .06em;
  text-transform: uppercase;
  border: 1px solid var(--border-h);
  background: transparent;
  color: var(--text-dim);
  transition: background var(--transition), color var(--transition), border-color var(--transition), opacity var(--transition);
}
.panel-btn:disabled { opacity: .28; cursor: not-allowed; }
.panel-btn-copy:not(:disabled):hover { background: rgba(255,255,255,.06); color: var(--text); border-color: var(--accent-dim); }
.panel-btn-clear:not(:disabled):hover { background: rgba(224,85,85,.08); color: #e05555; border-color: #e05555; }
.btn-icon { width: var(--s3); height: var(--s3); flex-shrink: 0; } /* 12px */

/* Booth banner nel panel */
.booth-banner--panel {
  display: flex;
  width: 100%;
  margin-top: var(--s2);       /* 8px — subito sotto i pulsanti */
  justify-content: center;
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  font-size: var(--type-xs);   /* 12px */
  padding: var(--s2) var(--s3); /* 8px 12px */
}

/* Offset contenuto quando sidebar è visibile */
@media (min-width: 768px) {
  body > header,
  .search-bar-wrap,
  .gallery-grid,
  .no-results,
  .instructions-section,
  .site-footer {
    margin-right: var(--panel-w);
  }
}

/* ============================================================
   LIGHTBOX
   ============================================================ */
.lightbox-backdrop {
  position: fixed;
  inset: 0;
  z-index: 800;
  background: rgba(0,0,0,.96);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s5);           /* 24px — respiro minimo dal bordo schermo */
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease;
}
.lightbox.open,
.lightbox-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-close {
  position: absolute;
  top: var(--s5);               /* 24px */
  right: var(--s5);             /* 24px */
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.1);
  color: var(--text-dim);
  width: 40px;                  /* 40px touch target */
  height: 40px;
  border-radius: var(--radius-xs);
  font-size: var(--type-md);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), color var(--transition);
  z-index: 10;
}
.lightbox-close:hover { background: rgba(255,255,255,.14); color: var(--text); }

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  color: var(--text-dim);
  width: 48px;                  /* 48px width */
  height: 64px;                 /* 64px height — proporzionale φ: 64/48 ≈ 1.33 */
  border-radius: var(--radius-xs);
  font-size: 1.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), color var(--transition);
  z-index: 10;
  line-height: 1;
}
.lightbox-nav:hover { background: rgba(255,255,255,.12); color: var(--text); }
.lightbox-prev { left: var(--s4); }  /* 16px */
.lightbox-next { right: var(--s4); } /* 16px */

.lightbox-content {
  max-width: min(90vw, 700px);
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--s2);               /* 8px tra immagine e footer */
}

.lightbox-img-wrap {
  position: relative;
  overflow: hidden;
  background: #0a0a0a;
  max-height: 78vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-img-wrap img {
  max-height: 78vh;
  width: 100%;
  object-fit: contain;
}

/* Watermark lightbox */
.lightbox-watermark {
  position: absolute;
  inset: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  overflow: hidden;
}
.lightbox-watermark span {
  font-size: .9rem;
  font-weight: 800;
  letter-spacing: .2em;
  color: rgba(255,255,255,.14);
  transform: rotate(-35deg);
  padding: var(--s4) var(--s5); /* 16px 24px */
  white-space: nowrap;
  user-select: none;
  font-family: var(--font);
}

.lightbox-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);               /* 16px */
  background: var(--bg-card);
  border: 1px solid var(--border-h);
  padding: var(--s3) var(--s5); /* 12px 24px — golden: 24/12 = 2, classica proporzione */
}

.lightbox-code {
  font-size: var(--type-sm);    /* 13px */
  font-weight: 700;
  letter-spacing: .14em;
  color: var(--accent-sub);
  text-transform: uppercase;
}

.lightbox-select-btn {
  height: 40px;                  /* 40px touch target */
  background: transparent;
  border: 1px solid var(--border-h);
  color: var(--text-dim);
  padding: 0 var(--s5);         /* 0 24px */
  font-size: var(--type-xs);    /* 12px */
  font-weight: 700;
  font-family: var(--font);
  letter-spacing: .1em;
  text-transform: uppercase;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}
.lightbox-select-btn:hover {
  border-color: var(--accent-dim);
  color: var(--text);
  background: rgba(255,255,255,.05);
}
.lightbox-select-btn.selected {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--border);
  padding: var(--s7) var(--s5); /* 40px 24px — golden: sezione minore */
  text-align: center;
}
.site-footer p {
  font-size: var(--type-xs);   /* 12px */
  color: var(--text-muted);
  line-height: 1.7;
  letter-spacing: .02em;
}
.footer-note {
  margin-top: var(--s2);       /* 8px — stessa riga visiva */
}

/* ============================================================
   TOAST NOTIFICATION
   ============================================================ */
.toast {
  position: fixed;
  bottom: var(--s10);           /* 80px — sopra panel mobile */
  left: 50%;
  transform: translateX(-50%) translateY(var(--s2));
  background: var(--text);
  color: #000;
  border-radius: var(--radius-xs);
  padding: var(--s3) var(--s5); /* 12px 24px */
  font-size: var(--type-xs);    /* 12px */
  font-weight: 700;
  font-family: var(--font);
  letter-spacing: .04em;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s, transform .18s;
  z-index: 9999;
  white-space: nowrap;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
@media (min-width: 768px) {
  .toast { bottom: var(--s5); } /* 24px desktop — niente panel sotto */
}

/* ============================================================
   BOOTH BANNER — galleria pubblica
   ============================================================ */
.booth-banner {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 999px;
  padding: 10px var(--s4);
  font-size: var(--type-xs);
  font-weight: 500;
  color: var(--text-dim);
  letter-spacing: .04em;
  margin-top: var(--s6);
  backdrop-filter: blur(12px);
  transition: border-color var(--transition), background var(--transition);
}
.booth-banner:hover {
  border-color: rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
}

.booth-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: var(--accent-brand);
  opacity: .8;
}

.booth-banner--section {
  display: flex;
  margin-top: var(--s7);        /* 40px (24 × φ ≈ 40) dopo gli step */
  width: 100%;
  justify-content: center;
}

/* ============================================================
   PULSANTE ACQUISTA ONLINE — nel pannello selezione
   ============================================================ */
.panel-btn-buy {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  width: 100%;
  height: 50px;
  margin-top: var(--s3);
  border-radius: var(--radius-sm);
  border: none;
  background: linear-gradient(135deg, #c084fc 0%, #a855f7 60%, #9333ea 100%);
  color: #fff;
  font-size: var(--type-xs);
  font-weight: 800;
  font-family: var(--font);
  letter-spacing: .1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: opacity var(--transition), filter var(--transition), transform var(--transition);
  flex-shrink: 0;
  box-shadow: 0 4px 20px rgba(168,85,247,.35);
  position: relative;
  overflow: hidden;
}
.panel-btn-buy::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.15) 0%, transparent 60%);
  pointer-events: none;
}
.panel-btn-buy:disabled {
  opacity: .25;
  cursor: not-allowed;
  box-shadow: none;
}
.panel-btn-buy:not(:disabled):hover {
  filter: brightness(1.12);
  transform: translateY(-1px);
  box-shadow: 0 6px 28px rgba(168,85,247,.45);
}
.panel-btn-buy:not(:disabled):active {
  transform: translateY(0);
}
.btn-buy-price {
  background: rgba(0,0,0,.2);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: var(--type-xs);
  font-weight: 800;
}

/* ============================================================
   BANNER AVVISO — ritardi consegna
   ============================================================ */
.notice-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 24px;
  background: rgba(234, 179, 8, .06);
  border-bottom: 1px solid rgba(234, 179, 8, .18);
  font-size: var(--type-xs);
  color: #d4a017;
  line-height: 1.6;
}

.notice-banner-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 2px;
  color: #d4a017;
  opacity: .85;
}

.notice-banner-text {
  margin: 0;
  font-weight: 500;
  letter-spacing: .01em;
  color: #c49a12;
}

/* ============================================================
   BANNER ESITO ORDINE — top della pagina
   ============================================================ */
.order-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
  padding: var(--s4) var(--s5);  /* 16px 24px */
  font-size: var(--type-sm);
  font-weight: 600;
  font-family: var(--font);
  opacity: 0;
  transform: translateY(-100%);
  transition: opacity .3s ease, transform .3s ease;
  pointer-events: none;
}
.order-banner.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.order-banner--success {
  background: #14532d;
  border-bottom: 1px solid #166534;
  color: #bbf7d0;
}
.order-banner--error {
  background: #450a0a;
  border-bottom: 1px solid #7f1d1d;
  color: #fca5a5;
}
.order-banner-close {
  background: transparent;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 1rem;
  opacity: .7;
  flex-shrink: 0;
  padding: 0 var(--s2);
  line-height: 1;
}
.order-banner-close:hover { opacity: 1; }

/* ============================================================
   MODALE ACQUISTO
   ============================================================ */
.buy-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1050;
  background: rgba(0,0,0,.86);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease;
}
.buy-modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.buy-modal {
  position: fixed;
  z-index: 1100;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: #111;
  border: 1px solid var(--border-h);
  border-radius: var(--radius-sm);
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(24px) scale(.97);
  transition: opacity .22s ease, transform .22s ease;

  /* centrato su desktop, bottom-sheet su mobile */
  margin: auto;
  max-width: 480px;
  width: calc(100% - var(--s7));
  max-height: 90vh;
}
.buy-modal.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}
@media (max-width: 600px) {
  .buy-modal {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    margin: 0;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  }
}

.buy-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s5) var(--s5) var(--s4);  /* 24px 24px 16px */
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.buy-modal-title {
  font-size: var(--type-md);
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.01em;
  margin: 0;
}
.buy-modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  padding: var(--s1);
  transition: color var(--transition);
}
.buy-modal-close:hover { color: var(--text); }
.buy-modal-close:disabled { opacity: .4; cursor: not-allowed; }

.buy-modal-body {
  padding: var(--s5);
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--s4);               /* 16px fra blocchi */
}

/* Riepilogo */
.buy-modal-summary {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  overflow: hidden;
}
.buy-summary-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s4);
  padding: var(--s4) var(--s4);  /* 16px */
  border-bottom: 1px solid var(--border);
}
.buy-summary-row:last-child { border-bottom: none; }
.buy-summary-total { align-items: center; }
.buy-summary-label {
  font-size: var(--type-xs);
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: .06em;
  text-transform: uppercase;
  flex-shrink: 0;
}
.buy-summary-codes {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s1);
  justify-content: flex-end;
}
.buy-summary-amount {
  font-size: var(--type-lg);
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.01em;
}

/* Email input */
.buy-email-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: var(--type-sm);
  font-weight: 600;
  color: var(--text-dim);
  font-family: var(--font);
}
.buy-email-hint {
  font-size: var(--type-xs);
  font-weight: 400;
  color: var(--text-muted);
}
.buy-email-input {
  width: 100%;
  height: 48px;
  background: var(--bg-card);
  border: 1px solid var(--border-h);
  border-radius: var(--radius-xs);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--type-sm);
  padding: 0 var(--s4);
  box-sizing: border-box;
  transition: border-color var(--transition);
  outline: none;
}
.buy-email-input:focus {
  border-color: var(--accent);
}
.buy-email-input::placeholder { color: var(--text-muted); }
.buy-email-error {
  font-size: var(--type-xs);
  color: #f87171;
  margin: 0;
  font-family: var(--font);
}

/* Nota consegna */
.buy-delivery-note {
  display: flex;
  align-items: flex-start;
  gap: var(--s2);
  font-size: var(--type-xs);
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
  padding: var(--s3) var(--s4);
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
}
.buy-note-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--text-muted);
}

/* Footer modale */
.buy-modal-footer {
  display: flex;
  gap: var(--s3);
  padding: var(--s4) var(--s5) var(--s5);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.buy-btn-secondary {
  flex: 0 0 auto;
  height: 48px;
  padding: 0 var(--s5);
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-h);
  background: transparent;
  color: var(--text-dim);
  font-family: var(--font);
  font-size: var(--type-sm);
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.buy-btn-secondary:hover { background: rgba(255,255,255,.06); color: var(--text); }
.buy-btn-secondary:disabled { opacity: .4; cursor: not-allowed; }

.buy-btn-primary {
  flex: 1;
  height: 48px;
  border-radius: var(--radius-xs);
  border: none;
  background: var(--accent);
  color: #000;
  font-family: var(--font);
  font-size: var(--type-sm);
  font-weight: 700;
  letter-spacing: .04em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  transition: opacity var(--transition), background var(--transition);
}
.buy-btn-primary:hover:not(:disabled) { background: #e879f9; }
.buy-btn-primary:disabled { opacity: .4; cursor: not-allowed; }

/* Pacchetto attivo nel riepilogo */
.buy-summary-pkg-name {
  font-size: var(--type-xs);
  font-weight: 600;
  color: var(--accent-sub);
  text-align: right;
}

/* Listino scaglioni — collassabile */
.buy-tiers-details {
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  overflow: hidden;
}
.buy-tiers-summary {
  padding: var(--s3) var(--s4);
  font-size: var(--type-xs);
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
}
.buy-tiers-summary::-webkit-details-marker { display: none; }
.buy-tiers-summary::after {
  content: "▾";
  font-size: .75rem;
  opacity: .5;
}
details[open] .buy-tiers-summary::after { content: "▴"; }

.buy-tiers-table {
  border-top: 1px solid var(--border);
}
.tier-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s2) var(--s4);
  border-bottom: 1px solid var(--border);
  font-size: var(--type-xs);
  color: var(--text-muted);
}
.tier-row:last-child { border-bottom: none; }
.tier-row--active {
  background: rgba(192, 132, 252, .08);
  color: var(--text);
}
.tier-row--active .tier-label { color: var(--accent-sub); font-weight: 700; }
.tier-price { font-weight: 700; color: var(--text-dim); }
.tier-row--active .tier-price { color: var(--text); }

/* Spinner */
@keyframes spin { to { transform: rotate(360deg); } }
.buy-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(0,0,0,.3);
  border-top-color: #000;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  flex-shrink: 0;
}
