/* ==========================================================================
   Cookie consent MasaGem — linguetta + popup preferenze
   Stili autonomi (palette site: verde primary / oro gold / crema).
   ========================================================================== */

/* ------------------------------- Linguetta ------------------------------- */
.cc-tab {
  position: fixed;
  right: 1.4rem;
  bottom: 0;
  z-index: 1200;
  border: 1px solid rgba(45, 90, 61, .18);
  border-bottom: 0;
  border-radius: 10px 10px 0 0;
  background: var(--white, #fff);
  color: var(--text-light, #7d7d7d);
  cursor: pointer;
  box-shadow: 0 -4px 16px rgba(20, 48, 31, .14);
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: .58rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  white-space: nowrap;
  padding: .8rem .95rem .45rem;
  transform: translateY(calc(100% - 10px));
  transition: transform .35s cubic-bezier(.2,.8,.2,1), color .2s, border-color .2s, background .2s;
}
.cc-tab.is-hidden { transform: translateY(100%); }
.cc-tab:hover,
.cc-tab:focus-visible {
  transform: translateY(0);
  color: var(--primary, #2d5a3d);
  border-color: var(--gold, #c9a84c);
  outline: none;
}

/* ------------------------------- Popup ----------------------------------- */
.cc-modal {
  position: fixed;
  inset: 0;
  z-index: 9500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.2rem;
}
.cc-modal[hidden] { display: none !important; }

.cc-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 20, 14, .74);
  backdrop-filter: blur(6px);
}

.cc-card {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  max-height: calc(100dvh - 2.4rem);
  overflow: auto;
  margin: auto;
  background: var(--white, #fff);
  color: var(--text, #3c3c3c);
  border: 1px solid rgba(45, 90, 61, .14);
  border-radius: var(--radius, 16px);
  padding: clamp(1.6rem, 4vw, 2.4rem);
  text-align: left;
  box-shadow: var(--shadow-lg, 0 18px 50px rgba(20, 48, 31, .16));
  animation: ccPop .28s cubic-bezier(.2,.8,.2,1);
}
@keyframes ccPop {
  from { transform: translateY(14px) scale(.98); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

.cc-x {
  position: absolute;
  top: .5rem;
  right: .8rem;
  border: 0;
  background: none;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text-light, #7d7d7d);
}
.cc-x:hover { color: var(--primary, #2d5a3d); }

.cc-card h2 {
  font-family: var(--font-heading, 'Playfair Display', serif);
  font-size: clamp(1.4rem, 3.2vw, 1.8rem);
  margin: 0 0 .5rem;
  color: var(--primary-dark, #14301f);
}
.cc-intro {
  margin: 0 0 1rem;
  color: var(--text-light, #7d7d7d);
  font-size: .92rem;
  line-height: 1.6;
}

.cc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .9rem 0;
  border-top: 1px solid rgba(45, 90, 61, .12);
}
.cc-row b { display: block; font-size: .95rem; color: var(--text, #3c3c3c); }
.cc-row span { font-size: .82rem; color: var(--text-light, #7d7d7d); }

.cc-switch { position: relative; display: inline-block; width: 46px; height: 26px; flex: 0 0 auto; }
.cc-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.cc-switch span {
  position: absolute;
  inset: 0;
  background: rgba(45, 90, 61, .22);
  border-radius: 999px;
  transition: background .2s;
  cursor: pointer;
}
.cc-switch span::before {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform .2s;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
}
.cc-switch input:checked + span { background: var(--primary, #2d5a3d); }
.cc-switch input:checked + span::before { transform: translateX(20px); }
.cc-switch input:disabled + span { opacity: .6; cursor: not-allowed; }
.cc-switch input:focus-visible + span { box-shadow: 0 0 0 3px rgba(201, 168, 76, .5); }

.cc-actions {
  display: flex;
  gap: .6rem;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-top: 1.2rem;
}
.cc-btn {
  border: 1px solid rgba(45, 90, 61, .22);
  background: var(--white, #fff);
  color: var(--text, #3c3c3c);
  border-radius: 999px;
  padding: .6rem 1.05rem;
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .2s, border-color .2s, color .2s, filter .2s;
}
.cc-btn:hover { border-color: var(--gold, #c9a84c); }
.cc-btn.primary { background: var(--primary, #2d5a3d); border-color: var(--primary, #2d5a3d); color: #fff; }
.cc-btn.primary:hover { filter: brightness(1.08); }
.cc-btn.accept { background: var(--gold, #c9a84c); border-color: var(--gold, #c9a84c); color: var(--primary-dark, #14301f); }
.cc-btn.accept:hover { filter: brightness(1.06); }

.cc-note { margin: .9rem 0 0; font-size: .8rem; }
.cc-note a { color: var(--primary, #2d5a3d); text-decoration: underline; }

html.cc-open,
html.cc-open body { overflow: hidden; }

@media (max-width: 520px) {
  .cc-actions { flex-direction: column-reverse; }
  .cc-actions .cc-btn { width: 100%; }
  .cc-tab { right: 1rem; }
}
