﻿/* =========================================================
       CONSENTIMIENTO DE COOKIES
       Componente compartido por todas las vistas.
       ========================================================= */

.cookie-consent,
.cookie-settings-overlay {
    font-family: Arial, sans-serif;
}

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

/* Banner principal */

.cookie-consent {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 9999;
    padding: 16px;
    background: rgba(255, 255, 255, 0.98);
    border-top: 4px solid #009a44;
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.18);
}

.cookie-consent__content {
    display: flex;
    width: min(1180px, 100%);
    margin: 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.cookie-consent__text {
    flex: 1;
    color: #525252;
}

.cookie-consent__title {
    margin: 0 0 6px;
    color: #046a38;
    font-size: 20px;
    font-weight: 700;
}

.cookie-consent__description {
    margin: 0;
    font-size: 15px;
    line-height: 1.5;
}

.cookie-consent__link {
    color: #046a38;
    font-weight: 700;
    text-decoration: underline;
}

.cookie-consent__actions {
    display: flex;
    flex: 0 0 auto;
    gap: 12px;
}

/* Botones compartidos por ambos paneles */

.cookie-consent__button {
    min-width: 120px;
    padding: 10px 18px;
    border: 2px solid #009a44;
    border-radius: 6px;
    background: #ffffff;
    color: #009a44;
    cursor: pointer;
    font-size: 15px;
    font-weight: 700;
    transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}

.cookie-consent__button--accept {
    border-color: #009a44;
    background: #009a44;
    color: #ffffff;
}

    .cookie-consent__button--accept:hover,
    .cookie-consent__button--accept:focus-visible {
        border-color: #046a38;
        background: #046a38;
    }

.cookie-consent__button--reject:hover,
.cookie-consent__button--reject:focus-visible {
    border-color: #df1a95;
    background: #df1a95;
    color: #ffffff;
}

.cookie-consent__button:focus-visible,
.cookie-consent__link:focus-visible {
    outline: 3px solid rgba(0, 154, 68, 0.35);
    outline-offset: 3px;
}

/* Panel de configuración */

.cookie-settings-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    padding: 20px;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.55);
}

.cookie-settings {
    width: min(780px, 100%);
    max-height: calc(100vh - 40px);
    padding: 28px;
    overflow-y: auto;
    background: #ffffff;
    border: 1px solid #97999b;
    border-radius: 8px;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.28);
    color: #333333;
}

.cookie-settings__title {
    margin: 0 0 24px;
    color: #046a38;
    font-size: 22px;
    font-weight: 700;
    text-align: center;
}

.cookie-settings__category {
    display: grid;
    padding: 18px 0;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 24px;
    border-bottom: 1px solid #dddddd;
}

.cookie-settings__category-title {
    margin: 0 0 8px;
    color: #333333;
    font-size: 16px;
    font-weight: 700;
}

.cookie-settings__category-description {
    margin: 0;
    color: #525252;
    font-size: 14px;
    line-height: 1.5;
    text-align: justify;
}

.cookie-settings__actions {
    display: flex;
    margin-top: 24px;
    justify-content: space-between;
    gap: 14px;
}

/* Controles de activación */

.cookie-toggle {
    position: relative;
    display: flex;
    min-width: 125px;
    align-items: center;
    gap: 9px;
    cursor: pointer;
    user-select: none;
}

.cookie-toggle--locked {
    cursor: not-allowed;
}

.cookie-toggle__input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.cookie-toggle__slider {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    flex: 0 0 auto;
    border-radius: 999px;
    background: #c9c9c9;
    transition: background-color .2s ease;
}

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

.cookie-toggle__input:checked + .cookie-toggle__slider {
    background: #009a44;
}

    .cookie-toggle__input:checked + .cookie-toggle__slider::before {
        transform: translateX(22px);
    }

.cookie-toggle__input:focus-visible + .cookie-toggle__slider {
    outline: 3px solid rgba(0, 154, 68, 0.35);
    outline-offset: 3px;
}

.cookie-toggle__status {
    color: #777777;
    font-size: 13px;
    font-weight: 700;
}

    .cookie-toggle__status::before {
        content: "Desactivadas";
    }

.cookie-toggle__input:checked ~ .cookie-toggle__status::before {
    content: "Activadas";
    color: #009a44;
}

@@media (max-width: 768px) {
    .cookie-consent {
        padding: 14px;
    }

    .cookie-consent__content {
        align-items: stretch;
        flex-direction: column;
        gap: 14px;
    }

    .cookie-consent__actions {
        width: 100%;
        flex-direction: column;
    }

    .cookie-consent__button {
        width: 100%;
        min-width: 0;
    }

    .cookie-settings-overlay {
        padding: 12px;
    }

    .cookie-settings {
        max-height: calc(100vh - 24px);
        padding: 20px 16px;
    }

    .cookie-settings__category {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .cookie-toggle {
        min-width: 0;
    }

    .cookie-settings__actions {
        flex-direction: column;
    }
}
