/* ============================================
   COOKIE BANNER + MODAL — variante ADMIN
   Usa los tokens del shell admin (admin-ui.css):
   --accent, --accent-deep, --accent-soft, --ink,
   --ink-mut, --line, --r*, --display, --body.
   Mismo markup/IDs que el componente compartido
   (es/components/cookie-banner.php); solo cambia el estilo.
   ============================================ */

/* ---------- Banner principal ---------- */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.10);
    z-index: 9999;
    padding: 18px 0;
    border-top: 3px solid var(--accent);
    animation: ckSlideUp 0.4s ease-out;
}

@keyframes ckSlideUp {
    from { transform: translateY(100%); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.cookie-banner-content {
    max-width: var(--admin-max, 1240px);
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.cookie-banner-text { flex: 1; }

.cookie-banner-title {
    font-family: var(--display);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.015em;
    margin: 0 0 6px;
    color: var(--ink);
}

.cookie-banner-description {
    font-family: var(--body);
    font-size: 14px;
    color: var(--ink-mut);
    margin: 0;
    line-height: 1.55;
}

.cookie-learn-more {
    color: var(--accent-deep);
    text-decoration: underline;
    font-weight: 600;
    font-family: var(--body);
}

.cookie-learn-more:hover { color: var(--accent); }

.cookie-banner-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.cookie-banner-actions .btn {
    white-space: nowrap;
    padding: 10px 20px;
    font-size: 14px;
    font-family: var(--display);
    font-weight: 600;
    border-radius: var(--r-pill);
    border: 1px solid transparent;
    cursor: pointer;
    transition: 0.2s ease-in-out;
}

/* Aceptar todas — coral sólido */
.cookie-banner-actions .btn-primero {
    background-color: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.cookie-banner-actions .btn-primero:hover {
    background-color: var(--accent-deep);
    border-color: var(--accent-deep);
    transform: translateY(-1px);
}

/* Solo esenciales — ghost */
.cookie-banner-actions .btn-secundario {
    border: 1px solid var(--line-2);
    background-color: #fff;
    color: var(--ink);
}
.cookie-banner-actions .btn-secundario:hover {
    border-color: var(--ink);
    background-color: var(--accent-tint);
}

/* Personalizar — oscuro */
.cookie-banner-actions .btn-terciario {
    background-color: var(--ink);
    border-color: var(--ink);
    color: #fff;
}
.cookie-banner-actions .btn-terciario:hover {
    background-color: #fff;
    color: var(--ink);
    border-color: var(--ink);
}

/* Link "Configurar cookies" en el footer admin */
.cookie-settings-link {
    color: var(--ink-mut);
    text-decoration: none;
    font-size: 14px;
    cursor: pointer;
    transition: color 0.2s;
}
.cookie-settings-link:hover { color: var(--accent-deep); }

/* ============================================
   MODAL DE PERSONALIZACIÓN
   ============================================ */

.cookie-modal {
    position: fixed;
    inset: 0;
    background: rgba(20, 20, 20, 0.55);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: ckFadeIn 0.25s ease-out;
}

@keyframes ckFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.cookie-modal-dialog {
    width: 100%;
    max-width: 560px;
    animation: ckScaleIn 0.25s ease-out;
}

@keyframes ckScaleIn {
    from { transform: scale(0.95); opacity: 0; }
    to   { transform: scale(1);    opacity: 1; }
}

.cookie-modal-content {
    background: #ffffff;
    border-radius: var(--r-lg);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
    overflow: hidden;
    border: 1px solid var(--line);
}

.cookie-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cookie-modal-title {
    font-family: var(--display);
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -0.015em;
    margin: 0;
    color: var(--ink);
}

.cookie-modal-close {
    background: #fff;
    border: 1px solid var(--line-2);
    color: var(--ink-mut);
    cursor: pointer;
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--r-pill);
    transition: 0.2s ease-in-out;
}

.cookie-modal-close span {
    display: block;
    font-size: 24px;
    line-height: 1;
    /* el glifo × queda óptimamente bajo en esta fuente/tamaño: súbelo para centrarlo */
    transform: translateY(-3px);
}
.cookie-modal-close:hover {
    background: var(--accent-soft);
    color: var(--ink);
    border-color: var(--accent-line);
    transform: rotate(90deg);
}

.cookie-modal-body {
    padding: 24px;
    max-height: 60vh;
    overflow-y: auto;
}

.cookie-modal-description {
    font-family: var(--body);
    font-size: 14px;
    color: var(--ink-mut);
    margin: 0 0 20px;
    line-height: 1.55;
}

/* Categorías de cookies */
.cookie-category {
    border: 1px solid var(--line);
    border-radius: var(--r);
    padding: 16px;
    margin-bottom: 14px;
    background: var(--accent-tint);
    transition: border-color 0.2s;
}
.cookie-category:last-child { margin-bottom: 0; }
.cookie-category:hover { border-color: var(--accent-line); }

.cookie-category-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.cookie-category-title {
    font-family: var(--display);
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 5px;
    color: var(--ink);
}

.cookie-category-desc {
    font-family: var(--body);
    font-size: 13px;
    color: var(--ink-mut);
    margin: 0;
    line-height: 1.45;
}

.cookie-always-active {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--success-deep);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

/* Toggle switch */
.cookie-toggle-wrapper { flex-shrink: 0; }

.cookie-switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 26px;
    margin: 0;
}
.cookie-switch input { opacity: 0; width: 0; height: 0; }

.cookie-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: var(--line-3);
    transition: 0.3s;
    border-radius: var(--r-pill);
}
.cookie-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: #fff;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}
.cookie-switch input:checked + .cookie-slider { background-color: var(--accent); }
.cookie-switch input:checked + .cookie-slider:before { transform: translateX(20px); }

/* Footer del modal */
.cookie-modal-footer {
    padding: 18px 24px;
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.cookie-modal-footer .btn-cancelar,
.cookie-modal-footer .btn-aceptar {
    font-family: var(--display);
    font-weight: 600;
    font-size: 14px;
    border-radius: var(--r-pill);
    padding: 10px 20px;
    cursor: pointer;
    transition: 0.2s ease-in-out;
}

.cookie-modal-footer .btn-cancelar {
    background-color: #fff;
    border: 1px solid var(--line-2);
    color: var(--ink);
}
.cookie-modal-footer .btn-cancelar:hover {
    border-color: var(--ink);
    background-color: var(--accent-tint);
}

.cookie-modal-footer .btn-aceptar {
    background-color: var(--accent);
    border: 1px solid var(--accent);
    color: #fff;
}
.cookie-modal-footer .btn-aceptar:hover {
    background-color: var(--accent-deep);
    border-color: var(--accent-deep);
    transform: translateY(-1px);
}

/* ============================================
   RESPONSIVE — Mobile
   ============================================ */
@media (max-width: 768px) {
    .cookie-banner-content { flex-direction: column; align-items: flex-start; gap: 15px; }
    .cookie-banner-actions { width: 100%; flex-direction: column; }
    .cookie-banner-actions .btn { width: 100%; }
    .cookie-banner-title { font-size: 16px; }
    .cookie-banner-description { font-size: 13px; }
    .cookie-modal { padding: 12px; }
    .cookie-modal-header,
    .cookie-modal-body,
    .cookie-modal-footer { padding: 16px; }
    .cookie-modal-title { font-size: 18px; }
    .cookie-category-header { flex-direction: column; gap: 12px; }
    .cookie-modal-footer { flex-direction: column; }
    .cookie-modal-footer .btn-cancelar,
    .cookie-modal-footer .btn-aceptar { width: 100%; }
}

/* ============================================
   SCROLLBAR — Modal body
   ============================================ */
.cookie-modal-body::-webkit-scrollbar { width: 8px; }
.cookie-modal-body::-webkit-scrollbar-track { background: var(--accent-tint); border-radius: 4px; }
.cookie-modal-body::-webkit-scrollbar-thumb { background: var(--line-3); border-radius: 4px; }
.cookie-modal-body::-webkit-scrollbar-thumb:hover { background: var(--ink-mut); }
