/* ==========================================================
   Estetica Skincare
   ========================================================== */

/* Caratteri ospitati nel sito (niente richieste a Google Fonts, per il GDPR).
   Licenza SIL Open Font License: vedi fonts/OFL-*.txt */
@font-face {
  font-family: "Belleza";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/belleza-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("fonts/instrument-sans-latin.woff2") format("woff2");
}

:root {
  --cream: #FFFAF1;
  --wine: #3F1521;
  --sky: #C3E8EB;
  --sand: #E8DED2;
  --card-bg: #EFE7DA;

  --sans: "Instrument Sans", system-ui, -apple-system, sans-serif;
  --display: "Belleza", "Instrument Sans", sans-serif;

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  /* angoli delle card, come su Yuri Roga */
  --radius: calc(100vw / 18.9);
}

*,
*::before,
*::after { box-sizing: border-box; }

* { margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--cream);
  color: var(--wine);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
address { font-style: normal; }
button, input { font: inherit; color: inherit; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

:focus-visible { outline: 2px solid var(--sky); outline-offset: 3px; }

/* ---------- Pill buttons ---------- */

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 45px;
  padding: 13px 20px;
  border-radius: 100px;
  font-size: 14.4px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  white-space: nowrap;
  transition: background-color .25s var(--ease), color .25s var(--ease), transform .25s var(--ease);
}
.pill:hover { transform: translateY(-1px); }

.pill--wine { background: var(--wine); color: var(--cream); }
.pill--wine:hover { background: #561d2d; }

/* ---------- Barra in alto (struttura Yuri Roga) ---------- */

body { position: relative; }

/* copre tutta la pagina così la barra dei menu può restare "sticky" fino in fondo */
.topbar {
  --bar-h: 32px;
  --bar-gap: 10px;
  position: absolute;
  inset: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: var(--bar-gap);
  padding: var(--bar-gap);
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }

.bar {
  height: var(--bar-h);
  border-radius: calc(var(--bar-h) / 2);
  background: rgba(232, 222, 210, .82);
  -webkit-backdrop-filter: blur(30px);
  backdrop-filter: blur(30px);
  color: var(--wine);
}

.site-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 20px;
  align-items: center;
  padding: 0 20px;
}
.logo {
  font-family: var(--display);
  font-size: 17px;
  line-height: 1;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.site-header__owner {
  font-size: 13px;
  letter-spacing: .02em;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.site-menu {
  position: sticky;
  top: var(--bar-gap);
  align-self: start;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--bar-gap);
}
@media (min-width: 1281px) {
  .site-menu__item { position: relative; }
}

.site-menu__btn {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  column-gap: 10px;
  padding: 0 20px;
  border: 0;
  font-size: 13px;
  letter-spacing: .02em;
  text-align: left;
  cursor: pointer;
  transition: background-color .2s var(--ease);
}
.site-menu__btn:hover,
.site-menu__btn[aria-expanded="true"] { background: rgba(255, 250, 241, .9); }

.site-menu__icon {
  width: 8px;
  height: 5px;
  color: rgba(63, 21, 33, .35);
  transition: color .2s var(--ease), transform .25s var(--ease);
}
.site-menu__btn:hover .site-menu__icon,
.site-menu__btn[aria-expanded="true"] .site-menu__icon { color: var(--wine); }
.site-menu__btn[aria-expanded="true"] .site-menu__icon { transform: rotate(180deg); }

/* Tendine */
.menu-panel {
  position: absolute;
  top: calc(100% + var(--bar-gap));
  left: 0;
  width: 100%;
  max-height: calc(100vh - var(--bar-h) - var(--bar-gap) * 3);
  max-height: calc(100svh - var(--bar-h) - var(--bar-gap) * 3);
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  padding: 20px 20px 32px;
  border-radius: calc(var(--bar-h) / 2);
  background: rgba(255, 250, 241, .82);
  -webkit-backdrop-filter: blur(40px);
  backdrop-filter: blur(40px);
  box-shadow: 0 24px 60px -36px rgba(63, 21, 33, .4);
  color: var(--wine);
}
.menu-panel:not([hidden]) { animation: panel-in .22s var(--ease); }
@keyframes panel-in { from { opacity: 0; transform: translateY(-6px); } }

@media (min-width: 1281px) {
  .menu-panel--large { width: calc(200% + var(--bar-gap)); }
}

.panel-label {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(63, 21, 33, .55);
}

/* Trattamenti: elenco per area nella tendina (ogni voce apre la scheda) */
.menu-cats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px 20px;
}
.menu-cats__col { display: grid; gap: 24px; align-content: start; }
.menu-cats ul { list-style: none; margin-top: 8px; }
.menu-cats li { border-top: 1px solid rgba(63, 21, 33, .1); }
.menu-cats a {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  font-size: 13.5px;
  line-height: 1.3;
  transition: opacity .2s var(--ease);
}
.menu-cats__time { color: rgba(63, 21, 33, .55); white-space: nowrap; }
.menu-cats__note {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid rgba(63, 21, 33, .1);
  font-size: 13px;
  color: rgba(63, 21, 33, .65);
}
.menu-cats__note a { color: var(--wine); white-space: nowrap; }

