/* ==========================================================================
   LA PIZZA A MODO MIO — Menu Digitale
   UI: carosello di categorie con la carta selezionata al centro e le vicine
   che sbirciano ai lati. I prodotti della categoria centrata stanno subito
   sotto, sempre visibili.
   Palette chiara: bianco, grigi caldi, pomodoro, ottone.

   Principio guida: si deve capire subito dove si e' e cosa c'e'.
   Niente pagine da aprire e chiudere.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. TOKENS
   -------------------------------------------------------------------------- */
:root {
    /* Superfici */
    --void: #FFFFFF;
    --surface: #FFFFFF;
    --surface-2: #F6F4EF;

    /* Filetti */
    --line: rgba(22, 22, 20, 0.11);
    --line-2: rgba(22, 22, 20, 0.22);

    /* Testo — contrasto alzato per la leggibilita' di una lista lunga */
    --ivory: #181816;
    --sage: #5F625D;
    --sage-dim: #7A7D77;
    --text-light: #5F625D;

    /* Accento */
    --tomato: #E24A2E;
    --tomato-hi: #F2603F;

    /* Dettaglio */
    --brass: #C9A868;

    /* Ombre */
    --shadow-md: 0 18px 44px -24px rgba(24, 24, 22, 0.18);
    --shadow-lg: 0 50px 100px -50px rgba(24, 24, 22, 0.24);

    /* Superfici semitrasparenti */
    --glass: rgba(255, 255, 255, 0.82);
    --glass-strong: rgba(255, 255, 255, 0.93);
    --hero-scrim-a: rgba(12, 14, 12, 0.55);
    --hero-scrim-b: rgba(12, 14, 12, 0.72);
    --hero-scrim-c: rgba(12, 14, 12, 0.92);
    --card-scrim-a: rgba(255, 255, 255, 0.08);
    --card-scrim-b: rgba(255, 255, 255, 0.04);
    --card-scrim-c: rgba(255, 255, 255, 0.80);
    --card-scrim-d: rgba(255, 255, 255, 0.94);

    /* Forme */
    --r-xs: 4px;
    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 16px;
    --r-pill: 999px;

    /* Tipografia */
    --font-display: 'Bodoni Moda', 'Times New Roman', serif;
    --font-ui: 'Archivo', 'Segoe UI', system-ui, sans-serif;

    /* Misure di struttura */
    --pad-x: clamp(1.15rem, 5vw, 3rem);
    --wrap: 1080px;
    --col: 760px;
    --bar-h: 5.2rem;

    /* Motion */
    --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

    /* Safe area */
    --sa-b: env(safe-area-inset-bottom, 0px);
    --sa-t: env(safe-area-inset-top, 0px);
    --sa-r: env(safe-area-inset-right, 0px);
    --sa-l: env(safe-area-inset-left, 0px);
}

html[data-theme="dark"] {
    --void: #0A100E;
    --surface: #111815;
    --surface-2: #18211D;
    --line: rgba(240, 236, 226, 0.11);
    --line-2: rgba(240, 236, 226, 0.22);
    --ivory: #F2EFE6;
    --sage: #B0BAAF;
    --sage-dim: #7C877D;
    --text-light: #7C877D;
    --shadow-md: 0 18px 44px -22px rgba(0, 0, 0, 0.95);
    --shadow-lg: 0 50px 100px -45px #000;
    --glass: rgba(10, 16, 14, 0.7);
    --glass-strong: rgba(10, 16, 14, 0.93);
    --hero-scrim-a: rgba(10, 16, 14, 0.78);
    --hero-scrim-b: rgba(10, 16, 14, 0.6);
    --hero-scrim-c: rgba(10, 16, 14, 0.4);
    --card-scrim-a: rgba(10, 16, 14, 0.10);
    --card-scrim-b: rgba(10, 16, 14, 0.05);
    --card-scrim-c: rgba(10, 16, 14, 0.82);
    --card-scrim-d: rgba(10, 16, 14, 0.96);
}

/* --------------------------------------------------------------------------
   2. RESET & BASE
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

* {
    margin: 0;
    padding: 0;
}

html {
    -webkit-text-size-adjust: 100%;
    background: var(--void);
    scroll-behavior: smooth;
}

body {
    background-color: var(--void);
    color: var(--ivory);
    font-family: var(--font-ui);
    font-size: 16px;
    line-height: 1.55;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    -webkit-tap-highlight-color: transparent;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font: inherit;
    color: inherit;
    border: 0;
    background: none;
    cursor: pointer;
}

h1,
h2,
h3,
h4 {
    font-family: var(--font-display);
    font-weight: 500;
    line-height: 1.04;
    letter-spacing: -0.02em;
}

::selection {
    background: var(--tomato);
    color: var(--ivory);
}

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

/* Micro etichette maiuscole spaziate */
.btn-main,
.btn-secondary,
.allergen-tag span,
.tag,
.footer .coperto-info,
.about-content h4,
.legal-content h2,
.last-update {
    font-family: var(--font-ui);
    text-transform: uppercase;
    letter-spacing: 0.14em;
}

