/* Altum Cardæ · cookie banner and preferences panel.
   AEPD guidance: "Aceptar" and "Rechazar" have the same visual weight; nothing is pre-ticked. */

/* ---------- Banner (first layer) ---------- */
.consent {
  position: fixed; left: var(--gutter); bottom: 24px; z-index: 170;
  width: min(560px, calc(100vw - 2 * var(--gutter)));
  display: grid; grid-template-columns: 40px 1fr; gap: 6px 20px;
  padding: 26px 28px 24px; background: var(--green-deep); color: var(--cream);
  border: 1px solid rgba(230, 201, 128, .35); box-shadow: 0 30px 60px rgba(0, 0, 0, .35);
  opacity: 0; transform: translateY(24px); transition: opacity .5s var(--ease), transform .6s var(--ease);
}
.consent.is-in { opacity: 1; transform: none; }
.consent::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--gold-gradient); }
.consent-emblem { width: 40px; height: 40px; }
.consent-text { grid-column: 2; }
.consent-title { font-family: var(--serif); font-size: 24px; line-height: 1.1; margin: 4px 0 10px; color: var(--cream); }
.consent-text p:not(.consent-title) { margin: 0; font-size: 14px; line-height: 1.65; color: rgba(250, 247, 240, .76); }
.consent a { color: var(--gold-light); text-decoration: underline; text-underline-offset: 3px; }
.consent-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 18px; }

.consent-btn {
  flex: 1 1 140px; min-height: 48px; padding: 0 22px;
  border: 1px solid var(--gold-light); background: transparent; color: var(--cream);
  font-family: var(--sans); font-size: 11px; letter-spacing: .24em; text-transform: uppercase;
  transition: background .35s var(--ease), color .35s var(--ease);
}
.consent-btn:hover, .consent-btn:focus-visible { background: var(--gold-light); color: var(--green); }
.consent-link { flex: 0 0 auto; padding: 8px 4px; font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--gold-light); text-decoration: underline; text-underline-offset: 4px; }
.consent-link:hover { color: var(--cream); }

/* ---------- Preferences panel (second layer) ---------- */
.consent-panel { position: fixed; inset: 0; z-index: 180; display: grid; place-items: center; padding: 20px; }
.consent-panel[hidden] { display: none; }
.consent-panel-backdrop { position: absolute; inset: 0; background: rgba(1, 28, 17, .72); backdrop-filter: blur(4px); opacity: 0; transition: opacity .4s; }
.consent-panel-box {
  position: relative; width: min(640px, 100%); max-height: calc(100vh - 40px); overflow: auto;
  padding: 40px clamp(24px, 4vw, 44px) 32px; background: var(--cream); color: var(--ink);
  border-top: 2px solid var(--gold-dark); transform: translateY(24px); opacity: 0;
  transition: transform .5s var(--ease), opacity .4s;
}
.consent-panel.is-in .consent-panel-backdrop { opacity: 1; }
.consent-panel.is-in .consent-panel-box { transform: none; opacity: 1; }
.consent-panel-box .consent-emblem { margin-bottom: 18px; }
.consent-panel-box h2 { font-size: clamp(30px, 3.4vw, 40px); font-weight: 300; color: var(--green); margin-bottom: 14px; }
.consent-panel-intro { font-size: 15px; color: var(--gray); margin-bottom: 26px; }
.consent-panel-intro a { color: var(--gold-dark); text-decoration: underline; text-underline-offset: 3px; }
.consent-close { position: absolute; top: 14px; right: 16px; width: 40px; height: 40px; font-size: 28px; line-height: 1; color: var(--green); }
.consent-close:hover { color: var(--gold-dark); }

.consent-cats { list-style: none; margin: 0 0 28px; padding: 0; border-top: 1px solid var(--line); }
.consent-cat { padding: 18px 0; border-bottom: 1px solid var(--line); }
.consent-cat p { margin: 8px 0 0; font-size: 14px; color: var(--gray); }
.consent-cat.is-unused { opacity: .6; }
.consent-cat-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.consent-cat-name { font-family: var(--serif); font-size: 22px; color: var(--green); }
.consent-always { font-size: 10px; letter-spacing: .22em; text-transform: uppercase; color: var(--gold-dark); white-space: nowrap; }

.consent-switch { position: relative; display: inline-block; width: 52px; height: 28px; flex: none; cursor: pointer; }
.consent-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.consent-switch i { position: absolute; inset: 0; border: 1px solid var(--line); border-radius: 28px; background: var(--cream-2); transition: background .3s, border-color .3s; }
.consent-switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--gray); transition: transform .35s var(--ease), background .3s; }
.consent-switch input:checked + span + i { background: var(--green); border-color: var(--green); }
.consent-switch input:checked + span + i::after { transform: translateX(24px); background: var(--gold-light); }
.consent-switch input:focus-visible + span + i { outline: 1px solid var(--gold-dark); outline-offset: 3px; }

.consent-panel-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.consent-btn--dark { border-color: var(--green); color: var(--green); }
.consent-btn--dark:hover, .consent-btn--dark:focus-visible { background: var(--green); color: var(--cream); }

html.consent-open { overflow: hidden; }

/* Footer "Configurar cookies" link looks like the other legal links */
.footer-cookies { padding: 0; font: inherit; font-size: 12px; letter-spacing: .06em; color: inherit; transition: color .3s; }
.footer-cookies:hover { color: var(--gold-light); }

@media (max-width: 560px) {
  .consent { left: 12px; right: 12px; bottom: 12px; width: auto; padding: 22px 20px 20px; grid-template-columns: 32px 1fr; }
  .consent-emblem { width: 32px; height: 32px; }
  .consent-btn { flex-basis: calc(50% - 6px); }
  .consent-link { flex-basis: 100%; text-align: center; }
}
.calm .consent, .calm .consent-panel-box, .calm .consent-panel-backdrop { transition: opacity .3s; transform: none; }