/* Chi siamo */
.about { display: grid; gap: 28px; }
.about__text { display: grid; gap: 10px; margin-top: 10px; font-size: 14.4px; line-height: 1.45; }
.about__rows { list-style: none; }
.about__rows li {
  display: grid;
  grid-template-columns: 6.5em minmax(0, 1fr);
  column-gap: 10px;
  padding: 9px 0;
  border-top: 1px solid rgba(63, 21, 33, .1);
  font-size: 14.4px;
  line-height: 1.3;
}
.about__rows li > :first-child { color: rgba(63, 21, 33, .55); }
.about__rows a { transition: opacity .2s var(--ease); }

@media (hover: hover) {
  .menu-cats a:hover,
  .about__rows a:hover { opacity: .55; }
}

/* ---------- Hero ---------- */

/* un pannello con gli angoli tondi come il footer, appena sotto la barra delle pillole */
main { padding-top: 52px; }

.hero {
  position: relative;
  /* un rettangolo più largo che alto */
  height: clamp(420px, 60vh, 600px);
  margin: 0 10px;
  display: grid;
  place-items: center;
  padding: 48px 24px;
  overflow: hidden;
  isolation: isolate;
  border-radius: clamp(28px, calc(100vw / 18.9), 80px);
  color: var(--wine);
  text-align: center;
  /* finché l'animazione non è caricata si vede il suo primo fotogramma */
  background: var(--sand) url("img/crema.jpg?v=2") center / cover no-repeat;
}

/* la crema che scorre (hero e footer): un video o, dove il telefono non lo fa partire, la
   stessa crema come immagine animata */
.bg-cream { position: absolute; inset: 0; }
.bg-cream img,
.bg-cream video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* il video compare solo quando gira davvero: prima si vede il suo primo fotogramma, che è lo
   sfondo del pannello, e Safari non può disegnarci sopra il suo pulsante play */
.js .bg-cream video { opacity: 0; transition: opacity .6s var(--ease); }
.js .bg-cream video.is-playing { opacity: 1; }
.bg-cream video::-webkit-media-controls,
.bg-cream video::-webkit-media-controls-start-playback-button {
  display: none !important;
  -webkit-appearance: none;
}

/* alone chiaro dietro alla scritta, per leggerla su ogni punto della crema */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(60% 40% at 50% 50%, rgba(255, 250, 241, .38), rgba(255, 250, 241, 0) 100%);
  pointer-events: none;
}

