/* Haiko Cookies v1.0 — estilos del aviso y del panel (ver haiko-cookies.js).
   FICHERO COMÚN A TODAS LAS WEBS. El color de cada web se cambia con las dos variables de .hk-ck.
   Aspecto calcado del aviso validado por Cinfa en 2024 (franja blanca arriba, botones verdes rectos). */

.hk-ck {
    --hk-ck-color: #97BF0D;        /* fondo de los botones */
    --hk-ck-color-texto: #FFFFFF;  /* letra de los botones */
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2147483000;
    font-size: 14px;
    line-height: 1.4;
    color: #000;
    text-align: left;
    -webkit-text-size-adjust: 100%;
}
.hk-ck *,
.hk-ck *::before,
.hk-ck *::after { box-sizing: border-box; }
/* El aviso lleva la misma letra en todas las webs (la del aviso validado), aunque la web
   imponga la suya. El panel, en cambio, usa la letra de cada web. */
.hk-ck-aviso,
.hk-ck-aviso * { font-family: -apple-system, Arial, Helvetica, sans-serif !important; }
.hk-ck [tabindex="-1"]:focus { outline: 0; }

/* Con bloqueo: capa oscura sobre toda la página y sin desplazamiento por detrás. */
.hk-ck--bloquea {
    bottom: 0;
    background: rgba(0, 0, 0, .5);
    overflow-y: auto;
}
html.hk-ck-bloqueado,
html.hk-ck-bloqueado body { overflow: hidden !important; }