/* --------------------------------------------------------------------------
   3. VIEWS
   -------------------------------------------------------------------------- */
.view {
    display: none;
}

.view.active {
    display: block;
    animation: viewIn 0.35s var(--ease-out) both;
}

@keyframes viewIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* --------------------------------------------------------------------------
   4. TESTATA (scorre via)
   -------------------------------------------------------------------------- */
/* Volutamente bassa: il protagonista e' il carosello, non la testata.
   Se la testata e' alta i prodotti finiscono sotto la piega. */
.masthead {
    position: relative;
    isolation: isolate;
    min-height: 17svh;
    display: grid;
    place-items: center;
    padding: calc(2.5rem + var(--sa-t)) var(--pad-x) 1.5rem;
    overflow: hidden;
    background: var(--surface);
}

.masthead-media {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: contrast(1.1) saturate(0.9) brightness(0.55);
}

.masthead-scrim {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        radial-gradient(62% 42% at 50% 50%, var(--hero-scrim-a) 0%, transparent 74%),
        linear-gradient(180deg, var(--hero-scrim-b) 0%, var(--hero-scrim-c) 46%, var(--void) 100%);
}

.masthead-inner {
    position: relative;
    z-index: 2;
}

.brand-logo {
    width: clamp(165px, 46vw, 260px);
    height: auto;
    filter: drop-shadow(0 8px 36px rgba(0, 0, 0, 0.9));
    animation: brandIn 0.9s var(--ease-out) both;
}

@keyframes brandIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

/* --------------------------------------------------------------------------
   4b. SEZIONI DI PRIMO LIVELLO (Cibo / Bevande / Vini)

   Resta incollata in alto: da metа' lista prodotti si deve poter cambiare
   sezione senza risalire tutta la pagina. Lo spazio a destra e' riservato al
   selettore lingua, che e' fisso nello stesso angolo.
   -------------------------------------------------------------------------- */
.groupbar {
    position: sticky;
    top: 0;
    z-index: 91;
    display: grid;
    /* Le due colonne laterali uguali tengono la pillola al centro esatto */
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 0.5rem;
    padding-block: 0.55rem;
    padding-left: max(0.7rem, calc(var(--pad-x) / 2 + var(--sa-l)));
    padding-right: max(0.7rem, calc(var(--pad-x) / 2 + var(--sa-r)));
    background: var(--glass-strong);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(20px) saturate(1.3);
    -webkit-backdrop-filter: blur(20px) saturate(1.3);
}

/* --- Controllo segmentato ---------------------------------------------- */
.groupbar-tabs {
    position: relative;
    justify-self: center;
    display: flex;
    gap: 2px;
    padding: 3px;
    border-radius: var(--r-pill);
    background: var(--surface-2);
    border: 1px solid var(--line);
    box-shadow: inset 0 1px 2px rgba(24, 24, 22, 0.08);
}

.groupbar-tabs[hidden] {
    display: none;
}

/* Pillola che scorre sotto la scheda attiva.
   JS passa posizione e larghezza; offsetLeft e' relativo a questo
   contenitore, quindi il riempimento di 3px torna da solo. */
.groupbar-tabs::before {
    content: "";
    position: absolute;
    z-index: 0;
    left: 0;
    top: 3px;
    bottom: 3px;
    width: var(--ind-w, 0px);
    transform: translateX(var(--ind-x, 0px));
    border-radius: var(--r-pill);
    background: var(--tomato);
    box-shadow: 0 6px 16px -8px rgba(226, 74, 46, 0.95);
    transition: transform 0.42s var(--ease-out), width 0.42s var(--ease-out);
}

.group-tab {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0.5rem 0.95rem;
    border: 0;
    border-radius: var(--r-pill);
    background: none;
    font-family: var(--font-ui);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    white-space: nowrap;
    color: var(--sage-dim);
    transition: color 0.28s var(--ease);
}

@media (hover: hover) {
    .group-tab:not(.is-active):hover {
        color: var(--sage);
    }
}

.group-tab.is-active {
    color: var(--ivory);
}

/* --- Lingua dentro la barra ------------------------------------------- */
.groupbar-side {
    min-width: 0;
}

.groupbar-lang {
    justify-self: end;
    display: flex;
    gap: 2px;
    padding: 3px;
    border-radius: var(--r-pill);
    background: var(--surface-2);
    border: 1px solid var(--line);
}

.groupbar-lang .lang-flag-btn {
    width: 30px;
    height: 30px;
    border-radius: var(--r-pill);
}

/* In home il selettore vive nella barra: quello fisso sarebbe un doppione */
html:has(#home-view.active) .lang-switcher-fixed {
    display: none;
}

/* Schermi stretti: la pillola si restringe prima di toccare le bandiere.
   Le soglie sono misurate, non stimate: a piena taglia servono ~430px,
   e sotto i 345px serve un secondo scalino. */