.hero__content {
  position: relative;
  z-index: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* la scritta come quella del footer, larga quanto la hero */
.hero { container-type: inline-size; }
.hero__wordmark {
  font-family: var(--display);
  font-size: 10.9cqw;
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  white-space: nowrap;
}
/* la "fessura": le lettere arrivano da sotto la linea di base e restano nascoste
   finché non la superano, una dopo l'altra da sinistra a destra */
.hero__letters { display: inline-flex; overflow: hidden; padding-top: .08em; }
.hero__letters span {
  display: inline-block;
  animation: letter-rise .9s cubic-bezier(.215, .61, .355, 1) both;
  animation-delay: calc(.2s + var(--i) * 55ms);
}
@keyframes letter-rise { from { transform: translateY(110%); } }

.hero__content .pill {
  margin-top: clamp(16px, 2.4cqw, 32px);
  animation: fade-up .7s var(--ease) 1.2s both;
}
@keyframes fade-up { from { opacity: 0; transform: translateY(10px); } }

/* ---------- Schede (pillole Viso / Corpo… e linee di prodotti) ---------- */

/* senza JS si vedono tutte le aree una sotto l'altra, con il loro titolo */
.tabs { display: none; }
.js .tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 30px 28px;
}
.tab {
  height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 18px;
  border: 0;
  border-radius: 18px;
  background: rgba(232, 222, 210, .7);
  font-size: 13.5px;
  letter-spacing: .02em;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .2s var(--ease), color .2s var(--ease);
}
.tab:hover { background: var(--sand); }
.tab[aria-selected="true"] { background: var(--wine); color: var(--cream); }
.tab__count { font-size: 11px; opacity: .6; }

.category__title {
  padding: 0 30px 20px;
  font-family: var(--display);
  font-size: 28px;
  font-weight: 400;
}
.js .category__title { display: none; }
.category + .category { margin-top: 64px; }
.js .category + .category { margin-top: 0; }

/* ---------- Trattamenti (griglia stile Yuri Roga) ---------- */

.treatments {
  padding: 64px 10px 110px;
}

.treatments__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 0 30px 28px;
}
.treatments__head h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: 40px;
  line-height: 1.1;
  color: var(--wine);
}

.grid {
  --cols: 4;
  --gap: 10px;
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  gap: 32px var(--gap);
}

.treatment { display: flex; flex-direction: column; scroll-margin-top: 64px; }

.card {
  position: relative;
  display: grid;
  width: 100%;
  aspect-ratio: 4 / 5;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  overflow: hidden;
  isolation: isolate;
  background: var(--card-bg);
  cursor: pointer;
}

.card__thumb {
  grid-area: 1 / 1;
  overflow: hidden;
  border-radius: inherit;
}
.card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* immagine leggermente "oltre" il bordo: in hover rientra (effetto Yuri Roga) */
  transform: scale(1.06);
  transition: transform .3s var(--ease);
}

.card__label {
  grid-area: 1 / 1;
  place-self: center;
  z-index: 1;
  max-width: calc(100% - 40px);
  min-height: 30px;
  display: flex;
  align-items: center;
  padding: 6px 20px;
  border-radius: 15px;
  background: rgba(255, 250, 241, .5);
  -webkit-backdrop-filter: blur(50px);
  backdrop-filter: blur(50px);
  color: var(--wine);
  font-size: 13px;
  line-height: 1.25;
  letter-spacing: .06em;
  text-align: center;
  opacity: 0;
  transform: translateY(15px);
  transition: opacity .2s var(--ease), transform .2s var(--ease);
}

/* Nome sotto la card: sempre visibile (durata e prezzo stanno nella scheda) */
.treatment__info { padding: 14px 18px 0; }
.treatment__name {
  font-family: var(--sans);
  font-size: 17.6px;
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: -0.01em;
}
.treatment__videos { margin-top: 8px; font-size: 13px; }
.treatment__videos a,
.treatment__links a {
  text-decoration: underline;
  text-decoration-color: rgba(63, 21, 33, .3);
  text-underline-offset: 3px;
  transition: text-decoration-color .2s var(--ease);
}
.treatment__videos a:hover,
.treatment__links a:hover { text-decoration-color: currentColor; }

/* Il testo della scheda: con JS si apre nella finestra (.sheet), senza resta sotto la card */
.treatment__detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  padding: 12px 18px 0;
  font-size: 14.4px;
  line-height: 1.45;
}
.js .treatment__detail { display: none; }

.treatment__price {
  font-family: var(--display);
  font-size: 22px;
  line-height: 1.1;
}

