/* ===== COOKIE POPUP + TRIGGER ===== */

/* ── Botón circular trigger (bottom-left) ───────────────────────────────── */
.cookie-trigger {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  z-index: 8000;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--charcoal);
  color: var(--stone);
  border: 1px solid rgba(216,205,192,.14);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 18px rgba(0,0,0,.4);
  transition: background .25s, color .25s, transform .2s, box-shadow .25s;
}
.cookie-trigger:hover {
  background: var(--burnt);
  color: var(--ivory);
  transform: scale(1.08);
  box-shadow: 0 6px 24px rgba(0,0,0,.5);
}
.cookie-trigger svg { pointer-events: none; }

/* ── Overlay oscuro ─────────────────────────────────────────────────────── */
.cookie-overlay {
  position: fixed;
  inset: 0;
  z-index: 8900;
  background: rgba(0,0,0,.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
}
.cookie-overlay.visible {
  opacity: 1;
  pointer-events: all;
}

/* ── Popup card ─────────────────────────────────────────────────────────── */
.cookie-popup {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  z-index: 8950;
  width: min(420px, calc(100vw - 2.5rem));
  background: var(--burnt);
  border: 1px solid rgba(216,205,192,.1);
  border-radius: 10px;
  box-shadow: 0 16px 56px rgba(0,0,0,.55);
  opacity: 0;
  transform: translateY(12px) scale(.97);
  pointer-events: none;
  transition: opacity .3s ease, transform .3s ease;
  overflow: hidden;
}
.cookie-popup.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

/* ── Cabecera ───────────────────────────────────────────────────────────── */
.cookie-popup-head {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid rgba(216,205,192,.08);
}
.cookie-popup-icon {
  font-size: 1.35rem;
  line-height: 1;
  flex-shrink: 0;
}
.cookie-popup-title {
  font-family: var(--f-head);
  font-size: 1.3rem;
  font-weight: 300;
  color: var(--ivory);
  letter-spacing: -.01em;
  flex: 1;
}
.cookie-popup-close {
  background: none;
  border: none;
  color: rgba(216,205,192,.32);
  font-size: 1.3rem;
  cursor: pointer;
  padding: .2rem .4rem;
  line-height: 1;
  transition: color .2s;
  flex-shrink: 0;
}
.cookie-popup-close:hover { color: var(--ivory); }

/* ── Texto intro ────────────────────────────────────────────────────────── */
.cookie-popup-text {
  padding: .9rem 1.25rem 0;
  font-size: .8rem;
  color: rgba(216,205,192,.52);
  line-height: 1.65;
}
.cookie-popup-text a {
  color: var(--bronze);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ── Categorías ─────────────────────────────────────────────────────────── */
.cookie-categories {
  padding: .75rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.cookie-cat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .9rem 0;
  border-bottom: 1px solid rgba(216,205,192,.06);
}
.cookie-cat:last-child { border-bottom: none; }

.cookie-cat-info { flex: 1; }
.cookie-cat-info h3 {
  font-family: var(--f-body);
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ivory);
  margin-bottom: .25rem;
}
.cookie-cat-info p {
  font-size: .76rem;
  color: rgba(216,205,192,.42);
  line-height: 1.55;
}

/* Etiqueta "Siempre activas" */
.cookie-cat-always {
  font-size: .65rem;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--bronze);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Toggle switch ──────────────────────────────────────────────────────── */
.cookie-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
  cursor: pointer;
}
.cookie-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.cookie-switch-slider {
  position: absolute;
  inset: 0;
  background: rgba(216,205,192,.12);
  border: 1px solid rgba(216,205,192,.18);
  border-radius: 22px;
  transition: background .25s, border-color .25s;
}
.cookie-switch-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 2px;
  top: 2px;
  background: rgba(216,205,192,.4);
  border-radius: 50%;
  transition: transform .25s, background .25s;
}
.cookie-switch input:checked + .cookie-switch-slider {
  background: var(--bronze);
  border-color: var(--bronze);
}
.cookie-switch input:checked + .cookie-switch-slider::before {
  transform: translateX(18px);
  background: var(--ivory);
}
.cookie-switch input:focus-visible + .cookie-switch-slider {
  outline: 2px solid var(--bronze);
  outline-offset: 2px;
}

/* ── Botones de acción ──────────────────────────────────────────────────── */
.cookie-popup-actions {
  display: flex;
  gap: .6rem;
  padding: .75rem 1.25rem 1rem;
  flex-wrap: wrap;
}
.cookie-btn-all {
  flex: 1;
  background: var(--bronze);
  color: var(--ivory);
  border: 1px solid var(--bronze);
  padding: .7rem 1rem;
  font-family: var(--f-body);
  font-size: .68rem;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .2s, border-color .2s, transform .15s;
  white-space: nowrap;
}
.cookie-btn-all:hover {
  background: var(--bronze-lt);
  border-color: var(--bronze-lt);
  transform: translateY(-1px);
}
.cookie-btn-save {
  flex: 1;
  background: transparent;
  color: rgba(216,205,192,.45);
  border: 1px solid rgba(216,205,192,.18);
  padding: .7rem 1rem;
  font-family: var(--f-body);
  font-size: .68rem;
  font-weight: 400;
  letter-spacing: .12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color .2s, border-color .2s;
  white-space: nowrap;
}
.cookie-btn-save:hover {
  color: var(--stone);
  border-color: rgba(216,205,192,.32);
}

/* Link política */
.cookie-popup-policy {
  display: block;
  text-align: center;
  padding: 0 1.25rem 1.1rem;
  font-size: .68rem;
  color: rgba(216,205,192,.25);
  text-decoration: none;
  transition: color .2s;
}
.cookie-popup-policy:hover { color: rgba(216,205,192,.5); }

/* ── Footer legal links (en index.html) ─────────────────────────────────── */
.footer-legal {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .72rem;
  color: rgba(246,242,236,.28);
  flex-wrap: wrap;
}
.footer-legal a {
  color: inherit;
  transition: color .2s;
}
.footer-legal a:hover { color: rgba(246,242,236,.55); }
.footer-legal-btn {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  font: inherit;
  font-size: inherit;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color .2s;
}
.footer-legal-btn:hover { color: rgba(246,242,236,.55); }

/* ── Mobile ─────────────────────────────────────────────────────────────── */
@media (max-width: 500px) {
  .cookie-trigger {
    bottom: 1.25rem;
    left: 1.25rem;
    width: 42px;
    height: 42px;
  }
  .cookie-popup {
    bottom: 1.25rem;
    left: 1.25rem;
    width: calc(100vw - 2.5rem);
  }
  .cookie-popup-actions { flex-direction: column; }
  .cookie-btn-all,
  .cookie-btn-save { text-align: center; }
}
