/* =====================================================================
   FrolliAMOci — Vetrina Visiva «Dolci del giorno» (v1.29)
   Lomazzi Federico (c) 2026
   Card verticali tipo «stories», fotografia protagonista, scorrimento con aggancio. Quante card si vedono lo decide la
   pasticceria (smartphone 1–5, computer 1–10; il tablet sta in mezzo): classi svv--m{n} / svv--t{n} / svv--d{n}, mai stili inline (CSP).
   ===================================================================== */

.svv { --svv-gap: 10px; --svv-n: var(--svv-m, 3); --svv-peek: var(--svv-peek-m, 0); display: grid; gap: var(--space-2); min-width: 0; }
.svv--m1 { --svv-m: 1; } .svv--m2 { --svv-m: 2; } .svv--m3 { --svv-m: 3; } .svv--m4 { --svv-m: 4; } .svv--m5 { --svv-m: 5; }
.svv--t1 { --svv-t: 1; } .svv--t2 { --svv-t: 2; } .svv--t3 { --svv-t: 3; } .svv--t4 { --svv-t: 4; } .svv--t5 { --svv-t: 5; }
.svv--t6 { --svv-t: 6; } .svv--t7 { --svv-t: 7; } .svv--t8 { --svv-t: 8; } .svv--t9 { --svv-t: 9; } .svv--t10 { --svv-t: 10; }
.svv--d1 { --svv-d: 1; } .svv--d2 { --svv-d: 2; } .svv--d3 { --svv-d: 3; } .svv--d4 { --svv-d: 4; } .svv--d5 { --svv-d: 5; }
.svv--d6 { --svv-d: 6; } .svv--d7 { --svv-d: 7; } .svv--d8 { --svv-d: 8; } .svv--d9 { --svv-d: 9; } .svv--d10 { --svv-d: 10; }
/* con più card di quelle visibili, la successiva «sbircia» dal bordo: invita a scorrere */
.svv--pm { --svv-peek-m: 0.28; } .svv--pt { --svv-peek-t: 0.22; } .svv--pd { --svv-peek-d: 0.18; }

.svv__title { margin-bottom: 0; }
.svv__viewport { position: relative; min-width: 0; }
.svv__track {
    display: flex; gap: var(--svv-gap); margin: 0; padding: 2px 2px 6px; list-style: none;
    overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scroll-padding-inline: 2px;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.svv__track::-webkit-scrollbar { display: none; }
.svv__track:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 4px; border-radius: var(--radius-lg); }
.svv__slide {
    flex: 0 0 calc((100% - (var(--svv-n) - 1 + var(--svv-peek)) * var(--svv-gap)) / (var(--svv-n) + var(--svv-peek)));
    min-width: 0; scroll-snap-align: start;
}

/* ---------- Card ---------- */
.svv-card {
    position: relative; display: block; overflow: hidden; isolation: isolate;
    aspect-ratio: 3 / 4; border-radius: var(--radius-lg);
    background: var(--tint-caramel); color: #fff; text-decoration: none;
    box-shadow: 0 10px 24px -16px rgba(62, 32, 22, 0.55), inset 0 0 0 1px rgba(62, 32, 22, 0.06);
    transform: translateZ(0);
}
.svv--m1 .svv-card, .svv--m2 .svv-card { aspect-ratio: 4 / 5; }
.svv-card.is-link { cursor: pointer; transition: transform var(--dur-fast, 0.15s) ease, box-shadow var(--dur-fast, 0.15s) ease; }
.svv-card.is-link:active { transform: scale(0.975); }
.svv-card.is-link:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 3px; }
@media (hover: hover) { .svv-card.is-link:hover { box-shadow: 0 16px 30px -16px rgba(62, 32, 22, 0.7); } .svv-card.is-link:hover .svv-card__img { transform: scale(1.04); } }
.svv-card__media { position: absolute; inset: 0; z-index: -1; }
.svv-card__img {
    width: 100%; height: 100%; object-fit: cover; display: block;
    object-position: var(--fx, 50%) var(--fy, 50%);
    transition: transform 0.5s cubic-bezier(.2, .7, .2, 1);
}
/* punto focale scelto dalla pasticceria (passi del 10%) */
.svv-fx-0 { --fx: 0%; } .svv-fx-10 { --fx: 10%; } .svv-fx-20 { --fx: 20%; } .svv-fx-30 { --fx: 30%; } .svv-fx-40 { --fx: 40%; } .svv-fx-50 { --fx: 50%; }
.svv-fx-60 { --fx: 60%; } .svv-fx-70 { --fx: 70%; } .svv-fx-80 { --fx: 80%; } .svv-fx-90 { --fx: 90%; } .svv-fx-100 { --fx: 100%; }
.svv-fy-0 { --fy: 0%; } .svv-fy-10 { --fy: 10%; } .svv-fy-20 { --fy: 20%; } .svv-fy-30 { --fy: 30%; } .svv-fy-40 { --fy: 40%; } .svv-fy-50 { --fy: 50%; }
.svv-fy-60 { --fy: 60%; } .svv-fy-70 { --fy: 70%; } .svv-fy-80 { --fy: 80%; } .svv-fy-90 { --fy: 90%; } .svv-fy-100 { --fy: 100%; }

