/*
 * Shop del Natale solidale CRI Mappano.
 * Un solo elemento forte: la fascia rossa d'apertura. Il resto è bianco e sobrio,
 * perché i protagonisti siano le foto dei prodotti e il percorso d'acquisto.
 */
:root{
  --red:#b5121b;--red-deep:#8e0e16;--red-wash:#fbeaec;
  --ink:#1d2127;--muted:#5d6570;--line:#e3e6ea;--soft:#f4f5f7;--surface:#fff;
  --ok:#1f7a4d;--ok-wash:#e8f5ee;--warn:#94570a;--warn-wash:#fdf2e1;
  --radius:14px;--radius-sm:10px;
  --shadow:0 1px 2px rgba(29,33,39,.06),0 8px 24px rgba(29,33,39,.06);
  font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
  color:var(--ink);background:var(--surface);
  -webkit-text-size-adjust:100%;
}
*{box-sizing:border-box}
html{scroll-behavior:smooth;scroll-padding-top:84px}
body{margin:0;overflow-x:hidden;font-size:16px;line-height:1.55}
a{color:var(--red)}
img{max-width:100%;display:block}
h1,h2,h3,p{margin-top:0}
button,input,select,textarea{font:inherit;color:inherit}
button{cursor:pointer}
button:disabled{cursor:not-allowed;opacity:.5}
:focus-visible{outline:3px solid var(--red);outline-offset:2px}
[hidden]{display:none!important}
.small{font-size:13px;line-height:1.55;color:var(--muted)}
.skip-link{position:absolute;left:12px;top:-60px;background:var(--ink);color:#fff;padding:10px 14px;border-radius:8px;z-index:50}
.skip-link:focus{top:12px}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}*{transition:none!important;animation:none!important}}

