:root {
    --orsa-giallo: #ffcc00;
    --orsa-bianco: #f9f9f7;
    --orsa-grigio-testo: #333333;
    --orsa-grigio-bordo: #d1d1d1;
    --orsa-ombra: rgba(0, 0, 0, 0.1);
}

body {
    /* Sfondo aggiornato con l'immagine caricata */
    background-image: url('Tovaglietta-sfondo-1.jpg');
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-size: cover; /* L'immagine copre l'intera finestra */
    background-position: center;
    
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--orsa-grigio-testo);
    line-height: 1.6;
}

.glow-giallo { 
    text-shadow: 0 0 8px rgba(255, 204, 0, 0.5); 
    color: var(--orsa-grigio-testo);
    border-bottom: 3px solid var(--orsa-giallo);
    display: inline-block;
    padding-bottom: 4px;
    margin-bottom: 20px;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    background: rgba(255, 255, 255, 0.95); /* Leggera trasparenza */
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px var(--orsa-ombra);
}

nav .logo { font-size: 1.4rem; font-weight: 800; color: var(--orsa-grigio-testo); text-transform: uppercase; }
nav .logo span { color: var(--orsa-giallo); }
nav .links a { color: var(--orsa-grigio-testo); margin-left: 20px; text-decoration: none; cursor: pointer; font-weight: 600; font-size: 0.9rem; transition: color 0.3s; }
nav .links a:hover { color: var(--orsa-giallo); }

.hamburger { display: none; flex-direction: column; gap: 5px; cursor: pointer; padding: 4px; background: none; border: none; width: auto; }
.hamburger span { display: block; width: 24px; height: 2px; background: var(--orsa-grigio-testo); border-radius: 2px; transition: 0.3s; }

@media (max-width: 680px) {
    nav { padding: 0.8rem 5%; flex-wrap: wrap; }
    .hamburger { display: flex; }
    nav .links {
        display: none;
        width: 100%;
        flex-direction: column;
        padding: 10px 0 14px;
        border-top: 1px solid var(--orsa-grigio-bordo);
        margin-top: 8px;
    }
    nav .links.aperto { display: flex; }
    nav .links a { margin-left: 0; padding: 10px 0; font-size: 1rem; border-bottom: 1px solid #f0f0f0; }
    nav .links a:last-child { border-bottom: none; }
    .hero { padding: 2rem 5%; clip-path: polygon(0 0, 100% 0, 100% 90%, 0 100%); margin-bottom: 0; }
    .hero h1 { font-size: 1.5rem; }
    .hero p { font-size: 0.9rem; margin: 6px 0 0; }
    #home { padding-top: 1rem; }
    .home-grid { grid-template-columns: 1fr !important; max-width: 340px !important; }
    .cart-container { padding: 16px; }
    .footer-icone { gap: 20px; }
    .footer-icona-item { min-width: 100px; }
    .info-banner { flex-direction: column; gap: 8px; }
}

.page { display: none; padding: 2rem 5%; min-height: 80vh; background: transparent; }
.active { display: block; }

.hero {
    background: transparent;
    padding: 4rem 5% 5rem;
    text-align: center;
    clip-path: none;
    margin-bottom: 0;
}

.hero h1 { font-size: 2.5rem; margin: 0; text-transform: uppercase; }

.grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-top: 2rem;
    align-items: start;
}

@media (max-width: 900px) {
    .grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 580px) {
    .grid { grid-template-columns: 1fr; }
}

.card {
    /* Sfondo nero con leggera trasparenza per far intravedere il background */
    background: rgba(20, 20, 20, 0.95); 
    padding: 14px;
    border-radius: 12px;
    /* Bordo grigio scuro per definizione */
    border: 1px solid #444; 
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    display: flex;
    flex-direction: column;
    align-self: start;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    /* Testo Bianco Leggibile */
    color: #ffffff;
}

.card h3 {
    color: var(--orsa-giallo); /* Il titolo giallo risalta meglio sul nero */
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.5);
    border-color: var(--orsa-giallo);
}

.card img { width: 80%; height: auto; object-fit: contain; border-radius: 8px; margin-bottom: 15px; transition: transform 0.3s ease; display: block; margin-left: auto; margin-right: auto; }
.card:hover img { transform: scale(1.02); }

.controls { margin: 15px 0; }
select, .co-form-group input, .co-form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #444;
    border-radius: 6px;
    background: #2b2b2b; /* Grigio molto scuro per gli input */
    color: #ffffff; /* Testo input bianco */
}
button {
    background: var(--orsa-grigio-testo);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    width: 100%;
    transition: background-color 0.3s, transform 0.1s;
}

button:hover { background: var(--orsa-giallo); color: var(--orsa-grigio-testo); }
button:active { transform: scale(0.98); }

