
/* =========================================================
   SOLEOL CONSENT MANAGER
   ========================================================= */

#soleol-consent-root {
    --sc-primary: #f54e48;
    --sc-action: #f54e48;
    --sc-action-hover: #c83b36;
    --sc-text: #252525;
    --sc-muted: #595959;
    --sc-border: #dedede;
    --sc-background: #ffffff;

    font-family: Montserrat, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--sc-text);

    --sc-ease: cubic-bezier(0.22, 1, 0.36, 1);
    --sc-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

#soleol-consent-root *,
#soleol-consent-root *::before,
#soleol-consent-root *::after {
    box-sizing: border-box;
}

#soleol-consent-root [hidden] {
    display: none !important;
}


/* =========================================================
   01. BANNER
   ========================================================= */

.sc-banner {
    position: fixed;
    bottom: 24px;
    left: 24px;

    width: 460px;
    max-width: calc(100% - 48px);

    padding: 28px;

    background: var(--sc-background);
    border: 1px solid var(--sc-border);
    border-radius: 8px;

    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);

    z-index: 1999;

    /* Estado cerrado */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transform: translateY(18px) scale(0.92);
    transform-origin: bottom left;

    transition:
        opacity 0.22s ease,
        transform 0.3s var(--sc-ease),
        visibility 0s linear 0.3s;
}

/* Estado abierto */
.sc-banner.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;

    transform: translateY(0) scale(1);

    transition:
        opacity 0.25s ease,
        transform 0.45s var(--sc-spring),
        visibility 0s;
}

.sc-title {
    margin: 0 0 12px;
    font-family: inherit;
    font-size: 20px;
    font-weight: 600;
    line-height: 1.35;
    color: var(--sc-text);
}

.sc-description {
    margin: 0 0 16px;
    font-size: 13px;
    line-height: 1.7;
    color: var(--sc-muted);
}


/* =========================================================
   02. ENLACES
   ========================================================= */

.sc-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin-bottom: 20px;
}

.sc-link {
    font-size: 12px;
    color: var(--sc-muted);
    text-decoration: underline;
}

.sc-link:hover {
    color: var(--sc-action);
    text-decoration: underline;
}

/* =========================================================
   03. BOTONES
   ========================================================= */

.sc-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.sc-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 44px;
    padding: 10px 16px;

    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    text-align: center;

    border: 1px solid transparent;
    border-radius: 4px;

    cursor: pointer;

    transform: scale(1);

    transition:
        transform 0.3s var(--sc-spring),
        background-color 0.15s ease,
        border-color 0.15s ease;

    -webkit-tap-highlight-color: transparent;
}

.sc-button:active {
    transform: scale(0.96);
    transition-duration: 0.12s;
}

.sc-button-primary {
    background: var(--sc-action);
    color: #ffffff;
    border-color: var(--sc-action);
}

.sc-button-primary:hover {
    background: var(--sc-action-hover);
    border-color: var(--sc-action-hover);
}

.sc-button-secondary {
    background: #ffffff;
    color: var(--sc-text);
    border-color: var(--sc-border);
}

.sc-button-secondary:hover {
    background: #f5f5f5;
}

.sc-button-full {
    grid-column: 1 / -1;
    width: 100%;
}

#soleol-consent-root button:focus-visible,
#soleol-consent-root a:focus-visible,
#soleol-consent-root input:focus-visible {
    outline: 3px solid var(--sc-action);
    outline-offset: 3px;
}


/* =========================================================
   04. PANEL DE PREFERENCIAS
   ========================================================= */

.sc-overlay {
    position: fixed;
    inset: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 24px;
    background: rgba(0, 0, 0, 0.5);

    z-index: 100200;

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transition:
        opacity 0.25s ease,
        visibility 0s linear 0.3s;
}

.sc-overlay.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;

    transition:
        opacity 0.25s ease,
        visibility 0s;
}

.sc-dialog {
    position: relative;

    width: 540px;
    max-width: 100%;
    max-height: 90vh;

    padding: 28px;

    overflow-y: auto;
    overscroll-behavior: contain;

    background: #ffffff;
    border-radius: 8px;

    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.2);

    transform: translateY(18px) scale(0.92);
    transform-origin: center;

    transition:
        transform 0.3s var(--sc-ease);
}

.sc-overlay.is-open .sc-dialog {
    transform: translateY(0) scale(1);

    transition:
        transform 0.45s var(--sc-spring);
}

.sc-dialog-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.sc-close {
    display: inline-flex;
    align-items: start;
    justify-content: center;
    flex-shrink: 0;

    padding: 0;

    background: transparent;
    border: 0;
    border-radius: 4px;

    color: var(--sc-muted);
    cursor: pointer;

    transition:
        transform 0.2s var(--sc-ease);
}

.sc-close:hover {
    transform: scale(1.15);
}

