/* =====================================================================
   AUTENTICO THEME — grafica stile Auténtico Pizzería per goorder.html
   ---------------------------------------------------------------------
   Caricare DOPO goorder.css e chat.css.
   Solo CSS: nessuna funzione, ID o classe usata dagli script cambia.
   I popup creati dai .js hanno stili inline: qui vengono ricolorati con
   selettori per ID e per valore di stile (con !important), senza toccare
   posizione, top/left, display o transform, che restano gestiti dal JS.
   ===================================================================== */

:root {
    --bg: #15100d;
    --bg2: #1d1612;
    --card: #241b16;
    --card2: #2c221c;
    --line: rgba(246, 239, 227, .12);
    --line2: rgba(246, 239, 227, .22);
    --cream: #f6efe3;
    --muted: #bfb2a2;
    --red: #c8141f;
    --red-d: #a50f18;
    --red-soft: #ff6b6b;
    --pink: #ffb4a8;
    --green: #2f7d32;
    --green-soft: #8fd694;
    --gold: #e2b65a;
    --gold-soft: #f3d48f;
    --serif: 'Playfair Display', Georgia, serif;
    --sans: 'DM Sans', system-ui, -apple-system, sans-serif;
    --radius: 18px;
    --tabbar: 72px;
}

/* ---------- Base ---------- */
html, body {
    background: var(--bg) !important;
    color: var(--cream);
    font-family: var(--sans);
    -webkit-font-smoothing: antialiased;
}
body { color-scheme: dark; }
::selection { background: var(--red); color: #fff; }

p { font-size: 14px; }
a { color: inherit; }

h1, h2, h3, h4, h5, h7 { color: var(--cream); }

/* goorder.css dà a h2/h5/g un box grigio: lo sostituiamo con titoli serif */
h2 {
    font-family: var(--serif);
    font-style: normal;
    font-weight: 700;
    font-size: clamp(1.35rem, 4.4vw, 1.9rem);
    line-height: 1.15;
    background: none;
    border: 0;
    box-shadow: none;
    color: var(--cream);
    padding: .2rem 0;
}
h3, h4 { font-family: var(--serif); }
h5 {
    background: var(--card);
    border: 1px solid var(--line);
    box-shadow: none;
    color: var(--cream);
    border-radius: 12px;
}
g {
    display: block;
    background: var(--card);
    border: 1px solid var(--line);
    box-shadow: none;
    color: var(--cream);
    font-style: normal;
    font-weight: 500;
    line-height: 1.5;
    padding: 1rem;
    border-radius: 14px;
}

/* ---------- Layout pagina ---------- */
.page-container {
    background: var(--bg);
    padding-bottom: calc(var(--tabbar) + env(safe-area-inset-bottom));
    box-sizing: border-box;
}

/* Header */
.ag-header {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: calc(10px + env(safe-area-inset-top)) 18px 10px;
    background: rgba(21, 16, 13, .92);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}
.ag-brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; }
.ag-logo {
    width: 42px; height: 42px;
    border-radius: 50%;
    object-fit: cover;
    /*box-shadow: 0 0 0 2px rgba(200, 20, 31, .55), 0 6px 18px -6px rgba(0, 0, 0, .8);*/
}
.ag-brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.ag-brand-text b { font-family: var(--serif); font-size: 1.25rem; font-weight: 700; color: var(--cream); }
.ag-brand-text small { font-family: var(--serif); font-style: italic; font-size: .82rem; color: var(--pink); }
.ag-eyebrow {
    font-size: .68rem;
    letter-spacing: .28em;
    text-transform: uppercase;
    color: var(--red-soft);
    font-weight: 700;
    white-space: nowrap;
}

/* Categorie: pill come i "tab" della carta di Auténtico */
.categories {
    flex: 0 0 auto;
    background: var(--bg) !important;
    padding: 12px 14px !important;
    gap: .5rem;
    justify-content: center;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    border-bottom: 1px solid var(--line);
}
.categories::-webkit-scrollbar { display: none; }
/* centrate quando c'è spazio, scorrevoli senza tagli quando non c'è */
.categories { justify-content: flex-start !important; }
.categories > .category-title:first-child { margin-left: auto !important; }
.categories > .category-title:last-child { margin-right: auto !important; }
.category-title { margin: 0 !important; flex: 0 0 auto; }
.nav-image {
    display: inline-flex !important;
    align-items: center;
    width: auto !important;
    height: auto !important;
    padding: .55rem 1.1rem;
    margin: 0 !important;
    border-radius: 999px !important;
    border: 1px solid rgba(246, 239, 227, .25) !important;
    background: rgba(36, 27, 22, .6) !important;
    color: var(--cream);
    font-size: .92rem;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    transition: background .2s, color .2s, border-color .2s;
}
.nav-image:hover,
.nav-image.active {
    background: var(--cream) !important;
    color: var(--bg) !important;
    border-color: var(--cream) !important;
}

/* Lista prodotti: riempie lo spazio e scorre */
#product-list {
    flex: 1 1 auto;
    height: auto !important;
    min-height: 0;
    max-width: 1100px;
    overflow-y: auto;
    padding: 16px 14px 28px !important;
    gap: 14px !important;
    align-items: stretch !important;
    align-content: start !important;
    grid-auto-rows: max-content;
    background: var(--bg);
    -webkit-overflow-scrolling: touch;
}
@media (min-width: 768px) {
    #product-list { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)) !important; gap: 18px !important; }
}

