/* =====================================================================
   FrolliAMOci — Base, layout e componenti condivisi
   Mobile-first (riferimento 360×800). Breakpoint: 768 tablet · 1024 desktop.
   Nessun colore/raggio/spazio "cablato": tutto da tokens.css
   ===================================================================== */

/* ---------- Reset essenziale ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body, h1, h2, h3, p, ul, figure { margin: 0; }
ul[class] { list-style: none; padding: 0; }
img { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

@view-transition { navigation: auto; } /* transizione morbida tra pagine (browser compatibili) */

body {
    min-height: 100dvh;
    font-family: var(--font-ui);
    font-size: var(--fs-md);
    font-weight: var(--fw-regular);
    line-height: var(--lh-base);
    color: var(--color-text);
    background: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
    overflow-x: hidden;
}

/* ---------- Focus visibile (tastiera) ---------- */
:focus-visible {
    outline: 3px solid var(--color-focus);
    outline-offset: 3px;
    border-radius: var(--radius-sm);
}
.skip-link {
    position: absolute; left: var(--space-3); top: -100px; z-index: 100;
    padding: var(--space-3) var(--space-4);
    background: var(--color-primary); color: var(--color-primary-contrast);
    border-radius: var(--radius-md); font-weight: var(--fw-bold); text-decoration: none;
}
.skip-link:focus { top: var(--space-3); }

/* ---------- Utility accessibilità ---------- */
.sr-only {
    position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Icone (Font Awesome Free, sprite locale) ---------- */
.icon { width: 1.15em; height: 1.15em; flex: none; fill: currentColor; vertical-align: -0.2em; }
.icon--sm { width: 0.95em; height: 0.95em; }
.icon--lg { width: 1.5rem; height: 1.5rem; }
.icon--img { object-fit: contain; border-radius: 4px; }   /* icona-immagine di un tema grafico (v1.31) */

/* =====================================================================
   LAYOUT
   ===================================================================== */
.app-shell { min-height: 100dvh; }
.app-main {
    display: flex; flex-direction: column;
    min-height: 100dvh;
    /* spazio per la bottom nav + safe area: nessun contenuto coperto */
    padding-bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + var(--space-2));
}
.app-content {
    flex: 1;
    width: 100%;
    max-width: var(--content-max);
    margin-inline: auto;
    padding-inline: var(--page-gutter);
    outline: none;
    animation: page-in var(--dur-slow) var(--ease-out) both;
}
@keyframes page-in { from { opacity: 0; transform: translateY(6px); } }

/* ---------- AppHeader ---------- */
.app-header {
    display: grid;
    grid-template-columns: var(--touch-cta) 1fr var(--touch-cta);
    align-items: center;
    height: var(--header-h);
    padding: var(--safe-top) var(--page-gutter) 0;
    max-width: var(--content-max);
    width: 100%;
    margin-inline: auto;
}
.app-logo { display: inline-flex; justify-self: center; align-items: center; height: 100%; border-radius: var(--radius-sm); }
/* Il logo non viene MAI deformato: dimensione controllata solo da max-width/max-height, height:auto */
.app-logo__img { width: auto; height: auto; max-width: min(190px, 52vw); max-height: 58px; }

.icon-button {
    position: relative;
    display: inline-grid; place-items: center;
    width: var(--touch-cta); height: var(--touch-cta);
    border: 0;
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--color-text);
    text-decoration: none;
    cursor: pointer;
    transition: background-color var(--dur-fast) ease, transform var(--dur-fast) ease;
}
.icon-button:hover { background: var(--color-surface-alt); }
.icon-button:active { transform: scale(0.94); }
.app-header__bell { justify-self: end; }

