/* ===========================================================================
   CLOUDESK — gestor de consentimiento de cookies.
   Va después de cloudesk.css: usa su paleta (--tinta, --marca…).

   La regla que manda en este archivo: los tres botones de la primera capa son
   IDÉNTICOS. Misma clase, mismo tamaño, mismo color, mismo peso, mismo borde.
   Aquí no hay un «Aceptar» azul brillante y un «Rechazar» gris pequeñito: eso
   es un patrón oscuro y es justo lo que la guía de la AEPD señala. Si alguien
   añade en el futuro una regla que distinga visualmente a .cc-btn según su
   value, la está rompiendo a propósito.
   =========================================================================== */

.cc {
  --cc-bg: var(--tinta, #0b1b2e);
  --cc-fg: #dbe4f0;
  --cc-fg-soft: #9fb0c6;
  --cc-line: rgba(255, 255, 255, .16);
  /* Azul de marca, no el acento del producto: el aviso de cookies habla en
     nombre de la casa, no de la página en la que estés. */
  --cc-accent: #7fb0f2;
}

.cc[hidden],
.cc [hidden] { display: none !important; }

/* ---- Primera capa: el aviso ---------------------------------------------- */

.cc-banner {
  position: fixed;
  inset: auto 16px 16px 16px;
  z-index: 2000;
  background: var(--cc-bg);
  border: 1px solid var(--cc-line);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .5);
  padding: 20px 22px;
  color: var(--cc-fg);
  /* Con el móvil apaisado o zoom alto no cabe: que se pueda recorrer. */
  max-height: calc(100vh - 32px);
  overflow-y: auto;
}

.cc-banner__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

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

.cc-banner__title {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
}

.cc-banner p {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--cc-fg-soft);
}

/* Enlaces de texto del aviso. Se excluye .cc-btn a propósito: «Configurar» es
   un <a> para poder funcionar sin JavaScript, y si esta regla lo alcanzara le
   pintaría el texto del mismo color que su fondo. */
.cc-banner a:not(.cc-btn),
.cc-panel a:not(.cc-btn) { color: var(--cc-accent); text-decoration: underline; }

.cc-banner__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  flex: none;
}

/* ---- El botón. Uno solo, repetido tres veces. ---------------------------- */

.cc-btn {
  flex: 1 1 auto;
  min-width: 148px;
  padding: 12px 20px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  color: #08172b;
  background: var(--cc-accent);
  border: 1px solid var(--cc-accent);
  border-radius: 999px;
  cursor: pointer;
  transition: filter .15s ease;
}

.cc-btn:hover { filter: brightness(1.08); color: #08172b; }
.cc-btn:active { filter: brightness(.94); }

/* «Configurar» es un <a> para que funcione sin JavaScript, pero tiene que
   verse exactamente igual que los otros dos: mismo alto, sin subrayado. */
a.cc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

/* ---- Segunda capa: el panel ---------------------------------------------- */

.cc-overlay {
  position: fixed;
  inset: 0;
  z-index: 2010;
  background: rgba(4, 12, 24, .72);
}

.cc-panel {
  position: fixed;
  z-index: 2020;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  width: min(760px, calc(100vw - 32px));
  max-height: min(86vh, 900px);
  display: flex;
  flex-direction: column;
  background: var(--cc-bg);
  border: 1px solid var(--cc-line);
  border-radius: 18px;
  box-shadow: 0 32px 80px rgba(0, 0, 0, .6);
  color: var(--cc-fg);
}

.cc-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px 16px;
  border-bottom: 1px solid var(--cc-line);
}

