/* ---------------------------------------------------------------------
   Banner y panel de cookies — Power Switch Solutions

   CSS propio, sin depender de Tailwind. Es deliberado: Tailwind se carga
   desde un CDN externo, y el banner tiene que verse bien incluso si ese CDN
   tarda o falla. Un aviso de cookies sin estilos es un muro de texto encima
   del sitio.

   Paleta tomada del sitio y del portal interno:
     slate-900 #0f172a   fondo oscuro corporativo
     slate-800 #1e293b   superficie elevada
     amber-400 #fbbf24   acento
     amber-500 #f59e0b   acento sólido (botón principal)
   --------------------------------------------------------------------- */

.pws-cc-banner,
.pws-cc-panel {
  --cc-fondo:      #0f172a;
  --cc-superficie: #1a2536;
  --cc-borde:      #2c3a4f;
  --cc-texto:      #f1f5f9;
  --cc-texto-soft: #a8b6c7;
  --cc-acento:     #fbbf24;
  --cc-acento-fuerte: #f59e0b;
  --cc-tinta-boton: #0f172a;

  font-family: "Inter", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  box-sizing: border-box;
}
.pws-cc-banner *,
.pws-cc-panel * { box-sizing: border-box; }

.pws-cc-banner[hidden],
.pws-cc-panel[hidden] { display: none !important; }

/* ---------- Banner inferior ---------- */

.pws-cc-banner {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 2147483000;
  padding: 0 16px 16px;
  animation: pws-cc-subir .32s cubic-bezier(.16,.84,.44,1) both;
}

@keyframes pws-cc-subir {
  from { transform: translateY(110%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.pws-cc-banner-inner {
  max-width: 1180px;
  margin: 0 auto;
  background: var(--cc-fondo);
  border: 1px solid var(--cc-borde);
  border-radius: 14px;
  box-shadow: 0 18px 48px rgba(2, 6, 23, .45);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px 32px;
  flex-wrap: wrap;
}

.pws-cc-texto { flex: 1 1 380px; min-width: 0; }

.pws-cc-texto h2 {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 700;
  color: var(--cc-texto);
  letter-spacing: -.01em;
}

.pws-cc-texto p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--cc-texto-soft);
  max-width: 68ch;
}

.pws-cc-texto a {
  color: var(--cc-acento);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.pws-cc-texto a:hover { color: #fcd34d; }

.pws-cc-acciones {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ---------- Botones ----------
   "Rechazar opcionales" y "Aceptar todas" tienen el mismo tamaño, el mismo
   peso tipográfico y están uno junto al otro. La ley pide que rechazar sea
   tan fácil como aceptar; hacer el rechazo más chico o más apagado es
   justamente el patrón que se sanciona. */

.pws-cc-btn-solido,
.pws-cc-btn-linea {
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .01em;
  padding: 11px 20px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color .16s ease, border-color .16s ease, color .16s ease;
}

.pws-cc-btn-solido {
  background: var(--cc-acento-fuerte);
  color: var(--cc-tinta-boton);
  border: 1px solid var(--cc-acento-fuerte);
}
.pws-cc-btn-solido:hover { background: var(--cc-acento); border-color: var(--cc-acento); }

.pws-cc-btn-linea {
  background: transparent;
  color: var(--cc-texto);
  border: 1px solid #45566e;
}
.pws-cc-btn-linea:hover { border-color: var(--cc-texto-soft); background: rgba(255,255,255,.04); }

.pws-cc-btn-texto {
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--cc-acento);
  background: none;
  border: none;
  padding: 11px 4px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.pws-cc-btn-texto:hover { color: #fcd34d; text-decoration: underline; text-underline-offset: 3px; }

.pws-cc-banner :focus-visible,
.pws-cc-panel :focus-visible {
  outline: 2px solid var(--cc-acento);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ---------- Panel de preferencias ---------- */

.pws-cc-panel {
  position: fixed;
  inset: 0;
  z-index: 2147483001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.pws-cc-panel-fondo {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, .72);
  backdrop-filter: blur(2px);
}

.pws-cc-panel-caja {
  position: relative;
  background: var(--cc-fondo);
  border: 1px solid var(--cc-borde);
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(2, 6, 23, .6);
  width: 100%;
  max-width: 620px;
  max-height: min(86vh, 780px);
  display: flex;
  flex-direction: column;
  animation: pws-cc-aparecer .22s ease both;
}

@keyframes pws-cc-aparecer {
  from { transform: translateY(10px) scale(.99); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

.pws-cc-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--cc-borde);
}
.pws-cc-panel-head h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--cc-texto);
  letter-spacing: -.01em;
}

.pws-cc-cerrar {
  background: none;
  border: none;
  color: var(--cc-texto-soft);
  font-size: 26px;
  line-height: 1;
  padding: 0 4px;
  cursor: pointer;
}
.pws-cc-cerrar:hover { color: var(--cc-texto); }

.pws-cc-panel-cuerpo {
  padding: 18px 24px 22px;
  overflow-y: auto;
  flex: 1 1 auto;
}

.pws-cc-intro {
  margin: 0 0 18px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--cc-texto-soft);
}

.pws-cc-cat {
  border-top: 1px solid var(--cc-borde);
  padding: 16px 0 14px;
}
.pws-cc-cat:first-of-type { border-top: none; padding-top: 0; }

.pws-cc-cat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 6px;
}
.pws-cc-cat-head h3 {
  margin: 0;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--cc-texto);
}

.pws-cc-fija-etiqueta {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--cc-acento);
  border: 1px solid rgba(251, 191, 36, .35);
  background: rgba(251, 191, 36, .1);
  border-radius: 4px;
  padding: 3px 8px;
  white-space: nowrap;
}

