/* Banner y panel de configuración de cookies — Azu ConsentManager.
   Accesible, responsive y con Aceptar/Rechazar del MISMO peso visual (AEPD). */

.azu-cookie-banner,
.azu-cookie-modal { box-sizing: border-box; }
.azu-cookie-banner *,
.azu-cookie-modal * { box-sizing: border-box; }

/* El atributo hidden DEBE ocultar (si no, .azu-cookie-modal{display:flex} lo
   dejaría siempre visible como capa a pantalla completa e interceptaría los clics). */
.azu-cookie-banner[hidden],
.azu-cookie-modal[hidden] { display: none !important; }

/* ---------- Banner ---------- */
.azu-cookie-banner {
  position: fixed;
  left: 50%; transform: translateX(-50%);
  bottom: 20px;
  z-index: 99999;
  width: min(920px, calc(100% - 32px));
  background: #ffffff;
  color: #1a2230;
  border: 1px solid rgba(0,0,0,0.10);
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(15,34,58,0.20);
  padding: 22px 24px;
}
.azu-cookie-banner.azu-pos-top { bottom: auto; top: 20px; }

.azu-cookie-title { font-size: 18px; font-weight: 800; margin: 0 0 8px; }
.azu-cookie-resp { font-size: 13px; color: #55617a; margin: 0 0 10px; }
.azu-cookie-resp strong { color: #1a2230; }
.azu-cookie-text { font-size: 14px; line-height: 1.55; color: #3a4356; margin: 0 0 16px; }
.azu-cookie-text a { color: #0b4aa2; text-decoration: underline; }

.azu-cookie-actions {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
}
/* Aceptar y Rechazar: MISMO tamaño, contraste y jerarquía */
.azu-cookie-btn {
  flex: 1 1 0; min-width: 140px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 18px; font-size: 15px; font-weight: 700;
  border-radius: 10px; cursor: pointer; border: 2px solid transparent;
  font-family: inherit; line-height: 1.2; text-align: center;
}
/* Aceptar y Rechazar comparten el mismo color y peso visual (simetría AEPD) */
.azu-cookie-btn-primary,
.azu-cookie-btn-reject { background: #eef1f6; color: #1a2230; border-color: #c7cfdd; }
.azu-cookie-btn-primary:hover,
.azu-cookie-btn-reject:hover { background: #e2e7f0; }
/* Configuración: acción terciaria pero perfectamente visible */
.azu-cookie-btn-settings {
  flex: 0 0 auto; background: transparent; color: #0b4aa2;
  border: 2px solid transparent; text-decoration: underline; font-weight: 600;
  padding: 12px 10px; min-width: 0;
}
.azu-cookie-btn:focus-visible,
.azu-cookie-fab:focus-visible,
.azu-cookie-switch input:focus-visible + .azu-cookie-slider {
  outline: 3px solid #ffb703; outline-offset: 2px;
}

/* ---------- Panel de configuración (modal) ---------- */
.azu-cookie-modal {
  position: fixed; inset: 0; z-index: 100000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px; background: rgba(10,18,32,0.55);
}
.azu-cookie-dialog {
  width: min(640px, 100%); max-height: 88vh; overflow: auto;
  background: #fff; color: #1a2230; border-radius: 16px; padding: 26px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.35);
}
.azu-cookie-dialog h2 { font-size: 20px; font-weight: 800; margin: 0 0 6px; }
.azu-cookie-dialog .azu-cookie-intro { font-size: 14px; color: #55617a; margin: 0 0 18px; }

.azu-cookie-cat {
  border: 1px solid #e5e9f0; border-radius: 12px; padding: 16px; margin-bottom: 12px;
  display: flex; gap: 14px; align-items: flex-start; justify-content: space-between;
}
.azu-cookie-cat h3 { font-size: 15px; font-weight: 700; margin: 0 0 4px; }
.azu-cookie-cat p { font-size: 13px; color: #55617a; margin: 0; line-height: 1.5; }
.azu-cookie-always { font-size: 13px; font-weight: 700; color: #0a7d3c; white-space: nowrap; padding-top: 2px; }

/* Interruptor accesible (checkbox real oculto + slider) */
.azu-cookie-switch { position: relative; display: inline-block; width: 50px; height: 28px; flex: 0 0 auto; }
.azu-cookie-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.azu-cookie-slider {
  position: absolute; inset: 0; background: #c7cfdd; border-radius: 999px; transition: background .15s;
}
.azu-cookie-slider::before {
  content: ""; position: absolute; height: 22px; width: 22px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: transform .15s;
}
.azu-cookie-switch input:checked + .azu-cookie-slider { background: #0b4aa2; }
.azu-cookie-switch input:checked + .azu-cookie-slider::before { transform: translateX(22px); }

.azu-cookie-modal-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.azu-cookie-modal-actions .azu-cookie-btn { flex: 1 1 0; min-width: 130px; }
.azu-cookie-back { background: none; border: 0; color: #55617a; text-decoration: underline; cursor: pointer; font: inherit; margin-bottom: 8px; padding: 4px 0; }

/* ---------- Botón flotante ---------- */
.azu-cookie-fab {
  position: fixed; left: 18px; bottom: 18px; z-index: 99998;
  width: 46px; height: 46px; border-radius: 50%; border: 1px solid rgba(0,0,0,0.12);
  background: #fff; box-shadow: 0 8px 22px rgba(0,0,0,0.16); cursor: pointer;
  font-size: 22px; line-height: 1; display: inline-flex; align-items: center; justify-content: center;
}
.azu-cookie-fab:hover { background: #f4f6fa; }

/* ---------- Responsive ---------- */
@media (max-width: 560px) {
  .azu-cookie-banner { bottom: 0; left: 0; transform: none; width: 100%; border-radius: 16px 16px 0 0; padding: 18px 16px; }
  .azu-cookie-actions { flex-direction: column; align-items: stretch; }
  .azu-cookie-btn, .azu-cookie-btn-settings { flex: 1 1 auto; width: 100%; }
  .azu-cookie-modal-actions { flex-direction: column; }
}

/* ---------- Modo oscuro del sistema ---------- */
@media (prefers-color-scheme: dark) {
  .azu-cookie-banner, .azu-cookie-dialog { background: #161b26; color: #e8ecf3; border-color: rgba(255,255,255,0.10); }
  .azu-cookie-text { color: #c3cad8; }
  .azu-cookie-resp { color: #9aa6bd; }
  .azu-cookie-resp strong { color: #e8ecf3; }
  .azu-cookie-btn-primary,
  .azu-cookie-btn-reject { background: #232a38; color: #e8ecf3; border-color: #3a4456; }
  .azu-cookie-btn-primary:hover,
  .azu-cookie-btn-reject:hover { background: #2c3444; }
  .azu-cookie-cat { border-color: #2c3444; }
  .azu-cookie-cat p, .azu-cookie-dialog .azu-cookie-intro { color: #9aa6bd; }
  .azu-cookie-fab { background: #161b26; color: #e8ecf3; border-color: rgba(255,255,255,0.14); }
}