/* ---------- Badge ---------- */
.badge {
    display: inline-flex; align-items: center; justify-content: center;
    font-size: var(--fs-xs); font-weight: var(--fw-bold); line-height: 1;
    border-radius: var(--radius-pill);
    animation: badge-in var(--dur-slow) var(--ease-out) both;
}
.badge--dot {
    position: absolute; top: 10px; right: 11px;
    width: 10px; height: 10px;
    background: var(--color-accent);
    box-shadow: 0 0 0 2px var(--color-bg);
}
.badge--count { min-width: 20px; height: 20px; padding: 0 6px; background: var(--color-accent); color: #fff; }
.badge--soft { padding: 5px 10px; background: var(--tint-rose); color: var(--color-accent-strong); }
@keyframes badge-in { from { transform: scale(0.4); opacity: 0; } }

/* ---------- Status text (aperta / chiusa) ---------- */
.status-text {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: var(--fs-xs); font-weight: var(--fw-bold);
    color: var(--color-text-muted);
}
.status-text::before {
    content: ""; width: 7px; height: 7px; border-radius: 50%;
    background: currentColor; flex: none;
}
.status-text--open { color: var(--color-success); }
.status-text--closed { color: var(--color-caramel-strong); }

/* ---------- Bottoni ---------- */
.button {
    display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
    min-height: var(--touch-cta);
    padding: 0 var(--space-6);
    border: 0; border-radius: var(--radius-pill);
    font-size: var(--fs-md); font-weight: var(--fw-bold);
    text-decoration: none; cursor: pointer;
    transition: background-color var(--dur-fast) ease, transform var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
}
.button:active { transform: scale(0.97); }
.button--primary { background: var(--color-primary); color: var(--color-primary-contrast); box-shadow: 0 6px 16px -8px rgba(62, 32, 22, 0.6); }
.button--primary:hover { background: var(--color-primary-hover); }
.button--secondary { background: var(--color-surface); color: var(--color-text); box-shadow: inset 0 0 0 1.5px var(--color-border-strong); }
.button--secondary:hover { background: var(--color-surface-alt); }
.button--block { width: 100%; }
.button:disabled, .button[aria-disabled="true"] { opacity: 0.5; pointer-events: none; }

/* ---------- ShopSelector ---------- */
.shop-selector {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: var(--space-3);
    min-height: 76px;
    padding: var(--space-2) var(--space-3) var(--space-2) var(--space-2);
    background: var(--color-surface-alt);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--color-text);
    box-shadow: inset 0 0 0 1px var(--color-border);
    transition: transform var(--dur-fast) ease, background-color var(--dur-fast) ease;
}
.shop-selector:hover { background: var(--color-bg-deep); }
.shop-selector:active { transform: scale(0.985); }
.shop-selector.is-current { box-shadow: inset 0 0 0 2px var(--color-accent); }
.shop-selector__thumb {
    width: 64px; height: 64px;              /* box stilizzato: indipendente dal file (600×600) */
    border-radius: 50%;
    overflow: hidden;
    background: var(--tint-caramel);
    box-shadow: 0 0 0 3px var(--color-surface);
    flex: none;
}
.shop-selector__img { width: 100%; height: 100%; object-fit: cover; }
.shop-selector__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.shop-selector__name {
    font-size: var(--fs-lg); font-weight: var(--fw-heavy); line-height: var(--lh-tight);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.shop-selector__address {
    display: flex; align-items: center; gap: 6px;
    font-size: var(--fs-sm); color: var(--color-text-muted);
    min-width: 0;
}
.shop-selector__address span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shop-selector__chevron { display: grid; place-items: center; min-width: 28px; color: var(--color-text); }

/* ---------- Back link & titoli pagina ---------- */
.back-link {
    display: inline-flex; align-items: center; gap: var(--space-1);
    min-height: var(--touch-min);
    padding-right: var(--space-3);
    font-weight: var(--fw-bold); font-size: var(--fs-sm);
    color: var(--color-text-muted); text-decoration: none;
}
.back-link:hover { color: var(--color-text); }
.page-title { font-size: var(--fs-2xl); font-weight: var(--fw-heavy); line-height: var(--lh-tight); margin: var(--space-2) 0 var(--space-5); }

/* ---------- Placeholder moduli ---------- */
.placeholder-card {
    display: flex; flex-direction: column; align-items: center; text-align: center;
    gap: var(--space-3);
    margin-top: var(--space-4);
    padding: var(--space-8) var(--space-5);
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
}
.placeholder-card__icon {
    display: grid; place-items: center;
    width: 88px; height: 88px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #fff 0%, var(--tint-rose) 70%);
    color: var(--color-accent);
    font-size: 2.3rem;
    margin-bottom: var(--space-2);
}
.placeholder-card__title { font-size: var(--fs-2xl); font-weight: var(--fw-heavy); line-height: var(--lh-tight); }
.placeholder-card__text { color: var(--color-text-muted); margin-bottom: var(--space-3); }

/* ---------- Elenco pasticcerie ---------- */
.shop-list { display: grid; gap: var(--space-3); }

/* ---------- Info list (bottom sheet) ---------- */
.info-list { display: grid; gap: var(--space-3); margin: var(--space-5) 0; }
.info-list__item { display: flex; align-items: flex-start; gap: var(--space-3); font-size: var(--fs-md); }
.info-list__item .icon { color: var(--color-accent); margin-top: 3px; }
.info-list__item a { font-weight: var(--fw-bold); }

/* ---------- ErrorState ---------- */
.error-state {
    display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--space-3);
    max-width: 460px; margin: var(--space-6) auto;
    padding: var(--space-8) var(--space-5);
    background: var(--color-surface); border-radius: var(--radius-xl); box-shadow: var(--shadow-card);
}
.error-state__icon { font-size: 2.4rem; color: var(--color-accent); }
.error-state__code { font-size: var(--fs-sm); font-weight: var(--fw-heavy); letter-spacing: 0.12em; color: var(--color-text-muted); }
.error-state__title { font-size: var(--fs-xl); font-weight: var(--fw-heavy); line-height: var(--lh-tight); }
.error-state__text { color: var(--color-text-muted); margin-bottom: var(--space-3); }
.error-state__debug {
    width: 100%; max-height: 240px; overflow: auto; text-align: left;
    padding: var(--space-3); border-radius: var(--radius-sm);
    background: #2a1710; color: #ffd9c9; font-size: var(--fs-xs); white-space: pre-wrap;
}