/* Titoli sottocategoria = eyebrow + titolo serif */
.subcategory-title,
#product-list .subcategory-title {
    font-family: var(--serif) !important;
    font-size: clamp(1.4rem, 5vw, 2rem) !important;
    font-style: normal;
    color: var(--cream) !important;
    text-align: center;
    margin: 18px 0 4px !important;
    padding: 0 !important;
    background: none !important;
    border: 0 !important;
    box-shadow: none !important;
}
.subcategory-title::after {
    content: "";
    display: block;
    width: 42px; height: 2px;
    margin: .55rem auto 0;
    background: var(--red);
    border-radius: 2px;
}
.title, .titlee, .titleee { background: none !important; color: var(--cream) !important; font-family: var(--serif); }

/* Card prodotto */
.product-item {
    width: 100% !important;
    max-width: none !important;
    padding: 0 !important;
    background: var(--card) !important;
    border: 1px solid var(--line);
    border-radius: var(--radius) !important;
    overflow: hidden;
    cursor: pointer;
    transition: transform .25s, box-shadow .25s, border-color .25s;
    box-shadow: 0 18px 40px -26px rgba(0, 0, 0, .9);
    align-self: stretch;
    min-height: max-content;
}
.product-item:hover {
    transform: translateY(-3px) !important;
    border-color: rgba(200, 20, 31, .5);
    box-shadow: 0 22px 44px -22px rgba(0, 0, 0, .95), 0 0 0 1px rgba(200, 20, 31, .25) !important;
}
.product-item .product-image-container {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 1 / 1;
    margin: 0 !important;
    border-radius: 0 !important;
    background: var(--bg2);
}
.product-item .product-image,
#product-list .product-item img.product-image {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    object-fit: cover;
    border-radius: 0 !important;
    transition: transform .6s;
}
.product-item:hover .product-image { transform: scale(1.05); }
.product-item .product-info {
    width: 100%;
    padding: .7rem .75rem .85rem;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: .25rem;
    flex: 1;
}
.product-info h3,
#product-list .product-item h3 {
    font-family: var(--serif) !important;
    font-size: 1.02rem !important;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 !important;
    color: var(--cream);
}
.product-info p,
#product-list .product-item p {
    color: var(--muted);
    font-size: .78rem !important;
    line-height: 1.35;
}
.product-price,
#product-list .product-item p.product-price {
    margin-top: auto !important;
    padding-top: .3rem;
    font-family: var(--sans);
    font-size: 1rem !important;
    font-weight: 700;
    color: var(--pink) !important;
}
.allergen-row img { filter: drop-shadow(0 0 1px rgba(255, 255, 255, .5)); }

/* Limited edition */
.limited-wrapper { max-width: 640px !important; padding: 0 !important; }
.limited-wrapper:hover { background: none !important; box-shadow: none !important; transform: none !important; }
.limited-title {
    font-family: var(--serif) !important;
    font-size: 1.5rem !important;
    color: var(--gold-soft) !important;
    margin-bottom: .6rem !important;
}
.limited-container {
    background:
        radial-gradient(circle at 90% 10%, rgba(226, 182, 90, .22), transparent 50%),
        linear-gradient(135deg, #2a1d16 0%, #120c09 60%, #3a0c10 100%) !important;
    border: 1px solid rgba(226, 182, 90, .35);
    border-radius: 22px !important;
    padding: 14px !important;
}
.limited-edition-item {
    background: rgba(21, 16, 13, .55);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 10px;
    cursor: pointer;
}
.limited-edition-item .product-image-container { width: 110px !important; height: 110px !important; border-radius: 12px !important; }
.limited-edition-item .product-image { height: 100% !important; object-fit: cover; border-radius: 12px !important; }
.limited-edition-item .product-info { text-align: left !important; display: flex !important; flex-direction: column; gap: .25rem; }
.limited-edition-item .product-info h3 { font-family: var(--serif); color: var(--cream); }
.limited-edition-item .product-info p { color: var(--muted); }
.limited-edition-item .product-price { color: var(--gold-soft) !important; text-align: left !important; }

/* Blocchi della home (loadWelcome): card scure */
#product-list > div[style*="max-width: 355px"],
#product-list > #bloccoMusicaBarrio {
    max-width: 420px !important;
    border-radius: var(--radius) !important;
    border: 1px solid var(--line) !important;
    box-shadow: 0 24px 50px -30px rgba(0, 0, 0, .9) !important;
    padding: 16px !important;
    margin: 0 auto !important;
}
#product-list > div[style*="max-width: 355px"] button {
    padding: .8rem 1rem !important;
    font-weight: 700 !important;
    font-size: .82rem !important;
    letter-spacing: .03em;
}
#offer-of-the-day > div {
    border-radius: 14px;
    overflow: hidden;
}
#offer-of-the-day h4 { font-family: var(--serif); font-size: 1.15rem; color: var(--cream); }
#offer-of-the-day img { border-radius: 12px !important; }

/* Pulsante PLAY nella home */
.btn-player-style {
    background: var(--red) !important;
    border-radius: 999px !important;
    padding: .55rem 1.3rem !important;
    margin-top: .7rem;
    box-shadow: 0 10px 26px -10px rgba(200, 20, 31, .8) !important;
    animation: none !important;
    filter: none !important;
}
.btn-player-style:hover { background: var(--red-d) !important; }

/* ---------- Tabbar (footer) ---------- */
.footer {
    position: fixed !important;
    left: 0; right: 0; bottom: 0;
    z-index: 800;
    width: 100% !important;
    height: calc(var(--tabbar) + env(safe-area-inset-bottom)) !important;
    padding: 0 6px env(safe-area-inset-bottom) !important;
    box-sizing: border-box;
    display: grid !important;
    grid-template-columns: repeat(5, 1fr);
    align-items: end !important;
    gap: 0 !important;
    background: rgba(21, 16, 13, .94) !important;
    border-top: 1px solid var(--line);
    box-shadow: none !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}
