/*
Theme Name: Viola Dentistry
Description: Общие стили и переменные
Version: 1.0.1
*/
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    overflow-x: hidden;
    /* Жестко отрезаем горизонтальный скролл */
}

/* ==========================================================================
   VARIABLES & BASE
   ========================================================================== */
:root {
    --c-primary: #A259E8;
    --c-primary-hover: #8D47D1;
    --c-primary-light: #F4EBF9;
    --c-dark: #373737;
    --c-text: #2B2B2B;
    --c-text-muted: #8E8E8E;
    --c-white: #FFFFFF;
    --c-border: #E8DDF2;
    --c-background: #ECDDF3;

    --font-main: 'Inter', sans-serif;
    --container-max: 1440px;
    --transition: all 0.3s ease;
}

body {
    font-family: var(--font-main);
    color: var(--c-text);
    background-color: var(--c-background);
    /* Глобальный фон всего сайта */
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    height: auto;
}

.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 20px;
}

/* ==========================================================================
   UI COMPONENTS
   ========================================================================== */
.title-h1 {
    font-size: clamp(32px, 4vw, 48px);
    font-weight: 700;
    line-height: 1.2;
    color: var(--c-dark);
    margin-top: 0;
    margin-bottom: 24px;
}

.title-h1__accent {
    color: var(--c-primary);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 32px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: var(--transition);
}

.btn--primary {
    background-color: var(--c-primary);
    color: var(--c-white);
}

.btn--primary:hover {
    background-color: var(--c-primary-hover);
    color: var(--c-white);
}

.btn--dark {
    background-color: var(--c-dark);
    color: var(--c-white);
}

.btn--dark:hover {
    opacity: 0.9;
    color: var(--c-white);
}

.check-list {
    list-style: none;
    padding: 0;
    margin: 0 0 32px 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.check-list__item {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 16px;
    font-weight: 500;
    color: var(--c-text);
}

.check-list__icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    background-color: var(--c-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--c-white);
}

/* ==========================================================================
   СТРАНИЦА 404
   ========================================================================== */
.page-404 {
    padding: 60px 0 100px 0;
    min-height: 70vh;
    /* Чтобы страница всегда занимала минимум 70% высоты экрана */
    display: flex;
    align-items: center;
}

.page-404__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
}

.page-404__content {
    flex: 1;
    max-width: 500px;
}

.page-404__code {
    font-size: clamp(80px, 8vw, 120px);
    font-weight: 800;
    color: var(--c-dark);
    line-height: 1;
    margin-bottom: 24px;
    letter-spacing: -2px;
}

.page-404__title {
    font-size: clamp(32px, 4vw, 42px);
    font-weight: 700;
    line-height: 1.2;
    color: var(--c-dark);
    margin-top: 0;
    margin-bottom: 40px;
}

.page-404__image {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

.page-404__image img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
}

/* ==========================================================================
   СТРАНИЦА "СПАСИБО ЗА ЗАЯВКУ"
   ========================================================================== */
.page-thanks {
    padding: 80px 0 100px 0;
    min-height: 70vh;
    display: flex;
    align-items: center;
}

.page-thanks__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.page-thanks__title {
    font-size: clamp(36px, 5vw, 56px);
    font-weight: 800;
    color: var(--c-dark);
    line-height: 1.2;
    margin-top: 0;
    margin-bottom: 16px;
}

.page-thanks__subtitle {
    font-size: clamp(16px, 2vw, 20px);
    font-weight: 600;
    color: var(--c-dark);
    margin-top: 0;
    margin-bottom: 40px;
}

.page-thanks__image {
    width: 100%;
    max-width: 450px;
    /* Ограничиваем ширину картинки для эстетики */
}

.page-thanks__image img {
    width: 100%;
    height: auto;
    display: block;
}

/* ==========================================================================
   АДАПТИВНОСТЬ ДЛЯ СТРАНИЦ 404 И СПАСИБО
   ========================================================================== */
