/* ============================================================
   CSS del módulo de consentimiento (cookies) — Complejo Deportivo
   Tema light. Paleta del proyecto: morado oscuro + rojo destacado.
   Variables propias con prefijo --cdx- para no chocar con BS3 ni
   con el resto del CSS del sitio.
   ============================================================ */

:root {
    --cdx-c-ink:        #1f1d24;
    --cdx-c-ink-2:      #3b3646;
    --cdx-c-paper:      #ffffff;
    --cdx-c-paper-2:    #f6f6f8;
    --cdx-c-mute:       #6b6677;
    --cdx-c-dim:        #9b97a5;
    --cdx-c-rule:       #e7e5ec;
    --cdx-c-rule-2:     #d9d6e0;
    --cdx-c-accent:     #ee4b5a;
    --cdx-c-accent-2:   #c8333f;
    --cdx-c-success:    #1d8a3a;
    --cdx-c-warn:       #b07000;
}

/* Banner principal abajo-derecha — fondo azul corporativo, texto claro */
.cdx-cookie-banner {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 12000;
    width: min(480px, calc(100vw - 32px));
    background: #1e3a5f;                  /* azul marino del logo */
    background: linear-gradient(155deg, #243f66 0%, #1a3354 100%);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 14px;
    box-shadow: 0 18px 48px rgba(15, 25, 45, .42), 0 2px 6px rgba(15, 25, 45, .25);
    padding: 26px 28px 22px;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.55;
    transform: translateY(24px);
    opacity: 0;
    transition: transform .28s ease, opacity .28s ease;
    overflow: hidden;
}
/* Franja decorativa superior fina con el rojo de la marca */
.cdx-cookie-banner::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--cdx-c-accent) 0%, #ffb84d 100%);
}

.cdx-cookie-banner.is-visible { transform: translateY(0); opacity: 1; }
.cdx-cookie-banner.is-hidden  { display: none; }

.cdx-cookie-banner__head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}
.cdx-cookie-banner__icon {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    flex-shrink: 0;
    line-height: 1;
    /* sin fondo, solo el emoji limpio */
}

