/*==============================================================================
  theme/12-cookie.css
  COOKIE CONSENT — Banner + settings
  Linked from templates/base.html in numbered order with the other theme modules.
==============================================================================*/

/* --------------------------------------------------------------------------
   COOKIE CONSENT — Centered Welcome modal (all breakpoints / pages)
   -------------------------------------------------------------------------- */
.cookie-consent__sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.cookie-welcome[hidden] {
  display: none !important;
}

.cookie-welcome {
  position: fixed;
  inset: 0;
  z-index: 10060;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  font-family: var(--font);
  box-sizing: border-box;
}

.cookie-welcome__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 37, 64, 0.42);
}

.cookie-welcome__panel {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  max-height: min(90vh, 720px);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--bg);
  color: var(--text);
  border-radius: 0;
  box-shadow: 0 24px 64px rgba(10, 37, 64, 0.28);
  padding: 28px 28px 24px;
  margin: auto;
  box-sizing: border-box;
}

.cookie-welcome__panel h2 {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-size: clamp(28px, 5vw, 36px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--text);
}

.cookie-welcome__panel > p {
  margin: 0 0 22px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
}

.cookie-welcome__list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid rgba(10, 37, 64, 0.12);
}

.cookie-welcome__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 52px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(10, 37, 64, 0.12);
}

.cookie-welcome__label {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.3;
}

.cookie-welcome__always {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

.cookie-welcome__link {
  display: inline-block;
  margin: 16px 0 22px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cookie-welcome__link:hover {
  color: var(--primary);
}

.cookie-welcome__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.cookie-welcome__footer-end {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
}

.cookie-welcome__btn {
  appearance: none;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  padding: 12px 16px;
  border-radius: 0;
  cursor: pointer;
  white-space: nowrap;
  border: 1px solid transparent;
}

.cookie-welcome__btn--outline {
  background: var(--bg);
  color: var(--primary) !important;
  border-color: var(--primary);
}

.cookie-welcome__btn--outline:hover {
  background: rgba(201, 162, 39, 0.08);
  color: var(--primary-hover) !important;
  border-color: var(--primary-hover);
}

.cookie-welcome__btn--solid {
  background: var(--primary);
  color: #fff !important;
  border-color: var(--primary);
}

.cookie-welcome__btn--solid:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.cookie-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  cursor: pointer;
}

.cookie-switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.cookie-switch__ui {
  width: 44px;
  height: 26px;
  border-radius: 999px;
  background: #d1d5db;
  position: relative;
  transition: background 0.2s ease;
}

.cookie-switch__ui::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease;
}

.cookie-switch input:checked + .cookie-switch__ui {
  background: var(--primary);
}

.cookie-switch input:checked + .cookie-switch__ui::after {
  transform: translateX(18px);
}

.cookie-switch input:focus-visible + .cookie-switch__ui {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

html.cookie-welcome-open,
html.cookie-welcome-open body {
  overflow: hidden !important;
  overscroll-behavior: none;
}

@media (max-width: 575px) {
  .cookie-welcome {
    padding: 12px;
    align-items: center;
    justify-content: center;
  }

  .cookie-welcome__panel {
    width: 100%;
    max-height: min(92vh, 100%);
    padding: 22px 18px 18px;
  }

  .cookie-welcome__footer {
    flex-direction: column;
    align-items: stretch;
  }

  .cookie-welcome__footer-end {
    margin-left: 0;
    width: 100%;
  }

  .cookie-welcome__footer-end .cookie-welcome__btn,
  .cookie-welcome__btn--outline {
    flex: 1 1 auto;
    width: 100%;
    text-align: center;
  }

  .cookie-welcome__footer-end {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}

