/* ===========================================
   BANNER Y PANEL DE COOKIES - Prodiversa
   =========================================== */

:root {
    --ck-primary: #d43031;
    --ck-primary-dark: #a81c1d;
    --ck-text: #1a1a1a;
    --ck-text-light: #5a5a5a;
    --ck-border: #e6e6e6;
    --ck-bg: #ffffff;
}

/* ---------- Banner (1ª capa) ---------- */
.ck-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100000;
    background: var(--ck-bg);
    color: var(--ck-text);
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.18);
    border-top: 4px solid var(--ck-primary);
    padding: 22px 0;
    transform: translateY(110%);
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.ck-banner.ck-visible {
    transform: translateY(0);
}

.ck-banner__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 28px;
    flex-wrap: wrap;
}

.ck-banner__content {
    flex: 1 1 420px;
    min-width: 280px;
}

.ck-banner__title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 8px;
    color: var(--ck-text);
}

.ck-banner__title i {
    color: var(--ck-primary);
}

.ck-banner__text {
    font-size: 0.92rem;
    line-height: 1.6;
    color: var(--ck-text-light);
    margin: 0;
}

.ck-banner__text a {
    color: var(--ck-primary);
    text-decoration: underline;
}

.ck-banner__text a:hover {
    color: var(--ck-primary-dark);
}

.ck-banner__actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

/* ---------- Botones ---------- */
.ck-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    padding: 12px 22px;
    border-radius: 50px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
    line-height: 1;
}

.ck-btn:focus-visible {
    outline: 3px solid rgba(212, 48, 49, 0.4);
    outline-offset: 2px;
}

.ck-btn--accept {
    background: var(--ck-primary);
    color: #fff;
    border-color: var(--ck-primary);
}

.ck-btn--accept:hover {
    background: var(--ck-primary-dark);
    border-color: var(--ck-primary-dark);
    transform: translateY(-2px);
}

.ck-btn--reject {
    background: #f2f2f2;
    color: var(--ck-text);
    border-color: #f2f2f2;
}

.ck-btn--reject:hover {
    background: #e6e6e6;
    border-color: #e6e6e6;
}

.ck-btn--config {
    background: transparent;
    color: var(--ck-primary-dark);
    border-color: var(--ck-border);
}

.ck-btn--config:hover {
    border-color: var(--ck-primary);
    color: var(--ck-primary);
}

/* ---------- Panel de preferencias (2ª capa) ---------- */
.ck-modal {
    position: fixed;
    inset: 0;
    z-index: 100001;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.55);
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ck-modal.ck-open {
    display: flex;
    opacity: 1;
}

.ck-modal__dialog {
    background: var(--ck-bg);
    color: var(--ck-text);
    width: 100%;
    max-width: 620px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 16px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
    transform: translateY(20px) scale(0.98);
    transition: transform 0.3s ease;
}

.ck-modal.ck-open .ck-modal__dialog {
    transform: translateY(0) scale(1);
}

.ck-modal__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 26px 28px 16px;
    border-bottom: 1px solid var(--ck-border);
}

.ck-modal__header h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0 0 6px;
    color: var(--ck-text);
}

.ck-modal__header p {
    font-size: 0.9rem;
    color: var(--ck-text-light);
    margin: 0;
    line-height: 1.5;
}

.ck-modal__close {
    background: #f2f2f2;
    border: none;
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    color: var(--ck-text);
    transition: all 0.2s ease;
}

.ck-modal__close:hover {
    background: var(--ck-primary);
    color: #fff;
}

.ck-modal__body {
    padding: 12px 28px 8px;
}

/* Categoría de cookies */
.ck-cat {
    border: 1px solid var(--ck-border);
    border-radius: 12px;
    padding: 18px 20px;
    margin-bottom: 14px;
}

.ck-cat__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.ck-cat__title {
    font-size: 1.02rem;
    font-weight: 700;
    margin: 0;
    color: var(--ck-text);
}

.ck-cat__desc {
    font-size: 0.88rem;
    line-height: 1.55;
    color: var(--ck-text-light);
    margin: 10px 0 0;
}

/* Interruptor */
.ck-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
}

.ck-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.ck-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #cfcfcf;
    border-radius: 26px;
    transition: background 0.25s ease;
}

.ck-slider::before {
    content: "";
    position: absolute;
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.25s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.ck-switch input:checked + .ck-slider {
    background: var(--ck-primary);
}

.ck-switch input:checked + .ck-slider::before {
    transform: translateX(22px);
}

.ck-switch input:disabled + .ck-slider {
    background: var(--ck-primary);
    opacity: 0.5;
    cursor: not-allowed;
}

.ck-switch input:focus-visible + .ck-slider {
    outline: 3px solid rgba(212, 48, 49, 0.4);
    outline-offset: 2px;
}

.ck-cat__always {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--ck-primary-dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.ck-modal__footer {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 18px 28px 26px;
    border-top: 1px solid var(--ck-border);
}

.ck-modal__footer .ck-btn {
    flex: 1 1 auto;
}

.ck-modal__legal {
    padding: 0 28px 20px;
    font-size: 0.82rem;
    color: var(--ck-text-light);
    text-align: center;
}

.ck-modal__legal a {
    color: var(--ck-primary);
    text-decoration: underline;
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
    .ck-banner__inner {
        gap: 18px;
    }

    .ck-banner__actions {
        width: 100%;
    }

    .ck-banner__actions .ck-btn {
        flex: 1 1 auto;
    }
}

@media (max-width: 520px) {
    .ck-banner {
        padding: 18px 0;
    }

    .ck-banner__actions {
        flex-direction: column;
    }

    .ck-banner__actions .ck-btn {
        width: 100%;
    }

    .ck-modal__footer {
        flex-direction: column;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ck-banner,
    .ck-modal,
    .ck-modal__dialog,
    .ck-slider,
    .ck-slider::before {
        transition: none;
    }
}
