/* ========================================================================
   ОПТИМИЗИРОВАННАЯ ТЕМНАЯ ТЕМА ДЛЯ VIPLABELS
   ======================================================================== */

/* CSS переменные для цветов */
:root {
    /* Светлая тема (по умолчанию) */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --text-primary: #333333;
    --text-secondary: #666666;
    --border-color: #e0e0e0;
    --header-bg: #ffffff;
    --nav-bg: #ffffff;
    --card-bg: #ffffff;
    --shadow-color: rgba(0, 0, 0, 0.1);
}

/* Темная тема - темно-синяя цветовая схема */
body.dark-theme {
    --bg-primary: #0a1929;
    --bg-secondary: #1e293b;
    --text-primary: #ffffff;
    --text-secondary: #cbd5e1;
    --border-color: #334155;
    --header-bg: #0a1929;
    --nav-bg: #1e293b;
    --card-bg: #1e293b;
    --shadow-color: rgba(10, 25, 41, 0.4);
    --accent-color: #60a5fa;
    --accent-hover: #3b82f6;

    /* Основной градиентный фон */
    background: linear-gradient(135deg, #0a1929 0%, #1e293b 50%, #334155 100%) !important;
    background-attachment: fixed !important;
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* ========================================================================
   ТУМБЛЕР ТЕМНОЙ ТЕМЫ
   ======================================================================== */

.theme-toggle-container {
    margin-top: 20px;
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
}

.theme-toggle-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.theme-toggle-label {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    transition: color 0.3s ease;
}

.theme-toggle {
    position: relative;
    width: 60px;
    height: 30px;
    background-color: #ccc;
    border-radius: 30px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    border: 2px solid transparent;
}

.theme-toggle:hover {
    background-color: #bbb;
}

.theme-toggle.active {
    background-color: var(--accent-color);
}

.theme-toggle.active:hover {
    background-color: var(--accent-hover);
}

.theme-toggle-slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 26px;
    height: 26px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.theme-toggle.active .theme-toggle-slider {
    transform: translateX(30px);
}

/* ========================================================================
   КНОПКА "ОНЛАЙН ЗАКАЗ" - ИСПРАВЛЕНИЯ ДЛЯ ВИДИМОСТИ ТЕКСТА
   ======================================================================== */

/* Общие исправления для кнопки "Онлайн заказ" в светлой теме */
.online-btn,
.btn.white-btn,
a.online-btn,
a.btn.white-btn,
.mob_nav-list-wrap .online-btn,
.mob_nav-list-wrap a.online-btn,
.modile__nav .online-btn,
.modile__nav a.online-btn {
    position: relative !important;
    overflow: visible !important;
    text-indent: 0 !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
    white-space: nowrap !important;
}

.online-btn span,
.btn.white-btn span,
a.online-btn span,
a.btn.white-btn span {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: static !important;
    text-indent: 0 !important;
    overflow: visible !important;
    z-index: 1 !important;
    color: inherit !important;
}

/* Кнопка "Онлайн заказ" ТОЛЬКО для темной темы - оранжевая */
body.dark-theme .online-btn,
body.dark-theme .btn.white-btn,
body.dark-theme a.online-btn,
body.dark-theme a.btn.white-btn,
body.dark-theme .mob_nav-list-wrap .online-btn,
body.dark-theme .mob_nav-list-wrap a.online-btn,
body.dark-theme .modile__nav .online-btn,
body.dark-theme .modile__nav a.online-btn {
    background-color: #ff6b35 !important;
    color: #0a1929 !important;
    /* ТЕМНО-СИНИЙ текст на оранжевом фоне для лучшей видимости */
    border: 1px solid #e55a2b !important;
    font-weight: 700 !important;
    /* Увеличиваем жирность для лучшей видимости */
    text-decoration: none !important;
    display: inline-block !important;
    padding: 8px 16px !important;
    border-radius: 4px !important;
}

body.dark-theme .online-btn:hover,
body.dark-theme .btn.white-btn:hover,
body.dark-theme a.online-btn:hover,
body.dark-theme a.btn.white-btn:hover {
    background-color: #e55a2b !important;
    color: #0a1929 !important;
    /* ТЕМНО-СИНИЙ текст при hover тоже */
}

body.dark-theme .online-btn span,
body.dark-theme .btn.white-btn span,
body.dark-theme a.online-btn span,
body.dark-theme a.btn.white-btn span {
    color: #0a1929 !important;
    /* ТЕМНО-СИНИЙ текст для максимальной видимости */
    font-weight: 700 !important;
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    text-shadow: none !important;
    /* Убираем тени, которые могут мешать */
}

/* Убираем псевдоэлементы */
.online-btn::before,
.btn.white-btn::before,
a.online-btn::before,
a.btn.white-btn::before,
.online-btn::after,
.btn.white-btn::after,
a.online-btn::after,
a.btn.white-btn::after {
    content: none !important;
}

/* ========================================================================
   ОСНОВНЫЕ СТИЛИ ТЕМНОЙ ТЕМЫ
   ======================================================================== */

/* Фоновые изображения с инвертированными цветами */
body.dark-theme .wrapper,
body.dark-theme .wrapper__container,
body.dark-theme .main {
    background-blend-mode: overlay !important;
    background-color: rgba(10, 25, 41, 0.6) !important;
}

body.dark-theme [style*="background-image"],
body.dark-theme .bg-image,
body.dark-theme .hero-section,
body.dark-theme .main-banner {
    filter: brightness(0.8) contrast(1.3) hue-rotate(200deg) saturate(0.8) !important;
    transition: filter 0.3s ease !important;
}

/* Текст и заголовки */
body.dark-theme h1,
body.dark-theme h2,
body.dark-theme h3,
body.dark-theme h4,
body.dark-theme h5,
body.dark-theme h6,
body.dark-theme p,
body.dark-theme span,
body.dark-theme div,
body.dark-theme li {
    color: var(--text-primary);
}

/* Ссылки */
body.dark-theme a {
    color: var(--accent-color);
}

body.dark-theme a:hover {
    color: var(--accent-hover);
}

/* Контейнеры и блоки */
body.dark-theme .header,
body.dark-theme .header__nav,
body.dark-theme .nav,
body.dark-theme .mob_nav-cntr,
body.dark-theme .header__menu,
body.dark-theme .menu {
    background-color: var(--nav-bg);
    border-color: var(--border-color);
}

body.dark-theme .card,
body.dark-theme .block,
body.dark-theme .section,
body.dark-theme .form-field,
body.dark-theme .zakazform-container,
body.dark-theme .content,
body.dark-theme .main-content {
    background-color: var(--card-bg);
    border-color: var(--border-color);
}

body.dark-theme .footer {
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
}

/* Формы */
body.dark-theme input,
body.dark-theme textarea,
body.dark-theme select,
body.dark-theme .form-control,
body.dark-theme .custom-select {
    background-color: var(--card-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

body.dark-theme input:focus,
body.dark-theme textarea:focus,
body.dark-theme select:focus,
body.dark-theme .form-control:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.2);
}

/* Кнопки (кроме онлайн заказа) */
body.dark-theme .btn:not(.online-btn):not(.white-btn) {
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-hover) 100%);
    border: none;
    color: white;
    font-weight: 500;
    transition: all 0.3s ease;
}