.treatment__links { list-style: none; display: grid; gap: 4px; }

.product-chips {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 16px 10px;
  max-width: 560px;
}
.product-chip__img {
  display: block;
  aspect-ratio: 3 / 4;
  border-radius: 22px;
  overflow: hidden;
  background: var(--sand);
}
.product-chip__img img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.product-chip__img--text {
  display: grid;
  place-items: center;
  background: var(--sand);
  font-family: var(--display);
  font-size: 17px;
}
.product-chip__name { display: block; margin-top: 8px; padding: 0 4px; font-size: 13.5px; line-height: 1.25; }
.product-chip__line { display: block; padding: 0 4px; font-size: 12px; color: rgba(63, 21, 33, .6); }

.treatment__book { display: flex; flex-wrap: wrap; gap: 8px; }
.pill--line { box-shadow: inset 0 0 0 1px rgba(63, 21, 33, .22); }
.pill--line:hover { background: var(--sand); }

/* Pedicure: accanto alla card, la nota sui prodotti Dermalena */
.note-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  aspect-ratio: 4 / 5;
  padding: 24px;
  border-radius: var(--radius);
  background: var(--sand);
  text-align: center;
}
.note-card__title {
  font-family: var(--display);
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1;
}
.note-card__text { max-width: 18em; font-size: 14.4px; line-height: 1.45; }
.note-card__link {
  margin-top: 4px;
  padding: 6px 16px;
  border-radius: 15px;
  background: rgba(255, 250, 241, .7);
  font-size: 13px;
  letter-spacing: .02em;
  transition: background-color .2s var(--ease);
}
.note-card__link:hover { background: var(--cream); }

.card:hover .card__thumb img,
.card:focus-visible .card__thumb img { transform: scale(1.005); }

.card:hover .card__label,
.card:focus-visible .card__label { opacity: 1; transform: none; }
.card__name { display: none; }

/* Touch: nessun hover, la pillola resta sempre visibile e porta il nome del
   trattamento, che quindi non si ripete sotto la card */
@media (hover: none) {
  .card__thumb img { transform: none; }
  .card__label {
    opacity: 1;
    transform: none;
    align-self: end;
    margin-bottom: 12px;
    font-size: 12px;
    letter-spacing: .01em;
    padding: 6px 14px;
    max-width: calc(100% - 20px);
  }
  .card__cta { display: none; }
  .card__name { display: inline; }
  .treatment__name { display: none; }
  .treatment__info:not(:has(.treatment__videos)) { display: none; }
}

/* Comparsa allo scroll (solo con JS attivo) */
.js .treatment.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
  transition-delay: var(--delay, 0ms);
}
.js .treatment.reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Tecnologia: testo su due colonne, le due card accanto ---------- */

.tech {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 32px 10px;
  padding: 0 10px 110px;
}
.tech__intro {
  grid-column: span 2;
  align-self: start;
  padding: 0 30px;
}
/* titolo di sezione, come Trattamenti e Prodotti */
.tech__title {
  font-family: var(--display);
  font-size: 40px;
  font-weight: 400;
  line-height: 1.1;
}
.tech__text {
  margin-top: 18px;
  max-width: 30em;
  font-size: 16px;
  line-height: 1.5;
  color: rgba(63, 21, 33, .8);
}

/* ---------- Prodotti: a sinistra le linee, a destra i prodotti in fila su un pannello sabbia ---------- */

.products { padding: 0 10px 110px; scroll-margin-top: 64px; }

.js .brands {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2.4fr);
  gap: 10px;
  align-items: start;
}

.brands__list { display: none; }
.js .brands__list { display: block; padding: 44px 30px 0; }

.brand-tab {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 11px 0 10px;
  border: 0;
  border-top: 1px solid rgba(63, 21, 33, .1);
  background: none;
  font-family: var(--display);
  font-size: 22px;
  line-height: 1.15;
  color: rgba(63, 21, 33, .38);
  text-align: left;
  cursor: pointer;
  transition: color .2s var(--ease), background-color .2s var(--ease);
}
.brand-tab:first-child { border-top: 0; padding-top: 0; }
.brand-tab:hover,
.brand-tab[aria-selected="true"] { color: var(--wine); }

