/* ============================================
   COOKIE CONSENT — Nordic editorial elegance
   ============================================ */

/* --- Banner --- */
.cookie-consent {
  position: fixed;
  z-index: 1200;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  width: min(820px, calc(100% - 32px));
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto auto auto;
  column-gap: 28px;
  row-gap: 0;
  background: linear-gradient(
    160deg,
    rgba(10, 22, 40, 0.92) 0%,
    rgba(26, 47, 35, 0.90) 60%,
    rgba(10, 22, 40, 0.94) 100%
  );
  color: var(--color-text-inverse);
  border: 1px solid rgba(125, 211, 192, 0.12);
  border-top: none;
  border-radius: 18px;
  box-shadow:
    0 32px 80px rgba(2, 8, 18, 0.5),
    0 8px 24px rgba(2, 8, 18, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  padding: 20px 24px;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transition: none;
}

.cookie-consent[hidden] {
  display: none;
}

/* Decorative gradient top edge */
.cookie-consent::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--color-aurora) 20%,
    var(--color-gold) 50%,
    var(--color-glacier) 80%,
    transparent 100%
  );
  opacity: 0.8;
}

/* Subtle inner glow */
.cookie-consent::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 20px;
  background: radial-gradient(
    ellipse at 20% 0%,
    rgba(125, 211, 192, 0.06) 0%,
    transparent 60%
  );
  pointer-events: none;
}

.cookie-consent__title {
  grid-column: 1;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: 0.01em;
  margin: 0;
  position: relative;
  z-index: 1;
}

.cookie-consent__accent {
  grid-column: 1;
  width: 36px;
  height: 1.5px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    var(--color-gold) 0%,
    rgba(196, 145, 138, 0.3) 100%
  );
  margin: 6px 0 0;
  position: relative;
  z-index: 1;
}

.cookie-consent__text {
  grid-column: 1;
  font-size: 0.76rem;
  line-height: 1.5;
  color: rgba(250, 248, 245, 0.65);
  margin: 8px 0 0;
  position: relative;
  z-index: 1;
}

