/* ==============================================================================
 * Estilos para Aviso de Cookies y Preferencias (Ley N° 21.719 - Terapia Online)
 * ============================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,400;0,600;0,700;1,400&display=swap');

:root {
    --tol-cookie-green: #2E9E5B;
    --tol-cookie-green-hover: #26874c;
    --tol-cookie-dark: #2c3e50;
    --tol-cookie-gray: #666666;
    --tol-cookie-light-bg: #f8f9fa;
    --tol-cookie-border: #e2e8f0;
    --tol-cookie-font: 'Open Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --tol-cookie-banner-height: 50px;
}

/* --- BANNER INFERIOR FIJO --- */
.tol-cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    background-color: #ffffff;
    box-shadow: 0 -2px 14px rgba(0, 0, 0, 0.1);
    z-index: 999999;
    padding: 8px 24px;
    font-family: var(--tol-cookie-font);
    color: var(--tol-cookie-dark);
    display: none;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

.tol-cookie-banner.is-visible {
    display: block;
    animation: tolSlideUp 0.35s ease-out;
}

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

.tol-cookie-banner__inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.tol-cookie-banner__text-wrap {
    flex: 1 1 auto;
    min-width: 0;
}

.tol-cookie-banner__title-inline {
    font-family: var(--tol-cookie-font);
    font-size: 13.5px;
    font-weight: 700;
    color: var(--tol-cookie-dark);
    margin-right: 4px;
}

.tol-cookie-banner__desc {
    font-family: var(--tol-cookie-font);
    font-size: 13.5px;
    line-height: 1.4;
    margin: 0;
    color: var(--tol-cookie-gray);
}

.tol-cookie-banner__link {
    color: var(--tol-cookie-green);
    text-decoration: underline;
    font-weight: 600;
}

.tol-cookie-banner__link:hover {
    color: var(--tol-cookie-green-hover);
}

.tol-cookie-banner__actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.tol-cookie-banner .tol-cookie-btn {
    padding: 6px 18px;
    font-size: 13px;
    line-height: 1.3;
}

.tol-cookie-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 22px;
    border-radius: 50px;
    font-family: var(--tol-cookie-font);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    text-decoration: none;
    outline: none;
    line-height: 1.2;
    box-sizing: border-box;
}

.tol-cookie-btn--primary {
    background-color: var(--tol-cookie-green);
    color: #ffffff !important;
    border-color: var(--tol-cookie-green);
}

.tol-cookie-btn--primary:hover {
    background-color: var(--tol-cookie-green-hover);
    border-color: var(--tol-cookie-green-hover);
}

.tol-cookie-btn--outline {
    background-color: #ffffff;
    color: var(--tol-cookie-green) !important;
    border-color: var(--tol-cookie-green);
}

.tol-cookie-btn--outline:hover {
    background-color: rgba(46, 158, 91, 0.08);
}

.tol-cookie-btn--secondary {
    background-color: #f1f5f9;
    color: #475569 !important;
    border-color: #cbd5e1;
}

.tol-cookie-btn--secondary:hover {
    background-color: #e2e8f0;
}

/* --- MODAL DE PREFERENCIAS --- */
.tol-cookie-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 1000000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
    backdrop-filter: blur(2px);
}

.tol-cookie-modal-backdrop.is-open {
    display: flex;
    animation: tolFadeIn 0.25s ease-out;
}

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

.tol-cookie-modal {
    background-color: #ffffff;
    border-radius: 18px;
    max-width: 580px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
    font-family: var(--tol-cookie-font);
    color: var(--tol-cookie-dark);
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

.tol-cookie-modal__header {
    background-color: var(--tol-cookie-green);
    color: #ffffff;
    padding: 24px 28px 20px 28px;
    border-top-left-radius: 18px;
    border-top-right-radius: 18px;
    position: relative;
    box-sizing: border-box;
}

.tol-cookie-modal__close {
    position: absolute;
    top: 18px;
    right: 20px;
    background: none;
    border: none;
    color: #ffffff;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.85;
    padding: 4px;
    transition: opacity 0.2s;
    font-family: var(--tol-cookie-font);
}

.tol-cookie-modal__close:hover {
    opacity: 1;
}

.tol-cookie-modal__title {
    font-family: var(--tol-cookie-font);
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 10px 0;
    color: #ffffff;
    line-height: 1.25;
}

.tol-cookie-modal__subtitle {
    font-family: var(--tol-cookie-font);
    font-size: 14px;
    line-height: 1.45;
    margin: 0;
    opacity: 0.95;
    color: #ffffff;
}

.tol-cookie-modal__subtitle a {
    color: #ffffff;
    text-decoration: underline;
    font-weight: 600;
}

.tol-cookie-modal__body {
    padding: 24px 28px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    box-sizing: border-box;
}

.tol-cookie-category {
    border-bottom: 1px solid var(--tol-cookie-border);
    padding-bottom: 18px;
    box-sizing: border-box;
}

.tol-cookie-category:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.tol-cookie-category__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.tol-cookie-category__title-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tol-cookie-category__name {
    font-family: var(--tol-cookie-font);
    font-size: 16px;
    font-weight: 700;
    margin: 0;
    color: var(--tol-cookie-dark);
    line-height: 1.3;
}

.tol-cookie-category__badge {
    font-family: var(--tol-cookie-font);
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
    background-color: #e2e8f0;
    color: #475569;
    text-transform: uppercase;
    line-height: 1.4;
    letter-spacing: 0.3px;
}

.tol-cookie-category__desc {
    font-family: var(--tol-cookie-font);
    font-size: 14px;
    line-height: 1.45;
    margin: 0;
    color: var(--tol-cookie-gray);
}

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

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

.tol-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: .3s;
    border-radius: 26px;
}

