/* ============================================================
   HandsBook — Cookie Banner GDPR
   Stile coerente con il sito (oro, marrone, serif).
   Nessuno stile inline: compatibile con CSP stretta.
   ============================================================ */

.hb-cc {
  --hb-gold:      #c9a14b;
  --hb-gold-soft: #e8c879;
  --hb-brown-dk:  #3a2414;
  --hb-cream:     #f6efe2;
  --hb-ink:       #2b1d10;
  --hb-shadow:    0 18px 60px rgba(0,0,0,.45);
}

.hb-cc-banner,
.hb-cc-modal,
.hb-cc-fab {
  font-family: "Cormorant Garamond", Georgia, serif;
  color: #f6efe2;
  box-sizing: border-box;
}
.hb-cc-banner *,
.hb-cc-modal *,
.hb-cc-fab * { box-sizing: border-box; }

/* ----- Banner ----- */
.hb-cc-banner {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 140%);
  width: min(960px, calc(100vw - 32px));
  background: linear-gradient(180deg, #3a2414 0%, #2a190b 100%);
  border: 1px solid rgba(201,161,75,.45);
  border-radius: 14px;
  padding: 22px 26px;
  z-index: 99998;
  box-shadow: 0 18px 60px rgba(0,0,0,.45);
  transition: transform .55s cubic-bezier(.22,.61,.36,1), opacity .4s;
  opacity: 0;
}
.hb-cc-banner.is-visible {
  transform: translate(-50%, 0);
  opacity: 1;
}
.hb-cc-banner__title {
  font-size: 1.3rem;
  font-weight: 600;
  margin: 0 0 6px 0;
  color: #e8c879;
  letter-spacing: .3px;
}
.hb-cc-banner__text {
  font-size: 1.02rem;
  line-height: 1.55;
  margin: 0 0 16px 0;
  color: #e8dcc4;
}
.hb-cc-banner__text a,
.hb-cc-modal__intro a {
  color: #e8c879;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.hb-cc-banner__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  align-items: center;
}

/* ----- Bottoni ----- */
.hb-cc-btn {
  font-family: inherit;
  font-size: 1rem;
  letter-spacing: .4px;
  padding: 11px 22px;
  border-radius: 999px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform .15s, box-shadow .25s, background .25s, color .25s;
}
.hb-cc-btn:hover { transform: translateY(-1px); }
.hb-cc-btn:active { transform: translateY(0); }
.hb-cc-btn:focus-visible { outline: 2px solid #e8c879; outline-offset: 2px; }

.hb-cc-btn--primary {
  background: linear-gradient(180deg, #e8c879, #c9a14b);
  color: #2b1d10;
  border-color: rgba(0,0,0,.15);
  box-shadow: 0 4px 14px rgba(201,161,75,.35);
  font-weight: 600;
}
.hb-cc-btn--primary:hover { box-shadow: 0 6px 22px rgba(201,161,75,.55); }

.hb-cc-btn--ghost {
  background: transparent;
  color: #f6efe2;
  border-color: rgba(232,200,121,.55);
}
.hb-cc-btn--ghost:hover { background: rgba(232,200,121,.12); }

.hb-cc-btn--link {
  background: transparent;
  color: #e8c879;
  border: none;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 11px 14px;
}

/* ----- Modal ----- */
.hb-cc-modal {
  position: fixed;
  inset: 0;
  background: rgba(10, 6, 2, .72);
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.hb-cc-modal.is-visible { display: flex; }
.hb-cc-modal__panel {
  background: linear-gradient(180deg, #3a2414 0%, #2a190b 100%);
  border: 1px solid rgba(201,161,75,.5);
  border-radius: 16px;
  width: min(640px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  padding: 28px 30px;
  box-shadow: 0 18px 60px rgba(0,0,0,.45);
}
.hb-cc-modal__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 8px;
}
.hb-cc-modal__title {
  font-size: 1.5rem;
  color: #e8c879;
  margin: 0;
}
.hb-cc-modal__close {
  background: transparent;
  border: none;
  color: #f6efe2;
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
}
.hb-cc-modal__close:hover { color: #e8c879; }
.hb-cc-modal__intro {
  font-size: .98rem;
  line-height: 1.55;
  color: #e8dcc4;
  margin: 0 0 20px 0;
}

/* ----- Categoria ----- */
.hb-cc-cat {
  border: 1px solid rgba(201,161,75,.25);
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 12px;
  background: rgba(255,255,255,.02);
}
.hb-cc-cat__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 6px;
}
.hb-cc-cat__name {
  margin: 0;
  font-size: 1.12rem;
  color: #e8c879;
}
.hb-cc-cat__tag {
  color: #b08a3a;
  font-size: .82em;
}
.hb-cc-cat__desc {
  margin: 0;
  font-size: .94rem;
  color: #d8c9ad;
  line-height: 1.5;
}

/* Toggle */
.hb-cc-switch { position: relative; width: 46px; height: 26px; flex-shrink: 0; }
.hb-cc-switch input { opacity: 0; width: 0; height: 0; }
.hb-cc-switch__slider {
  position: absolute;
  inset: 0;
  background: #2a190b;
  border: 1px solid rgba(201,161,75,.5);
  border-radius: 999px;
  cursor: pointer;
  transition: background .25s, border-color .25s;
}
.hb-cc-switch__slider::before {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #b0a48b;
  transition: transform .25s, background .25s;
}
.hb-cc-switch input:checked + .hb-cc-switch__slider {
  background: linear-gradient(180deg, #e8c879, #c9a14b);
  border-color: #c9a14b;
}
.hb-cc-switch input:checked + .hb-cc-switch__slider::before {
  transform: translateX(20px);
  background: #2b1d10;
}
.hb-cc-switch input:disabled + .hb-cc-switch__slider {
  cursor: not-allowed;
  background: linear-gradient(180deg, #8a7242, #6a5630);
  border-color: #6a5630;
}
.hb-cc-switch input:disabled + .hb-cc-switch__slider::before {
  background: #3a2414;
  transform: translateX(20px);
}
.hb-cc-switch input:focus-visible + .hb-cc-switch__slider {
  outline: 2px solid #e8c879;
  outline-offset: 2px;
}

.hb-cc-modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(201,161,75,.2);
}

/* ----- FAB ----- */
.hb-cc-fab {
  position: fixed;
  left: 18px;
  bottom: 18px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(201,161,75,.55);
  background: linear-gradient(180deg, #3a2414, #2a190b);
  color: #e8c879;
  cursor: pointer;
  z-index: 99997;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 6px 18px rgba(0,0,0,.35);
  transition: transform .2s, box-shadow .25s;
}
.hb-cc-fab.is-visible { display: flex; }
.hb-cc-fab:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0,0,0,.5); }
.hb-cc-fab:focus-visible { outline: 2px solid #e8c879; outline-offset: 2px; }

/* ----- Responsive ----- */
@media (max-width: 640px) {
  .hb-cc-banner {
    padding: 18px 18px 16px;
    bottom: 12px;
    width: calc(100vw - 16px);
  }
  .hb-cc-banner__title { font-size: 1.15rem; }
  .hb-cc-banner__text { font-size: .94rem; }
  .hb-cc-banner__actions { justify-content: stretch; }
  .hb-cc-banner__actions .hb-cc-btn { flex: 1 1 auto; }
  .hb-cc-modal__panel { padding: 20px 18px; }
}
