/* ==========================================
   BDS Accessibility v2.0 — Версия для слабовидящих
   С функциями BVI
   ========================================== */

/* КНОПКА ШОРТКОДА */
.bds-shortcode-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: #0066cc;
    color: #ffffff !important;
    border: 2px solid transparent;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    text-decoration: none;
    z-index: 999999;
    line-height: 1.4;
}
.bds-shortcode-btn:hover, .bds-shortcode-btn:focus {
    background: #0052a3;
    border-color: #ffcc00;
    outline: 3px solid #ffcc00;
    outline-offset: 2px;
    color: #ffffff !important;
}
.bds-icon { width: 20px; height: 20px; fill: #ffffff !important; color: #ffffff !important; }
.bds-btn-text { color: #ffffff !important; }

/* OVERLAY */
.bds-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.2);
    z-index: 999997;
    opacity: 0; visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
}
.bds-overlay[hidden] { display: none !important; }
.bds-overlay.active { opacity: 1; visibility: visible; }

/* БОКОВАЯ ПАНЕЛЬ */
.bds-side-panel {
    position: fixed; top: 0; right: 0;
    width: 350px; max-width: 90vw;
    height: 100vh; height: 100dvh;
    background: #ffffff;
    z-index: 999998;
    box-shadow: -3px 0 15px rgba(0, 0, 0, 0.2);
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
    overflow-y: auto;
    color: #333333;
}
.bds-side-panel[hidden] { display: block !important; transform: translateX(100%); }
.bds-side-panel.active { transform: translateX(0); }
.bds-panel-wrapper { display: flex; flex-direction: column; height: 100%; background: #ffffff; }

/* ЗАГОЛОВОК */
.bds-panel-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 20px; background: #0066cc; color: #ffffff !important;
    flex-shrink: 0; position: sticky; top: 0; z-index: 10;
}
.bds-panel-title {
    display: flex; align-items: center; gap: 10px;
    font-size: 18px; font-weight: 600; color: #ffffff !important;
}
.bds-panel-title svg { width: 24px; height: 24px; fill: #ffffff !important; }
.bds-panel-close {
    background: rgba(255,255,255,0.2); border: 2px solid rgba(255,255,255,0.5);
    color: #ffffff !important; cursor: pointer; padding: 8px;
    border-radius: 50%; width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
}
.bds-panel-close:hover, .bds-panel-close:focus {
    background: rgba(255,255,255,0.4); border-color: #ffcc00;
    outline: 2px solid #ffcc00; outline-offset: 2px; color: #ffffff !important;
}
.bds-panel-close svg { width: 20px; height: 20px; fill: #ffffff !important; }

/* КОНТЕНТ */
.bds-panel-content { padding: 20px; flex-grow: 1; overflow-y: auto; background: #ffffff; color: #333333; }
.bds-control-group { margin-bottom: 25px; padding-bottom: 20px; border-bottom: 1px solid #e0e0e0; }
.bds-control-group:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.bds-control-label { display: block; font-size: 16px; font-weight: 600; margin-bottom: 12px; color: #333333 !important; }

/* КНОПКИ ШРИФТА */
.bds-font-sizes { display: flex; gap: 10px; }
.bds-btn-font {
    flex: 1; height: 50px; background: #f5f5f5; border: 2px solid #ddd;
    border-radius: 5px; font-size: 18px; font-weight: 700; cursor: pointer;
    color: #333333 !important;
}
.bds-btn-font:hover, .bds-btn-font.active { background: #0066cc; color: #ffffff !important; border-color: #0066cc; }

/* ГАРНИТУРА */
.bds-font-family { display: flex; gap: 10px; }
.bds-btn-font-family {
    flex: 1; padding: 12px; background: #f5f5f5; border: 2px solid #ddd;
    border-radius: 5px; font-size: 14px; font-weight: 600; cursor: pointer;
    color: #333333 !important;
}
.bds-btn-font-family:hover, .bds-btn-font-family.active { background: #0066cc; color: #ffffff !important; border-color: #0066cc; }

/* ЦВЕТОВЫЕ СХЕМЫ */
.bds-color-schemes { display: flex; gap: 15px; flex-wrap: wrap; }
.bds-btn-color {
    width: 65px; height: 65px; border: 3px solid #ddd; border-radius: 8px;
    cursor: pointer; padding: 8px; background: #fff;
}
.bds-btn-color:hover, .bds-btn-color.active { border-color: #0066cc; outline: 3px solid #ffcc00; outline-offset: 2px; }
.bds-color-preview { display: block; width: 100%; height: 100%; border-radius: 4px; }

/* ИНТЕРВАЛ БУКВ */
.bds-letter-spacing { display: flex; gap: 10px; }
.bds-btn-spacing {
    flex: 1; padding: 12px; background: #f5f5f5; border: 2px solid #ddd;
    border-radius: 5px; font-size: 16px; cursor: pointer; color: #333333 !important;
}
.bds-btn-spacing:hover, .bds-btn-spacing.active { background: #0066cc; color: #ffffff !important; border-color: #0066cc; }

/* ИНТЕРВАЛ СТРОК */
.bds-line-height { display: flex; gap: 10px; }
.bds-btn-line-height {
    flex: 1; padding: 12px; background: #f5f5f5; border: 2px solid #ddd;
    border-radius: 5px; font-size: 14px; font-weight: 600; cursor: pointer;
    color: #333333 !important;
}
.bds-btn-line-height:hover, .bds-btn-line-height.active { background: #0066cc; color: #ffffff !important; border-color: #0066cc; }

/* Кнопка изображений - ИСПРАВЛЕНО */
.bds-btn-images {
    width: 100%;
    padding: 15px 20px;
    background: #f5f5f5;
    border: 2px solid #dddddd;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    color: #333333 !important; /* ЧЁРНЫЙ текст по умолчанию */
    display: flex;
    align-items: center;
    gap: 10px;
}

.bds-btn-images svg {
    width: 20px;
    height: 20px;
    fill: #333333 !important; /* ЧЁРНАЯ иконка */
    flex-shrink: 0;
}

.bds-btn-images .bds-btn-text {
    color: #333333 !important; /* ЧЁРНЫЙ текст */
}

.bds-btn-images:hover,
.bds-btn-images.active {
    background: #0066cc !important;
    color: #ffffff !important;
    border-color: #0066cc !important;
}

.bds-btn-images:hover svg,
.bds-btn-images.active svg {
    fill: #ffffff !important; /* БЕЛАЯ иконка при наведении */
}

.bds-btn-images:hover .bds-btn-text,
.bds-btn-images.active .bds-btn-text {
    color: #ffffff !important; /* БЕЛЫЙ текст при наведении */
}

/* СИНТЕЗ РЕЧИ */
.bds-btn-speech {
    width: 100%; padding: 15px 20px; background: #28a745; border: none;
    border-radius: 5px; font-size: 14px; font-weight: 600; cursor: pointer;
    color: #ffffff !important;
}
.bds-btn-speech:hover { background: #218838; }

/* ПОДВАЛ */
.bds-panel-footer { padding: 20px; background: #f9f9f9; border-top: 1px solid #e0e0e0; flex-shrink: 0; }
.bds-btn-reset {
    width: 100%; padding: 15px 25px; background: #dc3545; color: #ffffff !important;
    border: none; border-radius: 5px; font-size: 16px; font-weight: 600; cursor: pointer;
}
.bds-btn-reset:hover { background: #c82333; }
.bds-btn-reset span { color: #ffffff !important; }

/* СТИЛИ ВЕРСИИ ДЛЯ СЛАБОВИДЯЩИХ */
body.bds-enabled { background-color: #ffffff !important; color: #000000 !important; }
body.bds-enabled a { color: #0000ee !important; text-decoration: underline !important; }
body.bds-enabled, body.bds-enabled *, body.bds-enabled *::before, body.bds-enabled *::after {
    font-family: Arial, Verdana, sans-serif !important;
}

/* Белый на чёрном */
body.bds-enabled.bds-scheme-white-black { background-color: #000000 !important; color: #ffffff !important; }
body.bds-enabled.bds-scheme-white-black a { color: #ffff00 !important; }
body.bds-enabled.bds-scheme-white-black .bds-side-panel,
body.bds-enabled.bds-scheme-white-black .bds-panel-wrapper,
body.bds-enabled.bds-scheme-white-black .bds-panel-content { background: #1a1a1a !important; color: #ffffff !important; }
body.bds-enabled.bds-scheme-white-black .bds-panel-header { background: #333333 !important; }
body.bds-enabled.bds-scheme-white-black .bds-control-label,
body.bds-enabled.bds-scheme-white-black .bds-panel-title,
body.bds-enabled.bds-scheme-white-black .bds-btn-text { color: #ffffff !important; }
body.bds-enabled.bds-scheme-white-black .bds-btn-font,
body.bds-enabled.bds-scheme-white-black .bds-btn-font-family,
body.bds-enabled.bds-scheme-white-black .bds-btn-spacing,
body.bds-enabled.bds-scheme-white-black .bds-btn-line-height,
body.bds-enabled.bds-scheme-white-black .bds-btn-images { background: #333333 !important; border-color: #555555 !important; color: #ffffff !important; }
body.bds-enabled.bds-scheme-white-black .bds-panel-footer { background: #222222 !important; border-top-color: #444444 !important; }

/* Синий на белом - ИСПРАВЛЕНО */
body.bds-enabled.bds-scheme-blue-white {
    background-color: #ffffff !important;
    color: #003366 !important;
}

body.bds-enabled.bds-scheme-blue-white a {
    color: #003366 !important;
    text-decoration: underline !important;
}

body.bds-enabled.bds-scheme-blue-white .bds-panel-header {
    background: #003366 !important;
    color: #ffffff !important;
}

body.bds-enabled.bds-scheme-blue-white .bds-panel-title,
body.bds-enabled.bds-scheme-blue-white .bds-panel-title svg {
    color: #ffffff !important;
    fill: #ffffff !important;
}

body.bds-enabled.bds-scheme-blue-white .bds-panel-close,
body.bds-enabled.bds-scheme-blue-white .bds-panel-close svg {
    color: #ffffff !important;
    fill: #ffffff !important;
}

body.bds-enabled.bds-scheme-blue-white .bds-control-label {
    color: #003366 !important;
}

body.bds-enabled.bds-scheme-blue-white .bds-btn-font,
body.bds-enabled.bds-scheme-blue-white .bds-btn-font-family,
body.bds-enabled.bds-scheme-blue-white .bds-btn-spacing,
body.bds-enabled.bds-scheme-blue-white .bds-btn-line-height {
    background: #f0f4f8 !important;
    border-color: #003366 !important;
    color: #003366 !important;
}

body.bds-enabled.bds-scheme-blue-white .bds-btn-font:hover,
body.bds-enabled.bds-scheme-blue-white .bds-btn-font.active,
body.bds-enabled.bds-scheme-blue-white .bds-btn-font-family:hover,
body.bds-enabled.bds-scheme-blue-white .bds-btn-font-family.active,
body.bds-enabled.bds-scheme-blue-white .bds-btn-spacing:hover,
body.bds-enabled.bds-scheme-blue-white .bds-btn-spacing.active,
body.bds-enabled.bds-scheme-blue-white .bds-btn-line-height:hover,
body.bds-enabled.bds-scheme-blue-white .bds-btn-line-height.active {
    background: #003366 !important;
    color: #ffffff !important;
}

body.bds-enabled.bds-scheme-blue-white .bds-btn-images {
    background: #f0f4f8 !important;
    border-color: #003366 !important;
    color: #003366 !important;
}

body.bds-enabled.bds-scheme-blue-white .bds-btn-images svg {
    fill: #003366 !important;
}

body.bds-enabled.bds-scheme-blue-white .bds-btn-images:hover,
body.bds-enabled.bds-scheme-blue-white .bds-btn-images.active {
    background: #003366 !important;
    color: #ffffff !important;
    border-color: #003366 !important;
}

body.bds-enabled.bds-scheme-blue-white .bds-btn-images:hover svg,
body.bds-enabled.bds-scheme-blue-white .bds-btn-images.active svg {
    fill: #ffffff !important;
}

body.bds-enabled.bds-scheme-blue-white .bds-btn-color {
    border-color: #003366 !important;
}

body.bds-enabled.bds-scheme-blue-white .bds-panel-footer {
    background: #f0f4f8 !important;
    border-top-color: #003366 !important;
}

body.bds-enabled.bds-scheme-blue-white .bds-btn-reset {
    background: #dc3545 !important;
    color: #ffffff !important;
}

body.bds-enabled.bds-scheme-blue-white .bds-color-label {
    color: #003366 !important;
}

/* Размер шрифта */
body.bds-enabled.bds-font-size-1 { font-size: 16px !important; line-height: 1.5 !important; }
body.bds-enabled.bds-font-size-2 { font-size: 22px !important; line-height: 1.6 !important; }
body.bds-enabled.bds-font-size-3 { font-size: 28px !important; line-height: 1.7 !important; }

/* Гарнитура с засечками */
body.bds-enabled.bds-font-serif, body.bds-enabled.bds-font-serif * {
    font-family: 'Times New Roman', Times, serif !important;
}

/* Интервал букв */
body.bds-enabled.bds-letter-spacing-normal * { letter-spacing: normal !important; }
body.bds-enabled.bds-letter-spacing-medium * { letter-spacing: 0.5px !important; }
body.bds-enabled.bds-letter-spacing-large * { letter-spacing: 1px !important; }

/* Интервал строк */
body.bds-enabled.bds-line-height-1 { line-height: 1 !important; }
body.bds-enabled.bds-line-height-1-5 { line-height: 1.5 !important; }
body.bds-enabled.bds-line-height-2 { line-height: 2 !important; }

/* Скрытие изображений */
body.bds-enabled.bds-no-images img:not(.bds-keep):not(.bds-shortcode-btn *):not(.bds-side-panel *) {
    display: none !important;
}

/* Классы совместимости с BVI */
.bds-enabled .bvi-hide, .bds-enabled .bds-hide { display: none !important; }
.bds-enabled .bvi-show, .bds-enabled .bds-show { display: block !important; }
.bds-enabled .bvi-no-styles, .bds-enabled .bds-no-styles,
.bds-enabled .bvi-no-styles *, .bds-enabled .bds-no-styles * { all: initial !important; }

/* Адаптивность */
@media (max-width: 768px) {
    .bds-side-panel { width: 300px; max-width: 85vw; }
    .bds-shortcode-btn .bds-btn-text { display: inline; }
    .bds-color-schemes { justify-content: center; }
}

/* Elementor */
body.bds-enabled .elementor *, body.bds-enabled .elementor *::before, body.bds-enabled .elementor *::after {
    transition: none !important; animation: none !important;
}
/* Подписи к цветовым схемам */
.bds-btn-color {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.bds-color-preview {
    display: block;
    width: 100%;
    height: 45px;
    border-radius: 4px;
}

.bds-color-label {
    font-size: 11px;
    font-weight: 600;
    color: #666;
    text-align: center;
}

.bds-scheme-white-black .bds-color-label {
    color: #ffffff;
}
/* ==========================================
   ПОЗИЦИОНИРОВАНИЕ КНОПКИ
   ========================================== */

/* Фиксированная позиция - верх справа */
.bds-fixed-top-right {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 999999;
}

/* Фиксированная позиция - низ справа */
.bds-fixed-bottom-right {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999999;
}

/* Фиксированная позиция - низ слева */
.bds-fixed-bottom-left {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 999999;
}

/* Фиксированная позиция - верх слева */
.bds-fixed-top-left {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 999999;
}

/* Скрытие текста кнопки */
.bds-hide-text .bds-btn-text {
    display: none;
}

.bds-hide-text .bds-shortcode-btn {
    padding: 12px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bds-hide-text .bds-icon {
    width: 28px;
    height: 28px;
    margin: 0;
}