/* Pulsanti */
.button{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:48px;padding:12px 24px;border:0;border-radius:999px;background:var(--red);color:#fff;font-weight:700;text-decoration:none;transition:background .15s}
.button:hover{background:var(--red-deep)}
.button:disabled{opacity:.6;cursor:wait}
.button.full{width:100%}
.button-light{background:#fff;color:var(--red)}
.button-light:hover{background:var(--red-wash)}
.button-ghost{background:transparent;color:var(--red);box-shadow:inset 0 0 0 2px var(--red)}
.button-ghost:hover{background:var(--red-wash)}

/* Intestazione: fissa in alto, su telefono solo logo e carrello */
.site-header{position:sticky;top:0;z-index:30;display:flex;align-items:center;gap:16px;padding:10px max(20px,calc((100% - 1180px)/2));background:rgba(255,255,255,.94);backdrop-filter:saturate(1.4) blur(10px);-webkit-backdrop-filter:saturate(1.4) blur(10px);border-bottom:1px solid var(--line)}
.site-header > a:first-child img,.brand img{width:150px;height:auto}
.header-text{display:flex;flex-direction:column;line-height:1.2;padding-left:16px;border-left:1px solid var(--line)}
.header-text strong{font-size:16px;font-weight:800}
.header-text span{font-size:13px;color:var(--muted)}
.site-header nav{margin-left:auto;display:flex;align-items:center;gap:6px}
.site-header nav a{padding:10px 12px;border-radius:999px;color:var(--ink);font-weight:600;font-size:15px;text-decoration:none}
.site-header nav a:hover{background:var(--soft)}
.site-header nav .cart-link{display:inline-flex;align-items:center;gap:8px;background:var(--ink);color:#fff;padding:10px 16px}
.site-header nav .cart-link:hover{background:#000}
#cart-count{display:inline-grid;place-items:center;min-width:22px;height:22px;padding:0 6px;border-radius:999px;background:var(--red);color:#fff;font-size:12px;font-weight:800}

/* Apertura */
.hero{background:var(--red);color:#fff}
.hero-inner{max-width:1180px;margin:0 auto;padding:64px 20px 56px;display:grid;grid-template-columns:minmax(0,1.5fr) minmax(0,1fr);gap:48px;align-items:end}
.hero-kicker{margin:0 0 14px;font-weight:600;opacity:.85}
.hero h1{font-size:clamp(34px,5.4vw,60px);line-height:1.02;font-weight:850;letter-spacing:-.025em;margin:0 0 20px;max-width:14ch;text-wrap:balance}
.hero-copy > p:not(.hero-kicker){font-size:18px;line-height:1.55;max-width:46ch;margin:0 0 28px;opacity:.95}
.hero-facts{list-style:none;margin:0;padding:0;border-top:1px solid rgba(255,255,255,.35)}
.hero-facts li{display:flex;flex-direction:column;padding:14px 0;border-bottom:1px solid rgba(255,255,255,.35)}
.hero-facts strong{font-size:17px}
.hero-facts span{opacity:.85;font-size:15px}

/* Catalogo */
.catalog,.companies,.checkout{max-width:1180px;margin:0 auto;padding:56px 20px}
.section-heading{margin-bottom:24px}
.section-heading h2,.companies h2,.checkout h2{font-size:clamp(26px,3vw,34px);line-height:1.15;letter-spacing:-.015em;font-weight:800;margin-bottom:8px}
.section-heading p{color:var(--muted);max-width:60ch;margin:0}
.products{display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:20px}
.product{display:flex;flex-direction:column;background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);overflow:hidden;transition:border-color .15s,box-shadow .15s}
.product.in-cart{border-color:var(--red);box-shadow:0 0 0 1px var(--red)}
.product-photo{aspect-ratio:4/3;background:var(--soft);display:grid;place-items:center;overflow:hidden}
.product-photo > img{width:100%;height:100%;object-fit:cover}
.product-placeholder img{width:60%;opacity:.5;margin:auto}
.product-body{display:flex;flex-direction:column;gap:8px;padding:18px;flex:1}
.product h3{font-size:19px;line-height:1.25;margin:0}
.product-description{color:var(--muted);font-size:15px;margin:0;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.availability{align-self:flex-start;font-size:13px;font-weight:700;color:var(--ok);background:var(--ok-wash);padding:3px 10px;border-radius:999px}
.availability:empty{display:none}
.availability.booking{color:var(--warn);background:var(--warn-wash)}
.product-bottom{margin-top:auto;padding-top:10px;display:flex;align-items:flex-end;justify-content:space-between;gap:12px}
.price{margin:0;display:flex;flex-direction:column;line-height:1.2}
.price span{font-size:13px;color:var(--muted)}
.price strong{font-size:22px;font-variant-numeric:tabular-nums}
.add{min-height:46px;padding:0 20px;border:0;border-radius:999px;background:var(--red);color:#fff;font-weight:700}
.add:hover{background:var(--red-deep)}
.card-qty,.qty-stepper{display:inline-flex;align-items:center;border:1px solid var(--line);border-radius:999px;background:var(--surface)}
.card-qty output{min-width:34px;text-align:center;font-weight:800;font-variant-numeric:tabular-nums}
.qty-btn{width:44px;height:44px;border:0;background:none;font-size:22px;line-height:1;color:var(--red);border-radius:999px}
.qty-btn:hover{background:var(--red-wash)}
.empty{grid-column:1/-1;padding:40px;text-align:center;color:var(--muted);background:var(--soft);border-radius:var(--radius)}

/* Aziende */
.companies{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:24px;padding-top:0}
.companies > div:first-child{flex:1 1 420px;padding:28px 0;border-top:1px solid var(--line)}
.companies p{color:var(--muted);max-width:62ch;margin:0}
.companies-actions{display:flex;flex-wrap:wrap;gap:12px}

/* Carrello e modulo */
.checkout{display:grid;grid-template-columns:minmax(0,1.55fr) minmax(300px,1fr);grid-template-areas:"form basket";gap:40px;align-items:start;border-top:1px solid var(--line)}
.basket{grid-area:basket;position:sticky;top:84px;background:var(--soft);border-radius:var(--radius);padding:24px}
.basket h2{font-size:22px!important}
#checkout-form{grid-area:form;min-width:0}
.form-intro{color:var(--muted);margin-bottom:8px}
.cart-empty{color:var(--muted)}
.cart-line{padding:14px 0;border-bottom:1px solid var(--line)}
.cart-line-head{display:flex;justify-content:space-between;gap:12px;margin-bottom:8px}
.cart-line-head span{font-variant-numeric:tabular-nums;white-space:nowrap}
.cart-line-actions{display:flex;align-items:center;justify-content:space-between;gap:12px}
.qty-stepper input{width:46px;border:0;text-align:center;font-weight:800;background:none;-moz-appearance:textfield}
.qty-stepper input::-webkit-outer-spin-button,.qty-stepper input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}
.remove{border:0;background:none;color:var(--muted);text-decoration:underline;padding:8px}
.booking-note{display:block;margin-top:6px;color:var(--warn);font-size:13px}
.summary-row{display:flex;justify-content:space-between;gap:16px;padding:12px 0;border-bottom:1px solid var(--line);font-variant-numeric:tabular-nums}
.summary-row.total{border-bottom:0;padding-top:16px;font-size:18px}
.summary-row.total strong{font-size:26px;color:var(--red)}
#donation-extra{padding:14px 0;border-bottom:1px solid var(--line)}
#donation-extra > label{display:block;font-weight:700;margin-bottom:8px}
.optional{font-weight:500;color:var(--muted);font-size:14px}
.money-input{display:flex;align-items:center;gap:6px;background:var(--surface);border:1px solid var(--line);border-radius:var(--radius-sm);padding:0 12px}
.money-input input{border:0;flex:1;min-height:46px;background:none;font-variant-numeric:tabular-nums;outline:none}
.money-input:focus-within{outline:3px solid var(--red);outline-offset:1px}
.extra-presets{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}
.extra-presets button{border:1px solid var(--line);background:var(--surface);border-radius:999px;padding:8px 12px;font-size:14px;font-weight:600}
.extra-presets button.active{border-color:var(--red);color:var(--red);background:var(--red-wash)}

.checkout-step{border:0;border-top:1px solid var(--line);margin:0;padding:28px 0}
.checkout-step legend{display:flex;align-items:center;gap:12px;font-size:20px;font-weight:800;padding:0;margin-bottom:18px;float:left;width:100%}
.checkout-step > :not(legend){clear:both}
.step-number{display:inline-grid;place-items:center;width:32px;height:32px;border-radius:50%;background:var(--red);color:#fff;font-size:15px;flex:none}
.subhead{font-size:17px;margin:24px 0 4px}
.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px 16px;margin:14px 0}
.address-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
.address-grid .span-3{grid-column:span 3}
.address-grid .span-2{grid-column:span 2}
.wide{grid-column:1/-1}
#checkout-form label{display:flex;flex-direction:column;gap:6px;font-weight:600;font-size:15px}
#checkout-form label small{font-weight:400;color:var(--muted);font-size:13px}
#checkout-form input:not([type=radio]):not([type=checkbox]),#checkout-form select,#checkout-form textarea{width:100%;min-height:48px;padding:10px 14px;border:1px solid #cfd4da;border-radius:var(--radius-sm);background:var(--surface);font-size:16px}
#checkout-form textarea{min-height:72px;resize:vertical}
#checkout-form input:focus,#checkout-form select:focus,#checkout-form textarea:focus{outline:3px solid rgba(181,18,27,.35);border-color:var(--red)}
.notes{margin-top:14px}

.segmented{display:inline-flex;background:var(--soft);border-radius:999px;padding:4px;margin-bottom:6px}
#checkout-form .segmented label{flex-direction:row;gap:0}
.segmented input{position:absolute;opacity:0;pointer-events:none}
.segmented span{display:block;padding:9px 22px;border-radius:999px;font-weight:700;color:var(--muted);cursor:pointer}
.segmented input:checked + span{background:var(--surface);color:var(--ink);box-shadow:var(--shadow)}
.segmented input:focus-visible + span{outline:3px solid var(--red)}

.check{flex-direction:row!important;align-items:flex-start;gap:12px!important;font-weight:500!important;margin:12px 0;cursor:pointer}
.check input{width:22px;height:22px;margin:1px 0 0;accent-color:var(--red);flex:none}

.fulfillment-choice,.payment-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.payment-list{grid-template-columns:1fr}
.choice-card{position:relative;flex-direction:row!important;align-items:flex-start;gap:12px!important;padding:16px;border:1px solid #cfd4da;border-radius:var(--radius);cursor:pointer;background:var(--surface);transition:border-color .15s,background .15s}
.choice-card:hover{border-color:var(--muted)}
.choice-card:has(input:checked){border-color:var(--red);box-shadow:0 0 0 1px var(--red);background:#fffafa}
.choice-card:has(input:disabled){opacity:.55;cursor:not-allowed}
.choice-card input{width:20px;height:20px;margin:2px 0 0;accent-color:var(--red);flex:none}
.choice-body{display:flex;flex-direction:column;gap:2px}
.choice-body strong{font-size:16px}
.choice-price{font-weight:800;color:var(--red)}
.choice-body small{color:var(--muted);font-weight:400;font-size:14px!important}
.info-box{margin-top:14px;padding:16px;background:var(--soft);border-radius:var(--radius-sm)}
.info-box p{margin:0}
.info-box label + p,.info-box p + label{margin-top:12px}
.location-label{margin-bottom:12px}
.trap{position:absolute;left:-10000px;width:1px;height:1px;overflow:hidden}
#form-message{margin:16px 0;font-weight:600;color:var(--red)}
#form-message:empty{display:none}

/* Barra del carrello su telefono */
.mobile-cart-bar{display:none}

/* Piè di pagina */
.site-footer{background:var(--soft);border-top:1px solid var(--line);padding:36px max(20px,calc((100% - 1180px)/2));display:flex;flex-wrap:wrap;gap:16px 32px;align-items:center;font-size:14px;color:var(--muted)}
.site-footer > img{width:150px;height:auto}
.legal-footer{flex:1 1 420px}
.legal-footer p{margin:0}
.legal-links{display:flex;flex-wrap:wrap;gap:8px 18px;margin:0;width:100%}
.legal-links a{font-weight:600}
footer:not(.site-footer){background:var(--soft);border-top:1px solid var(--line);padding:30px 6%;display:flex;align-items:center;justify-content:space-between;gap:20px;font-size:13px;flex-wrap:wrap}
footer:not(.site-footer) img{width:150px;height:auto}

#toast{position:fixed;left:50%;bottom:24px;transform:translate(-50%,20px);opacity:0;pointer-events:none;background:var(--ink);color:#fff;padding:12px 18px;border-radius:999px;font-weight:600;z-index:60;transition:opacity .2s,transform .2s}
#toast.show{opacity:1;transform:translate(-50%,0)}

/* Pagina di esito */
.receipt{max-width:680px;margin:48px auto;padding:0 20px}
.receipt-card{border:1px solid var(--line);border-radius:var(--radius);padding:32px;background:var(--surface);box-shadow:var(--shadow)}
.receipt-card h1{font-size:26px;font-weight:800;margin:0 0 10px;letter-spacing:-.01em}
.receipt-card p{line-height:1.7;color:var(--muted)}
.receipt-status{display:inline-flex;align-items:center;gap:8px;font-weight:800;font-size:14px;padding:8px 14px;border-radius:999px;margin-bottom:16px}
.receipt-status.paid{background:var(--ok-wash);color:var(--ok)}
.receipt-status.pending{background:var(--warn-wash);color:var(--warn)}
.receipt-status .dot,.receipt-status.dot{width:9px;height:9px;border-radius:50%;background:currentColor;flex:none;display:inline-block}
.receipt-rows{margin:18px 0 24px;border-top:1px solid var(--line)}
.receipt code{overflow-wrap:anywhere;background:var(--soft);padding:2px 6px;border-radius:4px;font-size:13px}

/* Shop chiuso */
.closed-main{min-height:60vh;display:grid;place-items:center;padding:60px 20px}
.closed-card{max-width:460px;text-align:center;border:1px solid var(--line);border-radius:var(--radius);padding:44px 32px;background:var(--soft)}
.closed-dot{display:inline-block;width:12px;height:12px;border-radius:50%;background:var(--red);margin-bottom:18px}
.closed-card h1{font-size:26px;font-weight:800;margin:0 0 14px;letter-spacing:-.01em}
.closed-card p{line-height:1.7;color:var(--muted);margin:0 0 26px}

/* Tablet */
@media (max-width:960px){
  .hero-inner{grid-template-columns:1fr;gap:28px;padding:48px 20px 40px}
  .checkout{grid-template-columns:1fr;grid-template-areas:"basket" "form";gap:8px}
  .basket{position:static}
  .header-text{display:none}
}

/* Telefono */
@media (max-width:640px){
  html{scroll-padding-top:68px}
  .site-header{padding:8px 16px;gap:10px}
  .site-header > a:first-child img,.brand img{width:148px}
  .hero-facts li{padding:10px 0}
  .hero-facts strong{font-size:16px}
  .hero-facts span{font-size:14px}
  .site-header nav a:not(.cart-link){display:none}
  .site-header nav .cart-link{padding:9px 14px}
  .hero-inner{padding:36px 16px 32px}
  .hero-copy > p:not(.hero-kicker){font-size:17px}
  .hero-copy .button{width:100%}
  .catalog,.companies,.checkout{padding:40px 16px}
  .companies{padding-top:0}
  .companies-actions,.companies-actions .button{width:100%}
  .products{grid-template-columns:1fr;gap:14px}
  .product{display:grid;grid-template-columns:112px minmax(0,1fr)}
  .product-photo{aspect-ratio:auto;height:100%;min-height:150px}
  .product-body{padding:14px;gap:6px}
  .product h3{font-size:17px}
  .product-description{font-size:14px;-webkit-line-clamp:2}
  .product-bottom{flex-wrap:wrap;gap:8px}
  .price strong{font-size:19px}
  .add{min-height:44px;padding:0 16px}
  .basket{padding:18px;margin:0 -4px}
  .form-grid,.fulfillment-choice{grid-template-columns:1fr}
  .address-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .address-grid .span-3,.address-grid .span-2{grid-column:1/-1}
  .checkout-step legend{font-size:18px}
  .segmented{display:flex}
  .segmented label{flex:1}
  .segmented span{text-align:center}
  .mobile-cart-bar{position:fixed;left:0;right:0;bottom:0;z-index:40;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 16px calc(10px + env(safe-area-inset-bottom));background:var(--surface);border-top:1px solid var(--line);box-shadow:0 -6px 20px rgba(29,33,39,.08)}
  .mobile-cart-bar[hidden]{display:none!important}
  .mobile-cart-bar span{display:flex;flex-direction:column;line-height:1.2}
  .mobile-cart-bar strong{font-size:19px;font-variant-numeric:tabular-nums}
  .mobile-cart-bar small{color:var(--muted)}
  .mobile-cart-bar .button{min-height:46px;padding:10px 18px}
  #toast{bottom:84px}
  .site-footer{padding:28px 16px 96px}
  .receipt-card{padding:22px}
}

/* Avviso del primo giorno di ritiro */
.pickup-notice{display:flex;align-items:center;justify-content:center;gap:12px;padding:14px max(16px,calc((100% - 1180px)/2));background:#f2b705;color:#2a1c00;text-align:center}
.pickup-notice p{margin:0;font-size:17px;line-height:1.35}
.pickup-notice strong{font-size:19px}
.pickup-notice-icon{font-size:26px}
@media (max-width:640px){.pickup-notice{flex-direction:column;gap:4px}.pickup-notice strong{font-size:17px}.pickup-notice p{font-size:15px}}
.pickup-note{background:#fff4d6;border-left:4px solid #f2b705;border-radius:8px;padding:12px 14px}
.method-from{display:inline-block;margin-top:4px;padding:2px 10px;border-radius:999px;background:#fff4d6;color:#6b4e00;font-weight:700}
.net-quantity{font-size:14px;font-weight:600;color:var(--muted);white-space:nowrap}
.food-info{font-size:14px;color:var(--ink);border-top:1px solid var(--line);padding-top:8px}
.food-info summary{cursor:pointer;font-weight:700;color:var(--red);min-height:32px;display:flex;align-items:center}
.food-info p{margin:6px 0;line-height:1.45}
.food-allergens{background:#fff4d6;border-radius:8px;padding:6px 10px}