.line {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 36px;
  min-height: 560px;
  padding: 44px 0 36px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--sand);
}
.line + .line { margin-top: 10px; }
.js .line + .line { margin-top: 0; }

.line__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  padding: 0 44px;
}
.line__name {
  font-family: var(--display);
  font-size: 40px;
  font-weight: 400;
  line-height: 1.05;
}
.line__uses {
  margin-top: 14px;
  max-width: 36em;
  font-size: 13px;
  line-height: 1.5;
  color: rgba(63, 21, 33, .65);
}
.line__uses a {
  color: var(--wine);
  text-decoration: underline;
  text-decoration-color: rgba(63, 21, 33, .3);
  text-underline-offset: 3px;
  transition: text-decoration-color .2s var(--ease);
}
.line__uses a:hover { text-decoration-color: currentColor; }

.shelf-nav { display: none; gap: 8px; flex-shrink: 0; }
.js .shelf-nav { display: flex; }
.shelf-nav__btn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 250, 241, .7);
  color: var(--wine);
  cursor: pointer;
  transition: background-color .2s var(--ease), opacity .2s var(--ease);
}
.shelf-nav__btn:hover { background: var(--cream); }
.shelf-nav__btn:disabled { opacity: .35; cursor: default; background: rgba(255, 250, 241, .7); }
.shelf-nav__btn svg { width: 16px; height: 10px; }
.shelf-nav__btn--prev svg { transform: scaleX(-1); }

/* le foto hanno il fondo bianco: col multiply restano solo i prodotti, posati sulla sabbia */
.shelf {
  list-style: none;
  display: flex;
  gap: 4px;
  padding: 0 44px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 44px;
  scroll-behavior: smooth;
  scrollbar-width: none;
  background: var(--sand);
}
.shelf::-webkit-scrollbar { display: none; }
.product {
  flex: 0 0 clamp(150px, 13vw, 200px);
  scroll-snap-align: start;
  text-align: center;
}
/* pochi prodotti stanno in mezzo; tanti partono da sinistra e scorrono */
.product:first-child { margin-left: auto; }
.product:last-child { margin-right: auto; }
.product__btn {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  text-align: inherit;
  cursor: zoom-in;
}
.product img {
  width: 100%;
  height: auto;
  mix-blend-mode: multiply;
  transition: transform .3s var(--ease);
}
.product__btn:hover img { transform: translateY(-4px); }
.product__name { display: block; margin-top: 2px; font-size: 13.5px; line-height: 1.3; }
/* una linea ancora senza foto: il suo nome, grande e chiaro */
.line__mark {
  padding: 0 44px;
  font-family: var(--display);
  font-size: clamp(56px, 8vw, 120px);
  line-height: .9;
  color: rgba(63, 21, 33, .12);
}
/* Dermalena: sotto il nome, che cos'è */
.product__type { display: block; font-size: 12px; color: rgba(63, 21, 33, .6); }
.viewer__name .product__type {
  margin-top: 10px;
  font-family: var(--sans);
  font-size: 15px;
  letter-spacing: .01em;
}

/* ---------- Scheda del trattamento (finestra) ---------- */

.sheet {
  width: min(1040px, calc(100% - 40px));
  max-width: none;
  height: min(680px, calc(100dvh - 40px));
  max-height: none;
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: clamp(28px, calc(100vw / 30), 48px);
  overflow: hidden;
  background: var(--cream);
  color: var(--wine);
  box-shadow: 0 40px 120px -40px rgba(63, 21, 33, .5);
}
.sheet[open] {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  grid-template-rows: minmax(0, 1fr);
  animation: sheet-in .35s var(--ease);
}
.sheet::backdrop {
  background: rgba(63, 21, 33, .28);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.sheet[open]::backdrop { animation: fade-in .35s var(--ease); }
@keyframes sheet-in { from { opacity: 0; transform: translateY(16px) scale(.985); } }
@keyframes fade-in { from { opacity: 0; } }

html:has(.sheet[open]) { overflow: hidden; }

.sheet__media { position: relative; background: var(--card-bg); }
.sheet__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.sheet__body {
  overflow: auto;
  overscroll-behavior: contain;
  padding: 52px 44px 40px;
}
.sheet__title {
  margin-top: 10px;
  font-family: var(--display);
  font-size: clamp(30px, 3.2vw, 44px);
  font-weight: 400;
  line-height: 1.05;
}
.sheet__detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  margin-top: 20px;
}
.sheet__detail .treatment__desc { font-size: 17px; line-height: 1.5; }
.sheet__detail .panel-label { margin-top: 12px; }
.sheet__detail .treatment__book { margin-top: 16px; }

