/* ═══════════════════════════════════════════════════
   Cookie Consent Banner & Preferences
   ═══════════════════════════════════════════════════ */

/* ─── Banner ─── */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9000;
  background: var(--surface, #111111);
  border-top: 1px solid var(--border-gold, rgba(212, 168, 67, 0.2));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 20px 24px;
  animation: cookieBannerSlideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.cookie-banner[aria-hidden='true'] {
  display: none;
}

.cookie-banner-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 20px;
}

.cookie-banner-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(212, 168, 67, 0.1);
  border: 1px solid rgba(212, 168, 67, 0.2);
  border-radius: 50%;
}

.cookie-banner-icon .material-symbols-outlined {
  font-size: 22px;
  color: var(--gold, #d4a843);
}

.cookie-banner-content {
  flex: 1;
  min-width: 0;
}

.cookie-banner-text {
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  color: var(--text-secondary, rgba(255, 255, 255, 0.7));
  line-height: 1.6;
  margin: 0;
}

.cookie-banner-text a {
  color: var(--gold, #d4a843);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cookie-banner-text a:hover {
  color: var(--gold-light, #f0cd26);
}

.cookie-banner-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* ─── Banner buttons ─── */
.cookie-btn-accept {
  height: 44px;
  padding: 0 24px;
  background: linear-gradient(135deg, var(--gold-light, #f0cd26), var(--gold, #d4a843));
  border: none;
  border-radius: 100px;
  color: #000;
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
  box-shadow: 0 4px 20px rgba(212, 168, 67, 0.2);
  white-space: nowrap;
}

.cookie-btn-accept:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 28px rgba(212, 168, 67, 0.3);
}

.cookie-btn-reject {
  height: 44px;
  padding: 0 24px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 100px;
  color: var(--text, #fff);
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition:
    border-color 0.2s,
    background 0.2s;
  white-space: nowrap;
}

.cookie-btn-reject:hover {
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.04);
}

.cookie-btn-customize {
  background: none;
  border: none;
  color: var(--text-tertiary, rgba(255, 255, 255, 0.45));
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  transition: color 0.2s;
  white-space: nowrap;
  padding: 0 4px;
}

.cookie-btn-customize:hover {
  color: var(--gold, #d4a843);
}

/* ─── Banner animation ─── */
@keyframes cookieBannerSlideUp {
  from {
    opacity: 0;
    transform: translateY(100%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ─── Preferences modal ─── */
.cookie-prefs {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.cookie-prefs[aria-hidden='true'] {
  display: none;
}

.cookie-prefs-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: cookiePrefsFadeIn 0.3s ease;
}

.cookie-prefs-card {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: 85vh;
  overflow-y: auto;
  background: var(--surface, #111111);
  border: 1px solid var(--border-gold, rgba(212, 168, 67, 0.2));
  border-radius: var(--radius-lg, 24px);
  padding: 40px 36px 36px;
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.6),
    0 0 60px rgba(212, 168, 67, 0.08);
  animation: cookiePrefsSlideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Custom scrollbar */
.cookie-prefs-card::-webkit-scrollbar {
  width: 6px;
}

.cookie-prefs-card::-webkit-scrollbar-track {
  background: transparent;
}

.cookie-prefs-card::-webkit-scrollbar-thumb {
  background: var(--surface-3, #1a1a1a);
  border-radius: 3px;
}

.cookie-prefs-card::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* ─── Preferences close button ─── */
.cookie-prefs-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.06));
  border-radius: 50%;
  color: var(--text-tertiary, rgba(255, 255, 255, 0.45));
  cursor: pointer;
  transition:
    color 0.2s,
    border-color 0.2s,
    background 0.2s;
}

.cookie-prefs-close:hover {
  color: var(--text, #fff);
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
}

.cookie-prefs-close .material-symbols-outlined {
  font-size: 20px;
}

/* ─── Preferences header ─── */
.cookie-prefs-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(212, 168, 67, 0.1);
  border: 1px solid rgba(212, 168, 67, 0.2);
  border-radius: 50%;
}

.cookie-prefs-icon .material-symbols-outlined {
  font-size: 26px;
  color: var(--gold, #d4a843);
}

.cookie-prefs-title {
  font-family: 'Sora', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--text, #fff);
  margin: 0 0 8px;
  text-align: center;
}

.cookie-prefs-desc {
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  color: var(--text-secondary, rgba(255, 255, 255, 0.7));
  line-height: 1.6;
  margin: 0 0 28px;
  text-align: center;
}

/* ─── Category rows ─── */
.cookie-prefs-categories {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 28px;
}

.cookie-category {
  background: var(--bg, #050505);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.06));
  border-radius: var(--radius-sm, 10px);
  padding: 18px 20px;
  transition: border-color 0.2s;
}

.cookie-category:hover {
  border-color: rgba(255, 255, 255, 0.1);
}

.cookie-category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.cookie-category-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.cookie-category-name {
  font-family: 'Sora', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--text, #fff);
}

.cookie-category-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  color: var(--gold, #d4a843);
  background: rgba(212, 168, 67, 0.08);
  border: 1px solid var(--border-gold, rgba(212, 168, 67, 0.2));
  border-radius: 100px;
  padding: 2px 10px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  white-space: nowrap;
}

.cookie-category-desc {
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  color: var(--text-secondary, rgba(255, 255, 255, 0.7));
  line-height: 1.5;
  margin: 10px 0 0;
}

.cookie-category-services {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-tertiary, rgba(255, 255, 255, 0.45));
  margin: 8px 0 0;
  line-height: 1.5;
}

/* ─── Toggle switch ─── */
.cookie-toggle {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
}

.cookie-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.cookie-toggle-track {
  position: relative;
  width: 44px;
  height: 24px;
  background: var(--surface-3, #1a1a1a);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.06));
  border-radius: 12px;
  cursor: pointer;
  transition:
    background 0.2s,
    border-color 0.2s;
}

.cookie-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.cookie-toggle input:checked + .cookie-toggle-track {
  background: linear-gradient(135deg, var(--gold-light, #f0cd26), var(--gold, #d4a843));
  border-color: transparent;
}

.cookie-toggle input:checked + .cookie-toggle-track .cookie-toggle-thumb {
  transform: translateX(20px);
}

.cookie-toggle input:focus-visible {
  /* Visually-hidden checkbox: the track below carries the focus style. */
  outline: none;
}

.cookie-toggle input:focus-visible + .cookie-toggle-track {
  box-shadow: 0 0 0 2px var(--gold-glow, rgba(212, 168, 67, 0.4));
}

.cookie-toggle input:disabled + .cookie-toggle-track {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ─── Preferences actions ─── */
.cookie-prefs-actions {
  display: flex;
  gap: 10px;
}

.cookie-btn-save-prefs {
  flex: 1;
  height: 48px;
  padding: 0 28px;
  background: linear-gradient(135deg, var(--gold-light, #f0cd26), var(--gold, #d4a843));
  border: none;
  border-radius: 100px;
  color: #000;
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
  box-shadow: 0 4px 24px rgba(212, 168, 67, 0.25);
}

.cookie-btn-save-prefs:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 32px rgba(212, 168, 67, 0.35);
}

.cookie-btn-accept-all-prefs {
  flex: 1;
  height: 48px;
  padding: 0 28px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 100px;
  color: var(--text, #fff);
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition:
    border-color 0.2s,
    background 0.2s;
}

.cookie-btn-accept-all-prefs:hover {
  border-color: var(--gold, #d4a843);
  background: rgba(212, 168, 67, 0.05);
}

/* ─── Preferences footer ─── */
.cookie-prefs-footer {
  text-align: center;
  margin-top: 20px;
}

.cookie-prefs-footer a {
  font-family: 'Outfit', sans-serif;
  font-size: 12px;
  color: var(--text-tertiary, rgba(255, 255, 255, 0.45));
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.2s;
}

.cookie-prefs-footer a:hover {
  color: var(--gold, #d4a843);
}

/* ─── Preferences animations ─── */
@keyframes cookiePrefsFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes cookiePrefsSlideUp {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ─── Footer Cookie Settings link ─── */
.footer-cookie-link {
  background: none;
  border: none;
  padding: 0;
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  color: var(--text-tertiary, rgba(255, 255, 255, 0.45));
  cursor: pointer;
  transition: color 0.2s;
}

.footer-cookie-link:hover {
  color: var(--gold, #d4a843);
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .cookie-banner {
    padding: 20px 16px;
  }

  .cookie-banner-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  .cookie-banner-icon {
    display: none;
  }

  .cookie-banner-text {
    font-size: 13px;
    text-align: center;
  }

  .cookie-banner-actions {
    flex-direction: column;
    gap: 8px;
  }

  .cookie-btn-accept,
  .cookie-btn-reject {
    width: 100%;
    justify-content: center;
    display: flex;
    align-items: center;
  }

  .cookie-btn-customize {
    text-align: center;
    padding: 4px 0;
  }

  /* Preferences modal */
  .cookie-prefs {
    padding: 0;
    align-items: flex-end;
  }

  .cookie-prefs-card {
    max-width: none;
    max-height: 90vh;
    border-radius: 20px 20px 0 0;
    padding: 32px 20px 28px;
  }

  .cookie-prefs-title {
    font-size: 20px;
  }

  .cookie-prefs-desc {
    font-size: 13px;
  }

  .cookie-category {
    padding: 14px 16px;
  }

  .cookie-category-name {
    font-size: 14px;
  }

  .cookie-prefs-actions {
    flex-direction: column;
    gap: 8px;
  }

  .cookie-btn-save-prefs,
  .cookie-btn-accept-all-prefs {
    width: 100%;
  }
}
