/* DIHBU – Banner de cookies · Digiytal */
.dihbu-ck {
    --dihbu-ck-color: #114C5F;
    --dihbu-ck-texto: #083141;
    --dihbu-ck-fondo: #ffffff;
    --dihbu-ck-suave: #EBF2F4;
    --dihbu-ck-borde: #d5e2e6;
    font-family: var(--wp--preset--font-family--body, "Hind", system-ui, sans-serif);
    color: var(--dihbu-ck-texto);
    font-size: 15px;
    line-height: 1.5;
}
.dihbu-ck[hidden], .dihbu-ck [hidden] { display: none !important; }
.dihbu-ck *, .dihbu-ck *::before, .dihbu-ck *::after { box-sizing: border-box; }
.dihbu-ck a { color: var(--dihbu-ck-color); text-decoration: underline; }

/* ---------- Banner ---------- */
.dihbu-ck-banner {
    position: fixed;
    z-index: 2147483000;
    background: var(--dihbu-ck-fondo);
    box-shadow: 0 -4px 24px rgba(8, 49, 65, .18);
    display: flex;
    gap: 16px 32px;
    align-items: center;
    animation: dihbu-ck-in .25s ease-out;
}
.dihbu-ck--barra .dihbu-ck-banner {
    left: 0; right: 0; bottom: 0;
    padding: 20px max(16px, calc((100vw - 1200px) / 2));
    border-top: 4px solid var(--dihbu-ck-color);
}
.dihbu-ck--caja .dihbu-ck-banner {
    left: 16px; bottom: 16px;
    width: min(420px, calc(100vw - 32px));
    padding: 20px;
    border-radius: 10px;
    border-top: 4px solid var(--dihbu-ck-color);
    flex-direction: column;
    align-items: stretch;
}
.dihbu-ck-banner__body { flex: 1 1 auto; }
.dihbu-ck-banner__titulo { margin: 0 0 4px; font-weight: 700; font-size: 17px; color: var(--dihbu-ck-color); }
.dihbu-ck-banner__texto { margin: 0; }
.dihbu-ck-enlaces { display: block; margin-top: 6px; font-size: 14px; }
.dihbu-ck-banner__acciones { display: flex; gap: 10px; flex-wrap: wrap; flex: 0 0 auto; align-items: center; }

/* Aceptar y Rechazar con el mismo peso visual (Guía AEPD) */
.dihbu-ck-btn {
    appearance: none;
    border: 2px solid var(--dihbu-ck-color);
    background: var(--dihbu-ck-color);
    color: #fff;
    font: inherit;
    font-weight: 600;
    padding: 9px 18px;
    border-radius: 6px;
    cursor: pointer;
    line-height: 1.2;
    min-height: 44px;
    transition: filter .15s;
}
.dihbu-ck-btn:hover { filter: brightness(1.15); }
.dihbu-ck-btn--link { background: transparent; color: var(--dihbu-ck-color); }
.dihbu-ck-btn:focus-visible,
.dihbu-ck-flotante:focus-visible,
.dihbu-ck-modal__cerrar:focus-visible,
.dihbu-ck-switch input:focus-visible + .dihbu-ck-switch__slider {
    outline: 3px solid #fcb900;
    outline-offset: 2px;
}

/* ---------- Modal ---------- */
.dihbu-ck-modal { position: fixed; inset: 0; z-index: 2147483001; display: flex; align-items: center; justify-content: center; padding: 16px; }
.dihbu-ck-modal__overlay { position: absolute; inset: 0; background: rgba(8, 49, 65, .55); }
.dihbu-ck-modal__caja {
    position: relative;
    background: var(--dihbu-ck-fondo);
    width: min(680px, 100%);
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .3);
    outline: none;
    animation: dihbu-ck-in .2s ease-out;
}
.dihbu-ck-modal__cabecera { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--dihbu-ck-borde); }
.dihbu-ck-modal__titulo { margin: 0; font-weight: 700; font-size: 19px; color: var(--dihbu-ck-color); }
.dihbu-ck-modal__cerrar { background: none; border: 0; font-size: 30px; line-height: 1; cursor: pointer; color: var(--dihbu-ck-texto); padding: 0 6px; }
.dihbu-ck-modal__contenido { padding: 18px 22px; overflow-y: auto; }
.dihbu-ck-modal__intro { margin: 0 0 16px; font-size: 14px; }
.dihbu-ck-modal__pie { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; padding: 16px 22px; border-top: 1px solid var(--dihbu-ck-borde); }