.footer .ag-tab {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: var(--tabbar);
    color: var(--muted);
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    transition: color .2s;
}
.footer .ag-tab:hover { color: var(--cream); }
.footer .ag-tab > a { color: inherit; display: flex; }
.footer .footer-icon {
    width: 24px !important;
    height: 24px !important;
    transition: transform .2s;
}
.footer .ag-tab:hover .footer-icon { transform: translateY(-2px); }
.ag-label { font-size: .7rem; font-weight: 500; letter-spacing: .02em; }

/* CTA centrale: carrello nella bolla rossa */
.footer .cart-container.ag-cta { color: var(--cream); }
.ag-bub {
    width: 56px; height: 56px;
    border-radius: 50%;
    background: var(--red);
    color: #fff;
    display: grid;
    place-items: center;
    margin-top: -28px;
    box-shadow: 0 8px 24px -6px rgba(200, 20, 31, .8), 0 0 0 5px var(--bg);
    transition: transform .2s, background .2s;
}
.ag-cta:hover .ag-bub { background: var(--red-d); transform: translateY(-2px); }
.ag-bub .footer-icon { width: 26px !important; height: 26px !important; }
.footer .cart-count {
    top: -24px !important;
    right: calc(50% - 34px) !important;
    min-width: 20px;
    height: 20px;
    padding: 0 5px !important;
    box-sizing: border-box;
    display: grid;
    place-items: center;
    border-radius: 999px !important;
    background: var(--cream) !important;
    color: var(--bg) !important;
    font-size: .7rem !important;
    font-weight: 700;
    box-shadow: 0 0 0 2px var(--bg);
    z-index: 2;
}

/* Badge PLAY sopra l'icona musica */
.footer .player-status {
    top: 6px !important;
    right: calc(50% - 30px) !important;
    background: var(--red) !important;
    color: #fff !important;
    font-size: .58rem !important;
    letter-spacing: .04em;
    padding: 2px 6px !important;
    border-radius: 999px !important;
    animation: none !important;
    filter: none !important;
}

/* Desktop: tabbar centrata e più compatta */
@media (min-width: 900px) {
    .footer {
        left: 50% !important;
        right: auto;
        transform: translateX(-50%);
        bottom: 14px !important;
        max-width: 560px;
        border: 1px solid var(--line);
        border-radius: 22px;
        height: var(--tabbar) !important;
        padding: 0 6px !important;
    }
    .page-container { padding-bottom: calc(var(--tabbar) + 28px); }
}

/* Disattiva le vecchie regole mobile del footer */
@media (max-width: 600px) {
    .footer { justify-content: initial !important; }
}

/* ---------- Form e controlli ---------- */
input, select, textarea {
    font-family: var(--sans);
    background: var(--card) !important;
    color: var(--cream) !important;
    border: 1px solid var(--line2);
    border-radius: 12px !important;
    padding: .7rem .9rem;
    color-scheme: dark;
    box-sizing: border-box;
}
input::placeholder, textarea::placeholder { color: rgba(191, 178, 162, .7); }
input:focus, select:focus, textarea:focus {
    outline: 2px solid var(--red) !important;
    outline-offset: 1px;
}
input[type="radio"], input[type="checkbox"] {
    accent-color: var(--red);
    width: 18px; height: 18px;
    padding: 0;
    background: none !important;
    border: 0 !important;
}
input:disabled { background: var(--bg2) !important; opacity: .7; }
select option { background: var(--bg2); color: var(--cream); }
#menu-negozi { font-size: 13px !important; width: 100% !important; }
label { color: var(--cream); }
.order-form label {
    font-size: .72rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 700;
    margin-bottom: .35rem !important;
}
.order-form input, .order-form textarea { margin-bottom: 12px !important; }

button {
    font-family: var(--sans);
    color: var(--cream);
    background-color: var(--card);
    border: 1px solid var(--line);
    border-radius: 999px !important;
    font-weight: 600;
    transition: background-color .2s, transform .15s, filter .2s;
}
button:active { transform: scale(.97); }
button:hover { filter: brightness(1.08); }
button:disabled { opacity: .45; }

/* ---------- Overlay e popup creati dagli script ---------- */
#popup-overlay, #overlay, #popup-backdrop, #coupon-popup,
#popupLunes, #popupMartes {
    background: rgba(10, 7, 5, .72) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* Fogli/popup: sfondo scuro, bordo sottile, angoli grandi (posizione invariata) */
#popup-riepilogo, #side-panel, #popup-offerta-del-giorno, #user-popup,
#address-popup, #popup-regalo, #popup-attesa, #popup-pagamento,
#dynamic-order-popup, #popup-premi-fidelity, #popup-conflitto-fidelity,
#playerFooterBarrio, #gelatoModal > div, #popup-fidelity-card, #fidelity-popup,
#coupon-popup > div, #popupLunes > div, #popupMartes > div {
    background: var(--bg2) !important;
    color: var(--cream) !important;
    border: 1px solid var(--line) !important;
    border-radius: 24px !important;
    box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .95) !important;
    font-family: var(--sans) !important;
    scrollbar-width: thin;
    scrollbar-color: rgba(246, 239, 227, .2) transparent;
}
#side-panel { width: min(360px, 92vw) !important; height: min(600px, 82vh) !important; padding: 18px !important; }
#popup-riepilogo, #user-popup { padding: 22px !important; }
#popup-conflitto-fidelity h3 { color: var(--red-soft) !important; }