.cookie-consent__actions {
  grid-column: 2;
  grid-row: 1 / -1;
  display: flex;
  flex-direction: column;
  align-self: center;
  gap: 8px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.cookie-consent__link {
  grid-column: 1;
}

/* --- Buttons (banner) --- */
.cookie-consent__actions .btn {
  width: 100%;
  min-width: 150px;
  height: 30px;
  padding: 0 18px;
  border-radius: 10px;
  text-align: center;
  justify-content: center;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background var(--duration-fast) var(--ease-out-quart),
    border-color var(--duration-fast) var(--ease-out-quart),
    box-shadow var(--duration-fast) var(--ease-out-quart),
    transform 120ms var(--ease-out-quart);
  position: relative;
  overflow: hidden;
}

.cookie-consent__actions .btn:active {
  transform: scale(0.97);
}

.cookie-consent__actions .btn-primary {
  color: #0a1628;
  background: linear-gradient(135deg, #c4918a 0%, #b57f78 100%);
  border: 1px solid rgba(196, 145, 138, 0.3);
  box-shadow:
    0 2px 8px rgba(196, 145, 138, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.cookie-consent__actions .btn-primary:hover {
  background: linear-gradient(135deg, #d8aca6 0%, #c4918a 100%);
  box-shadow:
    0 4px 16px rgba(196, 145, 138, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.cookie-consent__actions .btn-secondary {
  color: rgba(250, 248, 245, 0.9);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(4px);
}

.cookie-consent__actions .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
}

.cookie-consent__actions .btn-outline {
  color: rgba(125, 211, 192, 0.9);
  background: rgba(125, 211, 192, 0.06);
  border: 1px solid rgba(125, 211, 192, 0.2);
}

.cookie-consent__actions .btn-outline:hover {
  background: rgba(125, 211, 192, 0.12);
  border-color: rgba(125, 211, 192, 0.4);
  color: var(--color-aurora);
}

/* --- Privacy link --- */
.cookie-consent__link {
  display: inline-flex;
  font-size: 0.68rem;
  color: rgba(250, 248, 245, 0.4);
  text-decoration: none;
  letter-spacing: 0.02em;
  margin-top: 8px;
  transition: color var(--duration-fast);
  position: relative;
  z-index: 1;
}

.cookie-consent__link:hover {
  color: rgba(250, 248, 245, 0.75);
}

.cookie-consent__link::after {
  content: ' →';
  opacity: 0;
  transform: translateX(-4px);
  transition:
    opacity var(--duration-fast),
    transform var(--duration-fast);
}

.cookie-consent__link:hover::after {
  opacity: 1;
  transform: translateX(0);
}

/* --- Entrance animation --- */
.cookie-consent--enter {
  animation: cookieSlideIn 700ms cubic-bezier(0.16, 1, 0.3, 1) 1s both;
}

@keyframes cookieSlideIn {
  0% {
    opacity: 0;
    visibility: visible;
    transform: translate(-50%, 32px);
  }
  100% {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
  }
}

/* Non-animating visible state */
.cookie-consent:not([hidden]):not(.cookie-consent--enter) {
  opacity: 1;
  visibility: visible;
}

/* ============================================
   CUSTOMIZE PANEL — Overlay modal
   ============================================ */

.cookie-consent-panel {
  position: fixed;
  z-index: 1210;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(10, 22, 40, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: var(--space-lg);
  animation: panelOverlayIn 300ms var(--ease-out-quart) both;
}

.cookie-consent-panel[hidden] {
  display: none;
}

@keyframes panelOverlayIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.cookie-consent-panel__card {
  width: min(520px, 100%);
  border-radius: 16px;
  background: var(--color-warm-white);
  color: var(--color-text-primary);
  box-shadow:
    0 32px 80px rgba(2, 8, 18, 0.3),
    0 1px 3px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  animation: panelCardIn 500ms cubic-bezier(0.16, 1, 0.3, 1) 80ms both;
}

@keyframes panelCardIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.cookie-consent-panel__header {
  padding: 28px 28px 20px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  position: relative;
}

/* Gold accent in panel header */
.cookie-consent-panel__header::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 28px;
  width: 40px;
  height: 2px;
  background: var(--color-gold);
  border-radius: 999px;
}

.cookie-consent-panel__title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 500;
  line-height: 1.15;
  color: var(--color-midnight);
  margin: 0;
}

.cookie-consent-panel__body {
  padding: 24px 28px 28px;
}

/* --- Option cards --- */
.cookie-consent-option {
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  background: rgba(0, 0, 0, 0.015);
  transition: border-color var(--duration-fast);
}

.cookie-consent-option:hover {
  border-color: rgba(0, 0, 0, 0.12);
}

.cookie-consent-option__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

.cookie-consent-option__title {
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--color-text-primary);
  margin: 0;
}

.cookie-consent-option__desc {
  margin: 6px 0 0;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--color-text-muted);
}

/* --- Toggle switch --- */
.cookie-consent-switch {
  appearance: none;
  -webkit-appearance: none;
  width: 44px;
  height: 24px;
  border-radius: 999px;
  border: none;
  background: #d1d5db;
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 200ms var(--ease-out-quart);
}

.cookie-consent-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  transition: transform 200ms var(--ease-out-quart);
}

.cookie-consent-switch:checked {
  background: var(--color-pine);
}

.cookie-consent-switch:checked::after {
  transform: translateX(20px);
}

.cookie-consent-switch:disabled {
  opacity: 0.45;
  cursor: default;
}

.cookie-consent-switch:focus-visible {
  outline: 2px solid var(--color-aurora);
  outline-offset: 2px;
}

/* --- Panel action buttons --- */
.cookie-consent-panel__actions {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cookie-consent-panel__actions .btn {
  height: 38px;
  padding: 0 20px;
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition:
    background var(--duration-fast),
    border-color var(--duration-fast),
    box-shadow var(--duration-fast),
    transform 120ms;
}

.cookie-consent-panel__actions .btn:active {
  transform: scale(0.97);
}

.cookie-consent-panel__actions .btn-primary {
  color: #fff;
  background: var(--color-pine);
  border: 1px solid transparent;
  box-shadow: 0 2px 6px rgba(61, 90, 71, 0.2);
}

.cookie-consent-panel__actions .btn-primary:hover {
  background: #4a6b54;
  box-shadow: 0 4px 12px rgba(61, 90, 71, 0.3);
}

.cookie-consent-panel__actions .btn-outline {
  color: var(--color-text-secondary);
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.12);
}

.cookie-consent-panel__actions .btn-outline:hover {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.2);
}

.cookie-consent-panel__actions .btn-secondary {
  color: var(--color-text-muted);
  background: transparent;
  border: 1px solid transparent;
}

.cookie-consent-panel__actions .btn-secondary:hover {
  color: var(--color-text-secondary);
  background: rgba(0, 0, 0, 0.03);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 640px) {
  .cookie-consent {
    width: calc(100% - 16px);
    bottom: 8px;
    border-radius: 16px;
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .cookie-consent__title {
    font-size: 1.25rem;
  }

  .cookie-consent__text {
    font-size: 0.76rem;
  }

  .cookie-consent__actions {
    grid-column: 1;
    grid-row: auto;
    flex-direction: row;
    flex-wrap: wrap;
    margin-top: 12px;
  }

  .cookie-consent__actions .btn {
    width: auto;
    min-width: 0;
    flex: 1 1 auto;
    height: 36px;
    font-size: 0.7rem;
  }

  .cookie-consent__link {
    margin-top: 10px;
  }

  .cookie-consent-panel__card {
    border-radius: 14px;
  }

  .cookie-consent-panel__header {
    padding: 22px 20px 16px;
  }

  .cookie-consent-panel__header::after {
    left: 20px;
  }

  .cookie-consent-panel__title {
    font-size: 1.35rem;
  }

  .cookie-consent-panel__body {
    padding: 18px 20px 22px;
  }

  .cookie-consent-panel__actions {
    flex-direction: column;
  }

  .cookie-consent-panel__actions .btn {
    width: 100%;
    justify-content: center;
  }
}

/* ============================================
   REDUCED MOTION
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  .cookie-consent--enter {
    animation: none;
    opacity: 1;
    visibility: visible;
  }

  .cookie-consent-panel {
    animation: none;
  }

  .cookie-consent-panel__card {
    animation: none;
  }
}


