/* ========================================================
   1. BOTÓN FLOTANTE DISPARADOR
   ======================================================== */
#ba-trigger-btn {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background-color: #e59b12;
    color: #ffffff;
    border: none;
    border-radius: 8px 0 0 8px;
    padding: 12px 14px;
    cursor: pointer;
    box-shadow: -3px 3px 12px rgba(0, 0, 0, 0.25);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

#ba-trigger-btn:hover {
    background-color: #cf8707;
    transform: translateY(-50%) scale(1.05);
}

/* ========================================================
   2. CAJÓN LATERAL (DRAWER) Y BLINDAJE DE ESTILOS
   ======================================================== */
#ba-drawer {
    position: fixed;
    top: 0;
    right: -360px;
    width: 330px;
    height: 100vh;
    background: #ffffff !important;
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.25);
    z-index: 1000000;
    transition: right 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    box-sizing: border-box;
}

#ba-drawer.ba-open {
    right: 0;
}

#ba-drawer,
#ba-drawer * {
    text-shadow: none !important;
    -webkit-text-stroke: 0 !important;
    text-decoration: none !important;
    box-sizing: border-box;
}

.ba-drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    border-bottom: 1px solid #e0e0e0 !important;
    background-color: #f7f7f7 !important;
}

#ba-drawer .ba-drawer-header h3 {
    margin: 0 !important;
    font-size: 1.15rem !important;
    color: #1a1a1a !important;
    font-weight: 700 !important;
}

#ba-drawer #ba-close-btn {
    background: transparent !important;
    border: none !important;
    font-size: 1.8rem !important;
    cursor: pointer;
    color: #333333 !important;
    line-height: 1;
}

#ba-drawer #ba-close-btn:hover {
    color: #000000 !important;
}

.ba-drawer-body {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow-y: auto;
}

.ba-tool-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    border: 1px solid #e6e6e6 !important;
    border-radius: 10px;
    background-color: #ffffff !important;
    gap: 10px;
}

.ba-tool-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

#ba-drawer .ba-tool-info strong {
    display: block;
    font-size: 0.92rem !important;
    color: #222222 !important;
    font-weight: 600 !important;
    white-space: nowrap;
}

#ba-drawer .ba-tool-info small {
    display: block;
    color: #666666 !important;
    font-size: 0.78rem !important;
    line-height: 1.2;
}

.ba-icon {
    font-size: 1.35rem;
    flex-shrink: 0;
}

/* Switches */
.ba-switch {
    width: 44px;
    height: 24px;
    background-color: #d1d1d6 !important;
    border-radius: 12px;
    position: relative;
    border: none !important;
    cursor: pointer;
    flex-shrink: 0;
    transition: background-color 0.25s ease;
}

.ba-switch::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: #ffffff !important;
    border-radius: 50%;
    transition: transform 0.25s ease;
}

.ba-switch[aria-pressed="true"] {
    background-color: #e59b12 !important;
}

.ba-switch[aria-pressed="true"]::after {
    transform: translateX(20px);
}

/* Botones de acción */
.ba-action-btn {
    padding: 7px 14px;
    border-radius: 6px;
    border: 1px solid #e59b12 !important;
    background: #ffffff !important;
    color: #e59b12 !important;
    font-weight: 600 !important;
    cursor: pointer;
    font-size: 0.85rem !important;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.ba-action-btn:hover,
.ba-action-btn[aria-pressed="true"] {
    background-color: #e59b12 !important;
    color: #ffffff !important;
}

.ba-action-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

#ba-btn-translate {
    min-width: 48px;
    text-align: center;
}

/* Grupo de botones para tamaño de fuente */
.ba-font-btn-group {
    display: flex;
    gap: 6px;
    align-items: center;
}

.ba-font-btn {
    min-width: 36px;
    padding: 6px 10px !important;
    text-align: center;
    font-weight: 700 !important;
    font-size: 0.88rem !important;
}

/* ========================================================
   CONTENEDOR EN COLUMNA Y SELECTOR DE VELOCIDAD TTS
   ======================================================== */
.ba-tool-item-column {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
}

.ba-tool-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.ba-tts-speed-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 8px;
    border-top: 1px dashed #e6e6e6;
    gap: 6px;
}