.sheet__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(232, 222, 210, .85);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  color: var(--wine);
  cursor: pointer;
  transition: background-color .2s var(--ease);
}
.sheet__close:hover { background: var(--sand); }
.sheet__close svg { width: 12px; height: 12px; }

/* ---------- Prodotto a tutta pagina ---------- */

.viewer {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--sand);
  color: var(--wine);
}
.viewer[open] {
  display: grid;
  place-items: center;
  animation: fade-in .3s var(--ease);
}
.viewer::backdrop { background: var(--sand); }
html:has(.viewer[open]) { overflow: hidden; }

.viewer__figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 72px 24px 40px;
  text-align: center;
}
/* il fondo bianco della foto sparisce nella sabbia */
.viewer__img {
  width: auto;
  height: min(68dvh, 880px);
  max-width: min(86vw, 660px);
  object-fit: contain;
  mix-blend-mode: multiply;
}
.viewer[open] .viewer__img { animation: viewer-in .4s var(--ease); }
@keyframes viewer-in { from { opacity: 0; transform: translateY(12px); } }
.viewer figcaption { display: grid; gap: 8px; }
.viewer__name {
  font-family: var(--display);
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.05;
}

.viewer__nav {
  position: absolute;
  top: 50%;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  margin-top: -24px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 250, 241, .7);
  color: var(--wine);
  cursor: pointer;
  transition: background-color .2s var(--ease);
}
.viewer__nav:hover { background: var(--cream); }
.viewer__nav svg { width: 18px; height: 12px; }
.viewer__nav--prev { left: 24px; }
.viewer__nav--prev svg { transform: scaleX(-1); }
.viewer__nav--next { right: 24px; }
.viewer__close { top: 20px; right: 20px; }

/* ---------- Footer: pannello con la crema che scorre e le pillole della barra in alto ---------- */

.footer { padding: 0 10px 10px; }

.footer__card {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  container-type: inline-size;
  padding: 28px 28px 22px;
  border-radius: clamp(28px, calc(100vw / 18.9), 80px);
  /* come nella hero: prima dell'animazione resta il suo primo fotogramma */
  background: var(--sand) url("img/crema.jpg?v=2") center / cover no-repeat;
  color: var(--wine);
}
.footer__card > :not(.bg-cream) { position: relative; z-index: 1; }