@media (max-width: 429px) {
    .group-tab {
        padding: 0.5rem 0.7rem;
        font-size: 0.56rem;
        letter-spacing: 0.14em;
    }

    .groupbar-lang .lang-flag-btn {
        width: 27px;
        height: 27px;
    }
}

@media (max-width: 344px) {
    .group-tab {
        padding: 0.45rem 0.5rem;
        font-size: 0.5rem;
        letter-spacing: 0.09em;
    }

    .groupbar-lang .lang-flag-btn {
        width: 24px;
        height: 24px;
    }

    .groupbar-lang {
        padding: 2px;
    }
}

/* --------------------------------------------------------------------------
   5. CAROSELLO CATEGORIE

   La carta al centro e' la selezionata; ai lati sbirciano la precedente e la
   successiva. JS misura lo scostamento dal centro di ogni carta e lo passa
   qui come numero puro (--p con segno, --d valore assoluto). Il CSS lo
   trasforma in prospettiva, scala, opacita' e filtro.

   Volutamente NESSUNA transizione su transform: l'effetto deve seguire il
   dito fotogramma per fotogramma, non inseguirlo con un ritardo.
   -------------------------------------------------------------------------- */
.carousel {
    position: relative;
    padding-top: clamp(1.1rem, 4vw, 1.75rem);
    /* Cambiando sezione si torna qui: non finire sotto la barra incollata */
    scroll-margin-top: 4.2rem;
}

.carousel-track {
    --card-w: min(68vw, 290px);
    --card-gap: clamp(0.7rem, 3vw, 1.15rem);

    display: flex;
    column-gap: var(--card-gap);
    /* Il riempimento laterale permette alla prima e all'ultima carta di
       arrivare davvero al centro */
    padding-inline: calc((100% - var(--card-w)) / 2);
    padding-block: 0.75rem 1.5rem;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
}

.carousel-track::-webkit-scrollbar {
    display: none;
}

.carousel-track:focus {
    outline: none;
}

.carousel-track:focus-visible .cat-card.is-active {
    outline: 2px solid var(--tomato);
    outline-offset: 5px;
}

.cat-card {
    --p: 0;
    --d: 0;
    --enter: 0;

    position: relative;
    isolation: isolate;
    flex: 0 0 var(--card-w);
    aspect-ratio: 4 / 5;
    scroll-snap-align: center;
    padding: 0;
    border: 0;
    border-radius: var(--r-lg);
    overflow: hidden;
    background: var(--surface);
    cursor: pointer;
    text-align: left;
    -webkit-tap-highlight-color: transparent;

    transform:
        perspective(1200px)
        translateX(calc(var(--p) * -2.4%))
        rotateY(calc(var(--p) * -17deg))
        scale(calc(1 - 0.13 * var(--d)))
        translateY(calc(var(--d) * 15px));
    /* Le carte vicine devono restare riconoscibili: servono a far capire
       cosa viene prima e cosa viene dopo. Attenuate, non spente. */
    opacity: calc(1 - 0.34 * var(--d));
    filter: saturate(calc(1 - 0.32 * var(--d))) brightness(calc(1 - 0.13 * var(--d)));
    will-change: transform, opacity;

    /* Solo l'ombra transisce: il resto segue lo scorrimento */
    transition: box-shadow 0.35s var(--ease);

    /* "backwards" e non "both": a fine animazione il valore torna a quello
       calcolato dallo scorrimento, altrimenti resterebbe congelato */
    animation: cardEnter 0.6s var(--ease-out) backwards;
    animation-delay: calc(var(--enter) * 55ms);
}

@keyframes cardEnter {
    from {
        opacity: 0;
    }
}

.cat-card.is-active {
    box-shadow: 0 28px 64px -26px rgba(0, 0, 0, 0.95);
}

.cat-card-media {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cat-card-scrim {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(180deg,
            rgba(0, 0, 0, 0) 0%,
            rgba(0, 0, 0, 0) 28%,
            rgba(30, 30, 28, 0.55) 62%,
            rgba(18, 18, 16, 0.88) 100%);
}

/* Filetto interno, ottone quando la carta e' al centro */
.cat-card::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 3;
    border-radius: inherit;
    box-shadow: inset 0 0 0 1px var(--line);
    pointer-events: none;
    transition: box-shadow 0.35s var(--ease);
}

.cat-card.is-active::after {
    box-shadow: inset 0 0 0 1px rgba(201, 168, 104, 0.55);
}

.cat-card-body {
    position: absolute;
    z-index: 2;
    left: 0;
    right: 0;
    bottom: 0;
    display: grid;
    gap: 0.3rem;
    padding: clamp(0.9rem, 3.5vw, 1.2rem);
    animation: bodyEnter 0.6s var(--ease-out) backwards;
    animation-delay: calc(var(--enter) * 55ms + 90ms);
}