.cart-container {
    max-width: 800px;
    margin: auto;
    /* Sfondo nero solido per i moduli */
    background: #1a1a1a; 
    color: #ffffff;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.4);
    border: 1px solid #333;
}
.info-banner {
    background: #fffbe6;
    border: 2px solid var(--orsa-giallo);
    border-radius: 10px;
    padding: 14px 20px;
    margin-bottom: 24px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 0.9rem;
}
.info-banner .icona { font-size: 1.7rem; flex-shrink: 0; }
.info-banner ul { margin: 4px 0 0 0; padding-left: 18px; font-size: 0.97rem; }
.info-banner strong { display: block; margin-bottom: 4px; font-size: 1.05rem; }

.ingredienti { font-size: 0.82rem; color: #ffffff; margin: 10px 0; border-top: 1px solid #eee; padding-top: 10px; }
.ingredienti .sezione-titolo { font-weight: 700; text-transform: uppercase; font-size: 0.78rem; color: var(--orsa-giallo); margin-top: 8px; margin-bottom: 2px; letter-spacing: 0.04em; }
.ingredienti ul { margin: 0 0 4px 0; padding-left: 16px; }
.ingredienti ul li { line-height: 1.5; }
.ingredienti .allergeni-riga { color: #cccccc; font-size: 0.78rem; margin-bottom: 4px; }
.ingredienti .puo-contenere { color: #ffcc00; font-size: 0.78rem; margin-top: 6px; font-style: italic; }


.qty-control { display: flex; align-items: center; gap: 10px; margin: 10px 0; }
.qty-control button { width: 36px; height: 36px; padding: 0; font-size: 1.2rem; border-radius: 6px; flex-shrink: 0; }
.qty-control span { font-weight: 700; font-size: 1rem; min-width: 60px; text-align: center; }

.avviso-minimo {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 12px 16px;
    margin-top: 10px;
    font-size: 0.9rem;
    color: #664d03;
}
#btn-checkout { margin-top: 20px; }

footer { background: rgba(249,249,247,0.95); border-top: 3px solid var(--orsa-giallo); margin-top: 50px; }
.footer-contatti { padding: 40px 5% 20px; }
.footer-icone { display: flex; justify-content: center; gap: 40px; flex-wrap: wrap; margin-bottom: 36px; }
.footer-icona-item { text-align: center; min-width: 140px; }
.footer-cerchio { width: 64px; height: 64px; border-radius: 50%; border: 2px solid var(--orsa-giallo); display: flex; align-items: center; justify-content: center; font-size: 1.5rem; margin: 0 auto 10px; background: white; transition: transform 0.3s; }
.footer-icona-item:hover .footer-cerchio { transform: scale(1.1); }
.footer-label { font-weight: 700; font-size: 1rem; margin-bottom: 4px; }
.footer-valore { font-size: 0.88rem; color: #555; }
.footer-valore a { color: #555; text-decoration: none; }
.footer-valore a:hover { color: var(--orsa-giallo); }
.footer-testo { max-width: 900px; margin: 0 auto 24px; text-align: center; font-size: 0.88rem; color: #555; line-height: 1.7; border-top: 1px solid var(--orsa-grigio-bordo); padding-top: 24px; }
.footer-copy { text-align: center; font-size: 0.82rem; color: #aaa; border-top: 1px solid var(--orsa-grigio-bordo); padding: 16px 0; }

.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 9999; align-items: center; justify-content: center; backdrop-filter: blur(3px); }
.modal-overlay.aperto { display: flex; }
modal-box {
    background: #262626;
    color: #ffffff;
    border: 2px solid var(--orsa-giallo);
    border-radius: 16px;
    padding: 36px 32px 28px;
    max-width: 420px;
    width: 90%;
    text-align: center;
}

@keyframes modalIn { from { transform: scale(0.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-icona { font-size: 3rem; margin-bottom: 12px; }
.modal-titolo { font-size: 1.3rem; font-weight: 800; margin-bottom: 8px; }
.modal-testo {
    color: #fefefe; /* testo leggibile*/
    font-size: 1rem;
    line-height: 1.4;
    text-align: center;
}.modal-mancante { display: inline-block; background: #fffbe6; border: 2px solid var(--orsa-giallo); border-radius: 8px; padding: 8px 20px; font-weight: 700; font-size: 1.05rem; margin: 12px 0 20px; color: var(--orsa-grigio-testo); }
.modal-btn { background: var(--orsa-giallo); color: var(--orsa-grigio-testo); border: none; padding: 12px 32px; border-radius: 8px; font-weight: 700; font-size: 1rem; cursor: pointer; width: auto; transition: 0.2s; }
.modal-btn:hover { background: #e6b800; }

.checkout-wrapper { max-width: 600px; }
.co-progress { display: flex; align-items: center; justify-content: center; margin-bottom: 36px; }
.co-step { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.co-step-circle { width: 36px; height: 36px; border-radius: 50%; background: var(--orsa-grigio-bordo); color: #999; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.95rem; transition: 0.3s; }
.co-step.active .co-step-circle { background: var(--orsa-giallo); color: var(--orsa-grigio-testo); box-shadow: 0 0 10px rgba(255, 204, 0, 0.4); }
.co-step.done .co-step-circle { background: #4A7C59; color: white; }
.co-step-label { font-size: 0.75rem; font-weight: 600; color: #aaa; white-space: nowrap; }
.co-step.active .co-step-label, .co-step.done .co-step-label { color: var(--orsa-grigio-testo); }
.co-step-line { flex: 1; height: 2px; background: var(--orsa-grigio-bordo); min-width: 40px; max-width: 80px; margin-bottom: 22px; transition: background 0.3s; }

.co-form-group { display: flex; flex-direction: column; gap: 4px; margin-bottom: 16px; }
.co-form-group label { font-weight: 600; font-size: 0.88rem; }
.co-form-group small { font-size: 0.78rem; color: #999; }
.co-form-group input, .co-form-group textarea { padding: 10px 12px; border: 1px solid var(--orsa-grigio-bordo); border-radius: 6px; font-size: 0.95rem; font-family: inherit; width: 100%; box-sizing: border-box; resize: vertical; transition: border-color 0.2s, box-shadow 0.2s; }
.co-form-group input:focus, .co-form-group textarea:focus { outline: none; border-color: var(--orsa-giallo); box-shadow: 0 0 0 3px rgba(255,204,0,0.2); }
.co-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 520px) { .co-form-row { grid-template-columns: 1fr; } }

.co-riepilogo-dati, .co-box-ordine, .co-note-box {
    background: #262626 !important; /* Grigio antracite invece del giallino */
    border: 1px solid #444 !important;
    color: #ffffff !important;
}
.co-riepilogo-riga { display: flex; gap: 10px; align-items: flex-start; font-size: 0.9rem; margin-bottom: 6px; }
.co-box-ordine { background: #f9f9f7; border: 1px solid var(--orsa-grigio-bordo); border-radius: 10px; padding: 16px 18px; margin-bottom: 16px; }
.co-box-ordine h3 { font-size: 0.95rem; margin: 0 0 10px; }
.co-item-riga {
    border-bottom: 1px dashed #444;
}.co-totale-finale { text-align: right; font-weight: 700; font-size: 1.15rem; margin-top: 10px; color: #ffffff; }

.co-note-box { display: flex; gap: 10px; align-items: flex-start; background: #f5f5f5; border-radius: 8px; padding: 10px 14px; font-size: 0.88rem; margin-bottom: 10px; }
.co-note-allergie { background: #fff8e6; border: 1px solid #ffc107; }
.co-demo-banner { background: #e8f4fd; border: 1px solid #90caf9; border-radius: 8px; padding: 12px 16px; font-size: 0.88rem; color: #1565c0; margin-bottom: 20px; }
.co-errore { background: #fff0f0; border: 1px solid #ffaaaa; border-radius: 6px; padding: 10px 14px; font-size: 0.88rem; color: #c00; margin-bottom: 14px; }

.btn-primary { background: var(--orsa-grigio-testo); color: white; border: none; padding: 13px 24px; border-radius: 8px; cursor: pointer; font-weight: 700; font-size: 1rem; width: 100%; transition: 0.2s; }
.btn-primary:hover { background: var(--orsa-giallo); color: var(--orsa-grigio-testo); }
.btn-secondary { background: var(--orsa-grigio-bordo); color: var(--orsa-grigio-testo); border: none; padding: 10px 20px; border-radius: 6px; cursor: pointer; font-weight: 600; font-size: 0.9rem; width: auto; transition: 0.2s; margin-bottom: 20px; }
.btn-secondary:hover { background: #bbb; color: white; }
.btn-pay { background: #28a745; color: white; border: none; padding: 13px 24px; border-radius: 8px; cursor: pointer; font-weight: 700; font-size: 1rem; flex: 1; transition: 0.2s; }
.btn-pay:hover { background: #218838; }
.btn-pay:disabled { background: #aaa; cursor: not-allowed; }
.co-btn-row { display: flex; gap: 12px; align-items: center; margin-top: 8px; }

.co-conferma-icona { font-size: 4rem; margin-bottom: 12px; animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
@keyframes popIn { 0% { transform: scale(0); } 100% { transform: scale(1); } }
.co-numero-ordine { 
    display: inline-block; 
    background: #fffbe6; 
    border: 2px solid var(--orsa-giallo); 
    border-radius: 10px; 
    padding: 12px 28px; 
    font-weight: 700; 
    font-size: 1.1rem; 
    letter-spacing: 0.06em; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.05); 
    color: var(--orsa-grigio-testo); /* testo leggibile */
}
#toast-carrello {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #333;
    color: #fff;
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 0.95rem;
    font-weight: 600;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, transform 0.3s;
    z-index: 99999;
    white-space: nowrap;
    border: 2px solid var(--orsa-giallo);
}
#toast-carrello.toast-visibile {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}