@media (max-width: 991px) {
    .page-404__inner {
        flex-direction: column;
        text-align: center;
    }

    .page-404__content {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .page-404__image {
        justify-content: center;
        max-width: 400px;
        margin: 0 auto;
    }

    .page-404 {
        padding: 40px 0 60px 0;
    }

    .page-thanks {
        padding: 40px 0 60px 0;
    }
}

@media (max-width: 575px) {
    .page-thanks__image {
        max-width: 300px;
    }
}

/* ==========================================================================
   СТРАНИЦА УСЛУГИ: HERO БЛОК
   ========================================================================== */
.service-page {
    padding-bottom: 80px;
}

.service-hero {
    padding: 40px 0 60px 0;
}

.service-hero__title {
    color: var(--c-primary);
    /* Фиолетовый заголовок по макету */
    margin-bottom: 24px;
}

.service-hero__desc {
    font-size: 16px;
    line-height: 1.6;
    color: var(--c-dark);
}

.service-hero__thumb {
    width: 100%;
    border-radius: 32px;
    overflow: hidden;
    position: relative;
}

.service-hero__thumb img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

/* ==========================================================================
   ПРИМЕРЫ РАБОТ (ДО И ПОСЛЕ СЛАЙДЕР)
   ========================================================================== */
.service-portfolio {
    padding: 40px 0 60px 0;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

/* Контейнер ползунка */
.ba-slider {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 16px;
    user-select: none;
    -webkit-user-drag: none;
    cursor: col-resize;
    /* Курсор для перетаскивания */
}

/* Изображения внутри слайдера */
.ba-slider img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    /* Запрещаем тащить саму картинку браузером */
}

.ba-slider__after {
    position: relative;
    z-index: 1;
}

/* Блок "ДО", который обрезается ползунком */
.ba-slider__before-wrap {
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    /* По умолчанию ползунок по центру */
    height: 100%;
    overflow: hidden;
    z-index: 2;
}

/* ВАЖНО: Картинка "ДО" должна быть абсолютного размера родителя, иначе она сожмется */
.ba-slider__before {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    max-width: none;
}

/* Ползунок с кружком */
.ba-slider__handle {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    background-color: var(--c-white);
    transform: translateX(-50%);
    z-index: 3;
    pointer-events: none;
    /* События мыши ловит сам .ba-slider */
}

.ba-slider__handle-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid var(--c-white);
    border-radius: 50%;
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.ba-slider__handle-btn svg {
    width: 16px;
    margin: -4px;
    /* Чтобы стрелочки были ближе друг к другу */
}

/* ==========================================================================
   АДАПТИВНОСТЬ ДЛЯ УСЛУГ И ПОРТФОЛИО
   ========================================================================== */
@media (max-width: 991px) {
    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    .portfolio-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   СТИЛИ МОДАЛЬНОГО ОКНА ЗАПИСИ (VIOLA CRM)
   ========================================================================== */

/* Общая обертка контента окна */
#modalConsultation .modal-content {
    background: #131314 !important;
    /* Глубокий темный фон как на макете */
    border: 1px solid #27272a !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* Стили полей ввода */
#modalConsultation .form-control {
    background-color: #202022 !important;
    /* Чуть светлее фона для контраста */
    border: 1px solid #2e2e33 !important;
    color: #ffffff !important;
    font-size: 16px;
    transition: all 0.25s ease-in-out;
}

#modalConsultation .form-control:focus {
    background-color: #242427 !important;
    border-color: #a855f7 !important;
    /* Фиолетовое свечение при фокусе */
    box-shadow: 0 0 0 4px rgba(168, 85, 247, 0.15);
}

/* Плейсхолдеры (сероватый текст-подсказка) */
#modalConsultation .form-control::placeholder {
    color: #71717a !important;
    opacity: 1;
}

/* Кнопка отправки формы */
#modalConsultation .btn-submit-modal {
    background: #a855f7 !important;
    /* Яркий фиолетовый */
    color: #ffffff !important;
    border: none !important;
    transition: all 0.20s ease;
    box-shadow: 0 4px 14px rgba(168, 85, 247, 0.4);
}

#modalConsultation .btn-submit-modal:hover {
    background: #9333ea !important;
    /* Темнее при наведении */
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(168, 85, 247, 0.6);
}

