/* ═══════════════════════════════════════════════════════════════
   OmniaCoin · Cookie Banner v1.0
   GDPR / ePrivacy / Garante IT 231/2021 compliant
   3 categorie: necessari · analytics · marketing
   Consent: localStorage · Rinnovo 180gg
   Load: <link rel="stylesheet" href="/shared/cookie-banner.css">
   ═══════════════════════════════════════════════════════════════ */

/* ── OVERLAY ── */
.cb-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: opacity .35s ease, visibility .35s ease;
}
.cb-overlay.cb-visible {
  opacity: 1;
  visibility: visible;
}

/* ── BANNER (bottom bar) ── */
.cb-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10001;
  background: rgba(6, 10, 16, 0.96);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid rgba(0, 220, 160, 0.12);
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.5), 0 0 30px rgba(0, 220, 160, 0.04);
  padding: 0;
  transform: translateY(100%);
  transition: transform .45s cubic-bezier(0.16, 1, 0.3, 1);
}
.cb-banner.cb-visible {
  transform: translateY(0);
}

.cb-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 2rem;
  display: flex;
  align-items: center;
  gap: 2rem;
}

/* ── Banner text ── */
.cb-text {
  flex: 1;
  min-width: 0;
}
.cb-text h3 {
  font-family: var(--fd, 'Rajdhani', sans-serif);
  font-weight: 700;
  font-size: 1rem;
  color: var(--t, #E9F2F2);
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.cb-text h3 .cb-icon {
  font-size: 1.1rem;
}
.cb-text p {
  font-family: var(--fb, 'Outfit', sans-serif);
  font-size: 0.82rem;
  color: var(--ts, #A6B7B7);
  line-height: 1.6;
  margin: 0;
}
.cb-text a {
  color: var(--a, #00DCA0);
  text-decoration: none;
  border-bottom: 1px solid rgba(0, 220, 160, 0.3);
  transition: border-color 0.2s;
}
.cb-text a:hover {
  border-color: var(--a, #00DCA0);
}

/* ── Banner buttons ── */
.cb-actions {
  display: flex;
  gap: 0.6rem;
  flex-shrink: 0;
}
.cb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.4rem;
  border-radius: 10px;
  font-family: var(--fd, 'Rajdhani', sans-serif);
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  border: none;
  transition: all 0.25s ease;
  white-space: nowrap;
}
.cb-btn-accept {
  background: linear-gradient(135deg, var(--a, #00DCA0), var(--cy, #0BE6B6));
  color: var(--bg, #040608);
  box-shadow: 0 4px 16px rgba(0, 220, 160, 0.2);
}
.cb-btn-accept:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(0, 220, 160, 0.35);
}
.cb-btn-reject {
  background: rgba(255, 255, 255, 0.04);
  color: var(--ts, #A6B7B7);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.cb-btn-reject:hover {
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--t, #E9F2F2);
  background: rgba(255, 255, 255, 0.06);
}
.cb-btn-settings {
  background: transparent;
  color: var(--a, #00DCA0);
  border: 1px solid rgba(0, 220, 160, 0.2);
}
.cb-btn-settings:hover {
  background: rgba(0, 220, 160, 0.06);
  border-color: rgba(0, 220, 160, 0.35);
}

/* ═══════════════════════════════════════════
   PREFERENCES PANEL (modal)
   ═══════════════════════════════════════════ */
.cb-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  z-index: 10002;
  width: 92%;
  max-width: 560px;
  max-height: 85vh;
  overflow-y: auto;
  background: rgba(6, 10, 16, 0.97);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid rgba(0, 220, 160, 0.14);
  border-radius: 20px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.7),
              0 0 40px rgba(0, 220, 160, 0.05),
              inset 0 1px 0 rgba(255, 255, 255, 0.04);
  padding: 2rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease, visibility .3s ease, transform .3s cubic-bezier(0.16, 1, 0.3, 1);
}
.cb-panel.cb-visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

/* Panel scrollbar */
.cb-panel::-webkit-scrollbar { width: 4px; }
.cb-panel::-webkit-scrollbar-track { background: transparent; }
.cb-panel::-webkit-scrollbar-thumb { background: rgba(0, 220, 160, 0.2); border-radius: 4px; }

/* Panel header */
.cb-panel-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.cb-panel-hd h3 {
  font-family: var(--fd, 'Rajdhani', sans-serif);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--t, #E9F2F2);
}
.cb-panel-close {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--tm, #78909C);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.cb-panel-close:hover {
  background: rgba(255, 69, 96, 0.1);
  border-color: rgba(255, 69, 96, 0.3);
  color: var(--r, #FF4560);
}

/* ── Category cards ── */
.cb-cat {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 1.2rem 1.4rem;
  margin-bottom: 0.8rem;
  transition: border-color 0.2s;
}
.cb-cat:hover {
  border-color: rgba(255, 255, 255, 0.1);
}
.cb-cat-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.5rem;
}
.cb-cat-info {
  flex: 1;
  min-width: 0;
}
.cb-cat-name {
  font-family: var(--fd, 'Rajdhani', sans-serif);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--t, #E9F2F2);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.cb-cat-badge {
  font-size: 0.6rem;
  padding: 0.15rem 0.55rem;
  border-radius: 100px;
  font-family: var(--fm, 'JetBrains Mono', monospace);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}
.cb-cat-badge.required {
  background: rgba(0, 220, 160, 0.1);
  border: 1px solid rgba(0, 220, 160, 0.2);
  color: var(--a, #00DCA0);
}
.cb-cat-badge.optional {
  background: rgba(255, 176, 32, 0.08);
  border: 1px solid rgba(255, 176, 32, 0.2);
  color: var(--o, #FFB020);
}
.cb-cat-desc {
  font-family: var(--fb, 'Outfit', sans-serif);
  font-size: 0.78rem;
  color: var(--tm, #78909C);
  line-height: 1.55;
  margin-top: 0.3rem;
}

/* ── Toggle switch ── */
.cb-toggle {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.cb-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.cb-toggle-track {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.25s ease;
}
.cb-toggle-track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: var(--tm, #78909C);
  border-radius: 50%;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.cb-toggle input:checked + .cb-toggle-track {
  background: rgba(0, 220, 160, 0.15);
  border-color: rgba(0, 220, 160, 0.35);
}
.cb-toggle input:checked + .cb-toggle-track::after {
  transform: translateX(20px);
  background: var(--a, #00DCA0);
  box-shadow: 0 0 8px rgba(0, 220, 160, 0.4);
}
.cb-toggle input:disabled + .cb-toggle-track {
  opacity: 0.6;
  cursor: not-allowed;
}
.cb-toggle input:disabled:checked + .cb-toggle-track::after {
  background: var(--a, #00DCA0);
  opacity: 0.7;
}

/* ── Panel footer ── */
.cb-panel-ft {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* ── Cookie count info ── */
.cb-cookie-count {
  font-family: var(--fm, 'JetBrains Mono', monospace);
  font-size: 0.65rem;
  color: var(--tm, #78909C);
  margin-top: 0.25rem;
}

/* ═══════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════ */
@media (max-width: 768px) {
  .cb-inner {
    flex-direction: column;
    padding: 1.2rem 1.2rem;
    gap: 1rem;
    text-align: center;
  }
  .cb-actions {
    width: 100%;
    flex-direction: column;
  }
  .cb-btn {
    width: 100%;
    padding: 0.85rem;
    font-size: 0.85rem;
  }
  .cb-panel {
    width: 96%;
    padding: 1.5rem;
    max-height: 90vh;
  }
  .cb-panel-ft {
    flex-direction: column;
  }
  .cb-panel-ft .cb-btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .cb-inner {
    padding: 1rem;
  }
  .cb-text h3 {
    font-size: 0.92rem;
    justify-content: center;
  }
  .cb-text p {
    font-size: 0.78rem;
  }
}