@keyframes bodyEnter {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
}

.cat-card-index {
    font-family: var(--font-ui);
    font-size: 0.56rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--brass);
}

.cat-card-title {
    font-family: var(--font-display);
    font-size: clamp(1.3rem, 5.4vw, 1.75rem);
    font-weight: 600;
    line-height: 1.02;
    letter-spacing: -0.03em;
    color: #F2EFE6;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.55), 0 1px 3px rgba(0, 0, 0, 0.4);
    text-wrap: balance;
}

/* Il conteggio compare solo sulla carta centrata: meno rumore ai lati */
.cat-card-count {
    font-family: var(--font-ui);
    font-size: 0.55rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--sage);
    opacity: 0;
    transition: opacity 0.3s var(--ease);
}

.cat-card.is-active .cat-card-count {
    opacity: 1;
}

/* --- Frecce (solo dove c'e' un puntatore) ------------------------------- */
.carousel-arrow {
    display: none;
}

@media (min-width: 900px) and (hover: hover) {
    .carousel-arrow {
        position: absolute;
        z-index: 60;
        top: 50%;
        transform: translateY(-50%);
        display: grid;
        place-items: center;
        width: 46px;
        height: 46px;
        border-radius: 50%;
        color: var(--ivory);
        background: var(--glass);
        border: 1px solid var(--line-2);
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
        transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease),
            opacity 0.2s var(--ease);
    }

    .carousel-prev {
        left: clamp(1rem, 4vw, 3rem);
    }

    .carousel-next {
        right: clamp(1rem, 4vw, 3rem);
    }

    .carousel-arrow:hover:not(:disabled) {
        background: var(--tomato);
        border-color: var(--tomato);
    }

    .carousel-arrow:disabled {
        opacity: 0.25;
        cursor: default;
    }
}

/* --------------------------------------------------------------------------
   6. AVANZAMENTO + CATEGORIA SELEZIONATA
   -------------------------------------------------------------------------- */
.carousel-meta {
    width: min(var(--col), 100%);
    margin: 0 auto;
    padding: 0 var(--pad-x);
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.carousel-progress {
    flex: 0 0 auto;
    font-family: var(--font-ui);
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    color: var(--sage-dim);
    font-variant-numeric: tabular-nums;
}

.carousel-bar {
    flex: 1 1 auto;
    height: 2px;
    background: var(--line);
    overflow: hidden;
}

.carousel-bar-fill {
    display: block;
    width: 100%;
    height: 100%;
    background: var(--tomato);
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 0.45s var(--ease-out);
}

.selection {
    width: min(var(--col), 100%);
    margin: 0 auto;
    padding: clamp(1.75rem, 6vw, 2.75rem) var(--pad-x) 0;
}

.selection-head {
    display: none;
}

.selection-head.is-entering > * {
    animation: headEnter 0.5s var(--ease-out) both;
}

.selection-head.is-entering .selection-title {
    animation-delay: 0.05s;
}

.selection-head.is-entering .selection-count {
    animation-delay: 0.1s;
}

@keyframes headEnter {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.selection-index {
    display: block;
    margin-bottom: 0.45rem;
    font-family: var(--font-ui);
    font-size: 0.56rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--brass);
}

.selection-title {
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 7.5vw, 2.75rem);
    font-weight: 600;
    line-height: 0.98;
    letter-spacing: -0.03em;
    color: var(--ivory);
    text-wrap: balance;
}

.selection-count {
    display: block;
    margin-top: 0.5rem;
    font-family: var(--font-ui);
    font-size: 0.56rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--sage-dim);
}

.menu-empty {
    padding: 1.75rem 0;
    font-size: 0.9rem;
    color: var(--text-light);
}

/* --------------------------------------------------------------------------
   7. RIGHE PRODOTTO
   -------------------------------------------------------------------------- */
.product-item {
    display: flex;
    align-items: flex-start;
    gap: clamp(0.9rem, 3.5vw, 1.4rem);
    padding: clamp(1rem, 4vw, 1.35rem) 0;
    border-bottom: 1px solid var(--line);
}

.product-item:last-child {
    border-bottom: 0;
}

.product-img-container {
    flex: 0 0 auto;
    order: 2;
    width: clamp(72px, 20vw, 96px);
    aspect-ratio: 1;
    border-radius: var(--r-sm);
    overflow: hidden;
    background: var(--surface-2);
}

.product-item-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: zoom-in;
    filter: saturate(0.92) brightness(0.97);
    transition: transform 0.45s var(--ease-out), filter 0.3s var(--ease);
}

@media (hover: hover) {
    .product-item:hover .product-item-img {
        transform: scale(1.06);
        filter: saturate(1.05) brightness(1);
    }
}

.product-content {
    flex: 1 1 auto;
    order: 1;
    min-width: 0;
}

.product-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.85rem;
    margin-bottom: 0.3rem;
}

