/* Personalizza queste variabili con i colori del brand "ge". */
:root {
  --cc-bg: #ffffff;
  --cc-text: #1a1a1a;
  --cc-border: #e2e2e2;
  --cc-accent: #1f2933;
  --cc-accent-text: #ffffff;
  --cc-radius: 10px;
  --cc-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
}

.cc-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  display: flex;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}

.cc-banner__box {
  width: 100%;
  max-width: 920px;
  background: var(--cc-bg);
  color: var(--cc-text);
  border: 1px solid var(--cc-border);
  border-radius: var(--cc-radius);
  box-shadow: var(--cc-shadow);
  padding: 20px 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  line-height: 1.5;
}

.cc-banner__text {
  margin: 0;
  flex: 1 1 320px;
}

.cc-banner__text a {
  color: inherit;
  text-decoration: underline;
}

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

/* I pulsanti Accetta/Rifiuta hanno stessa dimensione e peso visivo,
   come richiesto dalle linee guida del Garante Privacy (nessuna delle
   due opzioni deve risultare piu' evidente dell'altra). */
.cc-btn {
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 6px;
  border: 1px solid var(--cc-accent);
  cursor: pointer;
  white-space: nowrap;
}

.cc-btn--solid {
  background: var(--cc-accent);
  color: var(--cc-accent-text);
}

.cc-btn--outline {
  background: transparent;
  color: var(--cc-accent);
}

.cc-btn--ghost {
  background: transparent;
  border-color: transparent;
  color: var(--cc-text);
  text-decoration: underline;
  font-weight: 500;
  padding: 10px 6px;
}

.cc-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  padding: 16px;
  box-sizing: border-box;
}

.cc-modal__box {
  width: 100%;
  max-width: 560px;
  max-height: 85vh;
  overflow-y: auto;
  background: var(--cc-bg);
  color: var(--cc-text);
  border-radius: var(--cc-radius);
  box-shadow: var(--cc-shadow);
}

.cc-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--cc-border);
}

.cc-modal__header h2 {
  margin: 0;
  font-size: 18px;
}

.cc-modal__close {
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: var(--cc-text);
}

.cc-modal__body {
  padding: 12px 20px;
}

.cc-category {
  padding: 14px 0;
  border-bottom: 1px solid var(--cc-border);
}

.cc-category:last-child {
  border-bottom: none;
}

.cc-category__header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cc-category__name {
  font-weight: 600;
  font-size: 14px;
}

.cc-category__desc {
  margin: 6px 0 0;
  font-size: 13px;
  color: #555;
}

.cc-modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid var(--cc-border);
}

/* Interruttore on/off accessibile per ciascuna categoria */
.cc-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex: none;
}

.cc-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.cc-switch__slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #ccc;
  border-radius: 999px;
  transition: 0.15s;
}

.cc-switch__slider::before {
  content: "";
  position: absolute;
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: 0.15s;
}

.cc-switch input:checked + .cc-switch__slider {
  background-color: var(--cc-accent);
}

.cc-switch input:checked + .cc-switch__slider::before {
  transform: translateX(18px);
}

.cc-switch input:disabled + .cc-switch__slider {
  opacity: 0.6;
  cursor: not-allowed;
}

@media (max-width: 560px) {
  .cc-banner__box {
    flex-direction: column;
    align-items: stretch;
  }
  .cc-banner__actions {
    justify-content: stretch;
  }
  .cc-banner__actions .cc-btn {
    flex: 1 1 auto;
    text-align: center;
  }
}