/* testo sopra l'immagine: velo e contrasto automatici (la pasticceria non sceglie colori per renderlo leggibile) */
.svv-card__ov { position: absolute; inset: 0; display: flex; padding: 10px; pointer-events: none; }
.svv-card__ov--top { align-items: flex-start; background: linear-gradient(180deg, rgba(25, 12, 6, 0.72) 0%, rgba(25, 12, 6, 0.28) 42%, transparent 66%); }
.svv-card__ov--center { align-items: center; justify-content: center; text-align: center; background: radial-gradient(120% 70% at 50% 50%, rgba(25, 12, 6, 0.6) 0%, rgba(25, 12, 6, 0.18) 70%, transparent 100%); }
.svv-card__ov--bottom { align-items: flex-end; background: linear-gradient(0deg, rgba(25, 12, 6, 0.78) 0%, rgba(25, 12, 6, 0.32) 40%, transparent 64%); }
.svv-card__ovin {
    display: block; width: 100%; max-height: 100%; overflow: hidden;
    color: #fff; font-size: clamp(0.78rem, 0.7rem + 0.35vw, 0.98rem); font-weight: var(--fw-heavy); line-height: 1.2;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45); overflow-wrap: anywhere; contain: content;
}
.svv--m1 .svv-card__ovin, .svv--m2 .svv-card__ovin { font-size: clamp(1rem, 0.9rem + 0.6vw, 1.3rem); }
.svv-card__name {
    position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 10px 9px;
    font-size: var(--fs-sm); font-weight: var(--fw-heavy); line-height: 1.15; color: #fff;
    background: linear-gradient(0deg, rgba(25, 12, 6, 0.74) 0%, rgba(25, 12, 6, 0.3) 62%, transparent 100%);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.svv-card__ext { position: absolute; top: 8px; right: 8px; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
    background: rgba(255, 255, 255, 0.9); color: var(--color-text); font-size: 0.7rem; }

/* contenuto ricco del professionista (HTML ripulito): tipografia di base, il CSS della pasticceria resta confinato */
.svv-rich h2, .svv-rich h3 { margin: 0 0 0.2em; font-size: 1.25em; line-height: 1.1; color: inherit; }
.svv-rich h3 { font-size: 1.1em; }
.svv-rich p { margin: 0 0 0.35em; }
.svv-rich p:last-child { margin-bottom: 0; }
.svv-rich ul, .svv-rich ol { margin: 0.2em 0; padding-left: 1.2em; }
.svv-rich small { font-size: 0.8em; font-weight: var(--fw-bold); }
.svv-rich mark { background: var(--color-accent); color: #fff; padding: 0 0.25em; border-radius: 4px; }

/* ---------- Frecce (computer) e barra di avanzamento ---------- */
.svv__nav {
    position: absolute; top: 50%; z-index: 2; display: grid; place-items: center; width: 44px; height: 44px; margin-top: -22px;
    border: 0; border-radius: 50%; background: var(--color-surface); color: var(--color-text); cursor: pointer;
    box-shadow: 0 8px 20px -10px rgba(62, 32, 22, 0.7), inset 0 0 0 1px var(--color-border-strong);
    transition: opacity 0.2s ease, transform 0.15s ease;
}
.svv__nav[hidden] { display: none; }
.svv__nav:disabled { opacity: 0; pointer-events: none; }
.svv__nav:active { transform: scale(0.94); }
.svv__nav:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 2px; }
.svv__nav--prev { left: 8px; }
.svv__nav--next { right: 8px; }
@media (min-width: 1280px) { .svv__nav--prev { left: -16px; } .svv__nav--next { right: -16px; } }
.svv__bar { height: 4px; border-radius: 99px; background: var(--color-border-strong); overflow: hidden; margin: 0 2px; }
.svv__bar[hidden] { display: none; }
.svv__fill { display: block; height: 100%; width: 30%; border-radius: inherit; background: var(--color-accent); transform-origin: left center; transition: transform 0.12s linear; }

@media (min-width: 768px) {
    .svv { --svv-n: var(--svv-t, 4); --svv-peek: var(--svv-peek-t, 0); --svv-gap: 14px; }
}
@media (min-width: 1024px) {
    .svv { --svv-n: var(--svv-d, 5); --svv-peek: var(--svv-peek-d, 0); --svv-gap: 16px; }
    .svv-card__ov { padding: 14px; }
}
@media (prefers-reduced-motion: reduce) {
    .svv-card__img, .svv-card.is-link, .svv__fill { transition: none; }
    .svv__track { scroll-behavior: auto; }
}

/* ---------- Light-box (prodotto, categoria, contenuto) ---------- */
.svv-lb {
    width: min(640px, calc(100% - 2 * var(--page-gutter, 16px))); max-height: min(86vh, 900px); padding: 0;
    border: 0; border-radius: var(--radius-xl); background: var(--color-bg, #FFF8F1); color: var(--color-text);
    box-shadow: 0 30px 80px -30px rgba(25, 12, 6, 0.75); overflow: hidden;
}
.svv-lb::backdrop { background: rgba(25, 12, 6, 0.55); backdrop-filter: blur(3px); }
.svv-lb[open] { display: flex; flex-direction: column; animation: svv-lb-in 0.22s var(--ease-out, ease-out) both; }
@keyframes svv-lb-in { from { opacity: 0; transform: translateY(14px) scale(0.98); } }
@media (prefers-reduced-motion: reduce) { .svv-lb[open] { animation: none; } }
.svv-lb__bar { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 8px 8px 0; }
.svv-lb__body { overflow: auto; padding: 4px var(--space-5) var(--space-5); overscroll-behavior: contain; }
.svv-lb__load { display: grid; place-items: center; min-height: 220px; color: var(--color-text-muted); font-weight: var(--fw-bold); }
.svv-lb__spin { width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--color-border-strong); border-top-color: var(--color-accent); animation: svv-spin 0.8s linear infinite; }
@keyframes svv-spin { to { transform: rotate(360deg); } }
@media (max-width: 599px) {
    .svv-lb { width: 100%; max-width: none; max-height: 92vh; margin: auto 0 0; border-radius: var(--radius-xl) var(--radius-xl) 0 0; }
}

/* pagina / light-box: contenuto personalizzato */
.svv-page { display: grid; gap: var(--space-4); max-width: 760px; margin: 0 auto; }
.svv-page__h { font-size: clamp(1.4rem, 1.1rem + 1.4vw, 2rem); font-weight: var(--fw-heavy); line-height: 1.12; margin: 0; }
.svv-page__rich { font-size: var(--fs-md, 1rem); line-height: 1.55; overflow-wrap: anywhere; contain: content; isolation: isolate; overflow: hidden; }
.svv-page__rich h2 { font-size: 1.45em; } .svv-page__rich h3 { font-size: 1.2em; }
.svv-page__rich img { max-width: 100%; height: auto; border-radius: var(--radius-md); }
.svv-page__rich a { color: var(--color-accent-strong); font-weight: var(--fw-bold); }

/* pagina / light-box: prodotti di una categoria */
.svv-list { display: grid; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.svv-list__item a {
    display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; align-items: center; gap: var(--space-3); padding: 8px;
    border-radius: var(--radius-lg); background: var(--color-surface); box-shadow: var(--shadow-card); color: var(--color-text); text-decoration: none;
}
.svv-list__media { width: 72px; height: 72px; border-radius: var(--radius-md); overflow: hidden; background: var(--tint-caramel); }
.svv-list__media img { width: 100%; height: 100%; object-fit: cover; }
.svv-list__name { font-weight: var(--fw-heavy); line-height: 1.2; }
.svv-list__price { font-size: var(--fs-sm); color: var(--color-text-muted); font-weight: var(--fw-bold); }
.svv-more { justify-self: center; margin-top: var(--space-2); }
.svv-quick__open { margin-top: var(--space-3); }
