/* =========================================================
   Cookie Consent — ANs Holidays
   Uses site.css design tokens: --brand, --accent, --muted,
   --line, --container
   ========================================================= */

/* ── Utility ──────────────────────────────────────────────── */
.cc-hidden { display: none !important; }

.cc-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;
}

/* ── Banner (<dialog>) ────────────────────────────────────── */
#cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  top: auto;
  width: 100%;
  max-width: 100%;
  max-height: none;
  margin: 0;
  padding: 1.25rem 0;
  background: white;
  border: none;
  border-top: 3px solid var(--accent, #f5a524);
  box-shadow: 0 -8px 30px rgba(0, 34, 71, 0.12);
  z-index: 9999;
  /* <dialog> is hidden by default — JS calls show() */
}

/* Override browser's default dialog centering */
#cookie-banner::backdrop { display: none; }

/* ── Container ────────────────────────────────────────────── */
.cc-container {
  max-width: var(--container, 1160px);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}

/* ── Text block ───────────────────────────────────────────── */
.cc-text {
  flex: 1;
  min-width: 280px;
}

.cc-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--brand, #002247);
  margin: 0 0 0.35rem;
}

.cc-description {
  font-size: 0.85rem;
  color: var(--muted, #4A5568);
  line-height: 1.5;
  margin: 0 0 0.5rem;
}

.cc-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0;
}

.cc-links a {
  font-size: 0.8rem;
  color: var(--brand, #002247);
  text-decoration: underline;
  margin-right: 1rem;
}

.cc-links a:hover {
  color: var(--accent, #f5a524);
}

/* ── Actions column ───────────────────────────────────────── */
.cc-actions {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 200px;
}

/* Accept all */
.cc-btn-all {
  background: var(--accent, #f5a524);
  color: var(--brand, #002247);
  border: none;
  border-radius: 999px;
  padding: 0.6rem 1.25rem;
  font-weight: 700;
  font-size: 0.875rem;
  cursor: pointer;
  width: 100%;
  transition: background 0.2s;
}

.cc-btn-all:hover { background: var(--brand, #002247); }

/* Necessary only + Settings */
.cc-btn-necessary,
.cc-btn-settings {
  background: transparent;
  border: 1.5px solid var(--brand, #002247);
  color: var(--brand, #002247);
  border-radius: 999px;
  padding: 0.5rem 1.25rem;
  font-size: 0.875rem;
  cursor: pointer;
  width: 100%;
  transition: background 0.2s, color 0.2s;
}

.cc-btn-necessary:hover,
.cc-btn-settings:hover {
  background: var(--brand, #002247);
  color: white;
}

/* ── Settings panel ───────────────────────────────────────── */
.cc-settings-view {
  border-top: 1px solid var(--line, rgba(0,34,71,.14));
  padding-top: 1rem;
  margin-top: 0.5rem;
}

.cc-settings-view .cc-container {
  flex-direction: column;
  align-items: stretch;
  gap: 0;
}

.cc-toggles {
  width: 100%;
}

/* ── Toggle row ───────────────────────────────────────────── */
.cc-toggle-row {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line, rgba(0,34,71,.14));
}

.cc-toggle-row:last-child { border-bottom: none; }

.cc-toggle-info {
  flex: 1;
  min-width: 0;
}

.cc-toggle-label {
  display: block;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--brand, #002247);
  margin-bottom: 0.2rem;
}

.cc-toggle-desc {
  display: block;
  font-size: 0.78rem;
  color: var(--muted, #4A5568);
  line-height: 1.4;
}

/* ── CSS toggle switch ────────────────────────────────────── */
.cc-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.cc-toggle input[type="checkbox"] {
  /* Visually hidden but still focusable */
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.cc-toggle-track {
  display: inline-flex;
  align-items: center;
  width: 40px;
  height: 22px;
  border-radius: 22px;
  background: #ccc;
  cursor: pointer;
  transition: background 0.2s;
  position: relative;
  flex-shrink: 0;
}

.cc-toggle input[type="checkbox"]:checked + .cc-toggle-track {
  background: var(--accent, #f5a524);
}

.cc-toggle input[type="checkbox"]:focus-visible + .cc-toggle-track {
  outline: 2px solid var(--brand, #002247);
  outline-offset: 2px;
}

.cc-toggle-thumb {
  position: absolute;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
  transition: transform 0.2s;
}

.cc-toggle input[type="checkbox"]:checked ~ .cc-toggle-track .cc-toggle-thumb,
.cc-toggle input[type="checkbox"]:checked + .cc-toggle-track .cc-toggle-thumb {
  transform: translateX(18px);
}

.cc-toggle--disabled {
  opacity: 0.6;
}

.cc-toggle--disabled .cc-toggle-track {
  cursor: not-allowed;
}

.cc-toggle-always {
  font-size: 0.72rem;
  color: var(--muted, #4A5568);
  white-space: nowrap;
}

/* ── Settings footer ──────────────────────────────────────── */
.cc-settings-footer {
  display: flex;
  justify-content: flex-end;
  padding-top: 0.75rem;
}

.cc-btn-save {
  background: var(--brand, #002247);
  color: white;
  border: none;
  border-radius: 999px;
  padding: 0.55rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}

.cc-btn-save:hover { background: var(--brand2, #215387); }

/* ── Re-open button ───────────────────────────────────────── */
#cookie-reopen-btn {
  position: fixed;
  bottom: 1.25rem;
  left: 1.25rem;
  width: 44px;
  height: 44px;
  background: var(--brand, #002247);
  color: white;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 34, 71, 0.25);
  cursor: pointer;
  z-index: 9998;
  transition: transform 0.2s;
}

#cookie-reopen-btn:hover { transform: scale(1.1); }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
  #cookie-banner {
    padding: 1rem 0;
    max-height: 80vh;
    overflow-y: auto;
  }

  .cc-container {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }

  .cc-actions { width: 100%; }

  .cc-btn-all,
  .cc-btn-necessary,
  .cc-btn-settings {
    width: 100%;
    text-align: center;
  }
}
