/* La Porta del Benessere — stili comuni alle tre versioni.
   I colori arrivano dal foglio della singola versione (style.css) con le variabili --vino, --bg, ecc. */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--sans); font-size: 17px; line-height: 1.65; color: var(--ink); background: var(--bg); padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
img { max-width: 100%; display: block; height: auto; }
[hidden] { display: none !important; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--display); font-weight: 500; line-height: 1.08; letter-spacing: -0.005em; margin: 0 0 .45em; text-wrap: balance; color: var(--vino-testo); }
h2 { font-size: clamp(2.2rem, 7vw, 3.5rem); }
h3 { font-size: 1.75rem; font-weight: 600; }
h1 em, h2 em { font-style: italic; color: var(--vino); }
p { margin: 0 0 1em; }
section[id] { scroll-margin-top: 80px; }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 max(var(--gut), env(safe-area-inset-right)) 0 max(var(--gut), env(safe-area-inset-left)); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 100; background: var(--vino); color: #fff; padding: 10px 14px; }
.skip:focus { top: 8px; }
:focus-visible { outline: 2px solid var(--oro); outline-offset: 3px; }

.preview-strip { min-height: 28px; display: flex; align-items: center; justify-content: center; background: var(--vino); color: #fff; font-size: 12px; letter-spacing: .06em; padding: 4px 12px; text-align: center; }

/* ---- pulsanti: uno solo conta, WhatsApp ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; font: 700 1rem/1.1 var(--sans); letter-spacing: .01em; text-decoration: none; padding: 17px 28px; border-radius: 999px; border: 1.5px solid transparent; cursor: pointer; transition: background .25s, color .25s, border-color .25s, transform .25s, box-shadow .25s; }
.btn svg { width: 21px; height: 21px; fill: currentColor; flex: none; }
.btn:hover { transform: translateY(-2px); }
.btn-wa { background: var(--vino); color: #fff; box-shadow: 0 12px 24px -14px var(--vino); }
.btn-wa:hover { background: var(--vino-h); }
.btn-chiaro { background: #fff; color: var(--vino); }
.btn-chiaro:hover { background: var(--carta); }
.btn-block { width: 100%; }
.link { color: var(--vino); font-weight: 700; text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1.5px no-repeat; padding-bottom: 3px; transition: background-size .3s; }
.link:hover { background-size: 30% 1.5px; }
.link-wa { display: inline-flex; align-items: center; gap: 8px; }
.link-wa svg { width: 18px; height: 18px; fill: currentColor; flex: none; }
.micro { font-size: .86rem; color: var(--muted); margin: 12px 0 0; }

.kicker { display: flex; align-items: center; gap: 12px; font: 700 .74rem/1.4 var(--sans); letter-spacing: .24em; text-transform: uppercase; color: var(--oro-testo); margin: 0 0 16px; }
.kicker::before { content: ""; width: 28px; height: 1px; background: currentColor; opacity: .7; }

/* ---- aperto / chiuso ---- */
.status { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: .9rem; font-weight: 600; color: var(--ink); margin: 16px 0 0; }
.status .dot { width: 9px; height: 9px; border-radius: 50%; background: #a39699; flex: none; position: relative; }
.status.is-open .dot { background: var(--ok); }
.status.is-open .dot::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--ok); opacity: 0; animation: dot 2.4s ease-out infinite; }
@keyframes dot { 0% { transform: scale(.5); opacity: .7; } 80%, 100% { transform: scale(1.5); opacity: 0; } }
.status .hint { font-weight: 400; color: var(--muted); }
.badge { display: inline-block; font: 700 .7rem/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; padding: 6px 10px; border-radius: 99px; background: #a39699; color: #fff; vertical-align: middle; }
.badge.is-open { background: var(--ok); }

/* ---- orari ---- */
.hours { width: 100%; border-collapse: collapse; font-size: .95rem; }
.hours th, .hours td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.hours th { font-weight: 600; }
.hours td { text-align: right; }
.hours tr.is-today { background: var(--rosa); color: var(--vino-testo); font-weight: 700; }
.hours tr.is-today th::after { content: " · oggi"; font-weight: 400; }
.hours-next { font-size: .88rem; color: var(--muted); margin: 10px 0 0; }

/* ---- ZTL ---- */
.ztl { scroll-margin-top: 96px; background: var(--avviso-bg); border-left: 3px solid var(--oro); border-radius: 4px; padding: 14px 16px; font-size: .95rem; }
.ztl p { margin: 0 0 8px; }
.ztl-title { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--oro-testo); }
.ztl-title svg { width: 18px; height: 18px; fill: currentColor; flex: none; }
.ztl-links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 4px 0 0 !important; font-size: .9rem; }
.ztl:target { animation: flash 1.6s ease-out; }
@keyframes flash { 0%, 30% { box-shadow: 0 0 0 4px var(--oro); } 100% { box-shadow: 0 0 0 0 transparent; } }

