/* ===========================================
   Banner de cookies RGPD / ePrivacy
   Banner inferior + modal de preferencias
   =========================================== */

/* ---------- Banner inferior ---------- */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: var(--max-width, 600px);
    background: var(--surface, #fff);
    border: 1px solid var(--border, #dbdbdb);
    border-bottom: none;
    border-radius: 12px 12px 0 0;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.12);
    padding: 18px 20px;
    z-index: 10000;
    box-sizing: border-box;
    animation: cookie-slide-up 0.35s ease-out;
}

.cookie-banner[hidden] {
    display: none !important;
}

@keyframes cookie-slide-up {
    from {
        transform: translate(-50%, 100%);
        opacity: 0;
    }
    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

.cookie-banner__text {
    font-size: 13px;
    line-height: 1.5;
    color: var(--text, #262626);
    margin: 0 0 14px;
}

.cookie-banner__text a {
    color: var(--primary, #0095f6);
    text-decoration: underline;
    font-weight: 500;
}

.cookie-banner__actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* ---------- Botones ---------- */
.cookie-btn {
    padding: 9px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background 0.15s, border-color 0.15s, opacity 0.15s;
    white-space: nowrap;
}

.cookie-btn:hover {
    opacity: 0.88;
}

.cookie-btn:active {
    transform: scale(0.97);
}

.cookie-btn--primary {
    background: var(--primary, #0095f6);
    color: #fff;
}

.cookie-btn--primary:hover {
    background: var(--primary-hover, #1877f2);
}

.cookie-btn--secondary {
    background: transparent;
    color: var(--text, #262626);
    border-color: var(--border, #dbdbdb);
}

.cookie-btn--secondary:hover {
    background: var(--bg, #fafafa);
}

.cookie-btn--danger {
    background: transparent;
    color: var(--text-muted, #8e8e8e);
    border-color: var(--border-light, #efefef);
}

.cookie-btn--danger:hover {
    color: var(--text, #262626);
    border-color: var(--border, #dbdbdb);
}

/* ---------- Overlay del modal ---------- */
.cookie-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
    animation: cookie-fade-in 0.2s ease-out;
}

.cookie-overlay[hidden] {
    display: none !important;
}

@keyframes cookie-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ---------- Modal de preferencias ---------- */
.cookie-modal {
    background: var(--surface, #fff);
    border-radius: 12px;
    width: 100%;
    max-width: 480px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    animation: cookie-modal-in 0.25s ease-out;
}

@keyframes cookie-modal-in {
    from {
        transform: translateY(20px) scale(0.97);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.cookie-modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border-light, #efefef);
    position: sticky;
    top: 0;
    background: var(--surface, #fff);
    z-index: 1;
}

.cookie-modal__title {
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: var(--text, #262626);
    margin: 0;
}

.cookie-modal__close {
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    color: var(--text-muted, #8e8e8e);
    cursor: pointer;
    padding: 0 4px;
    transition: color 0.15s;
}

.cookie-modal__close:hover {
    color: var(--text, #262626);
}

.cookie-modal__body {
    padding: 8px 20px 20px;
}

/* ---------- Categoría / interruptor ---------- */
.cookie-category {
    padding: 16px 0;
    border-bottom: 1px solid var(--border-light, #efefef);
}

.cookie-category:last-of-type {
    border-bottom: none;
}

.cookie-category__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.cookie-category__info {
    flex: 1;
}

.cookie-category__name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text, #262626);
    margin: 0 0 2px;
}

.cookie-category__badge {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--success, #28a745);
    margin-left: 6px;
}

.cookie-category__desc {
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-muted, #8e8e8e);
    margin: 0;
}

/* ---------- Toggle switch (iOS style) ---------- */
.cookie-toggle {
    position: relative;
    display: inline-block;
    flex-shrink: 0;
    width: 42px;
    height: 24px;
    margin-top: 1px;
}

.cookie-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.cookie-toggle__slider {
    position: absolute;
    inset: 0;
    background: #ccc;
    border-radius: 24px;
    cursor: pointer;
    transition: background 0.2s;
}

.cookie-toggle__slider::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    transition: transform 0.2s;
}

.cookie-toggle input:checked + .cookie-toggle__slider {
    background: var(--primary, #0095f6);
}

.cookie-toggle input:checked + .cookie-toggle__slider::before {
    transform: translateX(18px);
}

.cookie-toggle input:disabled + .cookie-toggle__slider {
    background: var(--success, #28a745);
    cursor: not-allowed;
    opacity: 0.6;
}

.cookie-toggle input:disabled + .cookie-toggle__slider::before {
    transform: translateX(18px);
}

/* ---------- Footer del modal ---------- */
.cookie-modal__footer {
    display: flex;
    gap: 8px;
    justify-content: space-between;
    padding: 16px 20px;
    border-top: 1px solid var(--border-light, #efefef);
    position: sticky;
    bottom: 0;
    background: var(--surface, #fff);
}

/* ---------- Link "Cookies" en el footer del sitio ---------- */
.cookie-footer-link {
    color: var(--text-muted, #8e8e8e);
    text-decoration: underline;
    cursor: pointer;
    background: none;
    border: none;
    font: inherit;
    padding: 0;
}

.cookie-footer-link:hover {
    color: var(--primary, #0095f6);
}

/* ---------- Página de privacidad ---------- */
.privacy-page {
    max-width: var(--max-width, 600px);
    margin: 0 auto;
    padding: 24px 16px 48px;
    background: var(--surface, #fff);
    min-height: 60vh;
}

.privacy-page__title {
    font-family: 'Poppins', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: var(--text, #262626);
    margin: 0 0 4px;
}

.privacy-page__updated {
    font-size: 12px;
    color: var(--text-muted, #8e8e8e);
    margin: 0 0 24px;
}

.privacy-page__content {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text, #262626);
}

.privacy-page__content h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    font-weight: 600;
    margin: 24px 0 8px;
}

.privacy-page__content h3 {
    font-size: 14px;
    font-weight: 600;
    margin: 18px 0 6px;
}

.privacy-page__content p {
    margin: 0 0 12px;
}

.privacy-page__content ul {
    margin: 0 0 12px;
    padding-left: 20px;
}

.privacy-page__content li {
    margin-bottom: 6px;
}

.privacy-page__back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--primary, #0095f6);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 16px;
}

.privacy-page__back:hover {
    text-decoration: underline;
}

/* ---------- Responsive ---------- */
@media (max-width: 600px) {
    .cookie-banner {
        padding: 16px 14px;
        border-radius: 12px 12px 0 0;
    }

    .cookie-banner__actions {
        flex-direction: column-reverse;
    }

    .cookie-btn {
        width: 100%;
        text-align: center;
    }

    .cookie-modal {
        max-height: 90vh;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cookie-banner,
    .cookie-overlay,
    .cookie-modal {
        animation: none !important;
    }
    .cookie-toggle__slider,
    .cookie-toggle__slider::before {
        transition: none !important;
    }
}