.footer__pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.footer__pill {
  height: 32px;
  display: inline-flex;
  align-items: center;
  padding: 0 18px;
  border-radius: 16px;
  background: rgba(255, 251, 244, .72);
  font-size: 13px;
  letter-spacing: .02em;
  white-space: nowrap;
  transition: background-color .2s var(--ease), color .2s var(--ease);
}
.footer__pill:hover { background: #FFFBF4; }

/* come su Yuri Roga: «Email», e al passaggio l'indirizzo */
.footer__pill[data-email]::before { content: "Email"; }
.footer__pill[data-email]:hover::before { content: attr(data-email); }

.footer__pill--wine {
  margin-left: auto;
  background: var(--wine);
  color: var(--cream);
}
.footer__pill--wine:hover { background: #561d2d; }

.footer__wordmark {
  margin-top: clamp(48px, 7cqw, 96px);
  font-family: var(--display);
  /* il logotipo occupa tutta la larghezza del pannello */
  font-size: 11.15cqw;
  line-height: .8;
  letter-spacing: -0.01em;
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
  user-select: none;
}

.footer__legal {
  margin-top: 22px;
  font-size: 12px;
  color: rgba(63, 21, 33, .7);
}
.footer__legal a { transition: color .2s var(--ease); }
.footer__legal a:hover { color: var(--wine); }

/* ---------- Pagine Privacy e Cookie ---------- */

.legal__top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
}
.legal__top .bar {
  --bar-h: 32px;
  display: inline-flex;
  align-items: center;
  padding: 0 20px;
  background: rgba(232, 222, 210, .82);
}
.legal__home {
  font-family: var(--display);
  font-size: 17px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.legal__back { font-size: 13px; letter-spacing: .02em; }

.legal__main {
  max-width: 720px;
  margin: 0 auto;
  padding: 64px 20px 72px;
}
.legal__main h1 {
  margin-top: 10px;
  font-family: var(--display);
  font-size: clamp(40px, 6vw, 64px);
  font-weight: 400;
  line-height: 1;
}
.legal__lead { margin-top: 24px; font-size: 19px; line-height: 1.45; }
.legal__main section { margin-top: 40px; }
.legal__main h2 { font-size: 18px; font-weight: 500; margin-bottom: 10px; }
.legal__main p,
.legal__main li { font-size: 16px; line-height: 1.6; }
.legal__main ul { padding-left: 1.2em; display: grid; gap: 8px; }
.legal__main p + p { margin-top: 10px; }
.legal__main a { text-decoration: underline; text-underline-offset: 3px; }

.legal__foot {
  padding: 24px 20px 32px;
  font-size: 12px;
  text-align: center;
  color: rgba(63, 21, 33, .7);
}
.legal__foot a[aria-current] { color: var(--wine); }

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
  .sheet__body { padding: 48px 32px 32px; }
}

@media (max-width: 900px) {
}

@media (max-width: 840px) {
  .topbar { grid-template-columns: minmax(0, 1fr); }
  .site-header { padding: 0 16px; }
  .site-menu__btn { padding: 0 16px; }
  .menu-panel { padding: 16px 16px 24px; }
  main { padding-top: 94px; }
  /* su telefono soprattutto: più larga che alta, ma mai più bassa del testo */
  .hero { height: auto; min-height: clamp(270px, 60vw, 400px); padding: 28px 18px; }

  .grid { --cols: 2; }
  /* scacchiera anche a due colonne (persona, crema / crema, persona): l'ordine è
     pensato per quattro colonne, quindi in ogni gruppo di otto card la 3ª e la 4ª,
     e la 5ª e la 6ª, si scambiano di colonna */
  .grid:has(> :nth-child(4)) { grid-auto-flow: row dense; }
  .grid:has(> :nth-child(4)) > :nth-child(8n+3),
  .grid:has(> :nth-child(4)) > :nth-child(8n+5) { grid-column: 2; }
  .grid:has(> :nth-child(4)) > :nth-child(8n+4),
  .grid:has(> :nth-child(4)) > :nth-child(8n+6) { grid-column: 1; }
  .treatments { padding: 48px 10px 80px; }
  .treatments__head { padding: 0 6px 22px; }
  .treatments__head h2 { font-size: 30px; }
  .js .tabs { padding: 0 6px 22px; }
  .category__title { padding: 0 6px 16px; font-size: 24px; }
  .grid { row-gap: 24px; }
  .treatment__info { padding: 10px 6px 0; }
  .treatment__name { font-size: 15px; }
  .treatment__videos { font-size: 12px; }
  .treatment__detail { padding: 10px 6px 0; font-size: 13.5px; }

  .note-card { gap: 8px; padding: 16px 12px; }
  .note-card .panel-label { display: none; }
  .note-card__text { font-size: 12.5px; line-height: 1.35; }
  .note-card__link { font-size: 12px; padding: 5px 12px; }

  /* Tecnologia e Prodotti: la stessa composizione del desktop, in piccolo */
  .tech {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: 20px 10px;
    padding: 0 10px 80px;
  }
  /* il testo parte all'altezza della prima card */
  .tech__intro { grid-column: 1; grid-row: 1 / span 2; align-self: start; padding: 0 4px 0 6px; }
  .tech .treatment { grid-column: 2; }
  .tech__title { font-size: 30px; }
  .tech__text { margin-top: 12px; font-size: 13px; line-height: 1.45; }
  .tech .treatment__videos { line-height: 1.6; }

  .products { padding: 0 10px 80px; }
  .js .brands {
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 10px;
    align-items: stretch;
  }
  .js .brands__list { padding: 20px 0 0 4px; }
  .brand-tab { gap: 4px; padding: 8px 0 7px; font-size: 13px; white-space: nowrap; }
  .line { min-height: 0; gap: 18px; padding: 20px 0 16px; }
  .line__top { flex-direction: column; align-items: flex-start; gap: 12px; padding: 0 12px; }
  .line__name { font-size: 24px; }
  .line__uses { margin-top: 8px; font-size: 11.5px; line-height: 1.45; }
  .shelf-nav__btn { width: 32px; height: 32px; }
  .shelf { gap: 2px; padding: 0 12px; scroll-padding: 0 12px; }
  .product { flex-basis: calc(50% - 1px); }
  .product__name { font-size: 11.5px; }
  .product__type { font-size: 10.5px; }
  .line__mark { padding: 0 12px; font-size: 40px; }
}

@media (max-width: 767px) {
  /* le aree su una riga sola, senza i numeri (se non stanno, scorrono) */
  .js .tabs { flex-wrap: nowrap; gap: 5px; overflow-x: auto; scrollbar-width: none; }
  .js .tabs::-webkit-scrollbar { display: none; }
  .tab {
    flex: 1 1 auto;
    justify-content: center;
    padding: 0 clamp(6px, 2vw, 14px);
    font-size: clamp(11.5px, 3.3vw, 13.5px);
    letter-spacing: 0;
  }
  .tab__count { display: none; }

  .footer__card { padding: 20px 16px 18px; }
  .footer__pill { padding: 0 14px; font-size: 12px; }
  .footer__pill--wine { margin-left: 0; }
  .footer__legal { font-size: 11px; }

  /* la scheda sale dal basso e occupa quasi tutto lo schermo */
  .sheet {
    width: 100%;
    height: calc(100dvh - 16px);
    margin: auto 0 0;
    border-radius: 28px 28px 0 0;
  }
  .sheet[open] {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 34% minmax(0, 1fr);
    animation-name: sheet-up;
  }
  @keyframes sheet-up { from { transform: translateY(48px); opacity: 0; } }
  .sheet__body { padding: 24px 20px 32px; }
  .sheet__title { font-size: 30px; }
  .sheet__detail .treatment__desc { font-size: 16px; }
  .sheet__close { top: 12px; right: 12px; }
  .viewer__figure { gap: 14px; padding: 64px 16px 96px; }
  .viewer__img { height: min(58dvh, 560px); }
  .viewer__name { font-size: 30px; }
  /* frecce in basso, sotto il nome, dove arriva il pollice */
  .viewer__nav { top: auto; bottom: 28px; margin-top: 0; width: 44px; height: 44px; }
  .viewer__nav--prev { left: calc(50% - 52px); }
  .viewer__nav--next { right: calc(50% - 52px); }
  .product-chips { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .product-chip__img { border-radius: 18px; }
  .product-chip__name { font-size: 12.5px; }
  .product-chip__line { font-size: 11px; }
}

@media (max-width: 640px) {
  .logo { font-size: 15px; }
  .site-header__owner { font-size: 12px; }

  .hero__content .pill { min-height: 40px; padding: 10px 18px; }

  .treatments__head { flex-direction: column; align-items: flex-start; gap: 8px; }
}

@media (max-width: 480px) {
  .site-header__since { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
  .js .treatment.reveal { opacity: 1; transform: none; }
  .hero__letters span,
  .hero__content .pill,
  .sheet[open],
  .sheet[open]::backdrop,
  .viewer[open],
  .viewer[open] .viewer__img { animation: none; }
}