/* Titoli dentro i popup */
#popup-riepilogo h2, #side-panel h3, #user-popup h2, #popup-offerta-del-giorno h2,
#address-popup h2, #address-popup h3, #popup-pagamento h2, #dynamic-order-popup h2,
#popupLunes h2, #popupMartes h2 {
    font-family: var(--serif) !important;
    color: var(--cream) !important;
    background: none !important;
    border: 0 !important;
    box-shadow: none !important;
}
#side-panel h3 { font-size: 1.45rem; border-bottom: 1px solid var(--line) !important; padding-bottom: 12px !important; padding-right: 30px !important; }
#popup-riepilogo h3, #user-popup h3 { font-family: var(--serif); color: var(--cream); }

/* Bottone chiudi "X" (cerchio rosso in alto a destra) → cerchio crema discreto */
#popup-riepilogo > button:first-child,
#side-panel > button:first-child,
#user-popup > button[onclick*="closeUserPopup"],
#close-welcome-popup {
    width: 34px !important;
    height: 34px !important;
    background: rgba(246, 239, 227, .1) !important;
    color: var(--cream) !important;
    border: 1px solid var(--line) !important;
    font-weight: 700 !important;
    line-height: 1 !important;
}
#user-popup > button[onclick*="logout"] {
    background: transparent !important;
    border: 1px solid rgba(255, 107, 107, .5) !important;
    color: var(--red-soft) !important;
    padding: .4rem .9rem !important;
}

/* Riepilogo ordine */
#popup-riepilogo .order-options {
    background: var(--card);
    border-radius: 16px;
    padding: 10px 12px !important;
    margin-bottom: 12px !important;
}
#popup-riepilogo .order-options label { font-size: 1rem !important; font-weight: 700 !important; }
#lista-ordini { margin: 6px 0 10px; }
#lista-ordini > div {
    background: var(--card) !important;
    border: 1px solid var(--line);
    border-radius: 14px !important;
    padding: 12px 14px !important;
    margin-bottom: 10px !important;
}
#lista-ordini > div > div:first-child > div:first-child { font-family: var(--serif); font-size: 1rem !important; }
#lista-ordini > div > div:first-child > div:nth-child(2) { color: var(--pink); }
#lista-ordini button {
    background: rgba(246, 239, 227, .08) !important;
    color: var(--red-soft) !important;
    border: 1px solid var(--line) !important;
    width: 26px !important; height: 26px !important;
    margin-left: 8px;
    font-size: .7rem;
}
#popup-riepilogo .total, #totale {
    font-family: var(--serif);
    font-size: 1.35rem !important;
    color: var(--cream);
    padding: 12px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    margin: 6px 0 12px !important;
}
#prezzo-totale { color: var(--pink); }
#metodo-pagamento ul { gap: 8px; }
#metodo-pagamento li { flex: 1 0 calc(50% - 8px) !important; margin-bottom: 0 !important; }
#metodo-pagamento button {
    border: 1px solid var(--line2) !important;
    color: var(--cream) !important;
    padding: .75rem .6rem !important;
    font-size: .85rem;
}
#selected-payment { color: var(--muted); font-size: .9rem; }
#send-order-button {
    background: var(--red) !important;
    color: #fff !important;
    padding: 1rem !important;
    font-size: 1.02rem !important;
    font-weight: 700 !important;
    letter-spacing: .02em;
    box-shadow: 0 12px 30px -10px rgba(200, 20, 31, .75);
    margin-top: 6px;
}
#send-order-button:hover { background: var(--red-d) !important; }
#time-dropdown { width: 100%; }

/* Pannello prodotto (ingredienti / extra) */
#side-panel > div[style*="solid red"],
#side-panel > div[style*="solid green"],
#side-panel > div[style*="solid rgb(255, 0, 0)"],
#side-panel > div[style*="solid rgb(0, 128, 0)"] {
    background: var(--card);
    border: 1px solid var(--line) !important;
    border-radius: 14px !important;
}
#side-panel > p { color: var(--muted) !important; font-style: normal !important; font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; }
#ingredient-list li, #extra-list li {
    padding: 6px 0;
    border-bottom: 1px dashed rgba(246, 239, 227, .12);
    align-items: center !important;
}
#ingredient-list li button, #extra-list li button {
    width: 30px; height: 30px;
    padding: 0 !important;
    font-weight: 700;
    font-size: 1rem;
}
#ingredient-list li button { background: rgba(200, 20, 31, .2) !important; color: var(--red-soft) !important; border: 1px solid rgba(200, 20, 31, .45) !important; }
#extra-list li button { background: rgba(47, 125, 50, .25) !important; color: var(--green-soft) !important; border: 1px solid rgba(143, 214, 148, .4) !important; }
#extra-list li.selected { background: rgba(47, 125, 50, .12); border-radius: 10px; }
#extra-list li .price { color: var(--pink); font-weight: 700; font-size: .85rem; }
#extra-list > div { color: var(--gold) !important; letter-spacing: .18em; font-style: normal !important; }
#side-panel > div[style*="sticky"] { background: linear-gradient(180deg, transparent, var(--bg2) 35%) !important; padding-top: 16px !important; }
#side-panel > div[style*="sticky"] button {
    background: var(--red) !important;
    color: #fff !important;
    padding: .95rem !important;
    font-weight: 700 !important;
    box-shadow: 0 12px 30px -10px rgba(200, 20, 31, .75);
}

/* Player musica */
#playerFooterBarrio { bottom: calc(var(--tabbar) + 14px) !important; }
#closePlayerBarrio { background: rgba(246, 239, 227, .12) !important; color: var(--cream) !important; }
#playerFooterBarrio audio { color-scheme: dark; border-radius: 999px; }