/* Nome in grottesco, non in serif: una lista lunga si legge meglio */
.product-name {
    font-family: var(--font-ui);
    font-size: clamp(1rem, 4vw, 1.1rem);
    font-weight: 600;
    line-height: 1.28;
    letter-spacing: -0.015em;
    color: var(--ivory);
    text-wrap: pretty;
}

.product-price {
    flex: 0 0 auto;
    font-family: var(--font-ui);
    font-size: 0.9rem;
    font-weight: 700;
    /* Niente tabular-nums: allargherebbe la virgola dei decimali ("7 , 50"). */
    font-variant-numeric: normal;
    color: var(--tomato);
    white-space: nowrap;
}

.product-price::after {
    content: "\00a0€";
    font-weight: 500;
    opacity: 0.62;
}

.product-price:empty {
    display: none;
}

.product-desc {
    margin: 0;
    font-size: 0.86rem;
    line-height: 1.6;
    color: var(--sage);
    text-wrap: pretty;
}

.product-desc:empty {
    display: none;
}

/* --------------------------------------------------------------------------
   8. ALLERGENI
   -------------------------------------------------------------------------- */
.product-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.6rem;
}

.product-tags:empty {
    display: none;
}

.allergen-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.allergen-icon-circle {
    width: 6px;
    height: 6px;
    display: block;
    border-radius: 50%;
    /* L'icona Font Awesome a questa scala non serve */
    font-size: 0;
    color: transparent;
    overflow: hidden;
}

.allergen-tag span,
.tag {
    font-size: 0.55rem;
    font-weight: 600;
    color: var(--sage-dim);
}

.tag {
    display: inline-flex;
    align-items: center;
    padding-left: 0.5rem;
    border-left: 1px solid var(--line);
}

/* --------------------------------------------------------------------------
   9. AVVISO QUALITÀ
   -------------------------------------------------------------------------- */
.outro {
    width: min(var(--wrap), 100%);
    margin: 0 auto;
    padding: clamp(3rem, 9vw, 5rem) var(--pad-x) clamp(1rem, 4vw, 2rem);
}

.quality-notice {
    padding-left: clamp(1rem, 4vw, 1.5rem);
    border-left: 1px solid var(--brass);
}

.quality-notice p {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(1.1rem, 4.6vw, 1.55rem);
    font-weight: 400;
    line-height: 1.36;
    letter-spacing: -0.01em;
    color: var(--ivory);
    text-wrap: pretty;
}

.quality-notice strong {
    font-weight: 700;
    color: var(--tomato);
}

/* --------------------------------------------------------------------------
   10. BARRA AZIONI FISSA IN BASSO
   -------------------------------------------------------------------------- */
.hero-info {
    position: fixed;
    z-index: 100;
    left: 0;
    right: 0;
    bottom: 0;
    display: grid;
    grid-template-columns: 1fr 1.5fr 1fr;
    gap: 0.4rem;
    padding: 0.55rem clamp(0.6rem, 3vw, 1rem) calc(0.55rem + var(--sa-b));
    background: var(--void);
    border-top: 1px solid var(--line);
}

/* Il contenuto sfuma sopra la barra invece di finire tagliato di netto.
   Solo quando la barra e' incollata ai bordi: da tablet in su e' flottante
   e una sfumatura larga come lei si vedrebbe come un rettangolo. */
@media (max-width: 699px) {
    .hero-info::before {
        content: "";
        position: absolute;
        left: 0;
        right: 0;
        bottom: 100%;
        height: 2.5rem;
        pointer-events: none;
        background: linear-gradient(180deg, transparent, var(--void));
    }
}

.btn-main,
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 48px;
    padding: 0.7rem 0.6rem;
    border-radius: var(--r-sm);
    font-size: 0.6rem;
    font-weight: 700;
    line-height: 1.1;
    text-align: center;
    transition: background-color 0.2s var(--ease), color 0.2s var(--ease),
        border-color 0.2s var(--ease), transform 0.2s var(--ease);
}

.btn-main {
    color: var(--ivory);
    background: var(--tomato);
}

.btn-main i {
    font-size: 1.4em;
}

.btn-secondary {
    color: var(--sage);
    background: transparent;
    border: 1px solid var(--line-2);
}

@media (hover: hover) {
    .btn-main:hover {
        background: var(--tomato-hi);
    }

    .btn-secondary:hover {
        color: var(--ivory);
        border-color: var(--ivory);
    }
}

.btn-main:active,
.btn-secondary:active {
    transform: scale(0.97);
}

/* --------------------------------------------------------------------------
   11. FOOTER + SOCIAL
   -------------------------------------------------------------------------- */
.footer {
    padding: clamp(2rem, 6vw, 3rem) clamp(1.3rem, 5vw, 3rem) 1.5rem;
    text-align: center;
    border-top: 1px solid var(--line);
}

.footer-divider {
    width: 1px;
    height: 24px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(180deg, var(--brass), transparent);
}