body.dark-theme .btn:not(.online-btn):not(.white-btn):hover {
    background: linear-gradient(135deg, var(--accent-hover) 0%, var(--accent-color) 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(96, 165, 250, 0.3);
}

/* Навигация и меню */
body.dark-theme .header__link,
body.dark-theme .header__menu-item,
body.dark-theme .header__phone,
body.dark-theme .phone-number {
    color: var(--text-primary);
}

body.dark-theme .header__link:hover,
body.dark-theme .header__menu-item:hover {
    color: var(--accent-color);
}

/* Выпадающие меню */
body.dark-theme .header__popover,
body.dark-theme .header__popover2,
body.dark-theme .header__popover3,
.header__popover,
.header__popover2,
.header__popover3 {
    background-color: var(--nav-bg);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px var(--shadow-color);
    width: 100% !important;
    max-width: 300px !important;
    left: 0 !important;
    right: auto !important;
}

/* Мобильное меню */
body.dark-theme .modile__nav.show .mob_nav-cntr {
    background: linear-gradient(135deg, var(--nav-bg) 0%, var(--bg-primary) 100%);
    backdrop-filter: blur(10px);
    border-right: 1px solid var(--border-color);
    box-shadow: 2px 0 20px var(--shadow-color);
}

body.dark-theme .burger-btn strong,
body.dark-theme .burger-btn {
    color: var(--text-primary);
}

body.dark-theme .burger-btn span {
    background-color: var(--text-primary);
}

body.dark-theme .mobile-social-container {
    background-color: transparent;
    border-top: 1px solid var(--border-color);
}

/* Социальные иконки */
body.dark-theme .service__link img,
body.dark-theme .social img {
    filter: brightness(1.3) contrast(1.1);
    transition: filter 0.3s ease;
}

body.dark-theme .service__link:hover img,
body.dark-theme .social:hover img {
    filter: brightness(1.5) contrast(1.2);
}

body.dark-theme .service__link {
    background-color: rgba(96, 165, 250, 0.1);
    border-radius: 50%;
    padding: 8px;
    transition: all 0.3s ease;
}

body.dark-theme .service__link:hover {
    background-color: rgba(96, 165, 250, 0.2);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(96, 165, 250, 0.2);
}

/* Летающий баннер */
body.dark-theme #flyout-promo.flyout-promo {
    background: linear-gradient(135deg, var(--nav-bg) 0%, var(--bg-primary) 100%);
    border-color: var(--border-color);
    box-shadow: 0 4px 16px var(--shadow-color);
}

