/* Cookie consent modal */
.cookie-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
}
.cookie-overlay.visible {
  display: flex;
}

.cookie-modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  max-width: 520px;
  width: calc(100% - 2rem);
  max-height: calc(100vh - 3rem);
  overflow-y: auto;
  padding: 2rem;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4);
  position: relative;
}

.cookie-modal h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.cookie-modal > p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.cookie-modal a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Primary action buttons */
.cookie-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 0.25rem;
}

.cookie-btn {
  display: block;
  width: 100%;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.7rem 1.25rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.cookie-btn-all {
  background: var(--gradient);
  color: #fff;
}
.cookie-btn-all:hover { filter: brightness(1.1); }

.cookie-btn-necessary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.cookie-btn-necessary:hover { border-color: var(--text-muted); }

.cookie-btn-settings {
  background: transparent;
  color: var(--text-dim);
  border: none;
  font-size: 0.85rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 0.5rem;
}
.cookie-btn-settings:hover { color: var(--text); }

/* Custom settings panel */
.cookie-settings {
  display: none;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}
.cookie-settings.open { display: block; }

.cookie-category {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(51, 65, 85, 0.5);
}
.cookie-category:last-child { border-bottom: none; }

.cookie-cat-info { flex: 1; }
.cookie-cat-info h4 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
}
.cookie-cat-info p {
  font-size: 0.8rem;
  color: var(--text-dim);
  line-height: 1.5;
  margin: 0;
}

/* Toggle switch */
.cookie-toggle {
  position: relative;
  flex-shrink: 0;
  width: 44px;
  height: 24px;
  margin-top: 2px;
}
.cookie-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}
.cookie-toggle .slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 24px;
  cursor: pointer;
  transition: background 0.2s;
}
.cookie-toggle .slider::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}
.cookie-toggle input:checked + .slider {
  background: var(--primary);
}
.cookie-toggle input:checked + .slider::before {
  transform: translateX(20px);
}
.cookie-toggle input:disabled + .slider {
  opacity: 0.6;
  cursor: not-allowed;
}

.cookie-save-row {
  margin-top: 1rem;
  text-align: center;
}

.cookie-btn-save {
  background: var(--gradient);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.65rem 2rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}
.cookie-btn-save:hover { filter: brightness(1.1); }

@media (max-width: 480px) {
  .cookie-modal { padding: 1.5rem; }
}