.footer p {
    margin: 0 0 0.5rem;
    font-size: 0.75rem;
    line-height: 1.7;
    color: var(--sage-dim);
}

.footer a {
    color: var(--sage);
    transition: color 0.2s var(--ease);
}

.footer a:hover {
    color: var(--tomato);
}

.footer .coperto-info {
    display: inline-block;
    margin: 0.85rem 0;
    font-size: 0.58rem;
    font-weight: 700;
    color: var(--brass);
}

.footer .legal-footer {
    margin-top: 1rem;
    font-size: 0.68rem;
    color: var(--sage-dim);
    opacity: 0.75;
}

.footer .legal-footer a {
    color: inherit;
    text-decoration: underline;
}

/* I social non stanno piu' sospesi sullo schermo: chiudono la pagina */
.social-fixed {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    padding: 0 var(--pad-x) calc(var(--bar-h) + var(--sa-b) + 1.5rem);
}

.social-fixed a {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: var(--r-sm);
    font-size: 0.95rem;
    color: var(--sage);
    border: 1px solid var(--line);
    transition: color 0.2s var(--ease), background-color 0.2s var(--ease),
        border-color 0.2s var(--ease);
}

@media (hover: hover) {
    .social-fixed a:hover {
        color: var(--ivory);
        background: var(--tomato);
        border-color: var(--tomato);
    }
}

.social-fixed a:active {
    transform: scale(0.94);
}

.contest-social-btn {
    color: var(--ivory) !important;
    background: var(--tomato) !important;
    border-color: var(--tomato) !important;
}

.contest-social-btn.is-disabled,
.social-fixed a[hidden] {
    display: none !important;
}

/* --------------------------------------------------------------------------
   12. SELETTORE LINGUA
   -------------------------------------------------------------------------- */
.lang-switcher-fixed {
    position: fixed;
    top: calc(0.5rem + var(--sa-t));
    right: calc(0.7rem + var(--sa-r));
    z-index: 95;
    display: flex;
    gap: 2px;
    padding: 3px;
    border-radius: var(--r-pill);
    background: var(--glass);
    border: 1px solid var(--line);
    backdrop-filter: blur(18px) saturate(1.2);
    -webkit-backdrop-filter: blur(18px) saturate(1.2);
}

.theme-toggle {
    position: fixed;
    top: calc(0.5rem + var(--sa-t));
    left: calc(0.7rem + var(--sa-l));
    z-index: 96;
    min-height: 40px;
    padding: 0 0.9rem;
    border-radius: var(--r-pill);
    color: var(--ivory);
    background: var(--glass);
    border: 1px solid var(--line);
    font-family: var(--font-ui);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    backdrop-filter: blur(18px) saturate(1.2);
    -webkit-backdrop-filter: blur(18px) saturate(1.2);
    transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease), transform 0.2s var(--ease);
}

.theme-toggle:hover {
    color: #fff;
    background: var(--tomato);
    border-color: var(--tomato);
}

.theme-toggle:active {
    transform: scale(0.96);
}

html:has(#about-view.active) .theme-toggle,
html:has(#privacy-view.active) .theme-toggle {
    top: calc(3.55rem + var(--sa-t));
}

.lang-flag-btn {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: var(--r-pill);
    transition: background-color 0.2s var(--ease);
}

.lang-flag-btn img {
    width: 19px;
    height: 13px;
    object-fit: cover;
    border-radius: 1px;
    opacity: 0.42;
    filter: grayscale(1);
    transition: opacity 0.2s var(--ease), filter 0.2s var(--ease);
}

.lang-flag-btn:hover img {
    opacity: 0.85;
    filter: none;
}

.lang-flag-btn.active {
    background: var(--tomato);
}

.lang-flag-btn.active img {
    opacity: 1;
    filter: none;
}

.lang-flag-btn:active {
    transform: scale(0.94);
}

/* --------------------------------------------------------------------------
   13. TASTO INDIETRO (chi siamo / privacy)
   -------------------------------------------------------------------------- */
.btn-back {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: var(--r-sm);
    font-size: 0.85rem;
    color: var(--ivory);
    background: var(--glass);
    border: 1px solid var(--line-2);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: color 0.2s var(--ease), background-color 0.2s var(--ease),
        border-color 0.2s var(--ease), transform 0.25s var(--ease-out);
}

@media (hover: hover) {
    .btn-back:hover {
        background: var(--tomato);
        border-color: var(--tomato);
        transform: translateX(-2px);
    }
}

.btn-back:active {
    transform: scale(0.93);
}

.corner-back {
    position: absolute;
    z-index: 5;
    top: calc(0.85rem + var(--sa-t));
    left: calc(0.85rem + var(--sa-l));
}

.btn-back-privacy {
    position: fixed;
    z-index: 95;
    top: calc(0.85rem + var(--sa-t));
    left: calc(0.85rem + var(--sa-l));
}

/* --------------------------------------------------------------------------
   14. CHI SIAMO
   -------------------------------------------------------------------------- */
.hero {
    position: relative;
    isolation: isolate;
    min-height: 36svh;
    display: grid;
    place-items: center;
    padding: calc(4rem + var(--sa-t)) var(--pad-x) 3rem;
    background-size: cover;
    background-position: center;
    background-color: var(--surface);
    overflow: hidden;
}

.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: linear-gradient(180deg, transparent 40%, var(--void) 100%);
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    display: grid;
    justify-items: center;
    gap: 1.3rem;
}