#modalConsultation .btn-submit-modal:active {
    transform: translateY(1px);
}

#modalConsultation .btn-submit-modal:disabled {
    background: #52525b !important;
    box-shadow: none !important;
    cursor: not-allowed;
}

/* ==========================================================================
   КРЕСТИК ЗАКРЫТИЯ (SVG) И ЧЕКБОКС
   ========================================================================== */

/* Стили для нового крестика */
#modalConsultation .modal-close-btn {
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    color: #ffffff;
    /* Поставил чисто белый цвет, как на макете */
    padding: 0;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

#modalConsultation .modal-close-btn:hover {
    opacity: 0.8;
    transform: scale(1.1);
}

/* Кастомизация чекбокса согласия */
#modalConsultation .form-check-input {
    cursor: pointer;
}

#modalConsultation .form-check-input:checked {
    background-color: #a855f7 !important;
    border-color: #a855f7 !important;
}

#modalConsultation .form-check-label {
    cursor: pointer;
    user-select: none;
    padding-left: 10px;
    /* Отступ текста от чекбокса */
    font-size: 11px;
    color: #52525b;
    line-height: 1.3;
}

/* ==========================================================================
   АНИМАЦИЯ МАСКОТА НА КНОПКЕ В МОДАЛКЕ (ИСПРАВЛЕНО ЦЕНТРИРОВАНИЕ)
   ========================================================================== */

/* Контейнер кнопки */
#modalConsultation .modal-submit-wrapper {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
}

/* Кнопка должна лежать ПОВЕРХ маскота */
#modalConsultation .btn-submit-modal {
    position: relative;
    z-index: 5 !important;
}

/* Начальное состояние маскота (спрятан строго по центру за кнопкой) */
#modalConsultation .modal-mascot {
    position: absolute !important;
    left: 50% !important;
    bottom: 10% !important;
    transform: translateX(-50%) !important;
    /* Центрируем по горизонтали */
    width: 80px !important;
    /* Оптимальный размер по макету */
    height: auto !important;
    z-index: 1 !important;
    opacity: 0 !important;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    pointer-events: none !important;
}

/* Состояние при наведении (hover) с жестким сохранением центра */
#modalConsultation .modal-submit-wrapper:hover .modal-mascot {
    bottom: 83% !important;
    /* Выпрыгивает ровно над кнопкой */
    opacity: 1 !important;
    transform: translateX(-50%) !important;
}

/* На мобильных (где нет мышки) показываем сразу над кнопкой */
@media (max-width: 991px) {
    #modalConsultation .modal-mascot {
        bottom: 83% !important;
        opacity: 1 !important;
        transform: translateX(-50%) !important;
    }
}

/* Блок системных сообщений (ошибки / успех) */
#modalConsultation .form-messages span {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    animation: fadeInModalMsg 0.3s ease;
}

@keyframes fadeInModalMsg {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   ЖЕСТКИЙ ФИКС ДЛЯ МОДАЛКИ (ПРЯЧЕМ ЕЁ ИЗ ПОДВАЛА)
   ========================================================================== */

/* 1. Прячем форму до клика (пока Bootstrap не добавит ей класс .show) */
#modalConsultation:not(.show) {
    display: none !important;
}

/* 2. Отрываем окно от низа страницы и фиксируем поверх всего сайта */
#modalConsultation {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 10500 !important;
    background-color: rgba(0, 0, 0, 0.7) !important;
    /* Затемнение фона */
}

/* 3. Центрируем само окно по середине экрана */
#modalConsultation .modal-dialog {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 100vh !important;
    margin: 0 auto !important;
    max-width: 500px !important;
}


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

/* Фон всей секции с прайсами (светло-фиолетовый, как на скрине) */
.service-prices-section {
    background-color: #EBE4F0 !important;
    /* Цвет фона подбираем под макет */
    padding: 60px 0 !important;
}

/* Заголовки таблиц ("Общие позиции", "Рентгенологическая диагностика") */
.price-section__subtitle {
    font-size: 28px;
    font-weight: 600;
    color:  var(--c-primary);
    margin-top: 30px;
    margin-bottom: 20px; 

}

