/* 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
    vídeo: 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;
  font-family: "Tahoma", Arial, Helvetica, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text, #000);
}
#cc-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2147482999;
  background: rgba(0,0,0,0.4);
}
#cc-banner {
  background: #FFFFFF;
  border-top: 4px solid var(--primary-red, #FA5A5A);
  box-shadow: 0 -4px 16px rgba(0,0,0,0.12);
  padding: 24px;
}
#cc-banner .cc-inner {
  max-width: 1140px;
  margin: 0 auto;
  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-family: inherit;
  font-size: 20px;
  line-height: 26px;
  font-weight: 700;
  color: var(--text, #000);
}
#cc-banner .cc-text, #cc-panel .cc-text { flex: 1 1 480px; }
#cc-banner .cc-text p, #cc-panel .cc-text p { margin: 0; color: var(--dark-grey, #666); font-size: 13px; line-height: 19px; }
#cc-banner a, #cc-panel a { color: var(--text, #000) !important; font-weight: 700; text-decoration: underline; cursor: pointer; }
#cc-banner a:hover, #cc-panel a:hover { color: var(--primary-red, #FA5A5A) !important; }
.cc-actions { display: flex; gap: 10px; flex-wrap: wrap; flex: 1 1 420px; }
/* Mismo formato que .btn_primary de la página (critical.css). Aceptar y
    Rechazar mantienen el mismo peso visual (requisito AEPD). */
.cc-btn {
  border: 2px solid #000;
  border-radius: 6px;
  font-family: "Tahoma", Arial, Helvetica, sans-serif;
  font-size: 14px;
  font-weight: 700;
  line-height: 20px;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 13px 20px;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity .2s;
  flex: 1 1 0;
  min-width: 150px;
  text-align: center;
}
.cc-btn-primary, .cc-btn-secondary { background: #000; color: #FFF; }
/* La página no cambia de color sus .btn_primary en hover (la regla azul
    está comentada en critical.css): solo un ligero aclarado. */
.cc-btn-primary:hover, .cc-btn-secondary:hover { background: #000; border-color: #000; color: #FFF; opacity: .85; }

#cc-panel {
  top: 0;
  background: rgba(0,0,0,0);
  align-items: center;
  justify-content: center;
  padding: 20px;
}
#cc-panel .cc-box {
  background: #FFFFFF;
  border-radius: 6px;
  border-top: 4px solid var(--primary-red, #FA5A5A);
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  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: var(--text, #000);
}
#cc-panel .cc-close:hover { color: var(--primary-red, #FA5A5A); }
#cc-panel .cc-intro { margin-bottom: 16px; color: var(--dark-grey, #666); }
.cc-category { border-top: 1px solid var(--grey-light, #E1E1E1); padding: 14px 0; }
.cc-category:first-child { border-top: none; }
.cc-category-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.cc-category-head strong { font-size: 1.05em; }
.cc-category-desc { margin-top: 8px; font-size: 13px; line-height: 19px; color: var(--dark-grey, #666); }
.cc-category-desc p { margin: 0 0 8px; }
.cc-switch {
  position: relative;
  width: 40px;
  height: 22px;
  border-radius: 11px;
  background: var(--secondary-grey, #B3B3B3);
  border: none;
  cursor: pointer;
  flex: 0 0 auto;
}
.cc-switch[aria-checked="true"] { background: var(--primary-red, #FA5A5A); }
.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; }
#cc-panel .cc-panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}
#cc-panel .cc-panel-actions .cc-btn-full { flex: 1 1 100%; }
#cc-panel .cc-panel-actions-row { display: flex; flex-wrap: wrap; gap: 10px; flex: 1 1 100%; }

/* Cabecera del panel: título + enlace a la política de privacidad. */
#cc-panel .cc-panel-toprow {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 32px 16px 0;
}
#cc-panel #cc-panel-title { font-size: 20px; line-height: 26px; font-weight: 700; }
#cc-panel .cc-panel-toprow a { font-size: 13px; }

/* Pestañas (Configuración / Cookies / Política de cookies). */
#cc-panel .cc-tabs {
  display: flex;
  border-bottom: 1px solid var(--grey-light, #E1E1E1);
  margin-bottom: 16px;
}
#cc-panel .cc-tab {
  flex: 1 1 0;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  padding: 10px 8px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  color: var(--dark-grey, #666);
  cursor: pointer;
}
#cc-panel .cc-tab:hover { color: var(--text, #000); }
#cc-panel .cc-tab.active { color: var(--text, #000); border-bottom-color: var(--primary-red, #FA5A5A); }
#cc-panel .cc-tab-panel[hidden] { display: none; }

#cc-panel .cc-categorias-title { margin: 0 0 4px; font-weight: 700; }
#cc-panel .cc-categorias-title + .cc-category { border-top: none; }

/* Acordeón de categorías: el título/flecha despliega, el switch no. */
.cc-category-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  cursor: pointer;
  text-align: left;
}
.cc-chevron { display: inline-block; transition: transform .15s ease-in-out; }
.cc-category-toggle[aria-expanded="true"] .cc-chevron { transform: rotate(180deg); }
.cc-category-more[hidden] { display: none; }

.cc-shared-title { font-weight: 700; color: var(--text, #000); }
.cc-shared-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--grey-light, #E1E1E1);
  border-radius: 6px;
  padding: 8px 12px;
}
.cc-shared-name { font-weight: 700; color: var(--text, #000); }

#cc-panel .cc-cookie-list-note { font-size: 13px; color: var(--dark-grey, #666); }
#cc-panel .cc-cookie-list-note[hidden] { display: none; }
#cc-panel #cc-cookies-table-mirror,
#cc-panel #cookiefirst-policy-page { font-size: 13px; overflow-x: auto; }

#cc-panel .cc-branding {
  margin-top: 16px;
  font-size: 11px;
  color: var(--regular-grey, #999);
  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; }
}
