/* =========================================================
   Privacy & Cookies — Cookie Banner + Policy Modals
   ========================================================= */

/* --- Cookie Consent Banner --- */
.cookie-banner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 9999;
  padding: 0;
  transform: translateY(100%);
  opacity: 0;
  transition: transform 0.55s var(--ease-out-expo), opacity 0.4s;
  pointer-events: none;
}
.cookie-banner.is-visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.cookie-banner-inner {
  max-width: 820px;
  margin: 0 auto 20px;
  padding: 28px 32px;
  background: rgba(225, 228, 236, 0.85);
  backdrop-filter: blur(32px) saturate(160%);
  -webkit-backdrop-filter: blur(32px) saturate(160%);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0,0,0,0.18), 0 8px 20px rgba(0,0,0,0.10), inset 0 1px 0 rgba(255,255,255,0.5);
}
.cookie-banner-text {
  font-size: 14px;
  color: var(--text-1);
  line-height: 1.6;
  margin-bottom: 18px;
}
.cookie-banner-text a {
  color: var(--accent-green);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.cookie-banner-text a:hover { color: var(--accent-red); }
.cookie-banner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.cookie-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  font-size: 13px; font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.3s var(--easing);
}
.cookie-btn-accept {
  background: var(--text-0);
  color: var(--accent-red);
}
.cookie-btn-accept:hover {
  background: var(--accent-green);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 150, 64,0.25);
}
.cookie-btn-reject {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text-1);
}
.cookie-btn-reject:hover {
  background: rgba(0,0,0,0.05);
  border-color: var(--text-2);
}
.cookie-btn-settings {
  background: transparent;
  color: var(--text-2);
  font-size: 12px;
  padding: 8px 14px;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.cookie-btn-settings:hover { color: var(--accent-red); }

/* Customize panel */
.cookie-customize {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.4s var(--easing), opacity 0.3s, margin 0.3s;
  margin-top: 0;
}
.cookie-customize.is-open {
  max-height: 300px;
  opacity: 1;
  margin-top: 18px;
}
.cookie-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.cookie-option:last-child { border-bottom: none; }
.cookie-option-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-0);
}
.cookie-option-desc {
  font-size: 11px;
  color: var(--text-2);
  margin-top: 2px;
}
.cookie-option .customizer-switch {
  flex-shrink: 0;
}

@media (max-width: 600px) {
  .cookie-banner-inner {
    margin: 0 10px 10px;
    padding: 22px 20px;
    border-radius: var(--radius-md);
  }
  .cookie-banner-actions { flex-direction: column; }
  .cookie-btn { width: 100%; justify-content: center; }
}

/* --- Policy Modals (Full-screen overlay) --- */
.policy-modal {
  position: fixed; inset: 0; z-index: 10001;
  display: flex; align-items: center; justify-content: center;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s var(--easing), visibility 0s linear 0.4s;
}
.policy-modal.is-open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transition: opacity 0.4s var(--easing), visibility 0s linear 0s;
}
.policy-modal-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.policy-modal-content {
  position: relative; z-index: 1;
  width: 92%; max-width: 760px;
  max-height: 85vh;
  background: rgba(240, 242, 246, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: var(--radius-lg);
  box-shadow: 0 30px 80px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.5);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 48px 44px 40px;
  transform: translateY(20px) scale(0.97);
  transition: transform 0.45s var(--ease-out-expo);
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,0.12) transparent;
}
.policy-modal-content::-webkit-scrollbar { width: 5px; }
.policy-modal-content::-webkit-scrollbar-track { background: transparent; margin: 12px 0; }
.policy-modal-content::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); border-radius: 3px; }
.policy-modal-content::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.2); }
.policy-modal.is-open .policy-modal-content {
  transform: translateY(0) scale(1);
}
.policy-modal-close {
  position: absolute; top: 16px; right: 16px;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(0,0,0,0.06);
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: var(--text-1);
  transition: background 0.2s, color 0.2s;
  z-index: 10;
}
.policy-modal-close:hover { background: var(--accent-red); color: #fff; }
.policy-body h2 {
  font-size: 1.8rem;
  margin-bottom: 8px;
  color: var(--text-0);
}
.policy-body .policy-updated {
  font-size: 12px;
  color: var(--text-2);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.1em;
  margin-bottom: 28px;
}
.policy-body h3 {
  font-size: 1.15rem;
  margin-top: 28px;
  margin-bottom: 10px;
  color: var(--text-0);
}
.policy-body p, .policy-body ul {
  font-size: 14px;
  color: var(--text-1);
  line-height: 1.7;
  margin-bottom: 14px;
}
.policy-body ul {
  padding-left: 20px;
}
.policy-body ul li {
  margin-bottom: 6px;
}
.policy-body a {
  color: var(--accent-green);
  text-decoration: underline;
  text-underline-offset: 2px;
}

@media (max-width: 600px) {
  .policy-modal-content {
    width: 96%; padding: 32px 22px 28px;
    max-height: 90vh;
    border-radius: var(--radius-md);
  }
  .policy-body h2 { font-size: 1.4rem; }
}

/* --- Nav Policies Dropdown --- */
.nav-dropdown-wrap {
  position: relative;
}
.nav-dropdown-wrap > a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.nav-dropdown-arrow {
  width: 10px; height: 10px;
  transition: transform 0.3s var(--easing);
}
.nav-dropdown-wrap:hover .nav-dropdown-arrow,
.nav-dropdown-wrap.is-open .nav-dropdown-arrow {
  transform: rotate(180deg);
}
.nav-dropdown {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  min-width: 180px;
  background: rgba(240, 242, 246, 0.92);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 40px rgba(0,0,0,0.15), inset 0 1px 0 rgba(255,255,255,0.4);
  padding: 8px;
  padding-top: 18px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s var(--easing), visibility 0s 0.25s;
  z-index: 200;
}
/* Invisible bridge to prevent hover gap */
.nav-dropdown::before {
  content: '';
  position: absolute;
  top: -12px; left: 0; right: 0;
  height: 14px;
}
.nav-dropdown-wrap:hover .nav-dropdown,
.nav-dropdown-wrap.is-open .nav-dropdown {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
  transition: opacity 0.25s, transform 0.25s var(--easing), visibility 0s 0s;
}
.nav-dropdown a {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px !important;
  font-weight: 500 !important;
  color: var(--text-1) !important;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}
.nav-dropdown a:hover {
  background: rgba(227, 6, 21, 0.08);
  color: var(--accent-red) !important;
}
.nav-dropdown a svg {
  width: 14px; height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
  flex-shrink: 0;
}

/* Mobile dropdown */
@media (max-width: 900px) {
  .nav-dropdown-wrap {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .nav-dropdown-wrap > a {
    justify-content: center;
    width: 100%;
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    padding: 11px 24px !important;
    text-align: center;
    letter-spacing: -0.01em;
  }
  .nav-dropdown {
    position: static;
    transform: none !important;
    width: 100%;
    max-height: 0;
    opacity: 0;
    visibility: hidden;
    padding: 0;
    margin-top: 0;
    overflow: hidden;
    transition: max-height 0.35s var(--easing), opacity 0.3s, padding 0.3s, margin 0.3s;
    box-shadow: none;
    background: rgba(0,0,0,0.03);
    border: none;
    border-radius: var(--radius-sm);
  }
  .nav-dropdown::before { display: none; }
  .nav-dropdown-wrap.is-open .nav-dropdown {
    max-height: 120px;
    opacity: 1;
    visibility: visible;
    padding: 6px 8px;
    margin-top: 4px;
  }
  .nav-dropdown a {
    justify-content: center;
  }
}