.cc-panel__title { margin: 0; font-size: 20px; font-weight: 700; color: #fff; }

.cc-panel__close {
  flex: none;
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; line-height: 1;
  color: var(--cc-fg);
  background: transparent;
  border: 1px solid var(--cc-line);
  border-radius: 50%;
  cursor: pointer;
}
.cc-panel__close:hover { border-color: var(--cc-accent); color: var(--cc-accent); }

.cc-panel__body {
  padding: 20px 24px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.cc-panel__intro {
  margin: 0 0 14px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--cc-fg-soft);
}

.cc-panel__foot {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 16px 24px 22px;
  border-top: 1px solid var(--cc-line);
}

/* ---- Categorías ---------------------------------------------------------- */

.cc-cat {
  padding: 18px 0;
  border-top: 1px solid var(--cc-line);
}
.cc-cat:first-of-type { border-top: 0; padding-top: 6px; }

.cc-cat__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

.cc-cat__name { margin: 0; font-size: 16px; font-weight: 700; color: #fff; }

.cc-cat__always {
  flex: none;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--cc-accent);
  border: 1px solid var(--cc-line);
  border-radius: 999px;
  padding: 5px 12px;
}

.cc-cat__desc {
  margin: 0;
  font-size: 14px;
  line-height: 1.65;
  color: var(--cc-fg-soft);
}

.cc-cat__empty {
  margin: 10px 0 0;
  font-size: 13px;
  font-style: italic;
  color: var(--cc-fg-soft);
}

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

.cc-switch {
  flex: none;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

/* El input real no se oculta con display:none (dejaría de ser enfocable con
   teclado): se hace transparente y se coloca encima del carril. */
.cc-switch input {
  position: absolute;
  width: 52px; height: 30px;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.cc-switch__track {
  position: relative;
  width: 52px; height: 30px;
  flex: none;
  background: #ffffff1f;
  border: 1px solid var(--cc-line);
  border-radius: 999px;
  transition: background .18s ease, border-color .18s ease;
}

.cc-switch__track::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 22px; height: 22px;
  background: #dce8f5;
  border-radius: 50%;
  transition: transform .18s ease, background .18s ease;
}

.cc-switch input:checked + .cc-switch__track {
  background: var(--cc-accent);
  border-color: var(--cc-accent);
}
.cc-switch input:checked + .cc-switch__track::after {
  transform: translateX(22px);
  background: #08172b;
}

.cc-switch input:focus-visible + .cc-switch__track {
  outline: 3px solid var(--cc-accent);
  outline-offset: 2px;
}

/* Etiqueta accesible: la lee el lector de pantalla, no se ve. */
.cc-switch__label {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---- Tabla de cookies ---------------------------------------------------- */

.cc-table-wrap { margin-top: 14px; overflow-x: auto; }

.cc-table {
  width: 100%;
  min-width: 480px;
  border-collapse: collapse;
  font-size: 13px;
}

.cc-table th,
.cc-table td {
  padding: 9px 12px;
  text-align: left;
  border-bottom: 1px solid var(--cc-line);
  vertical-align: top;
  line-height: 1.5;
}

.cc-table th {
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
}

.cc-table td { color: var(--cc-fg-soft); }
.cc-table code { color: var(--cc-accent); font-size: 12.5px; }

/* ---- Enlace del pie ------------------------------------------------------ */

.cc-reopen {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-decoration: underline;
}
.cc-reopen:hover { color: var(--cc-accent); }

/* ---- Sustituto de contenido embebido bloqueado ---------------------------
   Hoy no hay ningún iframe de terceros. Queda listo para cuando lo haya: en
   lugar de cargar YouTube o Maps sin permiso, se pinta esto con un botón. */

.cc-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 220px;
  padding: 28px;
  text-align: center;
  background: var(--cc-bg);
  border: 1px dashed var(--cc-line);
  border-radius: 14px;
  color: var(--cc-fg-soft);
  font-size: 14px;
  line-height: 1.6;
}

/* ---- Adaptación a pantalla ----------------------------------------------- */

@media (min-width: 768px) {
  .cc-banner { inset: auto auto 24px 24px; max-width: 720px; }
}

@media (max-width: 575px) {
  .cc-banner { padding: 18px; border-radius: 14px; }
  .cc-banner__actions { width: 100%; }
  .cc-btn { flex: 1 1 100%; }
  .cc-panel { width: calc(100vw - 20px); max-height: 92vh; border-radius: 14px; }
  .cc-panel__head,
  .cc-panel__body,
  .cc-panel__foot { padding-left: 16px; padding-right: 16px; }
  .cc-panel__foot .cc-btn { flex: 1 1 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .cc-btn,
  .cc-switch__track,
  .cc-switch__track::after { transition: none; }
}

/* Sin JavaScript el panel no puede abrirse por botón, así que se abre por
   ancla (#cc-panel) y se cierra volviendo atrás. */
.cc-panel:target { display: flex !important; }
