/* ═══════════════════════════════════════════════════
   Cookie Consent — Banner + Modal
   ═══════════════════════════════════════════════════ */

/* ── Banner inferior ─────────────────────────────── */
.cookie-banner {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 9000;
    padding: .85rem 1.25rem;
    background: #fff;
    border-top: 1px solid rgba(55,0,60,.12);
    box-shadow: 0 -4px 24px rgba(55,0,60,.12);
    animation: cookieBannerIn .25s ease;
}
.cookie-banner.cookie-banner--hidden {
    animation: cookieBannerOut .2s ease forwards;
}
@keyframes cookieBannerIn {
    from { transform: translateY(100%); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}
@keyframes cookieBannerOut {
    from { transform: translateY(0);    opacity: 1; }
    to   { transform: translateY(100%); opacity: 0; }
}

.cookie-banner-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
}
.cookie-banner-text {
    flex: 1;
    min-width: 220px;
    font-size: .82rem;
    color: #4a3550;
    line-height: 1.5;
}
.cookie-banner-text a {
    color: #37003c;
    font-weight: 700;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}
.cookie-banner-text a:hover { color: #5a0060; }

.cookie-banner-actions {
    display: flex;
    gap: .5rem;
    flex-shrink: 0;
    flex-wrap: wrap;
}

/* ── Botones del banner ───────────────────────────── */
.cookie-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .46rem 1rem;
    border-radius: 7px;
    font-size: .82rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    border: 1.5px solid transparent;
    white-space: nowrap;
    transition: background .15s, border-color .15s, color .15s;
    line-height: 1;
}
.cookie-btn-primary {
    background: #37003c;
    color: #00ff87;
    border-color: #37003c;
}
.cookie-btn-primary:hover { background: #4d005a; border-color: #4d005a; }

.cookie-btn-secondary {
    background: transparent;
    color: #37003c;
    border-color: rgba(55,0,60,.3);
}
.cookie-btn-secondary:hover { background: rgba(55,0,60,.06); border-color: rgba(55,0,60,.5); }

.cookie-btn-outline {
    background: transparent;
    color: #7a6882;
    border-color: rgba(55,0,60,.15);
}
.cookie-btn-outline:hover { background: rgba(55,0,60,.04); border-color: rgba(55,0,60,.25); color: #37003c; }

/* ── Modal de configuración ──────────────────────── */
.cookie-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9100;
    background: rgba(26,5,32,.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
    animation: cookieFadeIn .2s ease;
}
/* display:flex sobreescribe [hidden] del navegador — forzamos none cuando está oculto */
.cookie-modal-overlay[hidden] { display: none !important; }
@media (min-width: 560px) {
    .cookie-modal-overlay { align-items: center; padding: 1.5rem; }
}
@keyframes cookieFadeIn { from { opacity: 0; } to { opacity: 1; } }

.cookie-modal {
    background: #fff;
    border-radius: 16px 16px 0 0;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 -8px 40px rgba(55,0,60,.2);
    animation: cookieModalIn .22s ease;
}
@media (min-width: 560px) {
    .cookie-modal {
        border-radius: 16px;
        box-shadow: 0 8px 40px rgba(55,0,60,.22);
    }
}
@keyframes cookieModalIn {
    from { transform: translateY(20px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.cookie-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1.4rem;
    border-bottom: 1px solid rgba(55,0,60,.1);
}
.cookie-modal-header h2 {
    font-size: 1rem;
    font-weight: 800;
    color: #1a0520;
    margin: 0;
}
.cookie-modal-close {
    width: 28px; height: 28px;
    border-radius: 50%;
    border: none;
    background: rgba(55,0,60,.07);
    color: #7a6882;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: .9rem;
    transition: background .12s, color .12s;
    padding: 0;
}
.cookie-modal-close:hover { background: rgba(55,0,60,.14); color: #37003c; }

.cookie-modal-body { padding: .5rem 0; }

/* ── Categoría de cookie ─────────────────────────── */
.cookie-category {
    padding: .9rem 1.4rem;
    border-bottom: 1px solid rgba(55,0,60,.07);
}
.cookie-category:last-child { border-bottom: none; }

.cookie-category-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}
.cookie-category-info { flex: 1; min-width: 0; }
.cookie-category-info h3 {
    font-size: .88rem;
    font-weight: 800;
    color: #1a0520;
    margin: 0 0 .25rem;
}
.cookie-category-info p {
    font-size: .77rem;
    color: #7a6882;
    margin: 0;
    line-height: 1.5;
}

/* ── Toggle switch ───────────────────────────────── */
.cookie-toggle {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 24px;
    flex-shrink: 0;
    margin-top: .1rem;
}
.cookie-toggle input {
    opacity: 0;
    width: 0; height: 0;
    position: absolute;
}
.cookie-toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #d4ccd8;
    border-radius: 24px;
    transition: background .2s;
}
.cookie-toggle-slider::before {
    position: absolute;
    content: "";
    width: 18px; height: 18px;
    left: 3px; bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform .2s;
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.cookie-toggle input:checked + .cookie-toggle-slider { background: #37003c; }
.cookie-toggle input:checked + .cookie-toggle-slider::before { transform: translateX(18px); }
.cookie-toggle input:focus-visible + .cookie-toggle-slider {
    outline: 2px solid #37003c;
    outline-offset: 2px;
}

.cookie-always-active {
    font-size: .72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #00a651;
    margin-top: .15rem;
    white-space: nowrap;
}

/* ── Footer del modal ────────────────────────────── */
.cookie-modal-footer {
    display: flex;
    gap: .6rem;
    padding: 1rem 1.4rem;
    border-top: 1px solid rgba(55,0,60,.1);
    background: #f8f4fb;
    border-radius: 0 0 16px 16px;
}
.cookie-modal-footer .cookie-btn { flex: 1; justify-content: center; }

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 600px) {
    .cookie-banner-inner { gap: .75rem; }
    .cookie-banner-actions { width: 100%; }
    .cookie-btn { flex: 1; font-size: .8rem; padding: .5rem .6rem; }
}