.tol-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.tol-switch input:checked + .tol-slider {
    background-color: var(--tol-cookie-green);
}

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

.tol-switch input:disabled + .tol-slider {
    background-color: #a7f3d0;
    cursor: not-allowed;
    opacity: 0.85;
}

.tol-switch input:disabled + .tol-slider:before {
    background-color: #065f46;
}

.tol-cookie-modal__footer {
    padding: 16px 28px 24px 28px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    border-top: 1px solid var(--tol-cookie-border);
    background-color: #fafafa;
    border-bottom-left-radius: 18px;
    border-bottom-right-radius: 18px;
}

/* --- CHECKBOX POLÍTICA DE PRIVACIDAD EN FORMULARIOS --- */
.tol-privacidad-check-slot {
    margin-top: 14px;
    margin-bottom: 14px;
    text-align: center;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-family: var(--tol-cookie-font);
    box-sizing: border-box;
}

.tol-privacidad-error {
    color: #dc3545;
    font-family: var(--tol-cookie-font);
    font-size: 13px;
    font-weight: 600;
    margin-top: 6px;
    text-align: center;
}

.tol-privacidad-check-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: var(--tol-cookie-font);
    font-size: 15px !important;
    line-height: 1.4;
    color: #444444;
    cursor: pointer;
    font-weight: normal !important;
    margin-bottom: 0 !important;
    text-align: left;
    box-sizing: border-box;
}

.tol-privacidad-check-label input[type="checkbox"] {
    margin: 0 !important;
    cursor: pointer;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    accent-color: var(--tol-cookie-green);
    vertical-align: middle;
    position: relative;
    top: 0;
}

.tol-privacidad-check-label span {
    font-family: var(--tol-cookie-font);
    font-size: 15px !important;
    line-height: 1.4;
    display: inline;
    vertical-align: middle;
}

.tol-privacidad-check-label a {
    font-family: var(--tol-cookie-font);
    color: var(--tol-cookie-green);
    text-decoration: underline;
    font-weight: 600;
    font-size: 15px !important;
}

.tol-privacidad-check-label a:hover {
    color: var(--tol-cookie-green-hover);
}

/* --- RESPONSIVE MOBILE & TABLET --- */
@media (max-width: 991.98px) {
    .tol-cookie-banner {
        left: 10px;
        right: 10px;
        bottom: 10px;
        width: auto;
        padding: 12px 14px;
        border-radius: 10px;
        border: 1px solid #cbd5e1;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.14);
        transition: bottom 0.3s ease;
    }

    body.tol-has-floating-bar .tol-cookie-banner.is-visible,
    body:has(.floating-buttons-container.visible) .tol-cookie-banner.is-visible {
        bottom: calc(var(--tol-floating-bar-height, 60px) + 8px);
    }

    .tol-cookie-banner__inner {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .tol-cookie-banner__title-inline {
        display: block;
        margin-bottom: 3px;
        font-size: 14px;
    }

    .tol-cookie-banner__desc {
        font-size: 12.5px;
        line-height: 1.35;
    }

    .tol-cookie-banner__actions {
        flex-direction: row-reverse;
        width: 100%;
        gap: 10px;
    }

    .tol-cookie-banner__actions .tol-cookie-btn {
        flex: 1 1 0%;
        padding: 8px 12px;
        font-size: 13px;
        border-radius: 8px;
    }
}

@media (max-width: 768px) {
    .tol-cookie-modal__header {
        padding: 18px 20px;
    }

    .tol-cookie-modal__body {
        padding: 18px 20px;
    }

    .tol-cookie-modal__footer {
        padding: 16px 20px;
        flex-direction: column-reverse;
        gap: 10px;
    }

    .tol-cookie-modal__footer .tol-cookie-btn {
        width: 100%;
    }
}

/* --- INTEGRACIÓN BOTONES FLOTANTES EN ESCRITORIO --- */
@media (min-width: 992px) {
    body.tol-has-cookie-banner .floating-buttons-container,
    body:has(#tolCookieBanner.is-visible) .floating-buttons-container {
        bottom: calc(var(--tol-cookie-banner-height, 50px) + 16px) !important;
        z-index: 1000000 !important;
        transition: bottom 0.3s ease, opacity 0.3s ease, transform 0.3s ease;
    }
}

