/* ============================================
   COOKIE CONSENT BANNER + PREFERENCES MODAL
   ============================================ */

/* ---------- BANNER ---------- */
.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9985;
  background: linear-gradient(180deg, #1a0a26 0%, #0c0420 100%);
  border-top: 2px solid var(--gold, #f7d77a);
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.6);
  transform: translateY(110%);
  opacity: 0;
  transition: transform 0.35s ease, opacity 0.35s ease;
  padding: 22px 0;
}
.cookie-banner.open {
  transform: translateY(0);
  opacity: 1;
}
.cookie-banner-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
}
.cookie-banner-text {
  color: #f0e6f7;
  min-width: 0;
}
.cookie-banner-title {
  font-family: 'Georgia', serif;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--gold, #f7d77a);
  margin: 0 0 6px;
}
.cookie-banner-body {
  font-size: 0.92rem;
  line-height: 1.55;
  margin: 0;
  color: #d8c5e5;
}
.cookie-banner-link {
  color: var(--gold, #f7d77a);
  text-decoration: underline;
}
.cookie-banner-link:hover { color: #fff3c2; }

.cookie-banner-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

@media (max-width: 820px) {
  .cookie-banner { padding: 18px 0; }
  .cookie-banner-inner {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .cookie-banner-actions {
    justify-content: stretch;
  }
  .cookie-banner-actions .cookie-btn { flex: 1; }
}

/* ---------- BUTTONS ---------- */
.cookie-btn {
  padding: 10px 18px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.12s ease;
  white-space: nowrap;
}
.cookie-btn:active { transform: translateY(1px); }

.cookie-btn-primary {
  background: linear-gradient(135deg, #f7d77a 0%, #d4a548 100%);
  color: #1a0a26;
  border-color: #f7d77a;
  box-shadow: 0 6px 18px rgba(247, 215, 122, 0.35);
}
.cookie-btn-primary:hover {
  background: linear-gradient(135deg, #fce39a 0%, #e6b85a 100%);
}

.cookie-btn-secondary {
  background: rgba(247, 215, 122, 0.08);
  color: var(--gold, #f7d77a);
  border-color: rgba(247, 215, 122, 0.45);
}
.cookie-btn-secondary:hover {
  background: rgba(247, 215, 122, 0.16);
  border-color: rgba(247, 215, 122, 0.7);
}

/* ---------- MODAL ---------- */
.cookie-prefs-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 9990;
  opacity: 0;
  transition: opacity 0.28s ease;
}
.cookie-prefs-backdrop.open { opacity: 1; }

.cookie-prefs-modal {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0.96);
  width: min(640px, calc(100vw - 32px));
  max-height: 86vh;
  background: #ffffff;
  color: #1f2937;
  border-radius: 18px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(0, 0, 0, 0.08);
  z-index: 9995;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transition: opacity 0.28s ease, transform 0.28s ease;
  overflow: hidden;
}
.cookie-prefs-modal.open {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.cookie-prefs-header {
  padding: 20px 22px 16px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
}
.cookie-prefs-title {
  font-family: 'Georgia', serif;
  font-size: 1.25rem;
  font-weight: 800;
  color: #1f2937;
  margin: 0;
}
.cookie-prefs-close {
  background: transparent;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  width: 34px;
  height: 34px;
  cursor: pointer;
  font-size: 1rem;
  color: #6b7280;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cookie-prefs-close:hover { background: #f3f4f6; color: #1f2937; }

.cookie-prefs-body {
  padding: 20px 22px;
  overflow-y: auto;
}
.cookie-prefs-intro {
  font-size: 0.92rem;
  color: #374151;
  margin: 0 0 18px;
  line-height: 1.55;
}

.cookie-prefs-category {
  padding: 14px 0;
  border-bottom: 1px solid #f3f4f6;
}
.cookie-prefs-category:last-of-type { border-bottom: none; }
.cookie-prefs-cat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.cookie-prefs-cat-title {
  font-size: 1rem;
  font-weight: 700;
  color: #1f2937;
  margin: 0;
}
.cookie-prefs-cat-desc {
  font-size: 0.85rem;
  color: #4b5563;
  margin: 0;
  line-height: 1.5;
}

.cookie-prefs-toggle {
  width: 46px;
  height: 26px;
  background: #d1d5db;
  border: none;
  border-radius: 14px;
  position: relative;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: background 0.2s ease;
}
.cookie-prefs-toggle:focus-visible {
  outline: 2px solid #4f46e5;
  outline-offset: 2px;
}
.cookie-prefs-toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: left 0.2s ease;
}
.cookie-prefs-toggle.on {
  background: #4f46e5;
}
.cookie-prefs-toggle.on .cookie-prefs-toggle-thumb {
  left: 23px;
}

/* "Always on" pseudo-toggle for Strictly Necessary */
.cookie-prefs-toggle.always-on {
  background: #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  width: auto;
  height: auto;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: default;
}
.cookie-prefs-always-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6b7280;
}

.cookie-prefs-note {
  font-size: 0.82rem;
  color: #6b7280;
  margin: 14px 0 0;
  padding-top: 14px;
  border-top: 1px solid #f3f4f6;
}
.cookie-prefs-note a {
  color: #4f46e5;
  text-decoration: underline;
}

.cookie-prefs-footer {
  padding: 16px 22px;
  border-top: 1px solid #e5e7eb;
  background: #fafafa;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

@media (max-width: 560px) {
  .cookie-prefs-modal {
    width: calc(100vw - 24px);
    max-height: 90vh;
  }
  .cookie-prefs-footer {
    flex-direction: column-reverse;
  }
  .cookie-prefs-footer .cookie-btn {
    width: 100%;
  }
}

/* When inside the modal, all category-toggle buttons swap to light-mode colors */
.cookie-prefs-modal .cookie-btn-primary {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
}
.cookie-prefs-modal .cookie-btn-primary:hover {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
}
.cookie-prefs-modal .cookie-btn-secondary {
  background: #ffffff;
  color: #4b5563;
  border-color: #d1d5db;
}
.cookie-prefs-modal .cookie-btn-secondary:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
  color: #1f2937;
}