.about-logo {
    width: clamp(170px, 48vw, 260px);
    filter: drop-shadow(0 8px 36px rgba(0, 0, 0, 0.9));
}

.brand-divider {
    width: 1px;
    height: 22px;
    background: linear-gradient(180deg, var(--brass), transparent);
}

.about-container {
    width: min(var(--col), 100%);
    margin: 0 auto;
    padding: clamp(2rem, 7vw, 3.5rem) var(--pad-x) 4rem;
}

.about-main-title {
    font-size: clamp(1.9rem, 8.5vw, 3.2rem);
    font-weight: 600;
    line-height: 1;
    color: var(--ivory);
    text-wrap: balance;
}

.about-divider {
    width: 100%;
    height: 1px;
    margin: 1.9rem 0;
    background: var(--brass);
    opacity: 0.5;
}

.about-content h4 {
    margin-bottom: 1rem;
    font-size: 0.58rem;
    font-weight: 700;
    color: var(--brass);
}

.about-content p {
    margin-bottom: 1.1rem;
    font-size: 0.93rem;
    line-height: 1.78;
    color: var(--sage);
    text-wrap: pretty;
}

.about-content p:first-of-type {
    font-family: var(--font-display);
    font-size: clamp(1.1rem, 4.6vw, 1.45rem);
    font-weight: 400;
    line-height: 1.42;
    letter-spacing: -0.01em;
    color: var(--ivory);
}

.about-premium-decoration {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    margin-top: 2.25rem;
}

.decoration-line {
    flex: 1;
    height: 1px;
    background: var(--line);
}

.gold-icon {
    color: var(--brass);
    font-size: 0.8rem;
}

/* --------------------------------------------------------------------------
   15. PRIVACY / LEGAL
   -------------------------------------------------------------------------- */
.category-header {
    width: min(var(--col), 100%);
    margin: 0 auto;
    padding: calc(4.5rem + var(--sa-t)) var(--pad-x) 0;
}

.category-header h2 {
    font-size: clamp(1.8rem, 8vw, 2.9rem);
    font-weight: 600;
    color: var(--ivory);
}

.legal-container {
    width: min(var(--col), 100%);
    margin: 0 auto;
    padding: clamp(1.5rem, 5vw, 2.5rem) var(--pad-x) 4rem;
}

.legal-content h1 {
    margin-bottom: 0.75rem;
    font-size: clamp(1.7rem, 7vw, 2.5rem);
    font-weight: 600;
    color: var(--ivory);
}

.legal-content h2 {
    margin-bottom: 0.65rem;
    font-size: 0.58rem;
    font-weight: 700;
    color: var(--brass);
}

.legal-content section {
    margin-bottom: 1.9rem;
    padding-bottom: 1.9rem;
    border-bottom: 1px solid var(--line);
}

.legal-content p,
.legal-content li {
    font-size: 0.87rem;
    line-height: 1.78;
    color: var(--sage);
}

.legal-content p {
    margin-bottom: 0.7rem;
}

.legal-content ul {
    margin: 0 0 0.9rem 1rem;
    display: grid;
    gap: 0.25rem;
}

.legal-content li::marker {
    color: var(--brass);
}

.legal-content strong {
    color: var(--ivory);
    font-weight: 600;
}