.ba-speed-label {
    font-size: 0.8rem !important;
    color: #555555 !important;
    font-weight: 600 !important;
}

.ba-speed-btn-group {
    display: flex;
    gap: 4px;
}

.ba-speed-btn {
    padding: 3px 8px !important;
    border: 1px solid #d1d1d6 !important;
    border-radius: 4px !important;
    background: #ffffff !important;
    color: #444444 !important;
    font-size: 0.76rem !important;
    font-weight: 600 !important;
    cursor: pointer;
    transition: all 0.15s ease;
}

.ba-speed-btn:hover {
    border-color: #e59b12 !important;
    color: #e59b12 !important;
}

.ba-speed-btn.ba-speed-active {
    background-color: #e59b12 !important;
    color: #ffffff !important;
    border-color: #e59b12 !important;
}

/* ========================================================
   MODO APUNTAR Y ESCUCHAR (CLICK-TO-READ) EN LA PÁGINA
   ======================================================== */
body.ba-tts-active p:not(#ba-drawer *):not(#ba-tts-toast *),
body.ba-tts-active h1:not(#ba-drawer *):not(#ba-tts-toast *),
body.ba-tts-active h2:not(#ba-drawer *):not(#ba-tts-toast *),
body.ba-tts-active h3:not(#ba-drawer *):not(#ba-tts-toast *),
body.ba-tts-active h4:not(#ba-drawer *):not(#ba-tts-toast *),
body.ba-tts-active h5:not(#ba-drawer *):not(#ba-tts-toast *),
body.ba-tts-active h6:not(#ba-drawer *):not(#ba-tts-toast *),
body.ba-tts-active li:not(#ba-drawer *):not(#ba-tts-toast *),
body.ba-tts-active blockquote:not(#ba-drawer *):not(#ba-tts-toast *),
body.ba-tts-active [data-ba-en]:not(#ba-drawer *):not(#ba-tts-toast *),
body.ba-tts-active .team_member:not(#ba-drawer *):not(#ba-tts-toast *),
body.ba-tts-active .nectar_team:not(#ba-drawer *):not(#ba-tts-toast *) {
    cursor: pointer !important;
    transition: outline 0.15s ease, background-color 0.15s ease;
}

body.ba-tts-active p:not(#ba-drawer *):not(#ba-tts-toast *):hover,
body.ba-tts-active h1:not(#ba-drawer *):not(#ba-tts-toast *):hover,
body.ba-tts-active h2:not(#ba-drawer *):not(#ba-tts-toast *):hover,
body.ba-tts-active h3:not(#ba-drawer *):not(#ba-tts-toast *):hover,
body.ba-tts-active h4:not(#ba-drawer *):not(#ba-tts-toast *):hover,
body.ba-tts-active h5:not(#ba-drawer *):not(#ba-tts-toast *):hover,
body.ba-tts-active h6:not(#ba-drawer *):not(#ba-tts-toast *):hover,
body.ba-tts-active li:not(#ba-drawer *):not(#ba-tts-toast *):hover,
body.ba-tts-active blockquote:not(#ba-drawer *):not(#ba-tts-toast *):hover,
body.ba-tts-active .team_member:not(#ba-drawer *):not(#ba-tts-toast *):hover {
    outline: 2px dashed #e59b12 !important;
    outline-offset: 4px !important;
}

/* Bloque que se está leyendo activamente */
.ba-tts-reading-target {
    outline: 3px solid #e59b12 !important;
    outline-offset: 4px !important;
    background-color: rgba(229, 155, 18, 0.18) !important;
    border-radius: 4px !important;
}

body.ba-dark-theme .ba-tts-reading-target {
    outline: 3px solid #f7a81b !important;
    background-color: rgba(247, 168, 27, 0.28) !important;
}

body.ba-contrast-theme:not(.ba-dark-theme) .ba-tts-reading-target {
    outline: 3px solid #000000 !important;
    background-color: #ffff00 !important;
    color: #000000 !important;
}

body.ba-contrast-theme.ba-dark-theme .ba-tts-reading-target {
    outline: 3px solid #ffff00 !important;
    background-color: #333300 !important;
    color: #ffff00 !important;
}

/* Toast flotante informativo cuando el modo lectura está activo */
.ba-tts-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: #1a1a1a;
    color: #ffffff;
    padding: 10px 18px;
    border-radius: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
    z-index: 999998;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.88rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    animation: baFadeInUp 0.3s ease;
}

.ba-tts-toast-icon {
    font-size: 1.15rem;
}

#ba-tts-toast-close {
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 1.3rem;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
    opacity: 0.8;
}

#ba-tts-toast-close:hover {
    opacity: 1;
}

@keyframes baFadeInUp {
    from {
        opacity: 0;
        transform: translate(-50%, 15px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

/* ========================================================
   3. MODO OSCURO (BASE)
   ======================================================== */
body.ba-dark-theme,
body.ba-dark-theme #ajax-content-wrap,
body.ba-dark-theme #page-wrap,
body.ba-dark-theme .container-wrap,
body.ba-dark-theme .container,
body.ba-dark-theme .main-content,
body.ba-dark-theme main,
body.ba-dark-theme section,
body.ba-dark-theme article,
body.ba-dark-theme .vc_row,
body.ba-dark-theme .vc_row-fluid,
body.ba-dark-theme .wpb_row,
body.ba-dark-theme .row,
body.ba-dark-theme .row-bg,
body.ba-dark-theme .row-bg-wrap,
body.ba-dark-theme .row_col_wrap_12,
body.ba-dark-theme .inner-wrap,
body.ba-dark-theme .span_12,
body.ba-dark-theme .full-width-section,
body.ba-dark-theme [class*="section"],
body.ba-dark-theme [class*="row-bg"],
body.ba-dark-theme header,
body.ba-dark-theme footer,
body.ba-dark-theme #header-outer,
body.ba-dark-theme #header-secondary-outer,
body.ba-dark-theme .nectar-shape-divider,
body.ba-dark-theme .divider-border {
    background-color: #121212 !important;
    background-image: none !important;
}

body.ba-dark-theme .vc_row::before,
body.ba-dark-theme .vc_row::after,
body.ba-dark-theme .row-bg::before,
body.ba-dark-theme .row-bg::after,
body.ba-dark-theme .row-bg-wrap::before,
body.ba-dark-theme .row-bg-wrap::after {
    background-color: #121212 !important;
    background-image: none !important;
}

body.ba-dark-theme div:not(#ba-drawer):not(#ba-drawer *):not(#ba-trigger-btn):not(#ba-trigger-btn *)[style*="background-color: #fff"],
body.ba-dark-theme div:not(#ba-drawer):not(#ba-drawer *):not(#ba-trigger-btn):not(#ba-trigger-btn *)[style*="background-color:#fff"],
body.ba-dark-theme div:not(#ba-drawer):not(#ba-drawer *):not(#ba-trigger-btn):not(#ba-trigger-btn *)[style*="background-color: rgb(255, 255, 255)"],
body.ba-dark-theme div:not(#ba-drawer):not(#ba-drawer *):not(#ba-trigger-btn):not(#ba-trigger-btn *)[style*="background-color:rgb(255, 255, 255)"] {
    background-color: #121212 !important;
}

body.ba-dark-theme .wpb_wrapper {
    background-color: transparent !important;
}

body.ba-dark-theme:not(.ba-contrast-theme) *:not(#ba-drawer):not(#ba-drawer *):not(#ba-trigger-btn):not(#ba-trigger-btn *) {
    color: #e2e2e2 !important;
    border-color: #2b2b2b !important;
}

body.ba-dark-theme:not(.ba-contrast-theme) h1:not(#ba-drawer *),
body.ba-dark-theme:not(.ba-contrast-theme) h2:not(#ba-drawer *),
body.ba-dark-theme:not(.ba-contrast-theme) h3:not(#ba-drawer *),
body.ba-dark-theme:not(.ba-contrast-theme) h4:not(#ba-drawer *) {
    color: #ffffff !important;
}

body.ba-dark-theme:not(.ba-contrast-theme) a:not(#ba-drawer *):not(#ba-trigger-btn) {
    color: #f7a81b !important;
}

/* Botones en modo oscuro estándar */
body.ba-dark-theme:not(.ba-contrast-theme) button:not(#ba-drawer *):not(#ba-trigger-btn),
body.ba-dark-theme:not(.ba-contrast-theme) a[class*="button"]:not(#ba-drawer *):not(#ba-trigger-btn),
body.ba-dark-theme:not(.ba-contrast-theme) a[class*="btn"]:not(#ba-drawer *):not(#ba-trigger-btn),
body.ba-dark-theme:not(.ba-contrast-theme) .vc_btn3,
body.ba-dark-theme:not(.ba-contrast-theme) [role="button"] {
    background-color: #1a1a1a !important;
    color: #ffffff !important;
    border: 1px solid #444444 !important;
}

body.ba-dark-theme:not(.ba-contrast-theme) button:not(#ba-drawer *):not(#ba-trigger-btn) *,
body.ba-dark-theme:not(.ba-contrast-theme) a[class*="button"]:not(#ba-drawer *):not(#ba-trigger-btn) *,
body.ba-dark-theme:not(.ba-contrast-theme) a[class*="btn"]:not(#ba-drawer *):not(#ba-trigger-btn) *,
body.ba-dark-theme:not(.ba-contrast-theme) .vc_btn3 * {
    color: #ffffff !important;
}

/* ========================================================
   4. CASO A: ALTO CONTRASTE CLARO (Contraste ON, Oscuro OFF)
   ======================================================== */
body.ba-contrast-theme:not(.ba-dark-theme),
body.ba-contrast-theme:not(.ba-dark-theme) #ajax-content-wrap,
body.ba-contrast-theme:not(.ba-dark-theme) .container-wrap,
body.ba-contrast-theme:not(.ba-dark-theme) .main-content,
body.ba-contrast-theme:not(.ba-dark-theme) main,
body.ba-contrast-theme:not(.ba-dark-theme) section,
body.ba-contrast-theme:not(.ba-dark-theme) .vc_row,
body.ba-contrast-theme:not(.ba-dark-theme) .wpb_row,
body.ba-contrast-theme:not(.ba-dark-theme) .row-bg,
body.ba-contrast-theme:not(.ba-dark-theme) header {
    background-color: #ffffff !important;
    background-image: none !important;
}

body.ba-contrast-theme:not(.ba-dark-theme) *:not(#ba-drawer):not(#ba-drawer *):not(#ba-trigger-btn):not(#ba-trigger-btn *):not(button):not(a[class*="button"]):not(a[class*="btn"]):not(.vc_btn3):not([role="button"]):not(button *):not(a[class*="button"] *):not(a[class*="btn"] *) {
    color: #000000 !important;
    font-weight: 800 !important;
    -webkit-text-stroke: 0.8px #000000 !important;
    paint-order: stroke fill !important;
    text-shadow: 0 0 1px rgba(0, 0, 0, 0.9) !important;
    text-decoration: underline 4px solid #000000 !important;
    text-underline-offset: 5px !important;
    text-decoration-skip-ink: none !important;
}

body.ba-contrast-theme:not(.ba-dark-theme) a:not(#ba-drawer *):not(#ba-trigger-btn):not([class*="button"]):not([class*="btn"]) {
    text-decoration: underline 5px solid #000000 !important;
    text-underline-offset: 5px !important;
    color: #000000 !important;
}

/* Botones en Contraste Claro: Fondo negro con texto blanco puro */
body.ba-contrast-theme:not(.ba-dark-theme) button:not(#ba-drawer *):not(#ba-trigger-btn),
body.ba-contrast-theme:not(.ba-dark-theme) a[class*="button"]:not(#ba-drawer *):not(#ba-trigger-btn),
body.ba-contrast-theme:not(.ba-dark-theme) a[class*="btn"]:not(#ba-drawer *):not(#ba-trigger-btn),
body.ba-contrast-theme:not(.ba-dark-theme) .vc_btn3,
body.ba-contrast-theme:not(.ba-dark-theme) [role="button"] {
    background-color: #000000 !important;
    color: #ffffff !important;
    border: 2px solid #000000 !important;
    text-decoration: none !important;
    -webkit-text-stroke: 0 !important;
    text-shadow: none !important;
    font-weight: 700 !important;
}

body.ba-contrast-theme:not(.ba-dark-theme) button:not(#ba-drawer *):not(#ba-trigger-btn) *,
body.ba-contrast-theme:not(.ba-dark-theme) a[class*="button"]:not(#ba-drawer *):not(#ba-trigger-btn) *,
body.ba-contrast-theme:not(.ba-dark-theme) a[class*="btn"]:not(#ba-drawer *):not(#ba-trigger-btn) *,
body.ba-contrast-theme:not(.ba-dark-theme) .vc_btn3 * {
    color: #ffffff !important;
    text-decoration: none !important;
    -webkit-text-stroke: 0 !important;
    text-shadow: none !important;
    font-weight: 700 !important;
}

/* ========================================================
   5. CASO B: ALTO CONTRASTE OSCURO (Contraste ON + Oscuro ON)
   ======================================================== */
body.ba-contrast-theme.ba-dark-theme,
body.ba-contrast-theme.ba-dark-theme #ajax-content-wrap,
body.ba-contrast-theme.ba-dark-theme #page-wrap,
body.ba-contrast-theme.ba-dark-theme .container-wrap,
body.ba-contrast-theme.ba-dark-theme .container,
body.ba-contrast-theme.ba-dark-theme .main-content,
body.ba-contrast-theme.ba-dark-theme main,
body.ba-contrast-theme.ba-dark-theme section,
body.ba-contrast-theme.ba-dark-theme article,
body.ba-contrast-theme.ba-dark-theme .vc_row,
body.ba-contrast-theme.ba-dark-theme .vc_row-fluid,
body.ba-contrast-theme.ba-dark-theme .wpb_row,
body.ba-contrast-theme.ba-dark-theme .row,
body.ba-contrast-theme.ba-dark-theme .row-bg,
body.ba-contrast-theme.ba-dark-theme .row-bg-wrap,
body.ba-contrast-theme.ba-dark-theme header,
body.ba-contrast-theme.ba-dark-theme footer,
body.ba-contrast-theme.ba-dark-theme #header-outer {
    background-color: #000000 !important;
    background-image: none !important;
}

body.ba-contrast-theme.ba-dark-theme *:not(#ba-drawer):not(#ba-drawer *):not(#ba-trigger-btn):not(#ba-trigger-btn *):not(button):not(a[class*="button"]):not(a[class*="btn"]):not(.vc_btn3) {
    color: #ffff00 !important;
    font-weight: 700 !important;
    -webkit-text-stroke: 1.2px #000000 !important;
    paint-order: stroke fill !important;
    text-shadow:
        -2px -2px 0 #000000,
        2px -2px 0 #000000,
        -2px 2px 0 #000000,
        2px 2px 0 #000000,
        0px -2px 0 #000000,
        0px 2px 0 #000000,
        -2px 0px 0 #000000,
        2px 0px 0 #000000,
        0 0 6px #000000 !important;
    text-decoration: none !important;
}

body.ba-contrast-theme.ba-dark-theme a:not(#ba-drawer *):not(#ba-trigger-btn):not([class*="button"]):not([class*="btn"]) {
    text-decoration: underline 3px solid #ffff00 !important;
    color: #ffff00 !important;
}

body.ba-contrast-theme.ba-dark-theme button:not(#ba-drawer *):not(#ba-trigger-btn),
body.ba-contrast-theme.ba-dark-theme a[class*="button"]:not(#ba-drawer *):not(#ba-trigger-btn),
body.ba-contrast-theme.ba-dark-theme a[class*="btn"]:not(#ba-drawer *):not(#ba-trigger-btn),
body.ba-contrast-theme.ba-dark-theme .vc_btn3,
body.ba-contrast-theme.ba-dark-theme [role="button"] {
    background-color: #000000 !important;
    color: #ffff00 !important;
    border: 2px solid #ffff00 !important;
    text-decoration: none !important;
    -webkit-text-stroke: 0 !important;
    text-shadow: none !important;
}

body.ba-contrast-theme.ba-dark-theme button:not(#ba-drawer *):not(#ba-trigger-btn) *,
body.ba-contrast-theme.ba-dark-theme a[class*="button"]:not(#ba-drawer *):not(#ba-trigger-btn) *,
body.ba-contrast-theme.ba-dark-theme a[class*="btn"]:not(#ba-drawer *):not(#ba-trigger-btn) *,
body.ba-contrast-theme.ba-dark-theme .vc_btn3 * {
    color: #ffff00 !important;
    text-decoration: none !important;
    -webkit-text-stroke: 0 !important;
    text-shadow: none !important;
}