/* ---------- Ricolorazione generica degli stili inline ---------- */
/* Sfondi chiari → card scure (forma scritta nel template e forma serializzata dal JS) */
[style*="background: white"], [style*="background:white"],
[style*="background-color: white"], [style*="background-color:white"],
[style*="background: #fff;"], [style*="background:#fff;"], 
[style*="background-color: #fff"], [style*="background-color:#fff"],
[style*="background: #fff3"], [style*="background: #fff8"], [style*="background: #f8fbff"],
[style*="background: #f1fff3"], [style*="background: #f2f2f2"],
[style*="background: #f9f9f9"], [style*="background-color: #f9f9f9"],
[style*="background-color: #f0f0f0"], [style*="background-color: #ccc"],
[style*="background: rgb(255, 255, 255)"], [style*="background-color: rgb(255, 255, 255)"],
[style*="background: rgb(249, 249, 249)"], [style*="background-color: rgb(249, 249, 249)"],
[style*="background-color: rgb(240, 240, 240)"], [style*="background-color: rgb(204, 204, 204)"],
[style*="background-color: rgb(255, 243, 205)"], [style*="background-color: rgb(230, 249, 236)"] {
    background: var(--card) !important;
    border-color: var(--line) !important;
}
/* Box evidenziati (prodotto non disponibile, premio) */
[style*="background-color: rgb(255, 243, 205)"] { box-shadow: inset 0 0 0 2px var(--gold) !important; }
/* campo non valido segnalato dagli script */
#menu-negozi:invalid { background: rgba(200, 20, 31, .18) !important; }
[style*="background-color: rgb(230, 249, 236)"] { box-shadow: inset 0 0 0 2px var(--green-soft) !important; }

/* Bordi grigi chiari */
[style*="solid #ccc"], [style*="solid #ddd"], [style*="solid black"], [style*="solid #d8ecff"],
[style*="solid rgb(204, 204, 204)"], [style*="solid rgb(221, 221, 221)"], [style*="solid rgb(0, 0, 0)"] {
    border-color: var(--line2) !important;
}

/* Testi colorati inline → versioni leggibili su scuro.
   (il prefisso spazio/;/tab evita di colpire "background-color: …") */
