/* ============================================================
   COOKIE CONSENT — BANNER + PREFERENCES MODAL
   ============================================================
   Self-contained: only used by the banner/modal markup that
   appears right after <body> on every page (see
   js/cookie-consent.js for the logic). Uses only the colour,
   spacing, radius and font variables already defined in
   variables.css, so it re-themes automatically with the rest of
   the site — nothing to edit here for a rebrand.

   This file is deliberately separate from components.css, the
   same way a third-party integration gets its own file (see
   SYSTEM-OVERVIEW.md principle 3) — even though cookie consent
   isn't third-party, keeping it in one place makes it easy for
   whoever is legally responsible for this site to find and audit
   exactly what the consent banner does.
   ============================================================ */

.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 500;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: var(--color-bg-dark);
  color: var(--color-text-on-dark);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  transform: translateY(110%);
  transition: transform var(--transition-fast);
}
.cookie-banner.is-visible {
  transform: translateY(0);
}
.cookie-banner__text {
  flex: 1 1 320px;
  font-size: 0.9rem;
  opacity: 0.9;
}
.cookie-banner__text p {
  margin: 0;
}
.cookie-banner__text a {
  color: var(--color-text-on-dark);
  text-decoration: underline;
}
.cookie-banner__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

@media (max-width: 700px) {
  .cookie-banner {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    padding: var(--space-md);
    gap: var(--space-sm);
    max-height: 70vh;
    overflow-y: auto;
  }
  /* In a column layout flex-basis applies to HEIGHT — without this the
     text box was forced to 320px tall, leaving a big empty gap. */
  .cookie-banner__text {
    flex: 0 0 auto;
  }
  .cookie-banner__buttons {
    justify-content: center;
  }
}

/* ---------- Preferences modal ----------
   A small, self-contained modal/overlay pair — deliberately not
   reusing a template's own .modal class (some templates, like a
   booking-only hotel or restaurant, don't have one at all), so
   this file works identically dropped into any template. */
.cookie-modal-overlay,
.cookie-modal {
  position: fixed;
  z-index: 600;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-fast), visibility var(--transition-fast);
}
.cookie-modal-overlay {
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}
.cookie-modal {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -48%);
  width: 90%;
  max-width: 440px;
  max-height: 85vh;
  overflow-y: auto;
  padding: var(--space-lg);
  background: var(--color-bg);
  color: var(--color-text);
  border-radius: var(--radius);
}
.cookie-modal-overlay.is-open,
.cookie-modal.is-open {
  opacity: 1;
  visibility: visible;
}
.cookie-modal.is-open {
  transform: translate(-50%, -50%);
}
.cookie-modal__close {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  background: none;
  border: none;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  color: var(--color-text-muted);
}

.cookie-option {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-md);
  padding: var(--space-sm) 0;
  border-top: 1px solid var(--color-border);
}
.cookie-option p {
  margin: 0.2em 0 0;
  font-size: 0.82rem;
  color: var(--color-text-muted);
}
.cookie-option__locked {
  flex-shrink: 0;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.cookie-toggle {
  position: relative;
  flex-shrink: 0;
  display: inline-block;
  width: 40px;
  height: 22px;
}
.cookie-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}
.cookie-toggle__track {
  position: absolute;
  inset: 0;
  background: var(--color-border);
  border-radius: 999px;
  transition: var(--transition-fast);
  cursor: pointer;
}
.cookie-toggle__track::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: var(--transition-fast);
}
.cookie-toggle input:checked + .cookie-toggle__track {
  background: var(--color-primary);
}
.cookie-toggle input:checked + .cookie-toggle__track::before {
  transform: translateX(18px);
}

/* ---------- Footer legal links ----------
   The small "Privacy Policy · Terms & Conditions · Cookie
   Settings" line added to .footer-bottom on every page. Kept
   here rather than in each template's own components.css so this
   whole feature — banner, modal, footer line — lives in one file. */
.footer-legal {
  margin: 0 0 var(--space-sm);
  font-size: 0.8rem;
}
.footer-legal a,
.footer-legal button {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: inherit;
  opacity: 0.75;
  text-decoration: underline;
  cursor: pointer;
  transition: opacity var(--transition-fast);
}
.footer-legal a:hover,
.footer-legal button:hover {
  opacity: 1;
}
.footer-legal span {
  opacity: 0.5;
  margin: 0 0.5em;
}
