/* ============================================================
   COOKIES — Banner + Modal (versión premium, RGPD-friendly)
   ============================================================ */

/* =========================
   COOKIE BANNER
========================= */
.cookie-banner {
  position: fixed;
  inset-inline: 0;
  bottom: 0;

  display: none; /* controlado por JS */
  align-items: center;
  justify-content: space-between;
  gap: 20px;

  padding: 18px 20px;

  background: rgba(18, 19, 20, 0.92);
  backdrop-filter: blur(4px);

  color: #fff;
  font-size: 0.95rem;
  line-height: 1.5;

  z-index: var(--z-cookie-banner, 9000);
}

/* Mostrar banner */
.cookie-banner.is-visible {
  display: flex;
}

/* Texto */
.cookie-banner__text {
  flex: 1;
  margin: 0; /* <p> por defecto mete margen y “rompe” el layout */
}

/* Links dentro del texto (si usas <a>) */
.cookie-banner__text a {
 color: #6ee7f0;
  text-decoration: underline;
}

/* =========================
   COMPATIBILIDAD CON TU HTML ACTUAL
   - Tu banner usa un <button class="btn-link" id="openCookiePolicy">
   - Este CSS lo deja como link “bonito” dentro del texto
========================= */
.cookie-banner__text .btn-link,
.btn-link#openCookiePolicy {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;

  color: var(--brand-400);
  text-decoration: underline;
  font: inherit;
  cursor: pointer;
}

.cookie-banner__text .btn-link:hover,
.btn-link#openCookiePolicy:hover {
  opacity: 0.9;
}

.cookie-banner__text .btn-link:focus-visible,
.btn-link#openCookiePolicy:focus-visible {
  outline: 3px solid var(--primary-400);
  outline-offset: 2px;
  border-radius: 6px;
}

/* Acciones */
.cookie-banner__actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

/* =========================
   BOTONES (estilo premium)
========================= */
.cookie-btn {
  padding: 10px 18px;

  border-radius: 8px;
  border: none;

  font-weight: 600;
  font-size: 0.9rem;

  cursor: pointer;
  white-space: nowrap;

  transition: background .25s ease, transform .15s ease, box-shadow .15s ease;
  -webkit-tap-highlight-color: transparent;
}

.cookie-btn:hover {
  transform: scale(1.03);
}

/* Aceptar */
.cookie-btn--accept {
  background: var(--brand-600);
  color: #fff;
}

.cookie-btn--accept:hover {
  background: var(--brand-700);
}

/* Configurar */
.cookie-btn--settings {
  background: rgba(255,255,255,0.14);
  color: #fff;
}

.cookie-btn--settings:hover {
  background: rgba(255,255,255,0.22);
}

/* Rechazar */
.cookie-btn--reject {
  background: transparent;
  color: #fff;
  opacity: 0.8;
}

.cookie-btn--reject:hover {
  opacity: 1;
}

/* Focus accesible */
.cookie-btn:focus-visible {
  outline: 3px solid var(--primary-400);
  outline-offset: 2px;
}

/* =========================
   COMPATIBILIDAD CON TU HTML ACTUAL
   - Tu botón Aceptar tiene class="cookie-banner__button"
   - Lo mapeamos a los estilos premium sin tocar HTML
========================= */
.cookie-banner__button {
  padding: 10px 18px;

  border-radius: 8px;
  border: none;

  font-weight: 600;
  font-size: 0.9rem;

  cursor: pointer;
  white-space: nowrap;

  transition: background .25s ease, transform .15s ease, box-shadow .15s ease;
  -webkit-tap-highlight-color: transparent;

  background: var(--brand-600);
  color: #fff;
}

.cookie-banner__button:hover {
  transform: scale(1.03);
  background: var(--brand-700);
}

.cookie-banner__button:focus-visible {
  outline: 3px solid var(--primary-400);
  outline-offset: 2px;
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 600px) {
  .cookie-banner {
    flex-direction: column;
    text-align: center;
    padding: 16px 14px;
  }

  .cookie-banner__actions {
    width: 100%;
    justify-content: center;
  }

  .cookie-btn,
  .cookie-banner__button {
    width: 100%;
  }
}

/* =========================
   COOKIE MODAL
   (extiende modal base)
========================= */
.cookie-modal .modal__content {
  max-width: 680px;
}

.cookie-modal .modal__title {
  margin-bottom: 10px;
}

.cookie-modal .modal__text p + p {
  margin-top: 10px;
}

/* =========================
   REDUCE MOTION
========================= */
@media (prefers-reduced-motion: reduce) {
  .cookie-btn,
  .cookie-banner__button {
    transition: none !important;
  }

  .cookie-btn:hover,
  .cookie-banner__button:hover {
    transform: none;
  }
}
/* =========================
   CMP MINI — Settings UI
========================= */
.cookie-settings {
  margin-top: 14px;
  display: grid;
  gap: 12px;
}

.cookie-setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;

  padding: 12px 12px;
  border-radius: 12px;
  background: rgba(0,0,0,0.04);
}

.cookie-setting__info {
  display: grid;
  gap: 4px;
}

.cookie-setting__info span {
  opacity: 0.8;
  font-size: 0.95rem;
}

/* Switch */
.cookie-switch {
  position: relative;
  width: 46px;
  height: 28px;
  flex: 0 0 auto;
}

.cookie-switch input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.cookie-switch__ui {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(0,0,0,0.25);
  transition: background .2s ease;
}

.cookie-switch__ui::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: transform .2s ease;
}

.cookie-switch input:checked + .cookie-switch__ui {
  background: var(--brand-600);
}

.cookie-switch input:checked + .cookie-switch__ui::after {
  transform: translateX(18px);
}

.cookie-switch input:disabled + .cookie-switch__ui {
  opacity: 0.6;
}

/* Modal actions */
.cookie-modal__actions {
  margin-top: 16px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

@media (max-width: 600px) {
  .cookie-modal__actions .cookie-btn {
    width: 100%;
  }
  .cookie-setting {
    align-items: flex-start;
  }
}