[style^="color:black"], [style^="color: black"],
[style*=" color: black"], [style*=" color:black"],
[style*="\9 color: black"], [style*="\9 color:black"],
[style*=";color: black"], [style*=";color:black"],
[style^="color:#000"], [style^="color: #000"],
[style*=" color: #000"], [style*=" color:#000"],
[style*="\9 color: #000"], [style*="\9 color:#000"],
[style*=";color: #000"], [style*=";color:#000"],
[style^="color:#222"], [style^="color: #222"],
[style*=" color: #222"], [style*=" color:#222"],
[style*="\9 color: #222"], [style*="\9 color:#222"],
[style*=";color: #222"], [style*=";color:#222"],
[style^="color:#333"], [style^="color: #333"],
[style*=" color: #333"], [style*=" color:#333"],
[style*="\9 color: #333"], [style*="\9 color:#333"],
[style*=";color: #333"], [style*=";color:#333"],
[style^="color:rgb(0, 0, 0)"], [style^="color: rgb(0, 0, 0)"],
[style*=" color: rgb(0, 0, 0)"], [style*=" color:rgb(0, 0, 0)"],
[style*="\9 color: rgb(0, 0, 0)"], [style*="\9 color:rgb(0, 0, 0)"],
[style*=";color: rgb(0, 0, 0)"], [style*=";color:rgb(0, 0, 0)"],
[style^="color:rgb(34, 34, 34)"], [style^="color: rgb(34, 34, 34)"],
[style*=" color: rgb(34, 34, 34)"], [style*=" color:rgb(34, 34, 34)"],
[style*="\9 color: rgb(34, 34, 34)"], [style*="\9 color:rgb(34, 34, 34)"],
[style*=";color: rgb(34, 34, 34)"], [style*=";color:rgb(34, 34, 34)"],
[style^="color:rgb(51, 51, 51)"], [style^="color: rgb(51, 51, 51)"],
[style*=" color: rgb(51, 51, 51)"], [style*=" color:rgb(51, 51, 51)"],
[style*="\9 color: rgb(51, 51, 51)"], [style*="\9 color:rgb(51, 51, 51)"],
[style*=";color: rgb(51, 51, 51)"], [style*=";color:rgb(51, 51, 51)"] {
    color: var(--cream) !important;
}
[style^="color:#555"], [style^="color: #555"],
[style*=" color: #555"], [style*=" color:#555"],
[style*="\9 color: #555"], [style*="\9 color:#555"],
[style*=";color: #555"], [style*=";color:#555"],
[style^="color:#666"], [style^="color: #666"],
[style*=" color: #666"], [style*=" color:#666"],
[style*="\9 color: #666"], [style*="\9 color:#666"],
[style*=";color: #666"], [style*=";color:#666"],
[style^="color:gray"], [style^="color: gray"],
[style*=" color: gray"], [style*=" color:gray"],
[style*="\9 color: gray"], [style*="\9 color:gray"],
[style*=";color: gray"], [style*=";color:gray"],
[style^="color:rgb(85, 85, 85)"], [style^="color: rgb(85, 85, 85)"],
[style*=" color: rgb(85, 85, 85)"], [style*=" color:rgb(85, 85, 85)"],
[style*="\9 color: rgb(85, 85, 85)"], [style*="\9 color:rgb(85, 85, 85)"],
[style*=";color: rgb(85, 85, 85)"], [style*=";color:rgb(85, 85, 85)"],
[style^="color:rgb(102, 102, 102)"], [style^="color: rgb(102, 102, 102)"],
[style*=" color: rgb(102, 102, 102)"], [style*=" color:rgb(102, 102, 102)"],
[style*="\9 color: rgb(102, 102, 102)"], [style*="\9 color:rgb(102, 102, 102)"],
[style*=";color: rgb(102, 102, 102)"], [style*=";color:rgb(102, 102, 102)"] {
    color: var(--muted) !important;
}
[style^="color:red"], [style^="color: red"],
[style*=" color: red"], [style*=" color:red"],
[style*="\9 color: red"], [style*="\9 color:red"],
[style*=";color: red"], [style*=";color:red"],
[style^="color:rgb(255, 0, 0)"], [style^="color: rgb(255, 0, 0)"],
[style*=" color: rgb(255, 0, 0)"], [style*=" color:rgb(255, 0, 0)"],
[style*="\9 color: rgb(255, 0, 0)"], [style*="\9 color:rgb(255, 0, 0)"],
[style*=";color: rgb(255, 0, 0)"], [style*=";color:rgb(255, 0, 0)"],
[style^="color:#d40000"], [style^="color: #d40000"],
[style*=" color: #d40000"], [style*=" color:#d40000"],
[style*="\9 color: #d40000"], [style*="\9 color:#d40000"],
[style*=";color: #d40000"], [style*=";color:#d40000"],
[style^="color:#cc0000"], [style^="color: #cc0000"],
[style*=" color: #cc0000"], [style*=" color:#cc0000"],
[style*="\9 color: #cc0000"], [style*="\9 color:#cc0000"],
[style*=";color: #cc0000"], [style*=";color:#cc0000"],
[style^="color:#c00"], [style^="color: #c00"],
[style*=" color: #c00"], [style*=" color:#c00"],
[style*="\9 color: #c00"], [style*="\9 color:#c00"],
[style*=";color: #c00"], [style*=";color:#c00"] {
    color: var(--red-soft) !important;
}
[style^="color:green"], [style^="color: green"],
[style*=" color: green"], [style*=" color:green"],
[style*="\9 color: green"], [style*="\9 color:green"],
[style*=";color: green"], [style*=";color:green"],
[style^="color:rgb(0, 128, 0)"], [style^="color: rgb(0, 128, 0)"],
[style*=" color: rgb(0, 128, 0)"], [style*=" color:rgb(0, 128, 0)"],
[style*="\9 color: rgb(0, 128, 0)"], [style*="\9 color:rgb(0, 128, 0)"],
[style*=";color: rgb(0, 128, 0)"], [style*=";color:rgb(0, 128, 0)"],
[style^="color:#006600"], [style^="color: #006600"],
[style*=" color: #006600"], [style*=" color:#006600"],
[style*="\9 color: #006600"], [style*="\9 color:#006600"],
[style*=";color: #006600"], [style*=";color:#006600"],
[style^="color:#28a745"], [style^="color: #28a745"],
[style*=" color: #28a745"], [style*=" color:#28a745"],
[style*="\9 color: #28a745"], [style*="\9 color:#28a745"],
[style*=";color: #28a745"], [style*=";color:#28a745"],
[style^="color:#18a031"], [style^="color: #18a031"],
[style*=" color: #18a031"], [style*=" color:#18a031"],
[style*="\9 color: #18a031"], [style*="\9 color:#18a031"],
[style*=";color: #18a031"], [style*=";color:#18a031"] {
    color: var(--green-soft) !important;
}
[style^="color:blue"], [style^="color: blue"],
[style*=" color: blue"], [style*=" color:blue"],
[style*="\9 color: blue"], [style*="\9 color:blue"],
[style*=";color: blue"], [style*=";color:blue"],
[style^="color:#4682B4"], [style^="color: #4682B4"],
[style*=" color: #4682B4"], [style*=" color:#4682B4"],
[style*="\9 color: #4682B4"], [style*="\9 color:#4682B4"],
[style*=";color: #4682B4"], [style*=";color:#4682B4"],
[style^="color:rgb(0, 0, 255)"], [style^="color: rgb(0, 0, 255)"],
[style*=" color: rgb(0, 0, 255)"], [style*=" color:rgb(0, 0, 255)"],
[style*="\9 color: rgb(0, 0, 255)"], [style*="\9 color:rgb(0, 0, 255)"],
[style*=";color: rgb(0, 0, 255)"], [style*=";color:rgb(0, 0, 255)"] {
    color: var(--pink) !important;
}

/* Bottoni azzurri / verdi principali → rosso Auténtico */
[style*="background-color: #87CEEB"], [style*="background: #87CEEB"],
[style*="background-color: rgb(135, 206, 235)"], [style*="background: rgb(135, 206, 235)"],
[style*="background-color: #4CAF50"], [style*="background-color: rgb(76, 175, 80)"],
[style*="background-color: green"], [style*="background-color: #007BFF"], [style*="background-color: #007bff"],
[style*="background-color: rgb(0, 123, 255)"], [style*="background-color: #4682B4"],
[style*="linear-gradient(135deg,#32CD32"] {
    background: var(--red) !important;
    color: #fff !important;
    border-color: var(--red) !important;
}
/* Rossi accesi → rosso del brand */
[style*="background: red"], [style*="background-color: red"], [style*="background:red"],
[style*="background: #ff3b30"], [style*="background-color: #f44336"], [style*="background-color: #e74c3c"],
[style*="background-color: #cc0000"], [style*="background-color: rgb(255, 0, 0)"],
[style*="background: rgb(255, 0, 0)"] {
    background: var(--red) !important;
}
[style*="background: green"], [style*="background-color: rgb(0, 128, 0)"] { background: var(--green) !important; }
/* Gialli (bottoni OK) → crema */
[style*="background-color: #ffc107"], [style*="background-color: rgb(255, 193, 7)"] {
    background: var(--cream) !important;
    color: var(--bg) !important;
}