.sc-close:active {
    transform: scale(0.92);
    transition-duration: 0.12s;
}

.sc-close svg {
    display: block;
    flex-shrink: 0;
}

/* =========================================================
   05. CATEGORÍAS
   ========================================================= */

.sc-category {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;

    padding: 20px 0;
    border-top: 1px solid var(--sc-border);
}

.sc-category-content {
    flex: 1;
    min-width: 0;
}

.sc-category-title {
    margin: 0 0 6px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    color: var(--sc-text);
}

.sc-category-description {
    margin: 0;
    font-size: 12px;
    line-height: 1.6;
    color: var(--sc-muted);
}

.sc-always-active {
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 600;
    color: #217346;
}


/* =========================================================
   06. INTERRUPTOR
   ========================================================= */

.sc-switch {
    position: relative;
    display: inline-block;
    flex-shrink: 0;
    width: 44px;
    height: 24px;
    margin: 0;
}

.sc-switch input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 1;
}

.sc-switch-slider {
    position: absolute;
    inset: 0;

    background: #a3a3a3;
    border-radius: 24px;
    transition: background-color 0.25s ease;
    pointer-events: none;
}

.sc-switch-slider::before {
    position: absolute;
    top: 3px;
    left: 3px;

    width: 18px;
    height: 18px;

    background: #ffffff;
    border-radius: 50%;
    content: "";

    transition: transform 0.3s var(--sc-spring);
}

.sc-switch input:checked + .sc-switch-slider {
    background: var(--sc-action);
}

.sc-switch input:checked + .sc-switch-slider::before {
    transform: translateX(20px);
}

.sc-switch input:focus-visible + .sc-switch-slider {
    outline: 3px solid var(--sc-action);
    outline-offset: 3px;
}


/* =========================================================
   07. ACCESO PERMANENTE
   ========================================================= */
.sc-status {
    margin-top: 12px;
    font-size: 12px;
    color: var(--sc-action);
}


/* =========================================================
   08. RESPONSIVE
   ========================================================= */

@media (max-width: 600px) {

    .sc-banner {
        bottom: 12px;
        left: 12px;

        width: calc(100% - 24px);
        max-width: none;
        max-height: calc(100vh - 24px);

        padding: 20px;
        overflow-y: auto;

        transform: translateY(24px) scale(0.98);
        transform-origin: bottom center;
    }

    .sc-banner.is-open {
        transform: translateY(0) scale(1);

        transition:
            opacity 0.25s ease,
            transform 0.45s var(--sc-ease),
            visibility 0s;
    }

    .sc-title {
        font-size: 18px;
    }

    .sc-overlay {
        padding: 12px;
    }

    .sc-dialog {
        padding: 20px;
        transform: translateY(24px) scale(0.98);
    }

    .sc-overlay.is-open .sc-dialog {
        transform: translateY(0) scale(1);

        transition:
            transform 0.45s var(--sc-ease);
    }

    .sc-actions {
        gap: 8px;
    }

    .sc-button {
        padding: 10px 8px;
        font-size: 12px;
    }

    .sc-category {
        gap: 10px;
    }
}

@media (prefers-reduced-motion: reduce) {

    #soleol-consent-root .sc-banner,
    #soleol-consent-root .sc-overlay,
    #soleol-consent-root .sc-dialog,
    #soleol-consent-root .sc-button,
    #soleol-consent-root .sc-close,
    #soleol-consent-root .sc-switch-slider,
    #soleol-consent-root .sc-switch-slider::before {
        animation: none !important;
        transition: none !important;
    }

    #soleol-consent-root .sc-banner,
    #soleol-consent-root .sc-dialog,
    #soleol-consent-root .sc-button,
    #soleol-consent-root .sc-close {
        transform: none !important;
    }

}

/* =====================================================
   BOTÓN EXTERNO DE PREFERENCIAS DE COOKIES
   ===================================================== */

.soleol-cookie-settings-button {

    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 44px;

    padding: 12px 22px;

    border: 1px solid #c83b36;
    border-radius: 4px;

    background: #c83b36;
    color: #ffffff;

    font-family: Montserrat, Arial, sans-serif;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;

    text-align: center;
    text-decoration: none;

    cursor: pointer;

    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease;

}

.soleol-cookie-settings-button:hover {

    background: #a92e29;
    border-color: #a92e29;
    color: #ffffff;

    text-decoration: none;

}

.soleol-cookie-settings-button:active {

    transform: scale(0.97);

}

.soleol-cookie-settings-button:focus-visible {

    outline: 3px solid #c83b36;
    outline-offset: 3px;

}

@media (max-width: 600px) {

    .soleol-cookie-settings-button {

        width: 100%;

    }

}

@media (prefers-reduced-motion: reduce) {

    .soleol-cookie-settings-button {

        transition: none;
        transform: none;

    }

}