.cdx-cookie-banner h3 {
    margin: 0;
    font-size: 1.18rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.25;
    letter-spacing: -.01em;
}
.cdx-cookie-banner p {
    margin: 0 0 18px;
    color: rgba(255, 255, 255, .85);
    font-size: 1rem;
    line-height: 1.6;
}
.cdx-cookie-banner a {
    color: #ffffff;
    font-weight: 600;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    text-decoration-color: rgba(255, 255, 255, .55);
}
.cdx-cookie-banner a:hover {
    color: #ffd6db;
    text-decoration-color: #ffd6db;
}
.cdx-cookie-banner strong { color: #ffffff; font-weight: 700; }

.cdx-cookie-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.cdx-cookie-actions .cdx-btn-config { grid-column: 1 / -1; }

.cdx-btn {
    border: 1px solid transparent;
    background: transparent;
    color: var(--cdx-c-ink);
    border-radius: 10px;
    padding: 12px 18px;
    font-size: .96rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s ease, color .15s ease, border-color .15s ease, box-shadow .15s ease, transform .12s ease;
    font-family: inherit;
    text-align: center;
    letter-spacing: .01em;
}
.cdx-btn:active { transform: translateY(1px); }
.cdx-btn-accept {
    background: var(--cdx-c-accent);
    color: var(--cdx-c-paper);
    border-color: var(--cdx-c-accent);
    box-shadow: 0 4px 12px rgba(238, 75, 90, .25);
}
.cdx-btn-accept:hover {
    background: var(--cdx-c-accent-2);
    border-color: var(--cdx-c-accent-2);
    box-shadow: 0 6px 16px rgba(200, 51, 63, .32);
}
.cdx-btn-reject {
    background: var(--cdx-c-paper);
    color: var(--cdx-c-ink);
    border-color: var(--cdx-c-rule-2);
}
.cdx-btn-reject:hover {
    background: var(--cdx-c-paper-2);
    border-color: var(--cdx-c-ink-2);
}
.cdx-btn-config {
    background: transparent;
    color: var(--cdx-c-ink-2);
    border-color: transparent;
    text-decoration: underline;
    text-decoration-color: var(--cdx-c-rule-2);
    text-underline-offset: 3px;
    font-weight: 600;
}
.cdx-btn-config:hover {
    color: var(--cdx-c-accent);
    text-decoration-color: var(--cdx-c-accent);
}

/* Overrides solo dentro del banner (no del modal) ----------- */
.cdx-cookie-banner .cdx-btn-reject {
    background: rgba(255, 255, 255, .08);
    color: #ffffff;
    border-color: rgba(255, 255, 255, .35);
}
.cdx-cookie-banner .cdx-btn-reject:hover {
    background: rgba(255, 255, 255, .18);
    border-color: rgba(255, 255, 255, .55);
}
.cdx-cookie-banner .cdx-btn-config {
    color: rgba(255, 255, 255, .85);
    text-decoration-color: rgba(255, 255, 255, .35);
}
.cdx-cookie-banner .cdx-btn-config:hover {
    color: #ffffff;
    text-decoration-color: #ffffff;
}

/* Panel modal de preferencias ------------------------------- */
.cdx-cookie-panel {
    position: fixed;
    inset: 0;
    z-index: 12100;
    background: rgba(31, 29, 36, .55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
}
.cdx-cookie-panel.is-visible { opacity: 1; pointer-events: auto; }
.cdx-cookie-panel__dialog {
    background: var(--cdx-c-paper);
    color: var(--cdx-c-ink);
    border-radius: 14px;
    width: 100%;
    max-width: 640px;
    max-height: calc(100vh - 48px);
    overflow: auto;
    padding: 28px;
    box-shadow: 0 18px 48px rgba(31, 29, 36, .35);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.cdx-cookie-panel__brand {
    display: flex;
    justify-content: center;
    margin: -4px 0 18px;
}
.cdx-cookie-panel__logo {
    max-height: 64px;
    max-width: 220px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}
@media (max-width: 640px) {
    .cdx-cookie-panel__logo { max-height: 52px; max-width: 180px; }
}

.cdx-cookie-panel h2 {
    margin: 0 0 12px;
    font-size: 1.3rem;
    font-weight: 700;
    text-align: center;
}
.cdx-cookie-panel p.intro {
    color: var(--cdx-c-mute);
    margin-bottom: 18px;
    font-size: .94rem;
}

.cdx-cookie-category {
    padding: 14px 0;
    border-top: 1px solid var(--cdx-c-rule);
}
.cdx-cookie-category:last-of-type { border-bottom: 1px solid var(--cdx-c-rule); }
.cdx-cookie-category-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 6px;
}
.cdx-cookie-category-title {
    font-weight: 700;
    color: var(--cdx-c-ink);
    font-size: 1rem;
}
.cdx-cookie-category-desc {
    color: var(--cdx-c-mute);
    font-size: .88rem;
    margin: 0;
}
.cdx-cookie-locked {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--cdx-c-success);
    font-weight: 700;
}

/* Toggle switch */
.cdx-switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.cdx-switch input { opacity: 0; width: 0; height: 0; }
.cdx-switch-slider {
    position: absolute; cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #ccc; border-radius: 24px; transition: background .15s ease;
}
.cdx-switch-slider::before {
    content: ""; position: absolute;
    width: 18px; height: 18px;
    left: 3px; top: 3px;
    background: #fff; border-radius: 50%;
    transition: transform .15s ease;
}
.cdx-switch input:checked + .cdx-switch-slider { background: var(--cdx-c-accent); }
.cdx-switch input:checked + .cdx-switch-slider::before { transform: translateX(20px); }
.cdx-switch input:disabled + .cdx-switch-slider { opacity: .55; cursor: not-allowed; }

.cdx-cookie-panel__foot {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 20px;
    flex-wrap: wrap;
}

/* Icono persistente ------------------------------------------- */
.cdx-cookie-icon {
    position: fixed;
    left: 18px;
    bottom: 18px;
    z-index: 11900;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--cdx-c-rule-2);
    background: var(--cdx-c-paper);
    color: var(--cdx-c-accent);
    box-shadow: 0 8px 20px rgba(31, 29, 36, .22);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: transform .15s ease, background-color .15s ease;
}
.cdx-cookie-icon:hover { transform: translateY(-1px); background: var(--cdx-c-paper-2); }
.cdx-cookie-icon:focus-visible { outline: 2px solid var(--cdx-c-accent); outline-offset: 2px; }
.cdx-cookie-icon.is-hidden { display: none; }
.cdx-cookie-icon svg { width: 22px; height: 22px; fill: var(--cdx-c-accent); }

/* Mobile ----------------------------------------------------- */
@media (max-width: 640px) {
    .cdx-cookie-banner {
        right: 8px;
        left: 8px;
        bottom: 8px;
        width: auto;
        padding: 16px 16px 14px;
    }
    .cdx-cookie-panel__dialog { padding: 22px; border-radius: 14px; }
    .cdx-cookie-icon { left: 12px; bottom: 12px; width: 42px; height: 42px; }
    .cdx-cookie-actions { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    .cdx-cookie-banner, .cdx-cookie-panel { transition: none !important; }
}
