/* ===== COOKIE POPUP + TRIGGER — Chereko Center ===== */

/* ── 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(--dark);
  color: var(--accent);
  border: 1px solid rgba(255,255,255,.12);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 18px rgba(42,31,23,.4);
  transition: background .25s, color .25s, transform .2s, box-shadow .25s;
}
.cookie-trigger:hover {
  background: var(--heading);
  color: var(--white);
  transform: scale(1.08);
  box-shadow: 0 6px 24px rgba(42,31,23,.5);
}
.cookie-trigger svg { pointer-events: none; }

/* ── Overlay oscuro */
.cookie-overlay {
  position: fixed;
  inset: 0;
  z-index: 8900;
  background: rgba(0,0,0,.5);
  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(--dark);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
  box-shadow: 0 16px 56px rgba(0,0,0,.45);
  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(255,255,255,.06);
}
.cookie-popup-icon {
  font-size: 1.35rem;
  line-height: 1;
  flex-shrink: 0;
}
.cookie-popup-title {
  font-family: var(--ff-h);
  font-size: 1.3rem;
  font-weight: 300;
  color: var(--white);
  letter-spacing: -.01em;
  flex: 1;
}
.cookie-popup-close {
  background: none;
  border: none;
  color: rgba(255,255,255,.3);
  font-size: 1.3rem;
  cursor: pointer;
  padding: .2rem .4rem;
  line-height: 1;
  transition: color .2s;
  flex-shrink: 0;
}
.cookie-popup-close:hover { color: var(--white); }

/* ── Texto intro */
.cookie-popup-text {
  padding: .9rem 1.25rem 0;
  font-size: .8rem;
  color: rgba(255,255,255,.45);
  line-height: 1.65;
}
.cookie-popup-text a {
  color: var(--accent);
  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(255,255,255,.05);
}
.cookie-cat:last-child { border-bottom: none; }
.cookie-cat-info { flex: 1; }
.cookie-cat-info h3 {
  font-family: var(--ff-b);
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--white);
  margin-bottom: .25rem;
}
.cookie-cat-info p {
  font-size: .76rem;
  color: rgba(255,255,255,.4);
  line-height: 1.55;
}
.cookie-cat-always {
  font-size: .65rem;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
  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(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.16);
  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(255,255,255,.35);
  border-radius: 50%;
  transition: transform .25s, background .25s;
}
.cookie-switch input:checked + .cookie-switch-slider {
  background: var(--accent);
  border-color: var(--accent);
}
.cookie-switch input:checked + .cookie-switch-slider::before {
  transform: translateX(18px);
  background: var(--dark);
}
.cookie-switch input:focus-visible + .cookie-switch-slider {
  outline: 2px solid var(--accent);
  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(--accent);
  color: var(--heading);
  border: 1px solid var(--accent);
  padding: .7rem 1rem;
  font-family: var(--ff-b);
  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;
  border-radius: 4px;
}
.cookie-btn-all:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  transform: translateY(-1px);
}
.cookie-btn-save {
  flex: 1;
  background: transparent;
  color: rgba(255,255,255,.42);
  border: 1px solid rgba(255,255,255,.15);
  padding: .7rem 1rem;
  font-family: var(--ff-b);
  font-size: .68rem;
  font-weight: 400;
  letter-spacing: .12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color .2s, border-color .2s;
  white-space: nowrap;
  border-radius: 4px;
}
.cookie-btn-save:hover {
  color: rgba(255,255,255,.75);
  border-color: rgba(255,255,255,.3);
}

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

/* ── Botón "Gestionar cookies" en footer */
.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: var(--white); }

/* ── 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; }
}
