/* cookies.css — Banner + panel de configuración de consentimiento (RGPD / AEPD) */

/* ===== Tipografía de páginas legales ===== */
.legal-content { max-width: 860px; margin: 0 auto; }
.legal-content h2 { margin: 36px 0 12px; font-size: 1.4rem; line-height: 1.25; }
.legal-content h3 { margin: 24px 0 8px; font-size: 1.12rem; }
.legal-content p, .legal-content li { line-height: 1.7; color: #333; }
.legal-content ul { padding-left: 22px; margin: 12px 0; }
.legal-content li { margin-bottom: 6px; }
.legal-content a { color: var(--color-primary, #1B3A5C); text-decoration: underline; }
.legal-updated { font-size: .85rem; color: #777; font-style: italic; margin-bottom: 8px; }
.legal-table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: .88rem; }
.legal-table th, .legal-table td { border: 1px solid #e0e0e0; padding: 10px 12px; text-align: left; vertical-align: top; }
.legal-table th { background: var(--color-bg-light, #f4f6f8); font-weight: 700; }
.legal-table caption { caption-side: bottom; font-size: .78rem; color: #888; margin-top: 8px; text-align: left; }
@media (max-width: 640px) {
    .legal-table, .legal-table thead, .legal-table tbody, .legal-table th, .legal-table td, .legal-table tr { display: block; }
    .legal-table thead { display: none; }
    .legal-table tr { margin-bottom: 14px; border: 1px solid #e0e0e0; border-radius: 8px; overflow: hidden; }
    .legal-table td { border: 0; border-bottom: 1px solid #eee; }
    .legal-table td::before { content: attr(data-th) ": "; font-weight: 700; }
}

/* ===== Banner (1ª capa) ===== */
.cc-banner {
    position: fixed;
    bottom: 16px;
    left: 16px;
    right: 16px;
    max-width: 1180px;
    margin: 0 auto;
    background: #fff;
    color: #1d1d1d;
    box-shadow: 0 8px 40px rgba(0, 0, 0, .22);
    border: 1px solid #e4e4e4;
    border-radius: 14px;
    z-index: 99999;
    padding: 22px 24px;
    display: none;
    flex-wrap: wrap;
    align-items: center;
    gap: 18px 28px;
}
.cc-banner.is-visible { display: flex; }
.cc-banner__text { flex: 1 1 340px; font-size: .92rem; line-height: 1.55; margin: 0; }
.cc-banner__text strong { display: block; font-size: 1.02rem; margin-bottom: 4px; }
.cc-banner__text a { color: var(--color-primary, #1B3A5C); text-decoration: underline; }
.cc-banner__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    flex: 0 0 auto;
    margin-left: auto;
}

/* Botones — Aceptar y Rechazar con el MISMO peso visual (exigencia AEPD) */
.cc-btn {
    font: inherit;
    font-weight: 600;
    font-size: .9rem;
    border-radius: 8px;
    padding: 11px 20px;
    cursor: pointer;
    border: 2px solid var(--color-primary, #1B3A5C);
    line-height: 1;
    transition: opacity .15s ease, transform .05s ease;
}
.cc-btn:active { transform: translateY(1px); }
.cc-btn--primary { background: var(--color-primary, #1B3A5C); color: #fff; }
.cc-btn--secondary { background: #fff; color: var(--color-primary, #1B3A5C); }
.cc-btn--ghost { background: transparent; border-color: transparent; color: var(--color-primary, #1B3A5C); text-decoration: underline; padding-left: 8px; padding-right: 8px; }
.cc-btn:hover { opacity: .88; }

/* ===== Modal de configuración (2ª capa) ===== */
.cc-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, .55);
}
.cc-modal.is-visible { display: flex; }
.cc-modal__dialog {
    background: #fff;
    color: #1d1d1d;
    width: 100%;
    max-width: 640px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
}
.cc-modal__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.cc-modal__title { margin: 0 0 4px; font-size: 1.4rem; }
.cc-modal__close { background: none; border: 0; font-size: 1.6rem; line-height: 1; cursor: pointer; color: #777; padding: 4px; }
.cc-modal__intro { font-size: .9rem; line-height: 1.6; color: #444; margin: 8px 0 20px; }

.cc-cat {
    border: 1px solid #e6e6e6;
    border-radius: 12px;
    padding: 16px 18px;
    margin-bottom: 14px;
}
.cc-cat__row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.cc-cat__name { font-weight: 700; font-size: 1rem; margin: 0; }
.cc-cat__desc { font-size: .85rem; line-height: 1.55; color: #555; margin: 8px 0 0; }

/* Interruptor accesible */
.cc-switch { position: relative; display: inline-block; width: 46px; height: 26px; flex: 0 0 auto; }
.cc-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.cc-switch__slider { position: absolute; inset: 0; background: #c7c7c7; border-radius: 26px; transition: background .2s; }
.cc-switch__slider::before { content: ""; position: absolute; height: 20px; width: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .2s; }
.cc-switch input:checked + .cc-switch__slider { background: var(--color-secondary, #E8670A); }
.cc-switch input:checked + .cc-switch__slider::before { transform: translateX(20px); }
.cc-switch input:disabled + .cc-switch__slider { background: var(--color-primary, #1B3A5C); opacity: .55; cursor: not-allowed; }
.cc-switch input:focus-visible + .cc-switch__slider { outline: 2px solid var(--color-secondary, #E8670A); outline-offset: 2px; }

.cc-modal__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.cc-modal__actions .cc-btn { flex: 1 1 160px; text-align: center; }

/* ===== Botón flotante para reabrir preferencias (retirada del consentimiento) ===== */
.cc-reopen {
    position: fixed;
    left: 14px;
    bottom: 14px;
    z-index: 9998;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid #ddd;
    background: #fff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .18);
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.cc-reopen.is-visible { display: flex; }
.cc-reopen svg { width: 22px; height: 22px; fill: var(--color-primary, #1B3A5C); }

/* ===== Facade de Google Maps (bloqueo de terceros sin consentimiento) ===== */
.cc-map-facade {
    width: 100%;
    min-height: 320px;
    border-radius: 12px;
    background: #eef1f4;
    border: 1px dashed #c2ccd6;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 12px;
    padding: 28px;
}
.cc-map-facade p { margin: 0; max-width: 460px; font-size: .9rem; color: #4a5a6a; line-height: 1.55; }

@media (max-width: 600px) {
    .cc-banner { padding: 18px; }
    .cc-banner__actions { width: 100%; }
    .cc-banner__actions .cc-btn { flex: 1 1 auto; text-align: center; }
}