/* Fidelity Card azzurra → carta oro/bordeaux come Auténtico */
[style*="linear-gradient(135deg, #87CEEB, #4682B4)"],
[style*="linear-gradient(135deg, rgb(135, 206, 235), rgb(70, 130, 180))"] {
    background:
        radial-gradient(circle at 85% 15%, rgba(226, 182, 90, .35), transparent 45%),
        linear-gradient(135deg, #2a1d16 0%, #120c09 60%, #3a0c10 100%) !important;
    border: 1px solid rgba(226, 182, 90, .4) !important;
    color: var(--cream) !important;
    box-shadow: 0 20px 44px -22px rgba(0, 0, 0, .95), inset 0 1px 0 rgba(255, 255, 255, .08) !important;
}
#fidelity-thumbnail-container [style*="linear-gradient"] div[style*="font-size: 16px"] {
    color: var(--gold) !important;
    letter-spacing: .14em;
    text-transform: uppercase;
    font-size: 11px !important;
}
#user-section-content [style*="linear-gradient(135deg, #87CEEB"] { aspect-ratio: 1.586 / 1; height: auto !important; }
#user-section-content [style*="linear-gradient(135deg, #87CEEB"] p:nth-child(2) {
    font-family: var(--serif);
    color: var(--gold-soft) !important;
}

/* ---------- Area privata ---------- */
#user-popup [onclick^="showSection"] {
    padding: .55rem 1rem !important;
    font-size: .85rem;
}
#user-section-content > div[style*="border: 1px solid #ccc"] {
    background: var(--card);
    border-radius: 14px !important;
}
#user-section-content p { color: var(--cream); }
#user-section-content strong { color: var(--muted); font-weight: 700; }

/* Ricevuta (resta chiara: viene esportata in PDF) */
.receipt-container {
    background: #fff !important;
    color: #222 !important;
    border-radius: 14px !important;
}
.receipt-container * { color: #222 !important; }
.receipt-container .download-button { background: var(--red) !important; color: #fff !important; }

/* Etichette "AGOTADO" */
[style*="position:absolute"][style*="background:red"],
[style*="position: absolute"][style*="background: red"] {
    border-radius: 999px !important;
    font-size: .7rem !important;
    letter-spacing: .12em;
}

/* ---------- Chat assistente (chat.css) ---------- */
.pizza-container-chat { background: transparent !important; }
.bot-message {
    background: var(--card) !important;
    color: var(--cream) !important;
    border: 1px solid var(--line);
    border-radius: 20px 20px 20px 6px !important;
    box-shadow: none !important;
}
.user-message {
    background: var(--red) !important;
    color: #fff !important;
    border-radius: 20px 20px 6px 20px !important;
    box-shadow: none !important;
}
.chat-pizza-itemchat {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 14px;
}
.product-infochat, .product-pricechat { color: var(--cream) !important; }
.product-infochat h3 { font-family: var(--serif); }
.product-pricechat { color: var(--pink) !important; }

/* ---------- SweetAlert2 ---------- */
.swal2-popup {
    background: var(--bg2) !important;
    color: var(--cream) !important;
    border: 1px solid var(--line);
    border-radius: 24px !important;
    font-family: var(--sans) !important;
}
.swal2-title { font-family: var(--serif) !important; color: var(--cream) !important; }
.swal2-html-container { color: var(--muted) !important; }
.swal2-styled.swal2-confirm { background: var(--red) !important; border-radius: 999px !important; }
.swal2-styled.swal2-cancel, .swal2-styled.swal2-deny { background: var(--card) !important; color: var(--cream) !important; border-radius: 999px !important; }
.swal2-backdrop-show { background: rgba(10, 7, 5, .72) !important; }

/* ---------- Varie ---------- */
.red-text { color: var(--red-soft); }
.receipt-container img { box-shadow: none; }
*::-webkit-scrollbar { width: 6px; height: 6px; }
*::-webkit-scrollbar-thumb { background: rgba(246, 239, 227, .18); border-radius: 6px; }
*::-webkit-scrollbar-track { background: transparent; }
#product-list::-webkit-scrollbar { display: none; }

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
}

/* ---------- Fix scorrimento pannello prodotto ----------
   Gli elementi del pannello non si schiacciano più: il riquadro extra
   ha un'altezza minima e scorre, e il pannello intero scorre se serve. */
#side-panel > * { flex-shrink: 0 !important; }
#side-panel > div[style*="solid green"],
#side-panel > div[style*="solid rgb(0, 128, 0)"] {
    flex: 1 0 auto !important;
    min-height: 220px;
    max-height: 45vh;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}
#ingredient-list li, #extra-list li { padding: 4px 0; }
#ingredient-list li button, #extra-list li button { width: 28px; height: 28px; }

/* =====================================================================
   LOOK MODERNO (v2) — schede "pizza fluttuante", pill prezzo + pulsante,
   testi compatti, animazione d'ingresso. Solo grafica.
   ===================================================================== */

