/* =============================================================
   COOKIE CONSENT — styles
   Uses the same design tokens as styles.css (--forest, --gold,
   etc.) so the banner/modal match the rest of the site. Loads
   independently and adds no render-blocking weight to the page
   (link it with normal <link rel="stylesheet"> — it's small).
============================================================= */

.cc-banner, .cc-modal-overlay, .cc-modal-overlay * { box-sizing: border-box; }

/* ---------- Banner ---------- */
.cc-banner {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 9998;
  background: var(--white, #fff);
  border-top: 1px solid var(--border, #E4DFD4);
  box-shadow: 0 -10px 30px -10px rgba(8,59,45,0.18);
  padding: 20px 24px;
  transform: translateY(110%);
  transition: transform .35s ease;
}
.cc-banner.cc-visible { transform: translateY(0); }
.cc-banner-inner {
  max-width: 1280px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 28px; flex-wrap: wrap;
}
.cc-banner-text { flex: 1 1 420px; min-width: 0; }
.cc-banner-title {
  font-family: var(--serif, serif); font-size: 1.1rem; font-weight: 700;
  color: var(--forest, #083B2D); margin: 0 0 6px;
}
.cc-banner-body { font-size: 0.88rem; line-height: 1.6; color: var(--muted, #666); margin: 0; }
.cc-banner-body a { color: var(--forest, #083B2D); font-weight: 700; text-decoration: underline; }
.cc-banner-actions { display: flex; gap: 10px; flex-wrap: wrap; flex: 0 0 auto; }

/* ---------- Buttons (namespaced so they never clash with site buttons) ---------- */
.cc-btn {
  font-family: inherit; font-size: 0.84rem; font-weight: 700;
  padding: 11px 18px; border-radius: 8px; cursor: pointer;
  border: 1px solid transparent; white-space: nowrap; transition: opacity .15s ease, background .15s ease;
}
.cc-btn:hover { opacity: 0.88; }
.cc-btn:focus-visible { outline: 2px solid var(--gold, #C9A14A); outline-offset: 2px; }
.cc-btn-solid { background: var(--forest, #083B2D); color: #fff; }
.cc-btn-outline { background: transparent; color: var(--forest, #083B2D); border-color: var(--border, #E4DFD4); }
.cc-btn-ghost { background: transparent; color: var(--muted, #666); text-decoration: underline; padding-left: 6px; padding-right: 6px; }

/* ---------- Modal ---------- */
.cc-modal-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(8,20,15,0.55);
  display: flex; align-items: center; justify-content: center; padding: 24px;
  opacity: 0; transition: opacity .2s ease;
}
.cc-modal-overlay.cc-visible { opacity: 1; }
body.cc-lock-scroll { overflow: hidden; }
.cc-modal {
  position: relative; background: var(--white, #fff); border-radius: var(--radius, 12px);
  max-width: 720px; width: 100%; max-height: 86vh; overflow-y: auto;
  padding: 36px 32px 28px; box-shadow: var(--shadow, 0 16px 40px -16px rgba(8,59,45,0.18));
  transform: translateY(14px); transition: transform .2s ease;
}
.cc-modal-overlay.cc-visible .cc-modal { transform: translateY(0); }
.cc-modal-close {
  position: absolute; top: 14px; right: 16px; width: 34px; height: 34px; border-radius: 50%;
  border: none; background: var(--ivory, #F8F5F0); color: var(--dark, #1F2D24);
  font-size: 1.3rem; line-height: 1; cursor: pointer;
}
.cc-modal-title { font-family: var(--serif, serif); font-size: 1.4rem; color: var(--forest, #083B2D); margin: 0 0 10px; }
.cc-modal-intro { font-size: 0.9rem; color: var(--muted, #666); line-height: 1.6; margin: 0 0 22px; }
.cc-cats { display: flex; flex-direction: column; gap: 18px; margin-bottom: 20px; }
.cc-cat { border: 1px solid var(--border, #E4DFD4); border-radius: 10px; padding: 16px 18px; }
.cc-cat-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.cc-cat-name { font-weight: 700; font-size: 0.94rem; color: var(--dark, #1F2D24); }
.cc-always-on { margin-left: auto; font-size: 0.7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--gold, #C9A14A); }

/* Toggle switch */
.cc-switch { position: relative; display: inline-block; width: 40px; height: 22px; flex-shrink: 0; }
.cc-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.cc-switch-track {
  position: absolute; inset: 0; background: var(--border, #E4DFD4); border-radius: 20px; transition: background .15s ease; cursor: pointer;
}
.cc-switch-track::before {
  content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: transform .15s ease; box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.cc-switch input:checked + .cc-switch-track { background: var(--forest, #083B2D); }
.cc-switch input:checked + .cc-switch-track::before { transform: translateX(18px); }
.cc-switch input:disabled + .cc-switch-track { background: var(--gold, #C9A14A); opacity: 0.6; cursor: not-allowed; }
.cc-switch input:focus-visible + .cc-switch-track { outline: 2px solid var(--gold, #C9A14A); outline-offset: 2px; }

.cc-table { width: 100%; border-collapse: collapse; font-size: 0.78rem; }
.cc-table th, .cc-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border, #E4DFD4); vertical-align: top; }
.cc-table th { color: var(--muted, #666); font-weight: 700; text-transform: uppercase; font-size: 0.68rem; letter-spacing: .04em; }
.cc-table tr:last-child td { border-bottom: none; }

.cc-links { font-size: 0.84rem; margin: 0 0 22px; }
.cc-links a { color: var(--forest, #083B2D); font-weight: 700; text-decoration: underline; }
.cc-modal-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .cc-banner-inner { flex-direction: column; align-items: stretch; }
  .cc-banner-actions { justify-content: stretch; }
  .cc-banner-actions .cc-btn { flex: 1 1 auto; }
  .cc-modal { padding: 30px 20px 22px; max-height: 90vh; }
}

/* ---------- Dark mode ---------- */
@media (prefers-color-scheme: dark) {
  .cc-banner { background: #10241c; border-top-color: #1e3a2e; }
  .cc-banner-body { color: #b9c4bd; }
  .cc-banner-title { color: #f2e6c8; }
  .cc-btn-outline { color: #f2e6c8; border-color: #2c4a3b; }
  .cc-modal { background: #10241c; }
  .cc-modal-title { color: #f2e6c8; }
  .cc-modal-intro, .cc-table th { color: #b9c4bd; }
  .cc-cat { border-color: #2c4a3b; }
  .cc-cat-name { color: #f0ece0; }
  .cc-table td { color: #d9d2c2; border-color: #23392e; }
  .cc-modal-close { background: #1e3a2e; color: #f0ece0; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .cc-banner, .cc-modal-overlay, .cc-modal { transition: none; }
}