.map { border-radius: 6px; overflow: hidden; aspect-ratio: 4 / 3; background: var(--rosa); }
.map iframe { width: 100%; height: 100%; border: 0; display: block; }

/* ---- il messaggio che si scrive da solo ---- */
.composer { display: grid; gap: 22px; }
.composer fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.composer legend { padding: 0; font-weight: 700; font-size: .92rem; margin-bottom: 10px; color: var(--vino-testo); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips label { margin: 0; }
.chips input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chips span { display: inline-block; padding: 11px 17px; border: 1.5px solid var(--line-2); border-radius: 999px; background: #fff; cursor: pointer; font-size: .97rem; font-weight: 600; color: var(--ink); transition: background .2s, border-color .2s, color .2s; user-select: none; }
.chips span:hover { border-color: var(--vino); }
.chips input:checked + span { background: var(--vino); border-color: var(--vino); color: #fff; }
.chips input:focus-visible + span { outline: 2px solid var(--oro); outline-offset: 2px; }

/* anteprima: come si vedrà in chat */
.chat { border-radius: 14px; overflow: hidden; background: #efe7dd; box-shadow: 0 30px 50px -36px rgba(60, 25, 30, .45), 0 0 0 1px rgba(60, 25, 30, .08); }
.chat-top { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: #f6f1ec; border-bottom: 1px solid rgba(60, 25, 30, .08); }
.chat-top .av { width: 36px; height: 36px; border-radius: 50%; background: var(--vino); display: grid; place-items: center; flex: none; }
.chat-top .av img { width: 24px; }
.chat-top b { display: block; font-size: .95rem; line-height: 1.2; color: var(--ink); }
.chat-top small { display: block; font-size: .78rem; color: var(--muted); line-height: 1.3; }
.chat-body { padding: 18px 14px 20px; min-height: 132px; display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-end; }
.bubble { position: relative; max-width: 92%; margin: 0; background: #d9fdd3; color: #111b21; font-size: .97rem; line-height: 1.45; padding: 8px 12px 20px; border-radius: 10px 0 10px 10px; box-shadow: 0 1px .5px rgba(11, 20, 26, .13); }
.bubble::after { content: "adesso  ✓✓"; position: absolute; right: 10px; bottom: 4px; font-size: .68rem; color: #667781; white-space: pre; }
.bubble.is-new { animation: pop .35s ease-out; }
@keyframes pop { from { transform: scale(.97); opacity: .6; } }

/* ---- barra fissa sul telefono: WhatsApp al centro, più grande ---- */
.action-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; display: grid; grid-template-columns: 64px 1fr 64px; gap: 8px; align-items: center; background: var(--bar-bg); border-top: 1px solid var(--line); padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); box-shadow: 0 -12px 24px -20px rgba(60, 25, 30, .5); }
.action-bar a { text-decoration: none; }
.ab-side { height: 50px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--vino-testo); font-size: .68rem; font-weight: 700; border-radius: 10px; }
.ab-side svg { width: 20px; height: 20px; fill: var(--vino); }
.ab-wa { height: 50px; display: flex; align-items: center; justify-content: center; gap: 9px; background: var(--vino); color: #fff; border-radius: 999px; font-weight: 700; font-size: 1rem; }
.ab-wa svg { width: 21px; height: 21px; fill: currentColor; }

/* pulsante che segue, solo da computer */
.wa-float { display: none; }

/* ---- comparsa allo scorrere ---- */
.js .rv { opacity: 0; transform: translateY(14px); transition: opacity .8s ease, transform .8s cubic-bezier(.2, .7, .2, 1); transition-delay: calc(var(--d, 0) * 90ms); }
.js .rv.in { opacity: 1; transform: none; }

/* ---- piè di pagina ---- */
.footer { font-size: .93rem; }
.footer a { text-decoration: none; overflow-wrap: anywhere; }
.footer a:hover { text-decoration: underline; }
.footer-bottom { font-size: .8rem; }
.footer-bottom p { margin: 0 0 4px; }

@media (min-width: 900px) {
  body { padding-bottom: 0; }
  .action-bar { display: none; }
  .wa-float { display: inline-flex; align-items: center; gap: 10px; position: fixed; right: 26px; bottom: 26px; z-index: 60; background: var(--vino); color: #fff; text-decoration: none; font-weight: 700; font-size: .98rem; padding: 15px 22px; border-radius: 999px; box-shadow: 0 18px 30px -16px rgba(60, 25, 30, .7); opacity: 0; transform: translateY(16px); pointer-events: none; transition: opacity .35s, transform .35s, background .25s; }
  .wa-float svg { width: 22px; height: 22px; fill: currentColor; }
  .wa-float.is-on { opacity: 1; transform: none; pointer-events: auto; }
  .wa-float:hover { background: var(--vino-h); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .rv { opacity: 1; transform: none; }
}
