:root {
  --bg: #fffaf6;
  --surface: #ffffff;
  --ink: #3b2f33;
  --muted: #7c6b70;
  --line: #f0e2dc;
  --peach: #e8a598;
  --peach-dark: #c9776a;
  --rose: #f4d4d8;
  --lilac: #e9c8f0;
  --butter: #fdf1c2;
  --wa: #1f9d55;
  --radius: 18px;
  --shadow: 0 10px 30px -12px rgba(120, 70, 70, .25);
  --script: "Great Vibes", cursive;
  --sans: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3 { line-height: 1.15; margin: 0; }
.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }

/* ---------- barra in alto ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(255, 250, 246, .9); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar-in { display: flex; align-items: center; gap: 24px; height: 66px; }
.logo { font-family: var(--script); font-size: 2rem; text-decoration: none; line-height: 1; margin: 0; white-space: nowrap; }
.topnav { display: flex; gap: 22px; margin-left: auto; font-weight: 600; font-size: .95rem; }
.topnav a { text-decoration: none; color: var(--muted); }
.topnav a:hover { color: var(--ink); }
.cart-btn { position: relative; display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); padding: 9px 16px; border-radius: 999px; font-weight: 700; }
.cart-btn:hover { border-color: var(--peach); }
.cart-count { position: absolute; top: -6px; right: -6px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--peach-dark); color: #fff; font-size: .75rem; display: grid; place-items: center; }
.cart-count[hidden] { display: none; }
.cart-count.pop { animation: pop .35s ease; }
@keyframes pop { 50% { transform: scale(1.35); } }

/* ---------- hero ---------- */
.hero { background: linear-gradient(100deg, var(--butter) 0%, var(--rose) 50%, var(--lilac) 100%); overflow: hidden; }
.hero-in { display: grid; grid-template-columns: 1.05fr 1fr; gap: 40px; align-items: center; padding: 64px 0 72px; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .78rem; font-weight: 800; color: var(--peach-dark); margin: 0 0 8px; }
.script { font-family: var(--script); font-weight: 400; font-size: clamp(3.4rem, 7vw, 5.6rem); display: inline-block; padding: 0 .1em; }
.lead { font-size: 1.25rem; font-weight: 700; margin: 6px 0 12px; }
.hero-sub { color: #5d4b50; max-width: 46ch; margin: 0 0 26px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-photos { position: relative; height: 420px; }
.hp { position: absolute; object-fit: cover; border-radius: 22px; box-shadow: var(--shadow); border: 6px solid #fff; }
.hp1 { width: 58%; height: 86%; right: 4%; top: 2%; transform: rotate(3deg); }
.hp2 { width: 42%; height: 46%; left: 2%; top: 8%; transform: rotate(-5deg); }
.hp3 { width: 44%; height: 44%; left: 10%; bottom: 0; transform: rotate(2deg); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 999px; padding: 13px 24px; font-weight: 800; text-decoration: none; transition: transform .15s, background .15s; }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: #241b1e; }
.btn-ghost { background: rgba(255, 255, 255, .7); color: var(--ink); }
.btn-ghost:hover { background: #fff; }
.btn-wa { background: var(--wa); color: #fff; }
.btn-wa:hover { background: #188547; }
.btn-full { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

/* ---------- catalogo ---------- */
.catalogo { padding: 56px 0 40px; }
.cat-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.cat-head h2, .come h2 { font-size: 2rem; font-weight: 800; }
.search { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 0 16px; color: var(--muted); width: min(320px, 100%); }
.search input { border: 0; outline: 0; background: none; padding: 11px 0; font: inherit; color: var(--ink); width: 100%; }
.search:focus-within { border-color: var(--peach); }
.filtri { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 10px; scrollbar-width: none; }
.filtri::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 8px 16px; font-weight: 700; font-size: .92rem; color: var(--muted); }
.chip:hover { color: var(--ink); border-color: var(--peach); }
.chip[aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip small { opacity: .6; font-weight: 600; margin-left: 4px; }
.risultati { color: var(--muted); font-size: .9rem; margin: 4px 0 18px; min-height: 1.4em; }

.griglia { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 22px; }
.card { background: var(--surface); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); display: flex; flex-direction: column; transition: transform .2s, box-shadow .2s; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card-img { position: relative; aspect-ratio: 1; background: #f7efe9; border: 0; padding: 0; display: block; width: 100%; }
.card-img { overflow: hidden; }
.card-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.card:hover .card-img img { transform: scale(1.04); }
.badge { position: absolute; top: 10px; left: 10px; background: var(--peach-dark); color: #fff; font-size: .72rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; }
.n-foto { position: absolute; bottom: 10px; right: 10px; background: rgba(0, 0, 0, .55); color: #fff; font-size: .72rem; padding: 3px 8px; border-radius: 999px; }
.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card-cat { font-size: .74rem; text-transform: uppercase; letter-spacing: .1em; color: var(--peach-dark); font-weight: 800; }
.card-nome { font-weight: 800; font-size: 1.04rem; background: none; border: 0; padding: 0; text-align: left; }
.card-nome:hover { text-decoration: underline; text-underline-offset: 3px; }
.card-misura { color: var(--muted); font-size: .86rem; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 10px; }
.prezzo { font-weight: 800; font-size: 1.1rem; }
.prezzo.richiesta { font-size: .9rem; color: var(--muted); font-weight: 700; }
.add { border: 0; background: var(--rose); color: var(--ink); font-weight: 800; font-size: .88rem; padding: 8px 14px; border-radius: 999px; white-space: nowrap; }
.add:hover { background: var(--peach); color: #fff; }
.vuoto { grid-column: 1 / -1; text-align: center; padding: 48px 0; color: var(--muted); }

/* ---------- come ordinare ---------- */
.come { padding: 56px 0; background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.passi { list-style: none; padding: 0; margin: 26px 0 18px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.passi li { background: var(--bg); border-radius: var(--radius); padding: 22px; border: 1px solid var(--line); }
.passi b { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg, var(--butter), var(--lilac)); font-weight: 800; margin-bottom: 12px; }
.passi h3 { font-size: 1.1rem; margin-bottom: 6px; }
.passi p { margin: 0; color: var(--muted); }
.nota-handmade { color: var(--muted); margin: 0; }

/* ---------- footer ---------- */
.footer { padding: 40px 0 24px; }
.footer-in { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; align-items: start; }
.footer-in p { margin: 4px 0; color: var(--muted); }
.footer .logo { color: var(--ink); }
.contatti { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.contatti a { text-decoration: none; font-weight: 700; display: inline-flex; gap: 8px; align-items: center; }
.contatti a:hover { color: var(--peach-dark); }
.copy { color: var(--muted); font-size: .85rem; margin-top: 28px; border-top: 1px solid var(--line); padding-top: 18px; }

/* ---------- scheda prodotto ---------- */
.scheda { border: 0; padding: 0; border-radius: 24px; width: min(920px, 100% - 32px); max-height: calc(100dvh - 32px); background: var(--surface); color: var(--ink); box-shadow: 0 30px 80px -20px rgba(60, 30, 40, .45); }
.scheda::backdrop { background: rgba(50, 30, 35, .5); backdrop-filter: blur(3px); }
.scheda[open] { animation: entra .22s ease; }
@keyframes entra { from { opacity: 0; transform: translateY(12px); } }
.scheda-in { display: grid; grid-template-columns: 1.1fr 1fr; }
.galleria { background: #f7efe9; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.galleria > img { width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: 14px; background: #fff; }
.miniature { display: flex; gap: 8px; flex-wrap: wrap; }
.miniature button { border: 2px solid transparent; padding: 0; border-radius: 10px; overflow: hidden; width: 64px; height: 64px; background: #fff; }
.miniature button[aria-current="true"] { border-color: var(--peach-dark); }
.miniature img { width: 100%; height: 100%; object-fit: cover; }
.scheda-info { padding: 34px 30px 28px; display: flex; flex-direction: column; gap: 10px; }
.scheda-cat { margin: 0; font-size: .78rem; text-transform: uppercase; letter-spacing: .12em; color: var(--peach-dark); font-weight: 800; }
.scheda-info h2 { font-size: 1.8rem; font-weight: 800; }
.scheda-prezzo { font-size: 1.5rem; font-weight: 800; margin: 0; }
.scheda-misura, .scheda-descr { margin: 0; color: var(--muted); }
.scheda-misura:empty, .scheda-descr:empty { display: none; }
.varianti { display: flex; flex-wrap: wrap; gap: 8px; }
.varianti:empty { display: none; }
.varianti button { border: 1.5px solid var(--line); background: #fff; border-radius: 12px; padding: 9px 14px; font-weight: 700; }
.varianti button[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: #fff; }
.qta-riga { display: flex; justify-content: space-between; align-items: center; margin: 6px 0; font-weight: 700; }
.qta { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; }
.qta button { border: 0; background: none; width: 36px; height: 36px; font-size: 1.2rem; }
.qta output { min-width: 26px; text-align: center; font-weight: 800; }
.scheda-nota { color: var(--muted); font-size: .85rem; margin: 2px 0 0; text-align: center; }
.chiudi { position: absolute; top: 12px; right: 12px; z-index: 2; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .92); font-size: 1.6rem; line-height: 1; box-shadow: 0 2px 8px rgba(0, 0, 0, .12); }

/* ---------- carrello ---------- */
.velo { position: fixed; inset: 0; background: rgba(50, 30, 35, .45); z-index: 40; }
.carrello { position: fixed; top: 0; right: 0; bottom: 0; z-index: 50; width: min(420px, 100%); background: var(--surface); display: flex; flex-direction: column; transform: translateX(100%); visibility: hidden; transition: transform .28s ease, visibility 0s .28s; }
.carrello.aperto { transform: none; visibility: visible; transition: transform .28s ease; box-shadow: -20px 0 50px -20px rgba(60, 30, 40, .35); }
.carr-head { position: relative; padding: 22px 22px 14px; border-bottom: 1px solid var(--line); }
.carr-head h2 { font-size: 1.35rem; font-weight: 800; }
.carr-head .chiudi { top: 14px; box-shadow: none; background: var(--bg); }
.carrello { overflow-y: auto; overscroll-behavior: contain; }
.carr-head { position: sticky; top: 0; background: var(--surface); z-index: 1; }
.carr-body { flex: 1 0 auto; padding: 8px 22px; }
.riga { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.riga img { width: 64px; height: 64px; object-fit: cover; border-radius: 12px; }
.riga-nome { font-weight: 800; line-height: 1.25; }
.riga-var { color: var(--muted); font-size: .85rem; }
.riga-dx { display: flex; flex-direction: column; align-items: end; gap: 6px; }
.riga .qta button { width: 28px; height: 28px; font-size: 1rem; }
.riga-prezzo { font-weight: 800; font-size: .95rem; }
.carr-vuoto { text-align: center; color: var(--muted); padding: 48px 10px; }
.carr-foot { border-top: 1px solid var(--line); padding: 16px 22px 22px; display: flex; flex-direction: column; gap: 10px; background: var(--bg); }
.carr-foot[hidden] { display: none; }
.totale { display: flex; justify-content: space-between; font-size: 1.1rem; }
.carr-nota { margin: 0; font-size: .84rem; color: var(--muted); }
.campo { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; font-weight: 700; }
.campo input, .campo textarea { font: inherit; font-weight: 400; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: #fff; resize: vertical; }
.campo input:focus, .campo textarea:focus { outline: 2px solid var(--peach); border-color: transparent; }
.link-email { text-align: center; font-size: .9rem; color: var(--muted); cursor: pointer; }
.avviso { margin: 0; font-size: .8rem; background: var(--butter); padding: 8px 10px; border-radius: 10px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 30px); opacity: 0; background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 999px; font-weight: 700; z-index: 60; transition: .25s; pointer-events: none; max-width: calc(100% - 32px); text-align: center; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

:focus-visible { outline: 2px solid var(--peach-dark); outline-offset: 2px; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .topnav { display: none; }
  .cart-btn { margin-left: auto; }
  .hero-in { grid-template-columns: 1fr; padding: 40px 0 48px; gap: 28px; }
  .hero-photos { height: 300px; }
  .passi { grid-template-columns: 1fr; }
  .scheda-in { grid-template-columns: 1fr; }
  .galleria > img { aspect-ratio: auto; height: min(46vh, 420px); }
  .scheda-info { padding: 22px 20px 24px; }
}
@media (max-width: 520px) {
  .logo { font-size: 1.7rem; }
  .cart-btn span { display: none; }
  .cart-btn { padding: 9px 12px; }
  .griglia { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .card-body { padding: 10px 12px 12px; }
  .card-nome { font-size: .95rem; }
  .card-foot { flex-direction: column; align-items: stretch; gap: 8px; }
  .add { text-align: center; }
  .scheda { width: 100%; max-height: 100dvh; border-radius: 20px 20px 0 0; margin-bottom: 0; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
