/* Bettadea – stile ispirato ai volantini Just delle Feste */

@font-face {
  font-family: "Playfair";
  src: url("../fonts/PlayfairDisplay-Italic.woff2") format("woff2");
  font-style: italic;
  font-weight: 400 900;
  font-display: swap;
}
@font-face {
  font-family: "Figtree";
  src: url("../fonts/Figtree.woff2") format("woff2");
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
}

:root {
  --wine: #7A2532;
  --wine-deep: #5E1B24;
  --blush: #F7E6E2;
  --rose: #C98587;
  --gold: #C9A46A;
  --ink: #3B1B20;
  --paper: #FFFCFB;
  --line: rgba(59, 27, 32, .18);
  --serif: "Playfair", "Playfair Display", Georgia, serif;
  --sans: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --pad: clamp(1.25rem, 5vw, 4rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 7rem; }
body {
  margin: 0;
  font: 400 1.0625rem/1.6 var(--sans);
  color: var(--ink);
  background: var(--paper);
  padding-top: env(safe-area-inset-top, 0px);
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; z-index: 50; background: #fff; padding: .5rem 1rem; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.small { font-size: .875rem; opacity: .85; }

/* ---------- Barra in alto ---------- */
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .4rem var(--pad);
  background: var(--wine-deep); color: #fff;
}
.brand { text-decoration: none; display: flex; align-items: center; gap: .75rem; }
.brand-logo { height: 88px; width: auto; }
.brand-sub { font-size: .875rem; opacity: .8; }
@media (max-width: 560px) {
  .brand-logo { height: 64px; }
  .brand-sub { display: none; }
}
.cart-link {
  text-decoration: none; font-weight: 600; display: inline-flex; align-items: center; gap: .45rem;
  padding: .45rem 1rem; border: 1.5px solid rgba(255,255,255,.55); border-radius: 999px;
}
.cart-link:hover { background: rgba(255,255,255,.1); }
.cart-badge {
  background: var(--gold); color: var(--wine-deep); border-radius: 999px;
  min-width: 1.5rem; padding: 0 .4rem; text-align: center; font-size: .85rem;
}

.flash { margin: 1rem var(--pad); padding: .8rem 1rem; border-radius: 8px; background: #E9F3EA; color: #1E4B26; }
.flash-err { background: #FBE3E3; color: #7A1D1D; }
.plain .flash { margin-left: 0; margin-right: 0; }

/* ---------- Apertura ---------- */
.intro {
  background: var(--wine-deep);
  color: #F8EDE7;
  padding: clamp(3rem, 9vw, 7rem) var(--pad) clamp(2.5rem, 6vw, 4.5rem);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.intro::before, .accesso::before { /* luci sfocate come nei volantini */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(circle at 12% 30%, rgba(233,170,110,.45) 0 6px, transparent 7px),
    radial-gradient(circle at 85% 22%, rgba(255,226,180,.55) 0 4px, transparent 5px),
    radial-gradient(circle at 70% 78%, rgba(233,170,110,.35) 0 9px, transparent 10px),
    radial-gradient(circle at 25% 85%, rgba(255,226,180,.4) 0 3px, transparent 4px),
    radial-gradient(circle at 50% 10%, rgba(255,226,180,.3) 0 5px, transparent 6px);
}
.intro h1 {
  position: relative;
  font: italic 700 clamp(2.8rem, 9vw, 6.5rem)/1.02 var(--serif);
  color: var(--gold);
  margin: 0 auto .4em;
  max-width: 14ch;
  letter-spacing: -.01em;
}
.intro p { position: relative; max-width: 46ch; margin: 0 auto; font-size: 1.15rem; }

/* ---------- Fasce prodotto ---------- */
.band {
  --fg: var(--ink);
  background: var(--band, var(--blush));
  color: var(--fg);
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  align-items: center;
}
.band-dark { --fg: #FBF0EC; }
.band-flip .band-img { order: 2; }
.band-img { margin: 0; position: relative; align-self: stretch; }
.band-img img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4 / 3; }
.bubble {
  position: absolute; right: 1.25rem; bottom: 1.25rem;
  background: var(--wine-deep); color: #fff;
  font-weight: 600; font-size: .95rem;
  padding: .6rem 1.1rem; border-radius: 1.4rem 1.4rem 1.4rem .3rem;
  box-shadow: 0 6px 18px rgba(40, 10, 15, .25);
}
.band-dark .bubble { background: var(--gold); color: var(--wine-deep); }
.band-flip .bubble { right: auto; left: 1.25rem; border-radius: 1.4rem 1.4rem .3rem 1.4rem; }

.band-body { padding: clamp(2rem, 5vw, 4.5rem) var(--pad); max-width: 38rem; }
.band-flip .band-body { justify-self: end; }
.band h2 {
  font: italic 700 clamp(2rem, 4.2vw, 3.1rem)/1.08 var(--serif);
  margin: 0 0 .35em;
}
.band-light h2, .band-light .price { color: var(--wine); }
.band-dark h2, .band-dark .price { color: var(--gold); }
.price { font: italic 700 clamp(2.2rem, 5vw, 3.2rem)/1 var(--serif); margin: 0 0 1rem; }
.price span { font: 400 1.1rem var(--sans); }
.desc { margin: 0 0 1rem; max-width: 48ch; }

.contents { border-top: 1px solid currentColor; border-bottom: 1px solid currentColor; margin: 0 0 1.5rem; border-color: color-mix(in srgb, currentColor 30%, transparent); }
.contents summary { cursor: pointer; font-weight: 600; padding: .7rem 0; list-style: none; display: flex; justify-content: space-between; }
.contents summary::-webkit-details-marker { display: none; }
.contents summary::after { content: "+"; font-size: 1.3rem; line-height: 1; }
.contents[open] summary::after { content: "−"; }
.contents ul { margin: 0 0 1rem; padding-left: 1.1rem; }
.contents li { margin: .25rem 0; }
.contents li::marker { color: var(--gold); }
.band-light .contents li::marker { color: var(--wine); }

.buy { display: flex; flex-wrap: wrap; align-items: end; gap: 1rem; }
.variants { border: 0; padding: 0; margin: 0; width: 100%; display: flex; flex-wrap: wrap; gap: .5rem; }
.variants legend { font-weight: 600; margin-bottom: .4rem; }
.variants label {
  border: 1.5px solid currentColor; border-radius: 999px; padding: .35rem .9rem; cursor: pointer;
  display: inline-flex; align-items: center; gap: .4rem;
}
.variants input { accent-color: var(--wine); }
.variants label:has(input:checked) { background: var(--wine-deep); color: #fff; border-color: var(--wine-deep); }
.qty { display: flex; flex-direction: column; font-size: .9rem; font-weight: 600; }
.qty input { width: 5rem; }
.soldout { font: italic 700 1.6rem var(--serif); }
.few { font-size: .9rem; margin-top: .6rem; }

/* ---------- Bottoni e campi ---------- */
.btn {
  display: inline-block; cursor: pointer; text-decoration: none; text-align: center;
  font: 700 1rem/1.2 var(--sans);
  padding: .95rem 1.6rem; border-radius: 999px;
  background: var(--wine-deep); color: #fff; border: 2px solid var(--wine-deep);
  transition: transform .15s ease, background .15s ease;
}
.btn:hover { background: var(--wine); border-color: var(--wine); }
.btn:active { transform: translateY(1px); }
.band-dark .btn { background: #fff; color: var(--wine-deep); border-color: #fff; }
.band-dark .btn:hover { background: var(--blush); }
.btn-ghost { background: transparent; color: inherit; border-color: currentColor; }
.btn-ghost:hover { background: rgba(0,0,0,.06); color: inherit; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; text-decoration: underline; cursor: pointer; color: inherit; }
.danger { color: #A3222E; }

input, select, textarea {
  font: inherit; color: var(--ink);
  padding: .7rem .8rem; border: 1.5px solid var(--line); border-radius: 8px; background: #fff;
  width: 100%;
}
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--wine); }
input[type=color] { padding: .2rem; height: 2.8rem; }
.band input { border-color: rgba(0,0,0,.2); }
.field { margin-bottom: 1rem; }
.field > label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: .3rem; }
.has-err input { border-color: #A3222E; }
.err { color: #A3222E; font-size: .88rem; margin: .3rem 0 0; }
.choice { display: flex; gap: .55rem; align-items: flex-start; font-weight: 400; margin-bottom: .5rem; cursor: pointer; }
.choice input { margin-top: .3rem; }
fieldset { border: 0; padding: 0; margin: 0 0 1.5rem; min-width: 0; }
legend { font: italic 700 1.4rem var(--serif); color: var(--wine); margin-bottom: .7rem; padding: 0; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.row3 { display: grid; grid-template-columns: 1fr 2fr 1fr; gap: 1rem; }

/* ---------- Party ---------- */
.party {
  background: #F1E2D3;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center; padding: clamp(2.5rem, 6vw, 5rem) var(--pad);
}
.party h2 { font: italic 700 clamp(2rem, 4vw, 3rem)/1.1 var(--serif); color: #23377F; margin: 0 0 .5em; }
.party-text { max-width: 36rem; }
.party-imgs { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.party-imgs img { border-radius: 4px; aspect-ratio: 1 / 1; object-fit: cover; width: 100%; }

/* ---------- Pagine semplici ---------- */
.page-plain main { background: var(--blush); min-height: 60vh; }
.plain { max-width: 64rem; margin: 0 auto; padding: clamp(2rem, 5vw, 3.5rem) var(--pad); }
.plain h1 { font: italic 700 clamp(2.2rem, 5vw, 3.2rem)/1.1 var(--serif); color: var(--wine); margin: 0 0 1.25rem; }
.legal { max-width: 46rem; line-height: 1.7; }
.legal h2 { font: 700 1.2rem/1.3 var(--sans); color: var(--wine); margin: 2rem 0 .5rem; }
.legal h3 { font-size: 1.05rem; margin: 1.4rem 0 .4rem; }
.legal .seller, .form-tpl { background: #fff; padding: 1rem 1.2rem; border-radius: 8px; }
.table-wrap { overflow-x: auto; }
.cookie-table { border-collapse: collapse; width: 100%; background: #fff; }
.cookie-table th, .cookie-table td { padding: .6rem .8rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }

/* Carrello */
.cart-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 10px; overflow: hidden; }
.cart-table th { text-align: left; font-size: .85rem; padding: .8rem; border-bottom: 1px solid var(--line); }
.cart-table td { padding: .9rem .8rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.cart-table input { width: 4.5rem; }
.cart-prod { display: flex; gap: .9rem; align-items: center; }
.cart-prod img { width: 96px; border-radius: 6px; }
.cart-foot { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; margin: 1rem 0; }
.cart-sub { font-size: 1.2rem; margin: 0; }
.cart-next { margin: 1.5rem 0 .5rem; }

/* Checkout */
.checkout-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 3rem); align-items: start; }
.summary { background: #fff; border-radius: 10px; padding: 1.4rem; }
.checkout .summary { position: sticky; top: 5rem; }
.summary h2 { font: italic 700 1.5rem var(--serif); color: var(--wine); margin: 0 0 1rem; }
.summary ul { list-style: none; margin: 0 0 1rem; padding: 0; }
.summary li, .sum-row { display: flex; justify-content: space-between; gap: 1rem; margin: .45rem 0; }
.sum-tot { border-top: 1px solid var(--line); padding-top: .7rem; font-weight: 700; font-size: 1.15rem; }
.delivery .small { margin: -.2rem 0 1rem 1.6rem; }

/* Pagamento */
.pay-box { background: #fff; border-radius: 12px; padding: clamp(1.4rem, 4vw, 2.2rem); max-width: 30rem; }
.pay-total { margin: 0 0 1rem; }
.pay-total strong { font: italic 700 2.4rem/1.2 var(--serif); color: var(--wine); }
.testmode { background: #FFF5D6; border: 1px dashed #B48A1E; padding: .8rem 1rem; border-radius: 8px; font-size: .92rem; }
.btn-pay { width: 100%; background: #635BFF; border-color: #635BFF; }
.btn-pay:hover { background: #4F46E5; border-color: #4F46E5; }
.thanks .summary { margin: 1.5rem 0; max-width: 32rem; }

/* ---------- Footer ---------- */
.site-footer { background: var(--wine-deep); color: #F3E3DE; padding: 2.5rem var(--pad) calc(1.5rem + env(safe-area-inset-bottom, 0px)); font-size: .95rem; }
.foot-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem; }
.foot-shop { font: italic 700 1.5rem var(--serif); color: var(--gold); margin: 0 0 .5rem; }
.site-footer nav { display: flex; flex-direction: column; gap: .4rem; }
.foot-note { margin: 2rem 0 0; font-size: .8rem; opacity: .65; }

/* ---------- Pagina di accesso (password del sito) ---------- */
body.accesso {
  position: relative; overflow-x: hidden;
  min-height: 100vh; min-height: 100dvh;
  display: grid; place-items: center;
  padding: max(1.5rem, env(safe-area-inset-top, 0px)) 16px 2rem;
  background: var(--wine-deep); color: #F8EDE7;
}
.accesso-box { position: relative; width: min(100%, 640px); text-align: center; }
.accesso-logo { margin: 0 0 1.75rem; }
.accesso-logo img { width: 100%; height: auto; margin: 0 auto; }
.accesso-form label { display: block; font-weight: 600; margin-bottom: .7rem; }
.accesso-riga { display: flex; gap: .6rem; max-width: 26rem; margin: 0 auto; }
.accesso-riga input {
  flex: 1; min-width: 0; font-size: 1.1rem; padding: .85rem 1.1rem;
  border: 1.5px solid rgba(255,255,255,.55); border-radius: 999px;
}
.accesso .btn { background: var(--gold); border-color: var(--gold); color: var(--wine-deep); }
.accesso .btn:hover { background: #D8B67E; border-color: #D8B67E; }
.accesso-err { margin: .9rem 0 0; font-weight: 600; color: #FFD9D3; }
@media (max-width: 420px) {
  .accesso-riga { flex-direction: column; }
}

/* ---------- Mobile ---------- */
@media (max-width: 820px) {
  .band, .party, .checkout-grid, .foot-cols { grid-template-columns: 1fr; }
  .band-flip .band-img { order: 0; }
  .band-flip .band-body { justify-self: start; }
  .band-flip .bubble { left: auto; right: 1.25rem; border-radius: 1.4rem 1.4rem 1.4rem .3rem; }
  .checkout .summary { position: static; order: -1; }
  .row3 { grid-template-columns: 1fr 1fr; }
  .row3 .field:nth-child(2) { grid-column: 1 / -1; grid-row: 1; }
  .cart-table thead { display: none; }
  .cart-table, .cart-table tbody, .cart-table tr, .cart-table td { display: block; width: 100%; }
  .cart-table tr { border-bottom: 1px solid var(--line); padding: .6rem 0; }
  .cart-table td { border: 0; padding: .3rem .8rem; }
  .cart-table td[data-label]:not([data-label="Prodotto"])::before { content: attr(data-label) ": "; font-weight: 600; }
}

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