.pws-cc-cat-desc {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--cc-texto-soft);
}

.pws-cc-vacia {
  margin: 9px 0 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: #8595a8;
  border-left: 2px solid var(--cc-borde);
  padding-left: 11px;
}

/* ---------- Interruptor ---------- */

.pws-cc-switch {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  cursor: pointer;
}
.pws-cc-switch input {
  position: absolute;
  opacity: 0;
  width: 100%; height: 100%;
  margin: 0;
  cursor: pointer;
}
.pws-cc-switch-pista {
  width: 42px; height: 24px;
  border-radius: 999px;
  background: #33415a;
  border: 1px solid #45566e;
  position: relative;
  transition: background-color .18s ease, border-color .18s ease;
}
.pws-cc-switch-pista::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #cbd5e1;
  transition: transform .18s ease, background-color .18s ease;
}
.pws-cc-switch input:checked + .pws-cc-switch-pista {
  background: var(--cc-acento-fuerte);
  border-color: var(--cc-acento-fuerte);
}
.pws-cc-switch input:checked + .pws-cc-switch-pista::after {
  transform: translateX(18px);
  background: #0f172a;
}
.pws-cc-switch input:focus-visible + .pws-cc-switch-pista {
  outline: 2px solid var(--cc-acento);
  outline-offset: 2px;
}

/* ---------- Detalle por cookie ---------- */

.pws-cc-detalle { margin-top: 10px; }
.pws-cc-detalle summary {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--cc-acento);
  cursor: pointer;
  padding: 4px 0;
  list-style: none;
}
.pws-cc-detalle summary::-webkit-details-marker { display: none; }
.pws-cc-detalle summary::before { content: "+ "; font-weight: 700; }
.pws-cc-detalle[open] summary::before { content: "\2212 "; }

.pws-cc-detalle ul {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  border-top: 1px solid var(--cc-borde);
}
.pws-cc-detalle li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 0;
  border-bottom: 1px solid var(--cc-borde);
}
.pws-cc-item-nombre {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--cc-texto);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  word-break: break-word;
}
.pws-cc-item-meta { font-size: 11.5px; color: #8595a8; }
.pws-cc-item-fin  { font-size: 12.5px; color: var(--cc-texto-soft); line-height: 1.5; }

/* ---------- Pie del panel ---------- */

.pws-cc-panel-pie {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 16px 24px 18px;
  border-top: 1px solid var(--cc-borde);
  background: var(--cc-superficie);
  border-radius: 0 0 13px 13px;
}
.pws-cc-enlace-politica {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--cc-acento);
  text-decoration: none;
}
.pws-cc-enlace-politica:hover { text-decoration: underline; text-underline-offset: 3px; }
.pws-cc-panel-botones { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .pws-cc-banner-inner { flex-direction: column; align-items: stretch; gap: 16px; padding: 18px; }
  /* Al pasar a columna hay que soltar el flex-grow del bloque de texto: si se
     mantiene el "1 1 380px" del escritorio, el texto se estira hasta llenar la
     altura del banner y deja un hueco enorme antes de los botones. */
  .pws-cc-texto { flex: 0 0 auto; }
  .pws-cc-acciones { justify-content: flex-start; }
  /* Los dos botones de decisión reparten el ancho en partes iguales: en móvil
     es donde más tienta achicar el "rechazar", y es donde más se nota. */
  .pws-cc-btn-linea,
  .pws-cc-btn-solido { flex: 1 1 0; min-width: 150px; text-align: center; }
  .pws-cc-btn-texto { order: 3; width: 100%; text-align: left; padding-left: 0; }
}

@media (max-width: 520px) {
  .pws-cc-banner { padding: 0 10px 10px; }
  .pws-cc-panel { padding: 10px; }
  .pws-cc-panel-caja { max-height: 92vh; }
  .pws-cc-panel-pie { flex-direction: column; align-items: stretch; }
  .pws-cc-panel-botones .pws-cc-btn-linea,
  .pws-cc-panel-botones .pws-cc-btn-solido { flex: 1 1 0; }
}

@media (prefers-reduced-motion: reduce) {
  .pws-cc-banner, .pws-cc-panel-caja { animation: none; }
  .pws-cc-switch-pista, .pws-cc-switch-pista::after,
  .pws-cc-btn-solido, .pws-cc-btn-linea { transition: none; }
}
