/* Banner e preferenze cookie — stessi colori e caratteri del resto del sito
   (variabili di pagina, con ricaduta sui valori di marca). Markup in
   inc/cookie-consent.php. */
.cc-banner,
.cc-modal {
  --cc-ink: var(--ink, #2c2a28);
  --cc-paper: var(--paper, #ede6dc);
  --cc-stone: var(--stone, #a79c8c);
  --cc-bronze: var(--bronze, #6e6258);
  font-family: var(--font-body, "Instrument Sans", system-ui, sans-serif);
  -webkit-font-smoothing: antialiased;
}

.cc-title {
  font-family: var(--font-display, "Cormorant", Georgia, serif);
  font-weight: 400;
  font-size: 1.45rem;
  line-height: 1.15;
  margin: 0 0 10px;
}

.cc-text {
  font-size: 0.8rem;
  line-height: 1.6;
  margin: 0 0 18px;
}
.cc-text a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ── Banner ── */
.cc-banner {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 9000;
  width: min(440px, calc(100vw - 40px));
  padding: 22px 24px 20px;
  background: var(--cc-ink);
  color: var(--cc-paper);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
  animation: ccRise 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.cc-banner .cc-text {
  color: rgba(237, 230, 220, 0.82);
}
@keyframes ccRise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.cc-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.cc-btn {
  appearance: none;
  border: 1px solid currentColor;
  background: transparent;
  color: inherit;
  padding: 10px 18px;
  font: inherit;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: background 0.25s, color 0.25s, opacity 0.25s;
}
.cc-btn:disabled {
  opacity: 0.5;
}
.cc-btn--primary {
  background: var(--cc-paper);
  border-color: var(--cc-paper);
  color: var(--cc-ink);
}
.cc-btn--link {
  border-color: transparent;
  padding-left: 4px;
  padding-right: 4px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.cc-btn:focus-visible,
.cc-close:focus-visible {
  outline: 2px solid var(--cc-stone);
  outline-offset: 2px;
}

/* ── Pannello preferenze ── */
.cc-modal {
  position: fixed;
  inset: 0;
  z-index: 9100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.cc-modal.is-open {
  display: flex;
}
.cc-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(44, 42, 40, 0.6);
}
.cc-panel {
  position: relative;
  width: min(560px, 100%);
  max-height: calc(100svh - 40px);
  overflow-y: auto;
  padding: 32px clamp(22px, 4vw, 36px) 28px;
  background: var(--cc-paper);
  color: var(--cc-ink);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
}
.cc-panel .cc-text {
  color: var(--cc-bronze);
}
.cc-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--cc-ink);
}
.cc-close svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 1.4;
  fill: none;
}

.cc-cat {
  padding: 16px 0;
  border-top: 1px solid rgba(44, 42, 40, 0.12);
}
.cc-cat p {
  margin: 8px 0 0;
  font-size: 0.78rem;
  line-height: 1.55;
  color: var(--cc-bronze);
  max-width: 44ch;
}
.cc-cat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.cc-cat-head strong {
  font-weight: 500;
  font-size: 0.88rem;
}
.cc-tag {
  margin-left: 8px;
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cc-stone);
}

.cc-switch {
  position: relative;
  flex: 0 0 auto;
  width: 42px;
  height: 24px;
}
.cc-switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  z-index: 1;
}
.cc-switch span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(44, 42, 40, 0.22);
  transition: background 0.25s;
}
.cc-switch span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--cc-paper);
  transition: transform 0.25s;
}
.cc-switch input:checked + span {
  background: var(--cc-ink);
}
.cc-switch input:checked + span::after {
  transform: translateX(18px);
}
.cc-switch input:disabled + span {
  opacity: 0.55;
}
.cc-switch input:focus-visible + span {
  outline: 2px solid var(--cc-stone);
  outline-offset: 2px;
}

.cc-actions--modal {
  margin-top: 8px;
  padding-top: 20px;
  border-top: 1px solid rgba(44, 42, 40, 0.12);
}
.cc-panel .cc-btn--primary {
  background: var(--cc-ink);
  border-color: var(--cc-ink);
  color: var(--cc-paper);
}

body.cc-lock {
  overflow: hidden;
}

@media (max-width: 600px) {
  .cc-banner {
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    padding: 20px 18px 22px;
  }
  .cc-btn {
    flex: 1 1 auto;
    text-align: center;
  }
  .cc-btn--link {
    flex-basis: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cc-banner {
    animation: none;
  }
}

/* In attesa che il popup newsletter si chiuda (home): il banner non si vede. */
.cc-banner.cc-wait {
  display: none;
}
