/* Banner cookie — struttura omil.it, colori Piscina di Lanzo */
.cookie-consent-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 51, 153, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 997;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  padding: 1rem;
}

.cookie-consent-overlay.active {
  opacity: 1;
  visibility: visible;
}

.cookie-consent-popup {
  background: var(--white, #fff);
  border-radius: var(--radius-lg, 24px);
  box-shadow: var(--shadow, 0 12px 40px rgba(0, 51, 153, .14));
  max-width: min(640px, 95vw);
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.92);
  transition: transform 0.3s var(--ease-out, cubic-bezier(0.22, 1, 0.36, 1));
}

.cookie-consent-overlay.active .cookie-consent-popup {
  transform: scale(1);
}

.cookie-header {
  padding: 1.5rem 1.5rem 1rem;
  border-bottom: 1px solid rgba(0, 51, 153, 0.1);
  background: linear-gradient(180deg, var(--sky-light, #a2d9f7) 0%, #fff 100%);
  border-radius: var(--radius-lg, 24px) var(--radius-lg, 24px) 0 0;
}

.cookie-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.cookie-icon {
  width: 2rem;
  height: 2rem;
  fill: var(--blue, #003399);
  flex-shrink: 0;
}

.cookie-logo h2 {
  font-family: var(--font-heading, 'Oswald', sans-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--blue, #003399);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.cookie-body {
  padding: 1.25rem 1.5rem;
}

.cookie-description {
  color: var(--blue-light, #1a47b1);
  font-size: 0.9rem;
  line-height: 1.65;
  margin-bottom: 1.25rem;
}

.cookie-description a {
  color: var(--blue, #003399);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cookie-categories {
  margin-bottom: 0.5rem;
}

.cookie-category {
  border: 1px solid rgba(0, 51, 153, 0.12);
  border-radius: var(--radius, 16px);
  margin-bottom: 0.75rem;
  overflow: hidden;
}

.cookie-category .category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1rem;
  cursor: pointer;
  background: var(--lime, #e2f16a);
  background: rgba(226, 241, 106, 0.35);
  transition: background 0.2s;
}

.cookie-category .category-header:hover {
  background: rgba(226, 241, 106, 0.55);
}

.cookie-category .category-info {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex: 1;
  flex-wrap: wrap;
}

.cookie-category .category-title {
  font-family: var(--font-heading, 'Oswald', sans-serif);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--blue, #003399);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.cookie-category .category-badge {
  font-size: 0.68rem;
  padding: 0.15rem 0.5rem;
  background: var(--blue, #003399);
  color: var(--white, #fff);
  border-radius: 999px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cookie-category .toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  background: rgba(0, 51, 153, 0.2);
  border-radius: 12px;
  transition: background 0.3s;
  cursor: pointer;
  flex-shrink: 0;
}

.cookie-category .toggle-switch::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  background: var(--white, #fff);
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: transform 0.3s;
  box-shadow: 0 2px 4px rgba(0, 51, 153, 0.2);
}

.cookie-category .toggle-switch.active {
  background: var(--blue, #003399);
}

.cookie-category .toggle-switch.active::after {
  transform: translateX(20px);
}

.cookie-category .toggle-switch.disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.cookie-category .category-description {
  font-size: 0.82rem;
  color: var(--blue-light, #1a47b1);
  line-height: 1.55;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
}

.cookie-category.expanded .category-description {
  max-height: 200px;
  padding: 0.85rem 1rem;
}

.cookie-actions {
  padding: 1rem 1.5rem 1.5rem;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.cookie-actions .btn {
  padding: 0.75rem 1.25rem;
  border: none;
  border-radius: 999px;
  font-family: var(--font-heading, 'Oswald', sans-serif);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
  flex: 1;
  min-width: 130px;
}

.cookie-actions .btn-primary {
  background: var(--blue, #003399);
  color: var(--white, #fff);
}

.cookie-actions .btn-primary:hover {
  background: var(--blue-light, #1a47b1);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 51, 153, 0.25);
}

.cookie-actions .btn-secondary {
  background: var(--white, #fff);
  color: var(--blue, #003399);
  border: 2px solid rgba(0, 51, 153, 0.2);
}

.cookie-actions .btn-secondary:hover {
  background: var(--lime, #e2f16a);
  border-color: transparent;
}

.cookie-settings-icon {
  position: fixed;
  bottom: 1.25rem;
  left: 1.25rem;
  width: 3.5rem;
  height: 3.5rem;
  background: var(--blue, #003399);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 51, 153, 0.35);
  transition: transform 0.3s, opacity 0.3s, visibility 0.3s;
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  transform: scale(0.85);
  border: none;
}

.cookie-settings-icon.visible {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}

.cookie-settings-icon:hover {
  transform: scale(1.08);
  background: var(--blue-light, #1a47b1);
}

.cookie-settings-icon svg {
  width: 1.6rem;
  height: 1.6rem;
  fill: var(--white, #fff);
}

.cookie-consent-popup::-webkit-scrollbar { width: 8px; }
.cookie-consent-popup::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 10px; }
.cookie-consent-popup::-webkit-scrollbar-thumb { background: var(--sky, #8ecaf9); border-radius: 10px; }

@media (max-width: 600px) {
  .cookie-actions {
    flex-direction: column;
  }

  .cookie-actions .btn {
    width: 100%;
    min-width: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cookie-consent-overlay,
  .cookie-consent-popup,
  .cookie-settings-icon {
    transition: none;
  }
}
