/* ═══════════════════════════════════════════════════════════
   COOKIE CONSENT — banner + modal
   ═══════════════════════════════════════════════════════════ */

.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 400;                      /* above drawer (300) */
  background: var(--bg-surface);
  border-top: 1px solid var(--line-strong);
  box-shadow: 0 -8px 32px rgba(0,0,0,.5);
  padding: 1rem 1.25rem calc(1rem + env(safe-area-inset-bottom));
  transform: translateY(0);
  animation: cookieSlideUp .28s ease-out;
}
@keyframes cookieSlideUp {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.cookie-banner[hidden] { display: none; }

.cookie-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem 2rem;
  align-items: center;
}
.cookie-copy h2 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 1.05rem;
  letter-spacing: .04em;
  color: var(--text);
  margin-bottom: .35rem;
}
.cookie-copy p {
  color: var(--text-dim);
  font-size: .85rem;
  line-height: 1.55;
  margin: 0;
}
.cookie-copy a { color: var(--gold); text-decoration: underline; }
.cookie-copy a:hover { color: var(--gold-dim); }

.cookie-actions {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.cookie-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .6rem 1.1rem;
  border-radius: var(--radius);
  font-size: .8rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: filter .15s, border-color .15s, color .15s, background .15s;
  min-height: 40px;
  white-space: nowrap;
}
.cookie-btn--primary {
  background: var(--gold);
  color: #111;
  border: 1px solid var(--gold);
}
.cookie-btn--primary:hover { filter: brightness(1.1); }
.cookie-btn--secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line-strong);
}
.cookie-btn--secondary:hover { border-color: var(--gold); color: var(--gold); }
.cookie-btn--ghost {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid transparent;
}
.cookie-btn--ghost:hover { color: var(--gold); }

/* ─── Modal ────────────────────────────────────────────── */
.cookie-modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.cookie-modal[hidden] { display: none; }
.cookie-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(4px);
  animation: cookieFade .18s ease-out;
}
@keyframes cookieFade { from { opacity: 0; } to { opacity: 1; } }

.cookie-modal-panel {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: 0 24px 64px rgba(0,0,0,.6);
  width: 100%;
  max-width: 520px;
  max-height: min(88vh, 720px);
  display: flex;
  flex-direction: column;
  animation: cookiePanel .2s ease-out;
}
@keyframes cookiePanel {
  from { transform: translateY(8px) scale(.98); opacity: 0; }
  to   { transform: translateY(0)    scale(1);   opacity: 1; }
}

.cookie-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem 1rem;
  border-bottom: 1px solid var(--line);
}
.cookie-modal-head h2 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 1.15rem;
  letter-spacing: .02em;
  margin: 0;
  color: var(--text);
}
.cookie-modal-close {
  background: transparent;
  border: 0;
  color: var(--text-dim);
  font-size: 1.6rem;
  line-height: 1;
  padding: 0 .4rem;
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
}
.cookie-modal-close:hover { color: var(--text); }

.cookie-modal-body {
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.cookie-cat {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .85rem;
  padding: .9rem 1rem;
  background: var(--bg-base);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  align-items: start;
}
.cookie-cat input[type="checkbox"] {
  margin-top: .25rem;
  width: 18px; height: 18px;
  accent-color: var(--gold);
}
.cookie-cat input[type="checkbox"]:disabled { opacity: .7; }
.cookie-cat strong {
  display: block;
  font-size: .92rem;
  color: var(--text);
  margin-bottom: .2rem;
}
.cookie-cat p {
  font-size: .82rem;
  color: var(--text-dim);
  line-height: 1.55;
  margin: 0;
}

.cookie-modal-foot {
  display: flex;
  gap: .5rem;
  padding: 1rem 1.5rem calc(1rem + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  justify-content: space-between;
  flex-wrap: wrap;
}
body.cookie-modal-open { overflow: hidden; }

/* ─── Legal page utilities ─────────────────────────────── */
.legal-meta {
  text-align: center;
  color: var(--text-faint);
  font-size: .78rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 2.5rem;
}
.legal-note {
  margin-top: 3rem;
  padding: 1.25rem 1.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold-dim);
  border-radius: var(--radius);
  color: var(--text-faint);
  font-size: .82rem;
  line-height: 1.6;
}
.content-page .prose-block ul { padding-left: 1.25rem; margin: .75rem 0; }
.content-page .prose-block li { color: var(--text-dim); margin-bottom: .35rem; line-height: 1.7; }
.content-page .prose-block code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .85em;
  background: var(--bg-base);
  border: 1px solid var(--line);
  padding: .1rem .4rem;
  border-radius: 3px;
  color: var(--gold);
}
.content-page .ship-table { min-width: 0; }
.content-page .prose-block { overflow-x: auto; }

/* ─── Mobile ───────────────────────────────────────────── */
@media (max-width: 720px) {
  .cookie-inner { grid-template-columns: 1fr; gap: .85rem; }
  .cookie-actions { justify-content: stretch; }
  .cookie-btn { flex: 1 1 auto; }
  .cookie-btn--ghost { flex-basis: 100%; }
  .cookie-banner { padding: .9rem 1rem calc(.9rem + env(safe-area-inset-bottom)); }
  .cookie-copy h2 { font-size: .95rem; }
  .cookie-copy p { font-size: .78rem; }
  .cookie-modal { padding: 0; align-items: flex-end; }
  .cookie-modal-panel {
    max-width: none;
    border-radius: var(--radius) var(--radius) 0 0;
    max-height: 90vh;
  }
  .cookie-modal-foot { justify-content: stretch; }
  .cookie-modal-foot .cookie-btn { flex: 1 1 40%; }
}