.legal-content a {
    color: var(--tomato);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.last-update {
    margin-bottom: 1.9rem !important;
    font-size: 0.58rem !important;
    font-weight: 600;
    color: var(--sage-dim) !important;
}

.legal-separator {
    height: 1px;
    margin: 2.75rem 0;
    border: 0;
    background: var(--brass);
    opacity: 0.4;
}

/* --------------------------------------------------------------------------
   16. LIGHTBOX
   -------------------------------------------------------------------------- */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 300;
    background: rgba(5, 8, 7, 0.97);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    animation: fadeIn 0.25s var(--ease);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.lightbox-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: min(92vw, 900px);
    max-height: 80svh;
    width: auto;
    height: auto;
    border-radius: var(--r-md);
    box-shadow: var(--shadow-lg);
    animation: zoomIn 0.3s var(--ease-out);
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: var(--r-sm);
    color: var(--ivory);
    background: rgba(24, 33, 29, 0.9);
    border: 1px solid var(--line-2);
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.lightbox-close {
    top: calc(0.9rem + var(--sa-t));
    right: calc(0.9rem + var(--sa-r));
    font-size: 1.6rem;
    line-height: 1;
}

.lightbox-prev,
.lightbox-next {
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.05rem;
}

.lightbox-prev {
    left: calc(0.85rem + var(--sa-l));
}

.lightbox-next {
    right: calc(0.85rem + var(--sa-r));
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    background: var(--tomato);
    border-color: var(--tomato);
}

/* --------------------------------------------------------------------------
   17. BREAKPOINT
   -------------------------------------------------------------------------- */

/* Da tablet in su: barra azioni flottante, non incollata ai bordi */
@media (min-width: 700px) {
    :root {
        --bar-h: 5.8rem;
    }

    .hero-info {
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        bottom: 1.1rem;
        width: min(640px, calc(100% - 3rem));
        gap: 0.5rem;
        padding: 0.5rem;
        border: 1px solid var(--line);
        border-radius: var(--r-md);
        box-shadow: var(--shadow-md);
    }

    .btn-main,
    .btn-secondary {
        font-size: 0.63rem;
    }

    .masthead {
        min-height: 21svh;
    }
}

/* Desktop: carte piu' grandi e prodotti su due colonne */
@media (min-width: 1000px) {
    .carousel-track {
        --card-w: min(34vw, 340px);
    }

    :root {
        --col: 900px;
    }

    .selection-body {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: clamp(2rem, 4vw, 3.5rem);
    }

    /* Con due colonne il filetto va rimosso alle ultime righe di entrambe */
    .selection-body .product-item:last-child,
    .selection-body .product-item:nth-last-child(2):nth-child(odd) {
        border-bottom: 0;
    }
}

/* --------------------------------------------------------------------------
   18. ACCESSIBILITÀ / STAMPA
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {

    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}

@media print {
    .lang-switcher-fixed,
    .social-fixed,
    .hero-info,
    .btn-back,
    .lightbox,
    .carousel,
    .carousel-meta,
    .masthead-media,
    .masthead-scrim {
        display: none !important;
    }

    body {
        background: #fff;
        color: #000;
    }
}

/* --------------------------------------------------------------------------
   10. RIFINITURE UI (2026-09-29)
   - Scrim hero piu' scuro per far respirare il logo/titolo
   - Ombra logo piu' morbida e centrata
   - Carte categoria: leggera profondita' e stato hover piu' nitido
   - Righe prodotto: divisori piu' definiti, hover sfondo delicato
   - Pulsanti azione fissi: contrasto e ombreggiatura migliorata
   -------------------------------------------------------------------------- */
.masthead-media {
    filter: contrast(1.1) saturate(0.92) brightness(0.5);
}

.masthead-scrim {
    background:
        radial-gradient(58% 40% at 50% 42%, rgba(0, 0, 0, 0.35) 0%, transparent 72%),
        linear-gradient(180deg, rgba(6, 8, 6, 0.55) 0%, rgba(6, 8, 6, 0.78) 55%, var(--void) 100%);
}

.brand-logo {
    filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.65)) drop-shadow(0 2px 8px rgba(0, 0, 0, 0.4));
}

.cat-card {
    box-shadow: 0 12px 30px -18px rgba(20, 22, 20, 0.35);
    transition: transform 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out);
}

@media (hover: hover) {
    .cat-card:hover:not(.is-active) {
        transform: translateY(-2px);
        box-shadow: 0 20px 44px -22px rgba(20, 22, 20, 0.45);
    }
}

.cat-card.is-active {
    box-shadow: 0 24px 60px -24px rgba(20, 22, 20, 0.55);
}

.product-item {
    border-radius: var(--r-md);
    padding-left: 0.4rem;
    padding-right: 0.4rem;
    transition: background-color 0.25s var(--ease);
}

.product-item.is-no-image .product-content {
    flex-basis: 100%;
}

@media (hover: hover) {
    .product-item:hover {
        background-color: color-mix(in srgb, var(--surface-2) 60%, transparent);
    }
}

.selection-title {
    letter-spacing: 0.01em;
}

.btn-main,
.btn-secondary {
    box-shadow: 0 10px 24px -14px rgba(24, 24, 22, 0.35);
    transition: transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out), background-color 0.25s var(--ease);
}

.btn-main {
    box-shadow: 0 14px 32px -14px rgba(226, 74, 46, 0.55);
}

@media (hover: hover) {
    .btn-main:hover,
    .btn-secondary:hover {
        transform: translateY(-1px);
    }
    .btn-main:hover {
        box-shadow: 0 18px 40px -14px rgba(226, 74, 46, 0.7);
    }
}

.hero-info {
    backdrop-filter: blur(10px) saturate(1.05);
    -webkit-backdrop-filter: blur(10px) saturate(1.05);
}

html[data-theme="dark"] .masthead-scrim {
    background:
        radial-gradient(58% 40% at 50% 42%, rgba(0, 0, 0, 0.45) 0%, transparent 72%),
        linear-gradient(180deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.88) 55%, var(--void) 100%);
}

