/* Quory - On the rail: capi appesi a un'asta */

body.qr-page {
  /* parete del negozio: intonaco grigio caldo, con la luce che arriva dall'alto */
  background-color: #b4afa8;
  background-image:
    radial-gradient(ellipse 70% 55% at 50% 0%, rgba(255, 255, 255, .22), rgba(255, 255, 255, 0) 70%),
    linear-gradient(180deg, rgba(0, 0, 0, 0) 55%, rgba(40, 32, 24, .10) 100%),
    url("assets/img/parete.webp");
  background-repeat: no-repeat, no-repeat, repeat;
  background-size: 100% 100%, 100% 100%, 1254px auto;
  background-attachment: scroll;
}
.qr {
  --qr-bg: transparent; --qr-ink: #141414;
  min-height: calc(100vh - 80px); padding: 26px clamp(16px, 2.5vw, 40px) 0;
  text-align: center; color: #111; overflow-x: hidden;
}
.qr-top { display: flex; justify-content: center; gap: 14px; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: #4f4c48; }
.qr-top span:first-child { color: #111; }
.qr-sep { opacity: .5; }

/* ---------- logo Quory sulla parete (lettere in rilievo, come in negozio) ---------- */
.qr-logo { display: flex; justify-content: center; margin: clamp(26px, 4vh, 46px) 0 0; pointer-events: none; }
.qr-logo img {
  display: block; height: clamp(110px, 17vh, 170px); width: auto;
  /* bordo chiaro dello spessore + ombra sulla parete */
  filter: drop-shadow(1px 1px 0 #ddd6cd) drop-shadow(1px 1.5px 0 #b9b1a7) drop-shadow(5px 8px 6px rgba(30, 20, 15, .32));
}

/* ---------- stand nero: telaio a U rovesciata + barra per le grucce ---------- */
.qr-scene { position: relative; width: min(1240px, 100%); margin: clamp(30px, 5vh, 56px) auto 0; padding: 70px 0 60px; }
.qr-frame {
  position: absolute; inset: 0; pointer-events: none; z-index: 1;
  filter: drop-shadow(16px 20px 9px rgba(25, 20, 15, .26));   /* ombra portata sul muro */
}
.qr-frame-top, .qr-post { position: absolute; background: linear-gradient(180deg, #2b2b2b, #111 60%, #0b0b0b); }
.qr-frame-top { top: 0; left: 0; right: 0; height: 13px; }
.qr-post { top: 0; bottom: 0; width: 13px; background: linear-gradient(90deg, #262626, #121212 55%, #070707); }
.qr-post-l { left: 0; } .qr-post-r { right: 0; }

.qr-stage { position: relative; width: calc(100% - 26px); margin: 0 auto; z-index: 2; }
/* barra interna, più indietro: piatta e opaca, agganciata ai montanti */
.qr-bar {
  position: absolute; left: -13px; right: -13px; top: 0; height: 11px; z-index: 3;
  background: linear-gradient(180deg, #333 0%, #161616 45%, #0a0a0a 100%);
  filter: drop-shadow(10px 14px 6px rgba(25, 20, 15, .25));
}
.qr-cap { position: absolute; top: -3px; width: 18px; height: 17px; background: linear-gradient(180deg, #2e2e2e, #0c0c0c); }
.qr-cap-l { left: 6px; } .qr-cap-r { right: 6px; }

/* ---------- capi ---------- */
/* i capi stanno "di lato" (girati di ~78 gradi, stretti) e si girano di fronte col mouse o scorrendo.
   --qr-w: larghezza del capo visto di fronte. Tutte le misure di gruccia e asta dipendono da questa.     */
.qr-items {
  /* il capo di fronte si rimpicciolisce se i capi sono tanti, così l'asta sta sempre nello schermo */
  --qr-w: min(270px, 21vw, calc((min(1180px, 100vw - 60px)) / (var(--qr-n, 5) * .36 + 1.15)));
  list-style: none; margin: 0; padding: 0; display: flex; justify-content: center; align-items: flex-start;
  gap: calc(var(--qr-w) * .04); position: relative; z-index: 2;
}
.qr-item {
  flex: 0 0 calc(var(--qr-w) * .25); min-width: 0; position: relative; z-index: 1;
  transition: flex-basis .8s cubic-bezier(.22, .8, .25, 1), opacity .45s ease;
}
.qr-item.is-active { flex-basis: calc(var(--qr-w) * 1.08); z-index: 10; }

.qr-garment {
  --qr-drop: calc(var(--qr-w) * .15); --qr-neck: calc(var(--qr-w) * .035); --qr-wood-w: 22%;
  display: block; position: relative; width: 100%; margin: 0; padding: var(--qr-drop) 0 0; border: 0; background: none; cursor: pointer;
  transform-origin: 50% 0; transition: transform .8s cubic-bezier(.22, .8, .25, 1);
}
.qr-garment:focus-visible { outline: none; }
.qr-garment:focus-visible .qr-turn { outline: 1px solid #111; outline-offset: 6px; }

/* il capo vero e proprio: largo come visto di fronte, centrato nello spazio (stretto) del suo posto sull'asta */
.qr-turn {
  display: block; position: relative; width: var(--qr-w); margin-left: calc((100% - var(--qr-w)) / 2);
  transform: perspective(1100px) rotateY(-78deg); transform-origin: 50% 50%;
  filter: brightness(.9) saturate(.95);
  transition: transform .85s cubic-bezier(.22, .8, .25, 1), filter .85s ease;
  pointer-events: none;
}
.qr-item.is-active .qr-turn { transform: perspective(1100px) rotateY(0deg); filter: none; }

.qr-img {
  display: block; width: 100%; height: auto; position: relative; z-index: 2;
  filter: drop-shadow(0 14px 18px rgba(0, 0, 0, .10)); user-select: none;
}
/* asta sottile dal binario fino al colletto (non gira) */
.qr-rod {
  position: absolute; z-index: 5; top: -4px; left: calc(50% - 1.5px); width: 3px;
  height: calc(var(--qr-drop) + var(--qr-neck) + var(--qr-w) * .044 + 4px);
  background: linear-gradient(90deg, #1c1c1c, #6a6a6a 50%, #1c1c1c); border-radius: 2px;
}
/* gruccia di legno dentro lo scollo: gira insieme al capo; si vede solo sopra il tessuto */
.qr-wood { position: absolute; z-index: 4; inset: 0; pointer-events: none; }
.qr-wood-in {
  display: flow-root; position: relative; aspect-ratio: 1000 / 1250;
  -webkit-mask-image: var(--qr-mask); mask-image: var(--qr-mask);
  -webkit-mask-size: 100% 100%; mask-size: 100% 100%; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
}
.qr-wood svg { display: block; width: var(--qr-wood-w); height: auto; margin: var(--qr-neck) auto 0; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .4)); }

/* ---------- con la foto di lato: a riposo si vede il capo di profilo, col mouse si gira (giro in due tempi) ---------- */
.qr-front { display: block; position: relative; }
.qr-side {
  position: absolute; top: 0; left: 0; width: 100%; height: auto; z-index: 3; display: block;
  filter: drop-shadow(0 14px 18px rgba(0, 0, 0, .10)); user-select: none;
  transform: perspective(1100px) rotateY(0deg); opacity: 1;
  transition: transform .42s cubic-bezier(.55, 0, .75, .4) .38s, opacity .2s linear .5s;
}
.has-side .qr-turn, .has-side.is-active .qr-turn { transform: none; filter: none; }
.has-side .qr-front {
  transform: perspective(1100px) rotateY(90deg); opacity: 0;
  transition: transform .42s cubic-bezier(.55, 0, .75, .4), opacity .15s linear .27s;
}
.has-side.is-active .qr-side {
  transform: perspective(1100px) rotateY(-90deg); opacity: 0;
  transition: transform .42s cubic-bezier(.55, 0, .75, .4), opacity .15s linear .27s;
}
.has-side.is-active .qr-front {
  transform: perspective(1100px) rotateY(0deg); opacity: 1;
  transition: transform .5s cubic-bezier(.2, .65, .3, 1) .4s, opacity .1s linear .4s;
}
.qr-item.has-side { flex-basis: calc(var(--qr-w) * .32); }
.qr-item.has-side.is-active { flex-basis: calc(var(--qr-w) * 1.08); }
/* di lato l'asta arriva sulla punta della gruccia, di fronte scende fino allo scollo */
.has-side:not(.is-active) .qr-rod { height: calc(var(--qr-drop) + var(--qr-w) * .052 + 4px); transition: height .3s ease .4s; }
.has-side.is-active .qr-rod { transition: height .3s ease .3s; }

/* di fronte: leggera oscillazione dal punto in cui è appeso */
.qr-item.is-active .qr-garment { animation: qr-sway 3.2s ease-in-out .9s infinite; }
@keyframes qr-sway {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(.8deg); }
  75% { transform: rotate(-.8deg); }
}

/* ---------- testo sotto l'asta ---------- */
.qr-info { position: relative; z-index: 2; margin-top: 34px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.qr-name { font-size: 22px; font-weight: 400; margin: 0; min-height: 1.3em; letter-spacing: .01em; }
.qr-hint { font-size: 13px; color: #4f4c48; margin: 0; }
.qr-nav { display: flex; align-items: center; gap: 34px; margin-top: 18px; font-size: 13px; letter-spacing: .08em; }
.qr-arrow { background: none; border: 0; cursor: pointer; font-size: 22px; line-height: 1; color: #111; padding: 4px 8px; }
.qr-arrow:disabled { opacity: .25; cursor: default; }
.qr-explore {
  margin-top: 20px; padding: 14px 30px; border: 1px solid #111; border-radius: 999px; background: transparent;
  font: inherit; font-size: 13px; color: #111; cursor: pointer; transition: background .2s, border-color .2s;
}
.qr-explore:hover { background: #111; border-color: #111; color: #fff; }
.qr-empty { padding: 80px 0; color: #7a7a7a; }

/* ---------- scheda del capo ---------- */
html.qr-lock, html.qr-lock body { overflow: hidden; }
.qr-detail {
  position: fixed; inset: 0; z-index: 6000; display: grid; grid-template-rows: 1fr auto;
  justify-items: center; align-items: center; padding: 70px 20px 40px;
  background: rgba(239, 238, 235, .72); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  opacity: 0; transition: opacity .35s ease;
}
.qr-detail[hidden] { display: none; }
.qr-detail.is-open { opacity: 1; }
.qr-d-figure { margin: 0; height: 100%; max-height: 62vh; display: flex; align-items: center; justify-content: center; }
.qr-d-figure img {
  max-height: 62vh; max-width: min(560px, 86vw); width: auto; height: auto; display: block;
  filter: drop-shadow(0 20px 30px rgba(0, 0, 0, .12));
  transform: scale(.92); opacity: 0; transition: transform .5s cubic-bezier(.22, .8, .25, 1), opacity .35s;
}
.qr-detail.is-open .qr-d-figure img.is-in { transform: none; opacity: 1; }
.qr-d-text { text-align: center; width: min(520px, 100%); }
.qr-d-count { font-size: 11px; letter-spacing: .14em; color: #7a7a7a; }
.qr-d-title { font-size: 30px; font-weight: 400; margin: 8px 0 4px; }
.qr-d-sub { font-size: 13px; color: #6b6b6b; margin: 0 0 16px; text-transform: uppercase; letter-spacing: .06em; }
.qr-d-tabs { display: flex; justify-content: center; gap: 40px; font-size: 14px; margin-bottom: 16px; }
.qr-d-tabs span { padding-bottom: 8px; }
.qr-d-tabs .is-on { border-bottom: 1px solid #111; }
.qr-d-foot { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid #d8d6d1; padding-top: 14px; font-size: 14px; }
.qr-d-link { color: #a33b1f; text-decoration: none; }
.qr-d-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.qr-close {
  position: absolute; top: 22px; right: clamp(16px, 2.5vw, 40px); background: none; border: 0; cursor: pointer;
  font: inherit; font-size: 13px; letter-spacing: .06em; color: #111; display: flex; align-items: center; gap: 8px;
}
.qr-close span { font-size: 24px; line-height: 1; }
.qr-d-arrow {
  position: absolute; top: 40%; background: none; border: 0; cursor: pointer; font-size: 28px; color: #111; padding: 12px;
}
.qr-d-prev { left: clamp(10px, 4vw, 60px); } .qr-d-next { right: clamp(10px, 4vw, 60px); }

/* ---------- telefono: tre capi alla volta, si scorre col dito ---------- */
@media (max-width: 768px) {
  .qr { padding-top: 18px; }
  .qr-scene { width: calc(100% + 32px); margin: 22px -16px 0; padding: 40px 0 40px; }
  .qr-frame-top { height: 9px; } .qr-post { width: 9px; }
  .qr-stage { width: calc(100% - 18px); }
  .qr-bar { top: 14px; left: -9px; right: -9px; height: 9px; }
  .qr-cap { top: -4px; width: 12px; }
  .qr-logo img { height: 96px; }
  .qr-frame { filter: drop-shadow(6px 8px 5px rgba(25, 20, 15, .22)); }
  .qr-bar { filter: drop-shadow(5px 7px 4px rgba(25, 20, 15, .2)); }
  .qr-items {
    justify-content: flex-start; overflow-x: auto; overflow-y: visible; scroll-snap-type: x mandatory;
    padding: 14px 30vw 30px; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .qr-items::-webkit-scrollbar { display: none; }
  .qr-items { --qr-w: 46vw; gap: 0; }
  .qr-items .qr-item, .qr-items .qr-item.is-active, .qr-items .qr-item.has-side, .qr-items .qr-item.has-side.is-active { flex: 0 0 38vw; scroll-snap-align: center; transition: opacity .45s ease; }
  .qr-item:not(.has-side) .qr-turn { transform: perspective(900px) rotateY(-62deg); }
  .qr-item:not(.has-side).is-active .qr-turn { transform: none; }
  .qr-item.is-active .qr-garment { animation: none; }
  .qr-items .qr-item:not(.is-active) { opacity: .75; }
  .qr-name { font-size: 19px; }
  .qr-detail { padding: 60px 16px 28px; }
  .qr-d-figure, .qr-d-figure img { max-height: 52vh; }
  .qr-d-title { font-size: 24px; }
  .qr-d-arrow { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .qr-garment, .qr-turn, .qr-item, .qr-side, .qr-front, .qr-rod, .qr-d-figure img, .qr-detail { transition: none !important; }
  .qr-item.is-active .qr-garment { animation: none; }
}