/* ---------- Aviso (primera capa) ---------- */
.hk-ck-aviso { background: #FFF; }
.hk-ck-aviso-dentro {
    max-width: 992px;
    margin: 0 auto;
    padding: 50px 16px 36px;
}
.hk-ck-texto { margin: 0 0 35px; color: #000; }
.hk-ck-texto a {
    color: #000;
    font-weight: 400;
    text-decoration: underline;
}
.hk-ck-botones {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}
/* Como en el aviso validado: «Configurar» a la izquierda, «Rechazar» y «Aceptar» a la derecha. */
.hk-ck-botones .hk-ck-btn--configurar { margin-right: auto; }

.hk-ck-btn {
    appearance: none;
    -webkit-appearance: none;
    margin: 0;
    padding: 8px 32px;
    min-height: 34px;
    border: 0;
    border-radius: 0;
    background: var(--hk-ck-color);
    color: var(--hk-ck-color-texto);
    font-size: 13px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    text-transform: none;
    cursor: pointer;
}
.hk-ck-btn:hover { filter: brightness(.93); }
.hk-ck-btn:focus-visible,
.hk-ck-casilla:focus-visible + .hk-ck-interruptor {
    outline: 3px solid #000;
    outline-offset: 2px;
}

/* ---------- Panel de configuración (segunda capa) ---------- */
.hk-ck-panel .hk-ck-btn {
    padding: 10px 20px;
    min-height: 44px;
    font-size: 14px;
}
.hk-ck-panel {
    display: flex;
    flex-direction: column;
    width: calc(100% - 32px);
    max-width: 720px;
    max-height: calc(100vh - 32px);
    margin: 16px auto;
    background: #FFF;
    box-shadow: 0 8px 32px rgba(0, 0, 0, .35);
}
/* Cabecera y pie no encogen: si el contenido no cabe, solo se desplaza el cuerpo. */
.hk-ck-panel-cabecera { flex: 0 0 auto; padding: 20px 24px 0; }
.hk-ck-panel-titulo {
    clear: both;
    margin: 0;
    font-size: 26px;
    font-weight: 700;
    line-height: 1.2;
    color: #000;
}
.hk-ck-panel-cuerpo {
    flex: 1 1 auto;
    min-height: 0;
    padding: 12px 24px 8px;
    overflow-y: auto;
}
.hk-ck-panel-texto { margin: 0 0 12px; }
.hk-ck-panel-seccion {
    margin: 8px 0 10px;
    padding-top: 16px;
    border-top: 1px solid #E5E5E5;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.3;
    color: #000;
}
/* Flecha de volver, arriba a la izquierda (como en el panel validado). */
.hk-ck-panel .hk-ck-volver {
    float: left;
    width: 38px;
    min-height: 38px;
    height: 38px;
    margin: 0 0 8px;
    padding: 0;
    border: 1px solid #C8C8C8;
    border-radius: 4px;
    background: #FFF;
    color: #222;
}
.hk-ck-volver::before {
    content: "";
    display: block;
    width: 9px;
    height: 9px;
    margin: 0 auto;
    border-left: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translateX(2px) rotate(45deg);
}
.hk-ck-panel .hk-ck-volver:hover { background: #F2F2F2; filter: none; }
.hk-ck-panel-politica {
    float: right;
    margin: 0 0 8px 16px;
    padding: 8px 14px;
    background: #EDEDED;
    color: #333;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}
.hk-ck-panel-politica:hover { background: #E0E0E0; color: #000; text-decoration: none; }
.hk-ck-panel-atajos {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    margin: 0 0 16px;
}
.hk-ck-panel-pie {
    display: flex;
    flex: 0 0 auto;
    justify-content: flex-end;
    padding: 12px 24px 20px;
    border-top: 1px solid #E5E5E5;
}

/* Cada finalidad, una tarjeta entera pulsable con su interruptor. */
.hk-ck-cat {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 0 0 10px;
    padding: 14px 16px;
    border: 1px solid #D9D9D9;
    font-weight: 400;
    cursor: pointer;
}
.hk-ck-cat--fija { cursor: default; background: #F7F7F7; }
.hk-ck-cat-textos { flex: 1 1 auto; min-width: 0; }
.hk-ck-cat-nombre { display: block; font-size: 16px; font-weight: 700; }
.hk-ck-cat-desc { display: block; margin-top: 4px; color: #333; }
.hk-ck-cat-lado {
    position: relative;
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 10px;
}
.hk-ck-cat-siempre { font-size: 13px; color: #555; white-space: nowrap; }

.hk-ck-casilla {
    position: absolute;
    right: 0;
    width: 52px;
    height: 30px;
    margin: 0;
    opacity: 0;
    cursor: inherit;
}
.hk-ck-interruptor {
    position: relative;
    display: block;
    width: 52px;
    height: 30px;
    border-radius: 15px;
    background: #B5B5B5;
    transition: background .15s;
    pointer-events: none;
}
.hk-ck-interruptor::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #FFF;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
    transition: transform .15s;
}
.hk-ck-casilla:checked + .hk-ck-interruptor { background: var(--hk-ck-color); }
.hk-ck-casilla:checked + .hk-ck-interruptor::after { transform: translateX(22px); }
.hk-ck-casilla:disabled + .hk-ck-interruptor { opacity: .55; }

/* ---------- Móvil: botones a todo el ancho, uno debajo de otro ---------- */
@media (max-width: 600px) {
    .hk-ck-aviso-dentro { padding: 24px 16px 20px; }
    .hk-ck-texto { margin-bottom: 20px; }
    .hk-ck-btn { min-height: 44px; }   /* en el móvil, botones cómodos para el dedo */
    .hk-ck-botones,
    .hk-ck-panel-atajos { flex-direction: column; }
    .hk-ck-botones .hk-ck-btn,
    .hk-ck-panel-atajos .hk-ck-btn,
    .hk-ck-panel-pie .hk-ck-btn { width: 100%; }
    .hk-ck-panel-cabecera { padding: 16px 16px 0; }
    .hk-ck-panel-cuerpo { padding: 10px 16px 6px; }
    .hk-ck-panel-pie { padding: 12px 16px 16px; }
    .hk-ck-panel-titulo { font-size: 22px; }
    .hk-ck-panel-politica { margin: 0 0 12px; padding: 11px 12px; }
    .hk-ck-cat-siempre { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .hk-ck-interruptor,
    .hk-ck-interruptor::after { transition: none; }
}