body.dark-theme #flyout-promo .flyout-promo-text {
    color: var(--text-primary);
}

body.dark-theme #flyout-promo .flyout-promo-small-text {
    color: var(--text-secondary);
}

/* Таблицы */
body.dark-theme table {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
}

body.dark-theme th {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
}

body.dark-theme td {
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

/* Модальные окна и всплывающие элементы */
body.dark-theme .modal,
body.dark-theme .popup,
body.dark-theme .tooltip,
body.dark-theme .notification,
body.dark-theme .toast {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    box-shadow: 0 8px 32px var(--shadow-color);
}

/* Специальные элементы */
body.dark-theme .highlight,
body.dark-theme .featured,
body.dark-theme .accent,
body.dark-theme .highlight-text,
body.dark-theme .price,
body.dark-theme .breadcrumbs a {
    color: var(--accent-color);
}

body.dark-theme .highlight,
body.dark-theme .featured {
    background-color: var(--bg-secondary);
    border-left: 4px solid var(--accent-color);
}

/* Пагинация */
body.dark-theme .pagination a {
    background-color: var(--card-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

body.dark-theme .pagination a:hover,
body.dark-theme .pagination .active {
    background-color: var(--accent-color);
    color: white;
}

/* Слайдеры */
body.dark-theme .slick-dots li button {
    background-color: var(--border-color);
}

body.dark-theme .slick-dots li.slick-active button {
    background-color: var(--accent-color);
}

/* Изображения */
body.dark-theme img:not(.service__link img):not(.flyout-promo-logo) {
    filter: brightness(0.9) contrast(1.1);
    transition: filter 0.3s ease;
}

body.dark-theme img:not(.service__link img):not(.flyout-promo-logo):hover {
    filter: brightness(1) contrast(1.2);
}

body.dark-theme .header__logo,
body.dark-theme .logo {
    filter: brightness(1.2) contrast(1.1);
}

/* Разделители */
body.dark-theme hr,
body.dark-theme .divider {
    border-color: var(--border-color);
}

/* Тени */
body.dark-theme .shadow,
body.dark-theme .box-shadow {
    box-shadow: 0 4px 6px var(--shadow-color);
}

/* ========================================================================
   АДАПТИВНОСТЬ ДЛЯ МОБИЛЬНЫХ УСТРОЙСТВ
   ======================================================================== */

@media (max-width: 768px) {
    .theme-toggle-container {
        padding: 12px 15px;
        margin-top: 15px;
    }

    .theme-toggle-label {
        font-size: 14px;
    }

    .theme-toggle {
        width: 50px;
        height: 25px;
    }

    .theme-toggle-slider {
        width: 21px;
        height: 21px;
        top: 2px;
        left: 2px;
    }

    .theme-toggle.active .theme-toggle-slider {
        transform: translateX(25px);
    }

    body.dark-theme .mobile-header {
        background-color: var(--header-bg);
        border-bottom: 1px solid var(--border-color);
    }

    .online-btn,
    .btn.white-btn,
    a.online-btn,
    a.btn.white-btn {
        font-size: 12px !important;
        padding: 6px 12px !important;
    }
}