/* CookieFirst en modo stealth oculta su propio diálogo vía JS, con una
   ventana de tiempo en la que puede llegar a insertarse visible en el DOM
   antes de que su propio efecto de "stealth" lo oculte (confirmado en
   yoigo/sanitas: parpadeo del banner original justo tras Aceptar/Rechazar).
   Lo ocultamos también por CSS, que se aplica antes que cualquier JS, para
   que ese parpadeo no pueda producirse nunca. Selector específico al
   diálogo del banner/panel (no a .cookiefirst-root en general, que
   también envuelve la tabla de cookies de /politica-de-cookies y esa sí
   debe seguir viéndose). */
dialog[data-id="cookiefirst-root"] {
  display: none !important;
}

#cc-banner, #cc-panel {
  display: none;
  position: fixed;
  z-index: 2147483000;
  left: 0;
  right: 0;
  bottom: 0;
  /* Fuente de sistema en vez de heredar la fuente de la web: el banner no
     depende así de ninguna descarga de webfont, evitando el reflow por
     cambio de métricas de fuente que causaba CLS en el mismo banner de
     yoigo/sanitas. */
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: rgba(0,0,0,1);
}
#cc-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2147482999;
  background: rgba(0,0,0,0.1);
}
#cc-banner {
  background: rgba(255,255,255,1);
  box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
  padding: 20px 24px;
}
#cc-banner .cc-inner {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 20px;
  justify-content: space-between;
}
#cc-banner h2, #cc-panel h2 {
  margin: 0 0 8px;
  font-size: 1.4em;
  font-weight: 700;
}
#cc-banner .cc-text, #cc-panel .cc-text { flex: 1 1 480px; }
#cc-banner .cc-text p, #cc-panel .cc-text p { margin: 0; }
#cc-banner a, #cc-panel a { color: inherit; text-decoration: underline; cursor: pointer; }
.cc-actions { display: flex; gap: 10px; flex-wrap: wrap; flex: 1 1 420px; }
.cc-btn {
  border: 1px solid rgba(255,121,0,1);
  border-radius: 24px;
  font-size: 12px;
  font-weight: 600;
  padding: 10px 20px;
  cursor: pointer;
  white-space: nowrap;
  transition: all .2s ease-in-out;
  flex: 1 1 0;
  min-width: 150px;
  text-align: center;
}
.cc-btn-primary { background: rgba(255,121,0,1); color: rgba(255,255,255,1); }
.cc-btn-primary:hover { background: rgba(0,0,0,0); color: rgba(255,121,0,1); }
.cc-btn-secondary { background: rgba(255,121,0,1); color: rgba(255,255,255,1); }
.cc-btn-secondary:hover { background: rgba(0,0,0,0); color: rgba(255,121,0,1); }
.cc-btn-full { flex: 1 1 100%; width: 100%; }

#cc-panel {
  top: 0;
  background: rgba(0,0,0,0);
  align-items: center;
  justify-content: center;
  padding: 20px;
}
#cc-panel .cc-box {
  background: rgba(255,255,255,1);
  border-radius: 4px;
  max-width: 700px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 24px 28px;
  position: relative;
}
#cc-panel .cc-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: rgba(0,0,0,1);
}

/* Fila superior: título del widget (estático, no navega) + enlace real a
   la página de política de privacidad (no es una pestaña del panel). */
.cc-panel-toprow {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-weight: 700;
  font-size: 1.05em;
  margin: 0 28px 12px 0;
}
.cc-panel-toprow a { font-weight: 700; font-size: 0.9em; }

/* Pestañas Ajustes / Cookies / Política de cookies */
.cc-tabs {
  display: flex;
  border-bottom: 1px solid #e5e5e5;
  margin-bottom: 16px;
}
.cc-tab {
  flex: 1;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 8px 4px 10px;
  font-weight: 700;
  font-size: 0.95em;
  cursor: pointer;
  color: rgba(0,0,0,0.55);
  font-family: inherit;
}
.cc-tab.active {
  color: rgba(0,0,0,1);
  border-bottom-color: rgba(255,121,0,1);
}