/* Card: superficie morbida, foto che "esce" dalla card */
.product-item {
    background: linear-gradient(180deg, rgba(44, 34, 28, .55) 0%, var(--card) 38%) !important;
    border: 1px solid rgba(246, 239, 227, .07) !important;
    border-radius: 26px !important;
    overflow: visible !important;
    box-shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 20px 40px -28px rgba(0, 0, 0, .95) !important;
    position: relative;
    animation: agRise .5s cubic-bezier(.2, .7, .2, 1) both;
}
#product-list .product-item:nth-of-type(2n) { animation-delay: .06s; }
#product-list .product-item:nth-of-type(3n) { animation-delay: .12s; }
@keyframes agRise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.product-item .product-image-container {
    background: transparent !important;
    padding: 12px;
    box-sizing: border-box;
    overflow: visible !important;
    display: flex !important;
}
.product-item .product-image,
#product-list .product-item img.product-image {
    object-fit: contain !important;
    border-radius: 18px !important;
    filter: drop-shadow(0 14px 18px rgba(0, 0, 0, .65));
    transition: transform .6s cubic-bezier(.2, .7, .2, 1);
}
.product-item:hover .product-image { transform: rotate(-8deg) scale(1.06) !important; }
.product-item:hover {
    transform: translateY(-4px) !important;
    border-color: rgba(200, 20, 31, .45) !important;
}

/* Testi: allineati a sinistra, ingredienti su 2 righe */
.product-item .product-info {
    text-align: left !important;
    padding: .55rem .9rem 1rem !important;
    gap: .3rem;
}
.product-info h3, #product-list .product-item h3 {
    font-size: 1.08rem !important;
    letter-spacing: .01em;
}
.product-info p:not(.product-price), #product-list .product-item p:not(.product-price) {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.7em;
    font-size: .76rem !important;
}

/* Prezzo in pill + pulsante "+" (decorativo: il click è quello della card) */
.product-price, #product-list .product-item p.product-price {
    align-self: flex-start;
    margin-top: .35rem !important;
    padding: .3rem .75rem !important;
    border-radius: 999px;
    background: rgba(255, 180, 168, .1);
    border: 1px solid rgba(255, 180, 168, .22);
    color: var(--pink) !important;
    font-size: .92rem !important;
    line-height: 1.2;
}
#product-list .product-item::after {
    content: "+";
    position: absolute;
    right: 12px;
    bottom: 12px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--red);
    color: #fff;
    font-size: 1.35rem;
    font-weight: 500;
    line-height: 1;
    box-shadow: 0 8px 18px -6px rgba(200, 20, 31, .85);
    transition: transform .2s;
    pointer-events: none;
}
#product-list .product-item:hover::after { transform: scale(1.1) rotate(90deg); }

/* Prodotto esaurito: foto in bianco e nero, niente "+" */
#product-list .product-item[style*="not-allowed"] .product-image { filter: grayscale(1) brightness(.7) drop-shadow(0 14px 18px rgba(0,0,0,.6)); }
#product-list .product-item[style*="not-allowed"]::after { content: "×"; background: rgba(246, 239, 227, .12); box-shadow: none; }

/* Titoli di sezione: a sinistra, stile editoriale */
.subcategory-title, #product-list .subcategory-title {
    text-align: left !important;
    font-size: clamp(1.5rem, 6vw, 2.1rem) !important;
    margin: 22px 2px 2px !important;
    display: flex !important;
    align-items: center;
    gap: .8rem;
    text-transform: capitalize;
}
.subcategory-title::after {
    content: "" !important;
    flex: 1;
    width: auto !important;
    height: 1px !important;
    margin: 0 !important;
    background: linear-gradient(90deg, rgba(200, 20, 31, .7), transparent) !important;
}

/* Header e categorie: vetro, compatti */
.ag-header { padding-top: calc(8px + env(safe-area-inset-top)); padding-bottom: 8px; }
.ag-logo { width: 38px; height: 38px; }
.categories {
    position: relative;
    background: rgba(21, 16, 13, .9) !important;
    padding: 10px 14px !important;
    border-bottom-color: transparent;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 28px), transparent 100%);
            mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 28px), transparent 100%);
}
.nav-image {
    padding: .5rem 1rem !important;
    font-size: .88rem !important;
    border-color: rgba(246, 239, 227, .14) !important;
    background: rgba(246, 239, 227, .05) !important;
}
.nav-image.active, .nav-image:hover {
    box-shadow: 0 8px 20px -10px rgba(246, 239, 227, .5);
}

/* Lista: più respiro tra le card */
#product-list { gap: 16px 12px !important; padding-top: 8px !important; }

/* ---------- Card compatte (le foto delle pizze sono orizzontali) ---------- */
.product-item .product-image-container {
    aspect-ratio: 4 / 3 !important;
    padding: 8px 8px 0 !important;
}
.product-item .product-info {
    padding: .2rem .8rem .75rem !important;
    gap: .15rem !important;
}
.product-info h3, #product-list .product-item h3 { font-size: 1rem !important; }
.product-info p:not(.product-price), #product-list .product-item p:not(.product-price) {
    min-height: 0 !important;
    font-size: .74rem !important;
    line-height: 1.3;
}
.product-price, #product-list .product-item p.product-price {
    margin-top: .3rem !important;
    padding: .2rem .65rem !important;
    font-size: .85rem !important;
}
#product-list .product-item::after {
    width: 30px; height: 30px;
    right: 10px; bottom: 10px;
    font-size: 1.2rem;
}
#product-list { gap: 12px 10px !important; }

/* ---------- Foto senza spazi vuoti sopra e sotto ----------
   Il riquadro prende l'altezza reale della foto. */
#product-list .product-item .product-image-container {
    aspect-ratio: auto !important;
    height: auto !important;
    padding: 0 !important;
    display: block !important;
}
#product-list .product-item .product-image-container img.product-image {
    width: 100% !important;
    height: auto !important;
    object-fit: contain !important;
    display: block;
}
[style*="linear-gradient(135deg, #87CEEB, #4682B4)"] [style*="linear-gradient(135deg, #87CEEB, #4682B4)"] {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}
.page-container {
    height: 100dvh !important;
    min-height: 0 !important;
}
#product-list {
    padding-bottom: calc(var(--tabbar) + 50px + env(safe-area-inset-bottom)) !important;
}