/* ---------- Skeleton ---------- */
.skeleton {
    display: block;
    background: linear-gradient(90deg, var(--color-bg-deep) 0%, var(--color-surface) 50%, var(--color-bg-deep) 100%);
    background-size: 200% 100%;
    border-radius: var(--radius-sm);
    animation: skeleton 1.2s ease-in-out infinite;
}
.skeleton--line { height: 0.9em; width: 100%; }
.skeleton--block { height: 120px; width: 100%; border-radius: var(--radius-lg); }
.skeleton--circle { width: 48px; height: 48px; border-radius: 50%; }
@keyframes skeleton { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* ---------- Dati live non aggiornati (offline / cache) ---------- */
[data-live].is-stale { opacity: 0.55; }
[data-live].is-stale::after { content: " · non aggiornato"; }

/* ---------- Footer / copyright ---------- */
.app-footer { padding: var(--space-6) var(--page-gutter) var(--space-3); text-align: center; }
.app-footer__copy { font-size: var(--fs-xs); color: var(--color-text-muted); }
.app-footer__copy a { font-weight: var(--fw-bold); color: var(--color-text); text-decoration: none; }
.app-footer__copy a:hover { text-decoration: underline; }

/* ---------- Preferito (cuore) — componente condiviso ---------- */
.favorite {
    position: relative; z-index: 2;
    display: grid; place-items: center; flex: none;
    width: var(--touch-min); height: var(--touch-min);
    border: 0; border-radius: 50%; background: transparent;
    color: var(--color-text); font-size: 1.35rem; cursor: pointer;
    transition: transform var(--dur-fast) ease, background-color var(--dur-fast) ease;
}
.favorite:hover { background: var(--tint-rose); }
.favorite:active { transform: scale(0.88); }
.favorite .favorite__on { display: none; color: var(--color-accent); }
.favorite.is-on .favorite__on { display: block; animation: heart-pop 320ms var(--ease-out); }
.favorite.is-on .favorite__off { display: none; }
@keyframes heart-pop { 0% { transform: scale(0.6); } 60% { transform: scale(1.2); } 100% { transform: scale(1); } }

/* ---------- Errore di form ---------- */
.form-error {
    display: flex; gap: var(--space-2); align-items: flex-start;
    padding: var(--space-3) var(--space-4); margin-bottom: var(--space-3);
    border-radius: var(--radius-md);
    background: #FFF1EF; color: var(--color-danger);
    font-size: var(--fs-sm); font-weight: var(--fw-bold);
}

/* ---------- Pulsanti condivisi (Schermata 4 e successive) ---------- */
/* CTA caramello: azione principale di un flusso ("Continua", "Invia") */
.cake-cta {
    display: inline-flex; align-items: center; justify-content: center; gap: var(--space-3);
    min-height: 56px; padding: 0 var(--space-6);
    border: 0; border-radius: var(--radius-pill);
    background: linear-gradient(180deg, #C9803F 0%, #9A5418 100%);
    color: #fff; font: inherit; font-size: 1.1rem; font-weight: var(--fw-heavy); text-decoration: none; cursor: pointer;
    box-shadow: 0 12px 24px -14px rgba(122, 64, 18, 0.9);
    transition: transform var(--dur-fast) ease, filter var(--dur-fast) ease, opacity var(--dur-fast) ease;
    touch-action: manipulation;
}
.cake-cta:hover { filter: brightness(1.05); }
.cake-cta:active { transform: scale(0.98); }
.cake-cta[aria-busy="true"] { cursor: progress; filter: saturate(0.75); }
.cake-cta:disabled { opacity: 0.55; cursor: not-allowed; }
.cake-cta .icon { transition: transform var(--dur-base) var(--ease-out); }
.cake-cta:hover .icon:last-child { transform: translateX(3px); }

/* Pulsante morbido secondario */
.btn-soft {
    display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
    min-height: var(--touch-cta); padding: 0 var(--space-5);
    border: 0; border-radius: var(--radius-pill);
    background: #fff; color: var(--color-primary);
    font: inherit; font-weight: var(--fw-heavy); text-decoration: none; cursor: pointer;
    box-shadow: var(--shadow-card), inset 0 0 0 1px var(--color-border-strong);
    transition: transform var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
    touch-action: manipulation;
}
.btn-soft:hover { box-shadow: var(--shadow-raised), inset 0 0 0 1px var(--color-border-strong); }
.btn-soft:active { transform: scale(0.97); }
.btn-soft:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-soft--strong { background: var(--color-primary); color: var(--color-primary-contrast); box-shadow: 0 10px 22px -14px rgba(62, 32, 22, 0.9); }

/* Campi di form morbidi (Schermata 4 e successive) */
.cake-field { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.cake-field[hidden] { display: none; }
.cake-field__label { display: flex; align-items: center; gap: var(--space-2); font-size: var(--fs-sm); font-weight: var(--fw-heavy); }
.cake-field__label .icon { color: var(--color-caramel-strong); }
.cake-input {
    width: 100%; min-height: var(--touch-cta);
    padding: var(--space-3) var(--space-4);
    border: 0; border-radius: var(--radius-md);
    background: #fff; color: var(--color-text);
    font: inherit; font-size: 1rem;   /* ≥16px: niente zoom automatico su iOS */
    box-shadow: var(--shadow-card), inset 0 0 0 1px var(--color-border);
    transition: box-shadow var(--dur-fast) ease;
}
.cake-input:focus { outline: none; box-shadow: var(--shadow-card), inset 0 0 0 2px var(--color-accent); }
.cake-input::placeholder { color: #A68C7F; }
.cake-input--area { resize: vertical; min-height: 112px; line-height: var(--lh-base); }
.cake-input.is-invalid { box-shadow: inset 0 0 0 2px var(--color-danger); }

/* Riepilogo a righe (richiesta torta) */
.summary__list { display: flex; flex-direction: column; margin: 0; }
.summary__row {
    display: grid; grid-template-columns: minmax(96px, 34%) 1fr auto; align-items: start; gap: var(--space-3);
    padding: var(--space-3) 0; border-bottom: 1px dashed var(--color-border-strong);
}
.summary__row:last-child { border-bottom: 0; }
.summary__label { font-size: var(--fs-sm); color: var(--color-text-muted); font-weight: var(--fw-bold); padding-top: 2px; }
.summary__value { margin: 0; font-weight: var(--fw-bold); overflow-wrap: anywhere; }
.price-hint {
    margin: var(--space-4) 0 0; padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md); background: var(--tint-butter);
    font-size: var(--fs-sm); line-height: var(--lh-base);
}
.price-hint strong { display: block; font-size: var(--fs-md); }
.preview__disclaimer {
    display: flex; gap: var(--space-2); align-items: flex-start;
    margin-top: var(--space-3);
    font-size: var(--fs-xs); color: var(--color-text-muted); line-height: 1.35;
}
.preview__disclaimer .icon { flex: none; margin-top: 1px; }

/* =====================================================================
   BOTTOM NAVIGATION (mobile / tablet)
   ===================================================================== */
.bottom-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    padding-bottom: var(--safe-bottom);
    background: var(--color-surface-glass);
    -webkit-backdrop-filter: saturate(1.4) blur(14px);
    backdrop-filter: saturate(1.4) blur(14px);
    border-top: 1px solid var(--color-border);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    box-shadow: var(--shadow-nav);
}
.bottom-nav__list {
    display: flex;
    max-width: 640px; margin: 0 auto;
    height: var(--bottom-nav-h);
}
.bottom-nav__cell { flex: 1; min-width: 0; }
.bottom-nav__item {
    position: relative;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    height: 100%; min-height: var(--touch-cta);
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: var(--fs-xs); font-weight: var(--fw-bold);
    transition: color var(--dur-fast) ease;
}
.bottom-nav__icon { width: 1.4rem; height: 1.4rem; transition: transform var(--dur-base) var(--ease-out); }
.bottom-nav__item:active .bottom-nav__icon { transform: scale(0.88); }
.bottom-nav__item.is-active { color: var(--color-accent-strong); }
.bottom-nav__item.is-active::after {
    content: ""; position: absolute; bottom: 5px;
    width: 18px; height: 4px; border-radius: var(--radius-pill);
    background: var(--color-accent);
}
.bottom-nav__label { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* =====================================================================
   DESKTOP SIDEBAR (nascosta sotto i 1024px)
   ===================================================================== */
.desktop-sidebar { display: none; }

/* =====================================================================
   TOAST / BOTTOM SHEET / MODAL
   ===================================================================== */
.toast-region {
    position: fixed; z-index: 60;
    left: 50%; transform: translateX(-50%);
    bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + var(--space-3));
    display: grid; gap: var(--space-2);
    width: min(440px, calc(100% - 2 * var(--page-gutter)));
    pointer-events: none;
}
.toast {
    display: flex; align-items: center; gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: var(--color-primary); color: var(--color-primary-contrast);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-raised);
    font-size: var(--fs-sm); font-weight: var(--fw-bold);
    pointer-events: auto;
    animation: toast-in var(--dur-slow) var(--ease-out) both;
}
.toast--warning { background: #6B3A1A; }
.toast--success { background: #2F6B45; }
.toast.is-leaving { animation: toast-out var(--dur-base) ease both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(0.98); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }

dialog.bottom-sheet, dialog.modal {
    border: 0; padding: 0;
    color: var(--color-text);
    background: var(--color-surface);
    box-shadow: var(--shadow-raised);
}
dialog.bottom-sheet::backdrop, dialog.modal::backdrop { background: var(--color-overlay); }
dialog.bottom-sheet {
    position: fixed; inset: auto 0 0 0;
    width: 100%; max-width: 560px; margin: 0 auto;
    max-height: 88dvh; overflow: auto;
    padding: var(--space-3) var(--space-5) calc(var(--space-6) + var(--safe-bottom));
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}
dialog.bottom-sheet[open] { animation: sheet-in var(--dur-slow) var(--ease-out) both; }
dialog.bottom-sheet.is-closing { animation: sheet-out var(--dur-base) ease both; }
@keyframes sheet-in { from { transform: translateY(100%); } }
@keyframes sheet-out { to { transform: translateY(100%); } }
.bottom-sheet__handle {
    display: block; width: 44px; height: 5px; margin: 0 auto var(--space-4);
    border-radius: var(--radius-pill); background: var(--color-border-strong);
}
.bottom-sheet__close { position: absolute; top: var(--space-2); right: var(--space-2); }
dialog.modal {
    width: min(480px, calc(100% - 2 * var(--page-gutter)));
    padding: var(--space-6);
    border-radius: var(--radius-xl);
}
dialog.modal[open] { animation: modal-in var(--dur-base) var(--ease-out) both; }
@keyframes modal-in { from { opacity: 0; transform: scale(0.96); } }

.shop-sheet__head { display: flex; align-items: center; gap: var(--space-4); padding-right: var(--space-7); }
[tabindex="-1"]:focus { outline: none; }
.shop-sheet__thumb { width: 72px; height: 72px; border-radius: 50%; overflow: hidden; flex: none; background: var(--tint-caramel); }
.shop-sheet__title { font-size: var(--fs-xl); font-weight: var(--fw-heavy); line-height: var(--lh-tight); margin-bottom: 4px; }
/* v1.28 — riga finale della scheda: pulsante (Tutte le pasticcerie | Chiudi) e, se l'attività è contattabile, WhatsApp a destra */
.shop-sheet__actions { display: grid; gap: var(--space-3); margin-top: var(--space-5); }
.shop-sheet__actions--wa { grid-template-columns: minmax(0, 1fr) auto; align-items: stretch; }
.wa-pick { position: relative; }
.wa-pick__btn {
    display: grid; place-items: center; width: 56px; height: 100%; min-height: 52px; border-radius: var(--radius-pill, 999px);
    background: #25D366; color: #fff; cursor: pointer; list-style: none;
    box-shadow: 0 8px 18px -10px rgba(18, 140, 74, 0.9), inset 0 -3px 0 rgba(0, 0, 0, 0.12);
    transition: transform var(--dur-fast, 0.15s) ease, background var(--dur-fast, 0.15s) ease;
}
.wa-pick__btn::-webkit-details-marker { display: none; }
.wa-pick__btn::marker { content: ""; }
.wa-pick__btn:hover { background: #1FBE5B; }
.wa-pick__btn:active { transform: scale(0.95); }
.wa-pick__btn:focus-visible { outline: 3px solid var(--color-text); outline-offset: 3px; }
.wa-pick[open] .wa-pick__btn { background: #128C4A; }
.wa-pick__menu {
    position: absolute; right: 0; bottom: calc(100% + 10px); z-index: 2; width: min(300px, calc(100vw - 2 * var(--page-gutter, 16px)));
    display: grid; gap: 6px; padding: var(--space-3); border-radius: var(--radius-lg, 20px);
    background: var(--color-surface); box-shadow: 0 18px 40px -16px rgba(62, 32, 22, 0.45), 0 0 0 1px var(--color-border-strong);
    animation: wa-pick-in 0.18s var(--ease-out, ease-out) both; transform-origin: bottom right;
}
@keyframes wa-pick-in { from { opacity: 0; transform: translateY(6px) scale(0.97); } }
@media (prefers-reduced-motion: reduce) { .wa-pick__menu { animation: none; } }
.wa-pick__q { margin: 0 4px 4px; font-weight: var(--fw-heavy); font-size: var(--fs-sm); }
.wa-pick__q span { display: block; font-weight: var(--fw-bold); color: var(--color-text-muted); font-variant-numeric: tabular-nums; }
.wa-pick__opt {
    display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 10px; align-items: center; padding: 8px; border-radius: var(--radius-md, 14px);
    color: var(--color-text); text-decoration: none; background: var(--color-surface-alt);
}
.wa-pick__opt:hover, .wa-pick__opt:focus-visible { background: var(--tint-caramel, var(--color-surface-alt)); }
.wa-pick__opt strong { display: block; font-size: var(--fs-sm); }
.wa-pick__opt small { display: block; font-size: var(--fs-xs); color: var(--color-text-muted); }
.wa-pick__ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--color-surface); color: var(--color-text); }
.wa-pick__ico--wa { background: #25D366; color: #fff; }

/* =====================================================================
   PAGINA ERRORE BASE (layout senza tenant)
   ===================================================================== */
.page-basic { display: flex; flex-direction: column; }
.basic-header { display: flex; justify-content: center; align-items: center; height: var(--header-h); }
.basic-main { flex: 1; padding-inline: var(--page-gutter); }
.error-state--page { margin-top: 12vh; }

/* =====================================================================
   TABLET ≥ 768px
   ===================================================================== */
@media (min-width: 768px) {
    :root { --header-h: 76px; --bottom-nav-h: 68px; }
    .app-logo__img { max-width: 220px; max-height: 64px; }
    .app-content { max-width: 760px; }
    .app-header { max-width: 760px; }
    .shop-selector { min-height: 84px; }
    .toast-region { left: auto; right: var(--space-6); transform: none; }
}

/* =====================================================================
   DESKTOP ≥ 1024px — sidebar sinistra, niente bottom nav
   ===================================================================== */
@media (min-width: 1024px) {
    .bottom-nav { display: none; }
    .app-main {
        padding-bottom: 0;
        margin-left: var(--sidebar-w);
    }
    .app-content, .app-header { max-width: var(--content-max); }
    .app-content { padding-inline: var(--space-7); }

    .app-header { grid-template-columns: 1fr auto; padding-inline: var(--space-7); }
    .app-header .app-logo, .app-header__spacer { display: none; }

    .desktop-sidebar {
        position: fixed; inset: 0 auto 0 0; z-index: 30;
        display: flex; flex-direction: column; gap: var(--space-6);
        width: var(--sidebar-w);
        padding: var(--space-6) var(--space-4);
        background: var(--color-surface);
        border-right: 1px solid var(--color-border);
        overflow-y: auto;
    }
    .app-logo--sidebar { justify-self: start; align-self: center; height: auto; padding: var(--space-2); }
    .app-logo--sidebar .app-logo__img { max-width: 200px; max-height: 70px; }

    .sidebar-nav { display: grid; gap: 4px; }
    .sidebar-nav__item {
        display: flex; align-items: center; gap: var(--space-3);
        min-height: var(--touch-cta);
        padding: 0 var(--space-4);
        border-radius: var(--radius-md);
        color: var(--color-text-muted);
        font-weight: var(--fw-bold);
        text-decoration: none;
        transition: background-color var(--dur-fast) ease, color var(--dur-fast) ease;
    }
    .sidebar-nav__item:hover { background: var(--color-bg); color: var(--color-text); }
    .sidebar-nav__item.is-active { background: var(--tint-rose); color: var(--color-accent-strong); }
    .sidebar-nav__icon { display: grid; place-items: center; width: 24px; font-size: 1.1rem; }

    .toast-region { bottom: var(--space-6); }
    dialog.bottom-sheet {
        inset: 0; margin: auto; height: fit-content;
        border-radius: var(--radius-xl);
        padding-bottom: var(--space-6);
    }
    dialog.bottom-sheet[open] { animation: modal-in var(--dur-base) var(--ease-out) both; }
    .bottom-sheet__handle { display: none; }
}

/* =====================================================================
   Movimento ridotto: nessuna animazione non essenziale
   ===================================================================== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 1ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 1ms !important;
        scroll-behavior: auto !important;
    }
    @view-transition { navigation: none; }
}

/* =====================================================================
   Sezione 11 — Personalizzazione dell'app: logo, copertina, anteprima
   ===================================================================== */
.shop-selector__thumb--logo { background: #fff; }
.shop-selector__thumb--logo .shop-selector__img { object-fit: contain; padding: 6px; }
.shop-sheet__cover {
    margin: calc(-1 * var(--space-2)) 0 var(--space-4);
    border-radius: var(--radius-lg);
    overflow: hidden;
    aspect-ratio: 16 / 7;
    background: var(--tint-caramel);
}
.shop-sheet__cover-img { width: 100%; height: 100%; object-fit: cover; }
.shop-sheet__about { margin: var(--space-3) 0 0; color: var(--color-text-muted); line-height: var(--lh-normal, 1.5); }
.preview-banner {
    display: flex; align-items: center; gap: var(--space-2);
    margin: 0 0 var(--space-3);
    padding: 10px 14px;
    border-radius: var(--radius-md);
    background: #2B1A12; color: #FFF6EE;
    font-size: var(--fs-sm);
}
.preview-banner .icon { color: #F6C58F; flex: none; }
