/* ═══════════════════════════════════════════════════════
   lgds-cookie-banner v1.0
   Cookie consent — LaGuiadelSeguro
   Prefijo: lgds-cb  (evita colisiones con otros estilos)
═══════════════════════════════════════════════════════ */

/* ── Base ────────────────────────────────────────────── */
.lgds-cb {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: #091c38;
  border-top: 3px solid #F25D14;
  box-shadow: 0 -6px 40px rgba(9, 28, 56, 0.55);
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.85);
  /* Inicio oculto fuera de pantalla */
  transform: translateY(110%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  /* Pequeño margen del botón flotante de WhatsApp en mobile */
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.lgds-cb[hidden] {
  display: block !important; /* mantener dimensiones para la transición */
  visibility: hidden;
  pointer-events: none;
}

.lgds-cb--in {
  transform: translateY(0);
  visibility: visible;
  pointer-events: auto;
}

/* Modo configurar: el banner es más alto, transición suave */
.lgds-cb--cfg {
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              max-height 0.35s ease;
}

/* ── Contenedor interno ──────────────────────────────── */
.lgds-cb__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
}

/* ── Vista — mostrar/ocultar ─────────────────────────── */
.lgds-cb__view { display: block; }
.lgds-cb__view--off { display: none; }

/* ── Vista principal ─────────────────────────────────── */
.lgds-cb__left {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  flex: 1;
  min-width: 0;
}

.lgds-cb__icon {
  font-size: 28px;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 1px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.lgds-cb__copy {
  flex: 1;
  min-width: 0;
}

.lgds-cb__copy strong {
  display: block;
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 3px;
  letter-spacing: 0.2px;
}

.lgds-cb__copy p {
  margin: 0;
  color: rgba(255, 255, 255, 0.6);
  font-size: 13px;
  line-height: 1.55;
}

/* ── Botones — contenedor ────────────────────────────── */
.lgds-cb__btns {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* ── Botón base ──────────────────────────────────────── */
.lgds-cb__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 10px 20px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  border: none;
  white-space: nowrap;
  transition: background 0.18s, border-color 0.18s, color 0.18s,
              transform 0.15s, box-shadow 0.18s;
  -webkit-tap-highlight-color: transparent;
}

.lgds-cb__btn:active {
  transform: scale(0.97);
}

/* Ghost — Rechazar */
.lgds-cb__btn--ghost {
  background: transparent;
  color: rgba(255, 255, 255, 0.5);
  border: 1.5px solid rgba(255, 255, 255, 0.16);
}
.lgds-cb__btn--ghost:hover {
  color: rgba(255, 255, 255, 0.9);
  border-color: rgba(255, 255, 255, 0.38);
  background: rgba(255, 255, 255, 0.04);
}

/* Outline — Configurar */
.lgds-cb__btn--outline {
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.82);
  border: 1.5px solid rgba(255, 255, 255, 0.16);
}
.lgds-cb__btn--outline:hover {
  background: rgba(255, 255, 255, 0.13);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.3);
}

/* Primary — Aceptar / Guardar */
.lgds-cb__btn--primary {
  background: linear-gradient(135deg, #F25D14, #ff7535);
  color: #ffffff;
  border: 1.5px solid transparent;
  box-shadow: 0 4px 14px rgba(242, 93, 20, 0.42);
}
.lgds-cb__btn--primary:hover {
  background: linear-gradient(135deg, #e05510, #F25D14);
  box-shadow: 0 6px 20px rgba(242, 93, 20, 0.55);
  transform: translateY(-1px);
}

/* ── Vista configurar ────────────────────────────────── */
.lgds-cb__inner--cfg {
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
}

.lgds-cb__cfg-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.2px;
}

.lgds-cb__cfg-title svg { opacity: 0.75; flex-shrink: 0; }

/* ── Grupos de cookies ───────────────────────────────── */
.lgds-cb__groups {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.lgds-cb__group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  transition: background 0.15s;
}

.lgds-cb__group:hover {
  background: rgba(255, 255, 255, 0.06);
}

.lgds-cb__ginfo {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.lgds-cb__glabel {
  font-size: 13px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.3;
}

.lgds-cb__gdesc {
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.45);
  line-height: 1.45;
}

/* "Siempre activas" badge */
.lgds-cb__always {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  color: #F25D14;
  background: rgba(242, 93, 20, 0.12);
  border: 1px solid rgba(242, 93, 20, 0.25);
  border-radius: 20px;
  padding: 3px 10px;
  white-space: nowrap;
  letter-spacing: 0.3px;
}

/* ── Toggle switch ───────────────────────────────────── */
.lgds-cb__toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.lgds-cb__chk {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.lgds-cb__track {
  position: relative;
  width: 46px;
  height: 26px;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 13px;
  transition: background 0.25s ease, box-shadow 0.25s ease;
}

.lgds-cb__toggle:hover .lgds-cb__track {
  background: rgba(255, 255, 255, 0.28);
}

.lgds-cb__chk:checked + .lgds-cb__track {
  background: #F25D14;
  box-shadow: 0 0 0 3px rgba(242, 93, 20, 0.2);
}

.lgds-cb__thumb {
  position: absolute;
  width: 20px;
  height: 20px;
  background: #ffffff;
  border-radius: 50%;
  top: 3px;
  left: 3px;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.28);
}

.lgds-cb__chk:checked + .lgds-cb__track .lgds-cb__thumb {
  transform: translateX(20px);
}

/* Foco accesible en el toggle */
.lgds-cb__chk:focus-visible + .lgds-cb__track {
  outline: 2px solid #F25D14;
  outline-offset: 2px;
}

/* ── Botones del panel configurar ────────────────────── */
.lgds-cb__btns--cfg {
  justify-content: flex-end;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  padding-top: 14px;
  margin-top: 2px;
}

/* ══ RESPONSIVE ════════════════════════════════════════ */

/* Tablet: texto y botones apilados */
@media (max-width: 900px) {
  .lgds-cb__inner {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding: 18px 20px;
  }

  .lgds-cb__btns {
    justify-content: flex-end;
  }
}

/* Móvil: botones apilados a ancho completo */
@media (max-width: 560px) {
  .lgds-cb__inner {
    padding: 16px;
    gap: 12px;
  }

  .lgds-cb__icon {
    font-size: 22px;
  }

  .lgds-cb__copy strong {
    font-size: 14px;
  }

  .lgds-cb__copy p {
    font-size: 12.5px;
  }

  .lgds-cb__btns {
    flex-direction: column;
    gap: 8px;
  }

  .lgds-cb__btn {
    width: 100%;
    padding: 13px 16px;
    font-size: 14px;
    border-radius: 9px;
  }

  /* El botón principal (aceptar) arriba en móvil */
  .lgds-cb__btn--primary {
    order: -1;
  }

  /* En el panel configurar, los botones no van en columna */
  .lgds-cb__btns--cfg {
    flex-direction: row;
    gap: 10px;
  }

  .lgds-cb__btns--cfg .lgds-cb__btn {
    flex: 1;
    order: unset;
  }

  .lgds-cb__group {
    padding: 10px 12px;
  }

  .lgds-cb__glabel {
    font-size: 12.5px;
  }

  .lgds-cb__gdesc {
    font-size: 11px;
  }
}

/* Móvil muy pequeño */
@media (max-width: 360px) {
  .lgds-cb__left {
    gap: 10px;
  }

  .lgds-cb__icon {
    display: none;
  }
}
