/* ============================================================
   Oltre il Visibile — banner consensi, preferenze e calendario
   ============================================================ */

/* ---------- banner ---------- */
.consent-banner {
  position: fixed; z-index: 10000;
  left: 24px; bottom: 24px;
  width: min(520px, calc(100vw - 48px));
  max-height: calc(100vh - 48px); overflow: auto;
  background: #FBFCFB; color: var(--ink, #0A0A09);
  border: 1px solid rgba(47, 80, 70, 0.18);
  border-radius: 20px;
  box-shadow: 0 24px 60px -18px rgba(22, 34, 29, 0.35);
  padding: 26px 26px 22px;
  font-family: var(--font-sans, 'Inter', system-ui, sans-serif);
  animation: consent-in .45s cubic-bezier(.16,1,.3,1) both;
}
@keyframes consent-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

.consent-title {
  font-family: var(--font-display, 'Fraunces', Georgia, serif);
  font-size: 22px; line-height: 1.2; font-weight: 400;
  margin: 0 36px 10px 0; color: var(--accent-ink, #2F5046);
}
.consent-text { font-size: 14px; line-height: 1.6; color: var(--ink-2, #2A2825); margin: 0 0 18px; }
.consent-text a, .consent-foot a, .consent-cat__desc a { color: var(--accent-ink, #2F5046); text-decoration: underline; text-underline-offset: 3px; }

.consent-x {
  position: absolute; top: 14px; right: 14px;
  width: 40px; height: 40px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink-2, #2A2825);
}
.consent-x svg { width: 20px; height: 20px; }
.consent-x:hover { background: rgba(47, 80, 70, 0.08); }

.consent-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
/* "Rifiuta" e "Accetta" hanno lo stesso identico peso visivo */
.consent-btn {
  min-height: 46px; padding: 10px 14px;
  border-radius: 100px;
  background: var(--accent-ink, #2F5046); color: var(--on-accent, #F3F1EA);
  border: 1px solid var(--accent-ink, #2F5046);
  font-size: 14px; font-weight: 500; line-height: 1.2;
  transition: background .25s, color .25s, border-color .25s;
}
.consent-btn:hover { background: #24423A; border-color: #24423A; }
.consent-btn--ghost { background: transparent; color: var(--accent-ink, #2F5046); }
.consent-btn--ghost:hover { background: rgba(47, 80, 70, 0.08); color: var(--accent-ink, #2F5046); }

.consent-banner :focus-visible, .consent-modal :focus-visible, .consent-embed :focus-visible, [data-cookie-preferenze]:focus-visible {
  outline: 2px solid var(--accent-ink, #2F5046); outline-offset: 3px;
}

/* ---------- pannello preferenze ---------- */
.consent-modal { position: fixed; inset: 0; z-index: 10001; display: flex; align-items: center; justify-content: center; padding: 16px; }
.consent-modal__veil { position: absolute; inset: 0; background: rgba(22, 34, 29, 0.45); }
.consent-modal__box {
  position: relative; width: min(600px, 100%); max-height: calc(100vh - 32px); overflow: auto;
  background: #FBFCFB; border-radius: 22px; padding: 28px 28px 22px;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.4);
  font-family: var(--font-sans, 'Inter', system-ui, sans-serif);
}
html.consent-locked, html.consent-locked body { overflow: hidden; }

.consent-cat { border-top: 1px solid rgba(47, 80, 70, 0.15); padding: 16px 0; }
.consent-cat__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.consent-cat__name { font-size: 15px; font-weight: 600; color: var(--ink, #0A0A09); }
.consent-cat__always { font-size: 12px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-ink, #2F5046); white-space: nowrap; }
.consent-cat__desc { font-size: 13.5px; line-height: 1.6; color: var(--ink-2, #2A2825); margin: 8px 0 0; }
.consent-foot { font-size: 13px; margin: 16px 0 0; color: var(--ink-2, #2A2825); }
.consent-modal .consent-actions { margin-top: 8px; }

/* interruttore accessibile (checkbox reale) */
.consent-switch { position: relative; flex: none; width: 52px; height: 30px; }
.consent-switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.consent-switch span { position: absolute; inset: 0; border-radius: 30px; background: #B9C4BF; transition: background .25s; }
.consent-switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .25s; }
.consent-switch input:checked + span { background: var(--accent-ink, #2F5046); }
.consent-switch input:checked + span::after { transform: translateX(22px); }
.consent-switch input:focus-visible + span { outline: 2px solid var(--accent-ink, #2F5046); outline-offset: 3px; }

/* ---------- link "Preferenze cookie" nel footer ---------- */
.footer-bottom .cookie-pref {
  font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer;
  text-decoration: underline; text-underline-offset: 4px;
}
.footer-bottom .cookie-pref:hover { color: var(--accent-glow); }

/* ---------- sezione prenotazione (Contatti) ---------- */
.booking-section { padding: clamp(4rem, 8vw, 7rem) var(--gutter, 1.5rem) clamp(3rem, 6vw, 5rem); scroll-margin-top: 90px; }
.booking-inner { max-width: 980px; margin: 0 auto; }
.booking-head { margin-bottom: 2rem; }
.booking-head .eyebrow { margin-bottom: 1.25rem; }
.booking-head h2 { font-size: clamp(2rem, 4.5vw, 3.4rem); margin-bottom: 1rem; }
.booking-head p { max-width: 640px; color: var(--ink-2, #2A2825); }

.consent-embed {
  background: #FBFCFB; border: 1px solid rgba(47, 80, 70, 0.16);
  border-radius: 24px; overflow: hidden;
  box-shadow: 0 18px 50px -24px rgba(22, 34, 29, 0.3);
}
.consent-embed__frame { outline: none; }
.consent-embed__frame iframe { display: block; width: 100%; height: 820px; border: 0; background: #fff; }
.consent-embed__placeholder { padding: clamp(28px, 5vw, 56px); text-align: left; }
.consent-embed__icon { width: 52px; height: 52px; border-radius: 16px; background: var(--bg-2, #DCE7E1); color: var(--accent-ink, #2F5046); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 18px; }
.consent-embed__icon svg { width: 26px; height: 26px; }
.consent-embed__title { font-family: var(--font-display, 'Fraunces', Georgia, serif); font-size: clamp(1.4rem, 3vw, 1.9rem); line-height: 1.2; margin: 0 0 12px; color: var(--ink, #0A0A09); }
.consent-embed__text { font-size: 15px; line-height: 1.65; color: var(--ink-2, #2A2825); max-width: 640px; margin: 0 0 22px; }
.consent-embed__text a { color: var(--accent-ink, #2F5046); text-decoration: underline; text-underline-offset: 3px; }
.consent-embed__actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.consent-embed__note { font-size: 13px; color: var(--muted, #6B6862); margin: 18px 0 0; }
.booking-alt { margin-top: 1.25rem; font-size: 14px; color: var(--ink-2, #2A2825); }
.booking-alt a { color: var(--accent-ink, #2F5046); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- mobile ---------- */
@media (max-width: 640px) {
  .consent-banner {
    left: 0; right: 0; bottom: 0; width: 100%;
    max-height: 85vh;
    border-radius: 20px 20px 0 0; border-bottom: 0;
    padding: 22px 18px calc(18px + env(safe-area-inset-bottom));
  }
  .consent-title { font-size: 20px; }
  .consent-text { font-size: 13.5px; margin-bottom: 14px; }
  .consent-actions { grid-template-columns: 1fr 1fr; }
  .consent-actions .consent-btn--ghost { grid-column: 1 / -1; order: 3; }
  .consent-modal { padding: 0; align-items: flex-end; }
  .consent-modal__box { border-radius: 20px 20px 0 0; max-height: 92vh; padding: 24px 18px calc(18px + env(safe-area-inset-bottom)); }
  .consent-embed { border-radius: 18px; }
  .consent-embed__frame iframe { height: 1450px; }
  .consent-embed__actions .btn-primary, .consent-embed__actions .btn-outline { width: 100%; justify-content: center; }
  /* il pulsante WhatsApp non deve coprire il banner */
  html.has-consent-banner .wa-float { opacity: 0; pointer-events: none; }
}
@media (prefers-reduced-motion: reduce) { .consent-banner { animation: none; } }

/* link "Preferenze cookie" dentro i testi delle policy */
.cookie-pref-inline { font: inherit; color: var(--accent-ink, #2F5046); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* il pulsante WhatsApp flottante non deve coprire i link legali del footer su telefono */
@media (max-width: 600px) { .footer-bottom { padding-bottom: 84px; } }