/* Стили для вложенных заголовков дочерних услуг (h3) */
.child-price h3.price-section__subtitle {
    color: var(--c-primary);
    /* Цвет текста (сделайте его отличным от главного h2) */
    font-size: 22px;
    /* Размер шрифта (меньше, чем у главного h2) */
    font-weight: 600;
    /* Насыщенность (полужирный) */
    margin-top: 20px;
    /* Отступ сверху от предыдущих элементов */
    margin-bottom: 15px;
    /* Отступ снизу до самой таблицы цен */
    letter-spacing: 0.5px;
    /* Межбуквенный интервал (по желанию) */
}

/* Стили только для главного заголовка секции (h2) */
h2.price-section__subtitle {

    color: var(--c-dark);
    /* Замените на нужный вам HEX-код цвета */
    font-size: 36px;
    /* Замените на нужный размер шрифта */
    font-weight: 700;
    /* Жирность шрифта (по желанию) */
    margin-bottom: 30px;
    /* Отступ снизу (по желанию) */
}

/* Убираем отступ сверху у самого первого заголовка */
.all-prices-wrapper .price-section:first-child .price-section__subtitle {
    margin-top: 0;
}

/* Обертка для самой таблицы (создаем ту самую белую плашку с закруглениями) */
.price-table-clean {
    background-color: #F8F5FA;
    /* Очень светлый оттенок внутри таблицы */
    border-radius: 16px;
    /* Закругление углов */
    overflow: hidden;
    /* Чтобы углы таблицы не выпирали за обертку */
    margin-bottom: 30px;
}

/* Сбрасываем стандартные стили таблиц */
.price-table-clean table {
    width: 100%;
    border-collapse: collapse;
    border: none;
    margin: 0;
    font-family: inherit;
}

/* Стилизация ячеек (отступы и только нижняя полоска) */
.price-table-clean table td,
.price-table-clean table th {
    padding: 24px 30px;
    border: none;
    border-bottom: 1px solid #E6DFEB;
    /* Цвет разделительной линии */
    text-align: left;
    vertical-align: middle;
    color: #212121;
    font-size: 15px;
    line-height: 1.5;
}

/* Убираем полоску у самой последней строки, чтобы она не подчеркивала пустоту */
.price-table-clean table tr:last-child td {
    border-bottom: none;
}

/* Настраиваем шапку таблицы (если в админке первая строка выделена жирным) */
.price-table-clean table tr:first-child td,
.price-table-clean table th {
    font-weight: 600;
    font-size: 16px;
}

/* --- НАСТРОЙКА КОЛОНОК ПОД ВАШИ ДАННЫЕ --- */

/* 1. Колонка с артикулом (B01.067...). На макете ее нет. 
   Если хотите ее скрыть полностью — раскомментируйте display: none; */
.price-table-clean table td:first-child {
    width: 15%;
    font-size: 14px;
    color: #777;
    /* display: none; */
}

/* 2. Колонка с названием услуги */
.price-table-clean table td:nth-child(2) {
    width: 65%;
}

/* 3. Колонка с ценой */
.price-table-clean table td:last-child {
    width: 20%;
    font-weight: 700;
    /* Делаем цену жирной, как на скрине */
    white-space: nowrap;
    /* Чтобы цена и валюта не переносились на разные строки */
}


/* ========================================= */
/* АДАПТИВНОСТЬ ДЛЯ МОБИЛЬНЫХ ТЕЛЕФОНОВ      */
/* ========================================= */
@media (max-width: 768px) {
    .service-prices-section {
        padding: 40px 0 !important;
    }

    .price-section__subtitle {
        font-size: 22px;
    }

    .price-table-clean table td,
    .price-table-clean table th {
        padding: 16px 20px;
        font-size: 14px;
    }

    /* На мобилках колонку с кодом точно лучше скрыть, чтобы сэкономить место */
    .price-table-clean table td:first-child {
        display: none;
    }

    .price-table-clean table td:nth-child(2) {
        width: 70%;
    }

    .price-table-clean table td:last-child {
        width: 30%;
        text-align: right;
        /* Прижимаем цену вправо */
    }
}