/* ============================================
   Cookie Banner — alessiozanghi.com
   Standalone, no Bootstrap
   ============================================ */

/* === Icona fissa recupero preferenze === */
.cookie-settings-btn {
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #0B1E36;
  border: 1.5px solid #C9A961;
  color: #C9A961;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(8, 22, 42, 0.25);
  z-index: 9998;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: transform .2s, background .2s, box-shadow .2s;
  opacity: 0;
  transform: translateY(16px) scale(0.95);
}
.cookie-settings-btn.show {
  display: flex;
  opacity: 1;
  transform: translateY(0) scale(1);
  animation: cookieIconFadeIn 0.35s cubic-bezier(.4,0,.2,1) both;
}
.cookie-settings-btn:hover {
  background: #C9A961;
  color: #0B1E36;
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 10px 24px rgba(201, 169, 97, 0.35);
}
.cookie-settings-btn svg { width: 22px; height: 22px; }

@keyframes cookieIconFadeIn {
  from { opacity: 0; transform: translateY(16px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(8, 22, 42, 0.97);
  color: #fff;
  z-index: 9999;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.3);
  border-top: 1px solid rgba(201, 169, 97, 0.3);
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(.4,0,.2,1);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  max-height: 90vh;
  overflow-y: auto;
}
.cookie-banner.show { transform: translateY(0); }

.cookie-banner-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 32px;
}

.cookie-banner-main {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
}

.cookie-banner-text strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #C9A961;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.cookie-banner-text p {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.82);
  max-width: 720px;
}
.cookie-banner-text a {
  color: #C9A961;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.cookie-banner-text a:hover { color: #E5C989; }

.cookie-banner-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.cookie-btn {
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 18px;
  border: 1.5px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.cookie-btn-primary {
  background: #C9A961;
  color: #08162A;
  border-color: #C9A961;
}
.cookie-btn-primary:hover {
  background: #E5C989;
  border-color: #E5C989;
}
.cookie-btn-outline {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.35);
}
.cookie-btn-outline:hover {
  border-color: #C9A961;
  color: #C9A961;
}
.cookie-btn-ghost {
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  border-color: transparent;
}
.cookie-btn-ghost:hover {
  color: #fff;
  text-decoration: underline;
}

/* === Pannello impostazioni === */
.cookie-banner-settings {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.cookie-banner-settings[hidden] { display: none; }

.cookie-option {
  display: grid;
  grid-template-columns: 50px 1fr;
  gap: 16px;
  align-items: center;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}
.cookie-option strong {
  display: block;
  font-size: 14px;
  color: #fff;
  margin-bottom: 2px;
}
.cookie-option small {
  display: block;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.5;
}

.cookie-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
}
.cookie-switch input { opacity: 0; width: 0; height: 0; }
.cookie-switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 22px;
  transition: background 0.2s;
}
.cookie-switch-slider::before {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}
.cookie-switch input:checked + .cookie-switch-slider {
  background: #C9A961;
}
.cookie-switch input:checked + .cookie-switch-slider::before {
  transform: translateX(18px);
}
.cookie-switch input:disabled + .cookie-switch-slider {
  opacity: 0.6;
  cursor: not-allowed;
}

.cookie-settings-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 4px;
}

@media (max-width: 768px) {
  .cookie-banner-inner { padding: 16px 20px; }
  .cookie-banner-main { grid-template-columns: 1fr; gap: 14px; }
  .cookie-banner-buttons { flex-direction: column; }
  .cookie-btn { width: 100%; }
}