.dihbu-ck-cat { border: 1px solid var(--dihbu-ck-borde); border-radius: 8px; padding: 14px 16px; margin-bottom: 12px; }
.dihbu-ck-cat__cabecera { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.dihbu-ck-cat__nombre { font-weight: 700; }
.dihbu-ck-cat__siempre { font-size: 13px; font-weight: 600; color: #2A4F4F; background: var(--dihbu-ck-suave); padding: 3px 10px; border-radius: 20px; white-space: nowrap; }
.dihbu-ck-cat__desc { margin: 8px 0 0; font-size: 14px; }
.dihbu-ck-cat__detalle { margin-top: 8px; font-size: 13px; }
.dihbu-ck-cat__detalle summary { cursor: pointer; color: var(--dihbu-ck-color); font-weight: 600; }

.dihbu-ck-switch { position: relative; display: inline-block; width: 46px; height: 26px; flex: 0 0 auto; cursor: pointer; }
.dihbu-ck-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.dihbu-ck-switch__slider { position: absolute; inset: 0; background: #b7c6cb; border-radius: 26px; transition: background .2s; pointer-events: none; }
.dihbu-ck-switch__slider::before { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .2s; }
.dihbu-ck-switch input:checked + .dihbu-ck-switch__slider { background: var(--dihbu-ck-color); }
.dihbu-ck-switch input:checked + .dihbu-ck-switch__slider::before { transform: translateX(20px); }

/* ---------- Tablas (panel y shortcode) ---------- */
.dihbu-ck-tabla-wrap { overflow-x: auto; margin: 8px 0 16px; }
.dihbu-ck-tabla { width: 100%; border-collapse: collapse; font-size: 13px; }
.dihbu-ck-tabla th, .dihbu-ck-tabla td { text-align: left; padding: 6px 8px; border-bottom: 1px solid #d5e2e6; vertical-align: top; }
.dihbu-ck-tabla th { background: #EBF2F4; }
.dihbu-ck-tabla code { font-size: 12px; word-break: break-all; }

/* ---------- Botón flotante ---------- */
.dihbu-ck-flotante {
    position: fixed; right: 16px; bottom: 16px; z-index: 2147482999;
    width: 44px; height: 44px; border-radius: 50%;
    border: 0; background: var(--dihbu-ck-color); color: #fff;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 3px 12px rgba(0, 0, 0, .25); cursor: pointer; opacity: .85;
}
.dihbu-ck-flotante:hover { opacity: 1; }

/* ---------- Placeholder de contenido bloqueado ---------- */
.dihbu-ck-placeholder {
    display: flex; align-items: center; justify-content: center;
    min-height: 240px; width: 100%;
    background: #EBF2F4; border: 1px dashed #59747C; border-radius: 8px;
    padding: 20px; text-align: center; color: #083141; font-size: 15px;
}
.wp-block-embed__wrapper > .dihbu-ck-placeholder { position: absolute; inset: 0; min-height: 0; }
.dihbu-ck-placeholder__inner { max-width: 480px; }
.dihbu-ck-placeholder p { margin: 0 0 10px; }
.dihbu-ck-placeholder { --dihbu-ck-color: #114C5F; }
.dihbu-ck-placeholder a { color: var(--dihbu-ck-color); margin-left: 8px; }

html.dihbu-ck-bloqueo-scroll { overflow: hidden; }

@keyframes dihbu-ck-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .dihbu-ck-banner, .dihbu-ck-modal__caja { animation: none; } }

@media (max-width: 782px) {
    .dihbu-ck--barra .dihbu-ck-banner { flex-direction: column; align-items: stretch; padding: 16px; }
    .dihbu-ck-banner__acciones { flex-direction: column-reverse; align-items: stretch; }
    .dihbu-ck-banner__acciones .dihbu-ck-btn { width: 100%; }
    .dihbu-ck-modal { padding: 0; align-items: flex-end; }
    .dihbu-ck-modal__caja { border-radius: 10px 10px 0 0; max-height: 92vh; max-height: 92dvh; }
    .dihbu-ck-modal__pie .dihbu-ck-btn { flex: 1 1 100%; }
}