#cc-panel .cc-intro { margin-bottom: 16px; }
.cc-categorias-title {
  text-align: center;
  font-weight: 700;
  font-size: 0.95em;
  border-top: 1px solid #000;
  border-bottom: 1px solid #000;
  padding: 6px 0;
  margin: 0 0 12px;
}
.cc-category { border-top: 1px solid #e5e5e5; padding: 14px 0; }
.cc-category:first-child { border-top: none; }
.cc-category-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
/* Acordeón: título + flecha son el botón que expande/colapsa la
   descripción — colapsado por defecto, igual que el widget real de
   CookieFirst, para no forzar scroll en el panel con las 4 categorías
   a la vez. */
.cc-category-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  color: inherit;
  text-align: left;
}
.cc-category-toggle[disabled] { cursor: default; }
.cc-category-head strong { font-size: 1.05em; }
.cc-chevron {
  display: inline-block;
  font-size: 0.75em;
  transition: transform .15s ease-in-out;
}
.cc-category-toggle[aria-expanded="true"] .cc-chevron { transform: rotate(180deg); }
.cc-category-desc { margin-top: 8px; font-size: 0.95em; color: #333; }
.cc-category-desc p { margin: 0 0 8px; }
/* Solo la parte "adicional" de cada categoría se pliega/despliega vía el
   acordeón: el primer párrafo (y, en "De publicidad", también el
   segundo) está siempre visible; el resto queda oculto hasta el clic. */
.cc-category-more { margin-top: 8px; }
.cc-category-more[hidden] { display: none; }
.cc-category-shared { margin-top: 12px; }
.cc-shared-title { font-weight: 700; font-size: 0.85em; margin: 0 0 6px; }
.cc-shared-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid #e5e5e5;
  border-radius: 4px;
}
.cc-shared-name { font-weight: 600; }
.cc-switch {
  position: relative;
  width: 40px;
  height: 22px;
  border-radius: 11px;
  background: #ccc;
  border: none;
  cursor: pointer;
  flex: 0 0 auto;
}
.cc-switch[aria-checked="true"] { background: rgba(255,121,0,1); }
.cc-switch[disabled] { cursor: not-allowed; opacity: .6; }
.cc-switch span {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: left .15s ease-in-out;
}
.cc-switch[aria-checked="true"] span { left: 20px; }

/* Pestañas "Cookies" y "Política de cookies": contenido real de CookieFirst,
   copiado/embebido dinámicamente (ver comentarios junto a cada div en el HTML
   y el JS de mirrorCookiesTable) — solo estilamos el contenedor, el markup
   interno lo genera CookieFirst y no lo controlamos. */
.cc-cookie-list-note { font-size: 0.9em; color: #555; margin: 0 0 8px; }
#cc-cookies-table-mirror { overflow-x: auto; }
#cc-cookies-table-mirror table { width: 100%; border-collapse: collapse; font-size: 0.85em; }
#cc-cookies-table-mirror th, #cc-cookies-table-mirror td {
  border: 1px solid #e5e5e5;
  padding: 6px 8px;
  text-align: left;
  vertical-align: top;
}
.cc-cookiefirst-attribution { margin-top: 16px; font-size: 0.8em; color: #777; }
.cc-cookiefirst-attribution a { color: inherit; }

#cc-panel .cc-panel-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}
#cc-panel .cc-panel-actions-row {
  display: flex;
  gap: 10px;
}
#cc-panel .cc-branding {
  margin-top: 16px;
  font-size: 11px;
  color: #777;
  text-align: center;
}
#cc-panel .cc-branding a { color: inherit; }
@media (max-width: 700px) {
  #cc-banner .cc-inner { flex-direction: column; align-items: stretch; }
  /* En columna, los "flex: 1 1 480px"/"420px" de .cc-text/.cc-actions
     (pensados como base de ANCHO en fila) pasan a ser una base de ALTURA
     — de ahí el hueco enorme bajo el texto y los botones gigantes que
     se estiraban para llenarla. Se fija la altura de ambos al contenido. */
  #cc-banner .cc-text { flex: 0 0 auto; }
  .cc-actions { flex: 0 0 auto; justify-content: stretch; align-items: stretch; }
  .cc-btn { flex: 1 1 auto; align-self: auto; text-align: center; }
}
