/* Стили для компонентов шаблона MODX */

/* Формы */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.form-control.error {
    border-color: #dc3545;
}

/* Кнопки */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* Small phones */
@media (max-width: 480px) {
    .btn { padding: 0.7rem 0.8rem; font-size: 0.9rem; }
}

.btn-primary {
    background-color: #007bff;
    color: #fff;
}

.btn-primary:hover {
    background-color: #0056b3;
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: #6c757d;
    color: #fff;
}

.btn-secondary:hover {
    background-color: #545b62;
}

.btn-success {
    background-color: #28a745;
    color: #fff;
}

.btn-success:hover {
    background-color: #1e7e34;
}

.btn-danger {
    background-color: #dc3545;
    color: #fff;
}

.btn-danger:hover {
    background-color: #c82333;
}

/* Алерты */
.alert {
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 4px;
}

.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.alert-warning {
    color: #856404;
    background-color: #fff3cd;
    border-color: #ffeaa7;
}

.alert-info {
    color: #0c5460;
    background-color: #d1ecf1;
    border-color: #bee5eb;
}

/* Карточки */
.card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
}

.card-header {
    padding: 1rem;
    background-color: #f8f9fa;
    border-bottom: 1px solid #ddd;
}

.card-body {
    padding: 1rem;
}

.card-footer {
    padding: 1rem;
    background-color: #f8f9fa;
    border-top: 1px solid #ddd;
}

/* Сетка */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -15px;
}

.col {
    flex: 1;
    padding: 0 15px;
}

.col-1 { flex: 0 0 8.333333%; }
.col-2 { flex: 0 0 16.666667%; }
.col-3 { flex: 0 0 25%; }
.col-4 { flex: 0 0 33.333333%; }
.col-5 { flex: 0 0 41.666667%; }
.col-6 { flex: 0 0 50%; }
.col-7 { flex: 0 0 58.333333%; }
.col-8 { flex: 0 0 66.666667%; }
.col-9 { flex: 0 0 75%; }
.col-10 { flex: 0 0 83.333333%; }
.col-11 { flex: 0 0 91.666667%; }
.col-12 { flex: 0 0 100%; }

/* Таблицы */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.table th,
.table td {
    padding: 0.75rem;
    border-bottom: 1px solid #ddd;
    text-align: left;
}

.table th {
    background-color: #f8f9fa;
    font-weight: 600;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0,0,0,0.05);
}

/* Пагинация */
.pagination {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 2rem 0;
    justify-content: center;
    gap: 0.25rem;
}

.pagination li {
    margin: 0;
}

.pagination a,
.pagination span {
    display: block;
    padding: 0.5rem 0.75rem;
    text-decoration: none;
    border: 1px solid #ddd;
    color: #007bff;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.pagination a:hover {
    background-color: #e9ecef;
    border-color: #dee2e6;
}

.pagination .active span {
    background-color: #007bff;
    border-color: #007bff;
    color: #fff;
}

.pagination .disabled span {
    color: #6c757d;
    pointer-events: none;
    background-color: #fff;
    border-color: #dee2e6;
}

/* Модальные окна */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal.show {
    display: block;
}

.modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 0;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.modal-header {
    padding: 1rem;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: 1rem;
}

.modal-footer {
    padding: 1rem;
    border-top: 1px solid #ddd;
    text-align: right;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
}

.modal-close:hover {
    color: #333;
}

/* Утилиты для компонентов */
.text-muted { color: #6c757d; }
.text-primary { color: #007bff; }
.text-success { color: #28a745; }
.text-danger { color: #dc3545; }
.text-warning { color: #ffc107; }
.text-info { color: #17a2b8; }

.bg-light { background-color: #f8f9fa; }
.bg-primary { background-color: #007bff; }
.bg-success { background-color: #28a745; }
.bg-danger { background-color: #dc3545; }
.bg-warning { background-color: #ffc107; }
.bg-info { background-color: #17a2b8; }

.border { border: 1px solid #dee2e6; }
.border-top { border-top: 1px solid #dee2e6; }
.border-bottom { border-bottom: 1px solid #dee2e6; }
.border-left { border-left: 1px solid #dee2e6; }
.border-right { border-right: 1px solid #dee2e6; }

.rounded { border-radius: 4px; }
.rounded-circle { border-radius: 50%; }
.rounded-pill { border-radius: 50rem; }

.shadow { box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,0.075); }
.shadow-sm { box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,0.075); }
.shadow-lg { box-shadow: 0 1rem 3rem rgba(0,0,0,0.175); }

/* Адаптивность для компонентов */
@media (max-width: 768px) {
    /* Уменьшаем логотип */
    .logo img { height: 34px !important; }
    .row {
        flex-direction: column;
    }
    
    .col {
        margin-bottom: 1rem;
    }
    
    .table-responsive {
        overflow-x: auto;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
}

/* Header Styles */
.site-header {
    background-color: var(--bg-light);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.header-top-bar {
    background-color: var(--primary-color);
    color: var(--text-light);
    padding: 5px 0;
    font-size: 14px;
    text-align: center;
}

.header-top-bar p {
    font-size: 14px;
    font-weight: 400;
}

.header-main {
    padding: 20px 0;
}

.header-main-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: nowrap;
}

.logo img {
    height: 53px;
}

.header-contact a {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 14px;
    line-height: 1.4;
}

.header-search {
    display: flex;
    border: 1px solid var(--border-color);
    border-radius: 5px;
}

.header-search input {
    border: none;
    padding: 10px;
    font-size: 14px;
    outline: none;
}

.header-search button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0 10px;
}

.header-phone a {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
}

.header-phone span {
    font-size: 14px;
    color: var(--text-gray);
    display: block;
}

.header-social {
    display: flex;
    gap: 10px;
}

.header-social img {
    width: 25px;
    height: 25px;
}

.header-main .btn {
    white-space: nowrap;
    min-width: 180px;
}

.header-nav {
    border-top: 1px solid var(--border-color);
}

.header-nav nav ul {
    display: flex;
    justify-content: center;
    gap: 40px;
    list-style: none;
    margin: 0;
    padding: 15px 0;
    flex-wrap: wrap;
}

.header-nav nav a {
    font-weight: 500;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.header-nav nav img {
    transform: rotate(90deg);
}

/* Mobile menu toggle button */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 25px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1000;
}

.mobile-menu-toggle span {
    width: 100%;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Header nav container fixes for dropdowns */
.header-nav { position: relative; z-index: 60; }
.header-nav .header-nav-menu { overflow: visible; }

/* Dropdown header menu (static nav-menu) */
.wrapper.nav-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 24px;
}

.nav-menu__item { position: relative; z-index: 50; }

.nav-menu__link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 0;
    font-weight: 500;
    font-size: 14px;
    color: var(--text-dark);
}

.nav-menu--has-parent {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--text-dark);
    border-bottom: 2px solid var(--text-dark);
    transform: rotate(45deg);
    margin-left: 6px;
}

/* Level 1 dropdown */
.subnav { position: absolute; z-index: 1000; }
.nav-menu__item { z-index: 50; }

/* First-level dropdown grid */
.nav-menu__item:hover > .subnav {
    display: grid;
    grid-template-columns: repeat(3, minmax(305px, 1fr));
    gap: 16px 24px;
    padding: 20px;
    min-width: 980px;
    position: absolute;
    background: #ffffff; /* white background */
    margin-left: -30px;
    border: 1px solid var(--border-color);
}

/* Flyout (level 2) positioned relative to hovered item, above grid */
.subnav__item { position: relative; z-index: 51; }
.subnav__item.with-childrens { z-index: 2000; }
.subnav__item.with-childrens > .subnav {
    position: absolute;
    top: -8px;
    left: calc(100% + 10px);
    min-width: 520px;
    padding: 16px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    z-index: 2100; /* above grid */
    display: none;
}

/* Show nested dropdown and layout as grid */
.subnav__item.with-childrens:hover > .subnav {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 12px 16px;
}

/* Avoid overlap flicker by keeping hover gap */
.subnav__item.with-childrens { padding-right: 8px; }

.subnav__item { position: relative; }

.subnav__link {
    display: block;
    padding: 10px 16px;
    white-space: nowrap;
    font-size: 14px;
    color: var(--text-dark);
}

.subnav__link:hover {
    background: rgba(0,87,255,0.06);
    color: var(--primary-color);
}

/* Show dropdown on hover (desktop) */
.nav-menu__item:hover > .subnav,
.subnav__item.with-childrens:hover > .subnav { display: block; }

/* Animations: keep top-level visible; animate only dropdown items */
.animated { transition: all 0.2s ease; }
/* Do NOT hide top level items */
.fadeInDownCustom { transform: none; opacity: 1; }
/* Hidden state only for items inside dropdowns */
.subnav .fadeInDownCustom { transform: translateY(-4px); opacity: 0; }
.nav-menu__item:hover > .subnav .fadeInDownCustom,
.subnav__item.with-childrens:hover > .subnav .fadeInDownCustom { transform: translateY(0); opacity: 1; }

/* Mobile (use existing mobile menu container) */
@media (max-width: 768px) {
    .wrapper.nav-menu { flex-direction: column; align-items: stretch; gap: 0; }
    .nav-menu__link { padding: 14px 0; font-size: 16px; }
    /* По умолчанию скрыты подменю, открываются классом .open */
    .subnav { position: static; display: none; box-shadow: none; border: none; border-radius: 0; padding: 0 0 8px 12px; background: transparent; }
    /* Контейнер меню прокручиваемый */
    .header-nav-menu { max-height: 100vh; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: 80px; }
}

/* Footer Styles */
.site-footer {
    background-color: var(--bg-light);
    padding-top: 0;
}

.footer-top-bar {
    background-color: var(--primary-color);
    color: var(--text-light);
    padding: 5px 0;
    font-size: 14px;
    text-align: center;
}

.footer-top-bar p {
    font-size: 14px;
}

.footer-main {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    padding: 40px 15px;
}

.footer-logo {
    height: 53px;
    margin-bottom: 20px;
}

.footer-legal p {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-gray);
    margin-bottom: 10px;
}

.footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.footer-col ul a {
    font-size: 16px;
    font-weight: 400;
}

.footer-contact {
    margin-bottom: 20px;
}

.footer-contact p {
    font-size: 12px;
    color: var(--text-gray);
    font-weight: 500;
}

.footer-contact a {
    font-size: 18px;
    font-weight: 500;
    color: var(--primary-color);
}

.footer-col .btn {
    width: 100%;
    margin-bottom: 15px;
}

.footer-social {
    display: flex;
    gap: 10px;
}

.footer-social img {
    width: 60px;
    height: 60px;
}

.footer-payment {
    display: flex;
    align-items: center;
    gap: 20px;
    padding-bottom: 20px;
    flex-wrap: wrap;
}

.footer-payment span {
    color: var(--primary-color);
    font-weight: 500;
}

.footer-payment .payment-icons {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.footer-payment .payment-icons img {
    height: 30px;
}

.footer-copyright {
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
}

.footer-copyright p {
    font-size: 14px;
    color: var(--text-gray);
    line-height: 1.2;
    margin-bottom: 10px;
}

/* Hero Section Styles */
#hero {
    background: linear-gradient(6deg, #8db4ff 0%, #0057ff 100.63%);
    padding: 80px 0;
    position: relative;
    color: var(--text-light);
    border-radius: 0 0 24px 24px;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.2;
    overflow: hidden;
}

.hero-bg img {
    width: 100%;
    height: auto;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 830px;
}

.hero-doctor-image {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    max-width: 45%;
}

.hero-doctor-image img {
    width: 100%;
    height: auto;
    max-width: 400px;
}

#hero h1 {
    font-size: 40px;
    font-weight: 700;
    line-height: 1.125;
    margin-bottom: 40px;
}

.hero-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
    margin-bottom: 40px;
}

.feature-item {
    background-color: var(--bg-light);
    color: #242424;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 16px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 18px;
}

.feature-item img {
    background-color: var(--primary-color);
    border-radius: 50%;
    padding: 2px;
}

/* Intro Section Styles */
#intro {
    padding: 40px 0;
}

#intro p {
    text-align: center;
    max-width: 1100px;
    margin: 0 auto;
}

/* Services Section Styles */
.services-section h2 {
    text-align: left;
    margin-bottom: 40px;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 520px));
    gap: 30px;
    margin-bottom: 40px;
    justify-content: center;
}

.service-card {
    background-color: var(--bg-light);
    border-radius: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
}

.service-card .card-header {
    background-color: var(--primary-color);
    color: var(--text-light);
    padding: 30px;
    border-radius: 30px 30px 0 0;
    text-align: center;
}

.service-card h3 {
    font-size: 27px;
    font-weight: 500;
}

.service-list {
    list-style: none;
    padding: 30px;
    margin: 0;
    flex-grow: 1;
}

.service-list li {
    font-size: 22px;
    font-weight: 500;
    padding-left: 20px;
    position: relative;
    margin-bottom: 15px;
}

.service-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    background-color: var(--text-dark);
    border-radius: 50%;
}

.service-card .btn {
    margin: 0 30px 30px;
}

.slider-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    max-width: 550px;
}

/* Slider container styles */
#tariffs .tariffs-grid,
#amenities .gallery-grid {
    overflow: hidden;
}

/* Slider functionality styles */
.services-grid {
    transition: transform 0.3s ease;
    display: flex !important;
    gap: 30px;
    width: max-content;
}

.tariffs-grid,
.gallery-grid {
    transition: transform 0.3s ease;
    overflow: hidden;
    display: flex !important;
    gap: 30px;
    width: max-content;
}

/* Services slider container for centering */
#services .container {
    position: relative;
}

#services .services-grid {
    justify-content: flex-start;
}

/* Services section overflow */
#services {
    overflow: hidden;
}

.services-grid .service-card,
.gallery-grid img {
    flex-shrink: 0;
    width: 520px;
    max-width: 520px;
}

.tariffs-grid .tariff-card {
    flex-shrink: 0;
    width: calc((100vw - 60px) / 4);
}

.doctors-grid .doctor-card {
    width: calc((100vw - 60px) / 4);
}


/* Override grid display for sliders */
.tariffs-grid {
    display: flex !important;
    grid-template-columns: none !important;
}

/* Slider Controls Styles */
.arrow-btn {
    background: none;
    border: none;
    cursor: pointer;
}

.slider-progress {
    flex-grow: 1;
}

.slider-progress span {
    font-family: 'Inter', sans-serif;
    font-size: 24px;
}

.progress-bar-bg {
    background-color: rgba(30, 30, 30, 0.1);
    height: 3px;
    border-radius: 2px;
    margin-top: 5px;
}

.progress-bar-fg {
    background-color: var(--primary-color);
    height: 100%;
    width: 50%;
    border-radius: 2px;
}

/* CTA Form Section Styles */
.cta-form-section {
    background-color: var(--primary-color);
    border-radius: 24px;
    padding: 60px 0;
    margin: 0 15px;
}

.cta-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

.cta-content {
    color: var(--text-light);
    position: relative;
    z-index: 2;
    max-width: 580px;
}

.cta-content h2 {
    color: var(--text-light);
    margin-bottom: 40px;
}

.form-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
}

.cta-content form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.cta-content input {
    background-color: transparent;
    border: 1px solid var(--text-light);
    border-radius: 50px;
    padding: 18px 20px;
    color: var(--text-light);
    font-size: 18px;
}

.cta-content input::placeholder {
    color: var(--text-light);
    opacity: 0.8;
}

.cta-content .btn {
    align-self: flex-start;
}

.privacy-text {
    font-size: 12px;
    line-height: 1.4;
    opacity: 0.8;
}

.cta-image {
    position: absolute;
    right: 0;
    bottom: -60px;
    z-index: 1;
}

.cta-image img {
    max-width: 426px;
    height: auto;
}

.cta-bg {
    position: absolute;
    top: -100px;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.1;
    overflow: hidden;
}

.cta-bg img {
    width: 100%;
    height: auto;
}

/* Advantages Section Styles */
.advantages-section h2 {
    margin-bottom: 70px;
}

.advantages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 80px 40px;
}

.advantage-item {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.advantage-item img {
    width: 74px;
    height: 74px;
    margin-bottom: 20px;
}

.advantage-item h3 {
    font-size: 18px;
    font-weight: 700;
}

.advantage-item p {
    font-size: 18px;
    line-height: 1.4;
}

/* Pricing Section Styles */
.pricing-section h2 {
    margin-bottom: 40px;
}

.pricing-table {
    border: 1px solid rgba(51, 51, 51, 0.2);
    border-radius: 20px;
    overflow: hidden;
}

.pricing-tabs {
    display: flex;
    background-color: rgba(255, 255, 255, 0.1);
}

.tab-btn {
    flex: 1;
    padding: 20px;
    background-color: transparent;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    color: rgba(51, 51, 51, 0.8);
    border-bottom: 1px solid rgba(51, 51, 51, 0.2);
}

.tab-btn.active {
    color: #5c5c5c;
    border: 1px solid var(--primary-color);
    border-bottom: none;
    border-radius: 20px 0 0 0;
    background-color: var(--bg-light);
    position: relative;
    z-index: 1;
}

.tab-btn:hover:not(.active) {
    background-color: rgba(0, 87, 255, 0.1);
    color: var(--primary-color);
}

.table-header {
    display: flex;
    justify-content: space-between;
    background-color: var(--primary-color);
    color: var(--text-light);
    padding: 15px 30px;
    font-weight: 500;
}

.table-row {
    display: flex;
    justify-content: space-between;
    padding: 15px 30px;
    color: rgba(51, 51, 51, 0.8);
}

.table-row:nth-child(even) {
    background-color: #f9f9f9;
}

.table-footer {
    padding: 20px;
    text-align: center;
    color: var(--primary-color);
    font-weight: 500;
    border-top: 1px solid rgba(51, 51, 51, 0.2);
}

.payment-info {
    margin-top: 20px;
    background-color: var(--primary-color);
    color: var(--text-light);
    border-radius: 30px;
    padding: 15px 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.payment-icons {
    background-color: var(--bg-light);
    border-radius: 20px;
    padding: 5px 15px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.payment-icons img {
    height: 25px;
}

.merged-icon-wrapper {
    position: relative;
    display: inline-block;
}

.merged-icon-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
}

/* About Section Styles */
.about-title {
    text-align: center;
    margin-bottom: 40px;
}

.about-content {
    display: flex;
    gap: 30px;
}

.about-tabs {
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex-shrink: 0;
}

.about-tab-btn {
    width: 263px;
    padding: 16px;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    text-align: center;
}

.about-tab-btn.active {
    background-color: var(--primary-color);
    color: var(--text-light);
}

.about-tab-btn:not(.active) {
    background-color: #f7f7f7;
    color: #474747;
}

.about-text h3 {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.about-text p {
    font-size: 16px;
    line-height: 1.56;
}

.about-text a {
    text-decoration: underline;
}

/* Promotions Section Styles */
.promotions-section h2 {
    margin-bottom: 40px;
}

.promotions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.promo-card {
    border-radius: 8px;
    padding: 16px;
    color: var(--text-light);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 250px;
}

.promo-1 {
    background: linear-gradient(204deg, #0057ff 0%, #b2ff00 213.61%);
}

.promo-2 {
    background: linear-gradient(31deg, #0057ff 0%, #ff8000 190.26%);
}

.promo-text {
    font-size: 24px;
    font-weight: 600;
    line-height: 1.6;
}

.promo-discount {
    font-size: 96px;
    font-weight: 600;
    line-height: 1.2;
}

/* Tariffs Section Styles */
.tariffs-section h2 {
    margin-bottom: 40px;
}

.tariffs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.tariff-card {
    background-color: var(--bg-light);
    border-radius: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
}

.tariff-card .card-header {
    background-color: var(--primary-color);
    color: var(--text-light);
    padding: 20px;
    border-radius: 30px 30px 0 0;
    text-align: center;
    min-height: 144px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tariff-card h3 {
    font-size: 27px;
    font-weight: 500;
    line-height: 1.1;
    color: #ffffff;
}

.card-price {
    padding: 20px 30px;
    font-size: 24px;
    font-weight: 500;
    color: rgba(51, 51, 51, 0.8);
    border-bottom: 1px solid var(--border-color);
}

.tariff-card .btn {
    margin: 15px 30px 30px;
}

/* Doctors Section Styles */
.doctors-section h2 {
    margin-bottom: 40px;
}

.doctors-slider {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 40px;
}

.doctors-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    flex-grow: 1;
    overflow: hidden;
}

.doctor-card {
    border: 1px solid var(--primary-color);
    background-color: #f2f7f9;
    border-radius: 16px;
    overflow: hidden;
}

.doctor-card img {
    width: 100%;
    height: 300px;
    object-fit: cover;
}

.doctor-info {
    padding: 20px;
}

.doctor-info h3 {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 10px;
}

.doctor-info p {
    font-size: 16px;
    line-height: 1.5;
}

.doctors-cta {
    text-align: center;
}

/* Rehabilitation Section Styles */
.rehab-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    align-items: flex-start;
}

.rehab-text-content .lead {
    font-size: 24px;
    line-height: 1.4;
    margin: 25px 0;
}

.rehab-text-content p {
    font-size: 18px;
    line-height: 1.4;
}

.rehab-quote-card {
    background-color: var(--bg-light);
    box-shadow: 0px 4px 25px 0px rgba(0, 0, 0, 0.08);
    padding: 20px;
    border-radius: 8px;
    margin-top: 30px;
}

.rehab-quote-card p {
    font-size: 16px;
    line-height: 1.4;
    margin-bottom: 20px;
}

.author {
    display: flex;
    align-items: center;
    gap: 15px;
}

.author img {
    width: 52px;
    height: 52px;
    border-radius: 50%;
}

.author-info strong {
    font-size: 14px;
    font-weight: 400;
    display: block;
}

.author-info span {
    font-size: 12px;
    color: var(--text-gray);
}

.rehab-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 60px;
}

.stat-item .stat-number {
    font-size: 64px;
    color: var(--primary-color);
    font-weight: 400;
    line-height: 1.4;
}

.stat-item .stat-label {
    font-size: 20px;
    line-height: 1.4;
}

/* Rehab Program Section Styles */
.rehab-program-section {
    background-color: var(--primary-color);
    color: var(--text-light);
}

.rehab-program-content {
    position: relative;
}

.rehab-program-images {
    display: flex;
    gap: 30px;
    margin-bottom: -150px; /* Overlap effect */
    position: relative;
    z-index: 1;
}

.merged-image-container {
    position: relative;
    flex: 1;
}

.merged-image-container .base-image {
    width: 100%;
    height: auto;
    display: block;
}

.merged-image-container .overlay-svg {
    position: absolute;
    bottom: -14px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
}

.rehab-program-text {
    padding: 200px 0 40px;
    font-size: 34px;
    line-height: 1.4;
}

.rehab-program-text p {
    font-size: 34px;
    line-height: 1.4;
    margin-bottom: 40px;
}

.rehab-program-text strong {
    font-weight: 700;
}

/* Amenities Section Styles */
.amenities-section h3 {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.4;
    max-width: 790px;
    margin-bottom: 60px;
}

.amenities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 60px;
}

.amenity-item {
    display: flex;
    align-items: center;
    gap: 20px;
}

.amenity-item img {
    height: 60px;
    width: auto;
}

.amenity-item span {
    font-size: 18px;
    font-weight: 500;
    line-height: 1.4;
}

.gallery-slider {
    display: flex;
    align-items: center;
    gap: 20px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    flex-grow: 1;
}

.gallery-grid img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 8px;
}

/* Intervention Section Styles */
.intervention-section h2 {
    text-align: center;
    margin-bottom: 60px;
}

.intervention-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    align-items: flex-start;
}

.step-item {
    text-align: center;
}

.step-number {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: var(--text-light);
    font-size: 48px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.step-item p {
    font-size: 16px;
    font-weight: 500;
    line-height: 1.56;
    max-width: 230px;
    margin: 0 auto;
}

/* FAQ Section Styles */
.faq-section h2 {
    margin-bottom: 10px;
}

.subtitle {
    font-size: 30px;
    font-weight: 500;
    margin-bottom: 40px;
}

.faq-accordion {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.faq-item {
    border: 1px solid var(--border-color);
    padding: 20px;
}

.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.faq-question:hover {
    background-color: rgba(0, 87, 255, 0.05);
}

/* FAQ answer visibility */
.faq-answer { display: none; padding: 12px 0 0; color: #333; }
.faq-item.active .faq-answer { display: block; }

.faq-item.active {
    border-color: var(--primary-color);
    background-color: rgba(0, 87, 255, 0.02);
}

.faq-item.active .faq-question {
    color: var(--primary-color);
}

/* Legal Section Styles */
.legal-section {
    background-color: var(--primary-color);
    color: var(--text-light);
    border-radius: 24px;
    margin: 0 15px;
}

.legal-section h2 {
    color: var(--text-light);
    font-size: 40px;
    margin-bottom: 20px;
}

.legal-section p {
    font-size: 18px;
    line-height: 1.3;
    max-width: 670px;
    margin-bottom: 30px;
}

.license-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 25px;
}

/* Licenses Section Styles */
.licenses-section {
    padding-top: 0;
}

.licenses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.licenses-grid a {
    display: block;
    box-shadow: 0px 0px 32px 1px rgba(0, 0, 0, 0.06);
    transition: transform 0.3s ease;
}

.licenses-grid a:hover {
    transform: translateY(-5px);
}

.licenses-grid img {
    width: 100%;
    height: auto;
    display: block;
}

/* Testimonials Section Styles */
.testimonials-section {
    /* Убираем отступы, так как слайдер теперь во всю ширину */
}

.testimonials-section h2 {
    margin-bottom: 40px;
}

.testimonials-slider {
    margin-bottom: 20px;
    width: 100%;
    position: relative;
    padding: 0 20px;
}

.testimonials-wrapper {
    /* Slick will handle the display */
}

.testimonial-card {
    background-color: #f8f8f8;
    border-radius: 20px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex-shrink: 0;
    width: 100%;
    min-height: 300px;
    opacity: 1;
    visibility: visible;
    box-sizing: border-box;
    overflow: visible;
}

.card-top {
    display: flex;
    align-items: center;
    gap: 20px;
}

.card-top img {
    height: 30px;
}

.stars {
    color: #ffc107;
}

.testimonial-card p {
    font-size: 16px;
    line-height: 1.5;
    flex-grow: 1;
    margin: 0;
    overflow: visible;
    word-wrap: break-word;
}

.card-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.card-bottom span {
    font-weight: 400;
}

.card-bottom time {
    color: var(--text-gray);
}

.testimonial-card .btn {
    align-self: flex-start;
}

.testimonials-section .slider-controls {
    max-width: none;
    justify-content: center;
    margin: 20px auto 0;
    max-width: 1170px;
    padding: 0 20px;
}

.testimonials-section .slider-progress {
    max-width: 500px;
}

/* Slick Slider Custom Styles for Testimonials */
.testimonials-section .slick-prev,
.testimonials-section .slick-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid var(--primary-color);
    cursor: pointer;
    padding: 0;
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    width: 48px;
    height: 48px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    font-size: 0;
    line-height: 0;
}

.testimonials-section .slick-prev {
    left: 10px;
}

.testimonials-section .slick-next {
    right: 10px;
}

.testimonials-section .slick-prev:hover,
.testimonials-section .slick-next:hover {
    background: var(--primary-color);
    transform: translateY(-50%) scale(1.1);
}

.testimonials-section .slick-prev:hover img,
.testimonials-section .slick-next:hover img {
    filter: brightness(0) invert(1);
}

.testimonials-section .slick-prev:focus,
.testimonials-section .slick-next:focus {
    outline: none;
}

.testimonials-section .slick-prev img,
.testimonials-section .slick-next img {
    width: 20px;
    height: 20px;
    transition: filter 0.3s ease;
}

.testimonials-section .slick-prev.slick-disabled,
.testimonials-section .slick-next.slick-disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.testimonials-section .slick-prev.slick-disabled:hover,
.testimonials-section .slick-next.slick-disabled:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-50%);
}

/* Скрываем стандартные стрелки Slick */
.testimonials-section .slick-prev:before,
.testimonials-section .slick-next:before {
    display: none !important;
}

/* Убеждаемся, что наши кастомные стрелки видны */
.testimonials-section .slick-prev img,
.testimonials-section .slick-next img {
    display: block !important;
    width: 20px;
    height: 20px;
    transition: filter 0.3s ease;
}

/* Slick dots for mobile */
.testimonials-section .slick-dots {
    display: flex !important;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.testimonials-section .slick-dots li {
    list-style: none;
}

.testimonials-section .slick-dots li button {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: none;
    background-color: #ddd;
    cursor: pointer;
    font-size: 0;
    transition: background-color 0.3s ease;
}

.testimonials-section .slick-dots li.slick-active button {
    background-color: var(--primary-color);
}

/* Slick slide spacing */
.testimonials-section .slick-slide {
    height: auto;
    margin: 0 10px;
}

.testimonials-section .slick-slide > div {
    height: auto;
}

.testimonials-section .slick-list {
    margin: 0 -10px;
}

.testimonials-section .slick-track {
    display: flex;
    align-items: flex-start;
}

.testimonials-section .slick-slide {
    display: flex;
    align-items: flex-start;
}

/* Tablet styles for testimonials */
@media (max-width: 1024px) and (min-width: 769px) {
    .testimonials-section .slider-controls {
        padding: 0 15px;
    }
    
    .testimonial-card {
        min-height: 280px;
    }
    
    .testimonials-section .slick-slide {
        margin: 0 8px;
    }
    
    .testimonials-section .slick-list {
        margin: 0 -8px;
    }
    
    .testimonials-section .slick-prev {
        left: 5px;
    }
    
    .testimonials-section .slick-next {
        right: 5px;
    }
    
    .testimonials-slider {
        padding: 0 15px;
    }
    
    /* Doctors tablet styles */
    .doctors-section .slick-prev {
        left: 5px;
    }
    
    .doctors-section .slick-next {
        right: 5px;
    }
    
    .doctors-section .slick-slide {
        margin: 0 8px;
    }
    
    .doctors-section .slick-list {
        margin: 0 -8px;
    }
    
    .doctors-slider {
        padding: 0 15px;
    }
}

/* Doctors Section Styles */
.doctors-section {
    /* Убираем отступы, так как слайдер теперь во всю ширину */
}

.doctors-section h2 {
    margin-bottom: 40px;
}

.doctors-slider {
    margin-bottom: 20px;
    width: 100%;
    position: relative;
    padding: 0 20px;
}

.doctors-grid {
    /* Slick will handle the display */
    display: block; /* override grid for slick container */
}

/* When slick is initialized, let slick control slide widths */
.slick-initialized.doctors-grid .doctor-card {
    width: 295px !important;
    max-width: 295px !important;
}

/* Ensure slick slide wrapper matches desired width */
.doctors-section .slick-slide {
    width: 295px !important;
}

@media (max-width: 768px) {
    .slick-initialized.doctors-grid .doctor-card { width: 295px !important; max-width: 295px !important; }
    .doctors-section .slick-slide { width: 295px !important; }
}

.doctor-card {
    background-color: #f8f8f8;
    border-radius: 20px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex-shrink: 0;
    width: 100%;
    min-height: 300px;
    opacity: 1;
    visibility: visible;
    box-sizing: border-box;
    overflow: visible;
    text-align: center;
}

.doctor-card img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 10px;
}

.doctor-info h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.doctor-info p {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-gray);
    margin: 0;
}

.doctors-cta {
    text-align: center;
    margin-top: 40px;
}

/* Slick Slider Custom Styles for Doctors */
.doctors-section .slick-prev,
.doctors-section .slick-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid var(--primary-color);
    cursor: pointer;
    padding: 0;
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    width: 48px;
    height: 48px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    font-size: 0;
    line-height: 0;
}

.doctors-section .slick-prev {
    left: 10px;
}

.doctors-section .slick-next {
    right: 10px;
}

.doctors-section .slick-prev:hover,
.doctors-section .slick-next:hover {
    background: var(--primary-color);
    transform: translateY(-50%) scale(1.1);
}

.doctors-section .slick-prev:hover img,
.doctors-section .slick-next:hover img {
    filter: brightness(0) invert(1);
}

.doctors-section .slick-prev:focus,
.doctors-section .slick-next:focus {
    outline: none;
}

.doctors-section .slick-prev img,
.doctors-section .slick-next img {
    display: block !important;
    width: 20px;
    height: 20px;
    transition: filter 0.3s ease;
}

.doctors-section .slick-prev.slick-disabled,
.doctors-section .slick-next.slick-disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.doctors-section .slick-prev.slick-disabled:hover,
.doctors-section .slick-next.slick-disabled:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-50%);
}

/* Скрываем стандартные стрелки Slick */
.doctors-section .slick-prev:before,
.doctors-section .slick-next:before {
    display: none !important;
}

/* Slick slide spacing for doctors */
.doctors-section .slick-slide {
    height: auto;
    margin: 0 10px;
}

.doctors-section .slick-slide > div {
    height: auto;
}

.doctors-section .slick-list {
    margin: 0 -10px;
}

.doctors-section .slick-track {
    display: flex;
    align-items: flex-start;
}

.doctors-section .slick-slide {
    display: flex;
    align-items: flex-start;
}

/* Slick dots for mobile doctors */
.doctors-section .slick-dots {
    display: flex !important;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.doctors-section .slick-dots li {
    list-style: none;
}

.doctors-section .slick-dots li button {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: none;
    background-color: #ddd;
    cursor: pointer;
    font-size: 0;
    transition: background-color 0.3s ease;
}

.doctors-section .slick-dots li.slick-active button {
    background-color: var(--primary-color);
}

/* Review CTA Section Styles */
.review-cta-section {
    text-align: center;
}

.review-cta-section h4 {
    font-size: 32px;
    font-weight: 600;
    margin-bottom: 8px;
}

.review-cta-section p {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 40px;
}

.review-platforms {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.platform-card {
    background-color: #f8f8f8;
    border-radius: 16px;
    padding: 20px 40px;
    display: flex;
    flex-direction: column;
    gap: 25px;
    align-items: center;
    justify-content: center;
    width: 312px;
}

.platform-card img {
    height: 37.5px;
    width: auto;
}

/* Map Section Styles */
.map-section h2 {
    margin-bottom: 40px;
}

.map-container {
    position: relative;
    border-radius: 40px;
    overflow: hidden;
    height: 620px;
}

.map-bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Medical car icon on map */
.map-car {
    position: absolute;
    top: 0;
    left: 0;
    width: 50px;
    height: 50px;
    background: url('../images/medical.png') center/contain no-repeat;
    will-change: transform;
    pointer-events: none;
    z-index: 5;
}

.map-info-box {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 400px;
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(1px);
    border-radius: 20px;
    padding: 20px;
    z-index: 10; /* above moving car */
}

.map-logo {
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(30, 30, 30, 0.1);
}

.map-logo img {
    height: 34px;
    margin-bottom: 15px;
}

.map-logo p {
    font-size: 18px;
    font-weight: 500;
    line-height: 1.2;
    color: #474747;
}

.map-contact-list {
    list-style: none;
    padding: 20px 0 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.map-contact-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 20px;
    color: #474747;
    line-height: 1.3;
}

.map-contact-list a {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 22px;
}

/* Desktop styles for mobile menu close button */
.mobile-menu-close {
    display: none;
}

/* Ensure header nav links use dark text color */
.header-nav .nav-menu__link,
.header-nav .subnav__link { color: var(--text-dark) !important; }

/* Mobile Responsive */
@media (max-width: 1200px) {
    .header-main-container {
        justify-content: center;
        flex-wrap: wrap;
    }
}

@media (max-width: 768px) {
    /* В хедере на телефоне показываем только логотип, телефон и соцсети */
    .header-contact,
    .header-search,
    .header-main .btn { display: none !important; }
    /* Скрыть подпись "Круглосуточно / анонимно" */
    .header-phone span { display: none !important; }

    /* Вся шапка в одну строку */
    .header-main-container { flex-wrap: nowrap !important; justify-content: flex-start !important; align-items: center !important; gap: 10px !important; position: relative; padding-right: 56px; }
    .header-main-container .logo { flex: 0 0 auto; }
    .header-main-container .header-phone { flex: 0 0 auto; }
    .header-main-container .header-social { flex: 0 0 auto; }

    /* Кнопку меню переносим в правый край шапки */
    .mobile-menu-toggle { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); display: flex; }

    .header-nav {
        padding-top: 10px;
        padding-bottom: 10px;
    }
    
    .header-nav nav ul {
        justify-content: flex-start;
        gap: 20px;
    }
    
    /* Mobile menu styles */
    .mobile-menu-toggle {
        display: flex;
        margin-left: auto;
    }
    
    .header-nav-menu {
        position: fixed;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100vh;
        background-color: var(--bg-light);
        transition: left 0.3s ease;
        z-index: 999;
        padding: 60px 20px 40px 20px;
        box-sizing: border-box;
    }
    
    .header-nav-menu.active {
        left: 0;
        overflow-y: scroll;
        height: 100vh;
    }
    
    .mobile-menu-close {
        position: absolute;
        top: 20px;
        right: 20px;
        width: 30px;
        height: 30px;
        background: none;
        border: none;
        cursor: pointer;
        padding: 0;
        z-index: 1001;
        display: block;
    }
    
    .mobile-menu-close span {
        position: absolute;
        top: 50%;
        left: 50%;
        width: 20px;
        height: 2px;
        background-color: var(--primary-color);
        border-radius: 1px;
        transition: all 0.3s ease;
    }
    
    .mobile-menu-close span:first-child {
        transform: translate(-50%, -50%) rotate(45deg);
    }
    
    .mobile-menu-close span:last-child {
        transform: translate(-50%, -50%) rotate(-45deg);
    }
    
    
    .header-nav-menu ul {
        flex-direction: column;
        padding: 0;
        gap: 20px;
        margin: 0;
    }
    
    .header-nav-menu li {
        border-bottom: 1px solid var(--border-color);
        padding-bottom: 15px;
    }
    
    .header-nav-menu a {
        font-size: 18px;
        padding: 10px 0;
    }
    
    /* Hero mobile styles */
    .hero-doctor-image {
        display: none;
    }
    
    /* Mobile slider adjustments */
    .services-grid,
    .tariffs-grid,
    .gallery-grid {
        display: flex !important;
        flex-direction: column;
        width: 100% !important;
    }
    
    .services-grid .service-card,
    .tariffs-grid .tariff-card,
    .gallery-grid img {
        width: 100% !important;
    }
    
    /* Hide slider controls on mobile */
    .slider-controls {
        display: none;
    }
    
    .testimonials-section .slider-controls {
        padding: 0 15px;
    }
    
    /* Slick mobile adjustments */
    
    .testimonials-section .slick-prev,
    .testimonials-section .slick-next {
        display: none !important;
    }
    
    .testimonials-section .slick-dots {
        display: flex !important;
    }
    
    /* Отзывы: стандартный одноколоночный мобильный вид */
    .testimonials-section .slick-list { margin: 0 -5px; }
    .testimonials-section .slick-slide { margin: 0 5px; }
    .testimonial-card { min-height: 250px; }
    .testimonials-slider { padding: 0 15px; }
    
    /* Doctors mobile styles */
    .doctors-section .slick-prev,
    .doctors-section .slick-next {
        display: none !important;
    }
    
    .doctors-section .slick-dots {
        display: flex !important;
    }
    
    .doctor-card {
        min-height: 250px;
    }
    
    .doctors-section .slick-slide {
        margin: 0 5px;
    }
    
    .doctors-section .slick-list {
        margin: 0 -5px;
    }
    
    .doctors-slider {
        padding: 0 15px;
    }
    
    /* CTA Form mobile styles */
    .cta-image {
        display: none;
    }
    
    .cta-container {
        justify-content: center;
    }
    
    .cta-content {
        text-align: center;
    }
    
    .cta-content .btn {
        align-self: center;
    }

    /* Header top bar smaller on mobile */
    .header-top-bar { padding: 4px 0; }
    .header-top-bar p { font-size: 12px; }

    /* Hide header social icons on mobile */
    .header-social { display: none !important; }

    /* Services cards smaller on mobile */
    .service-card { border-radius: 20px; }
    .service-card .card-header { padding: 18px; border-radius: 20px 20px 0 0; }
    .service-card h3 { font-size: 20px; }
    .service-list { padding: 16px; }
    .service-list li { font-size: 16px; margin-bottom: 10px; }
    .service-card .btn { margin: 0 16px 16px; }

    /* Tariffs button width on mobile */
    .tariff-card .btn { max-width: 80%; }
    /* Tariff cards smaller on mobile */
    .tariff-card { border-radius: 20px; }
    .tariff-card .card-header { padding: 18px; border-radius: 20px 20px 0 0; }
    .tariff-card h3 { font-size: 20px; }
    .tariff-card .card-price { padding: 14px 20px; font-size: 18px; }
    
    /* About mobile styles */
    .about-content {
        flex-direction: column;
    }
    
    .about-tabs {
        flex-direction: row;
        overflow-x: auto;
        width: 100%;
    }
    
    .about-tab-btn {
        width: auto;
        min-width: 200px;
        flex-shrink: 0;
    }
    
    /* Rehabilitation mobile styles */
    .rehab-grid {
        grid-template-columns: 1fr;
    }
    
    .rehab-quote-card {
        margin-top: 0;
    }
    
    /* Rehab Program mobile styles */
    .rehab-program-text p {
        font-size: 24px;
    }
    
    .rehab-program-images {
        flex-direction: column;
        margin-bottom: 40px;
    }
    
    .rehab-program-text {
        padding-top: 40px;
    }
    
    .rehab-program-text p {
        font-size: 18px;
    }
    
    /* Amenities mobile styles */
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    /* Doctors mobile styles */
    .doctors-grid {
        grid-template-columns: 1fr;
    }
    
    /* Map mobile styles */
    .map-info-box {
        position: static;
        width: auto;
        border-radius: 0;
    }
    
    .map-container { height: 60vw; min-height: 220px; position: relative; overflow: hidden; }
    .map-car { width: 30px; height: 30px; }
}

/* First-level dropdown hidden by default and shown on hover as grid */
.nav-menu__item > .subnav { display: none; }
.nav-menu__item:hover > .subnav {
    display: grid;
    grid-template-columns: repeat(3, minmax(305px, 1fr));
    gap: 16px 24px;
    padding: 20px;
    min-width: 980px;
    position: absolute;
    background: #ffffff; /* white background */
    margin-left: -30px;
    border: 1px solid var(--border-color);
}

/* Hide payment-info block sitewide */
.payment-info { display: none !important; }

/* Nested subnav (flyout) hidden by default and shown on hover as block */
.subnav__item.with-childrens > .subnav { display: none; }
.subnav__item.with-childrens:hover > .subnav { display: block; }

/* Improve flyout positioning and hover bridge */
.subnav__item.with-childrens { position: relative; padding-right: 16px; }
.subnav__item.with-childrens > .subnav { left: calc(100% + 16px); }
.subnav__item.with-childrens::after {
    content: '';
    position: absolute;
    top: -12px;
    right: 0;
    width: 16px; /* bridge between parent and flyout */
    height: calc(100% + 24px);
    z-index: 2050; /* below the flyout but above grid */
}

/* Subnav items spacing inside grid */
.nav-menu__item > .subnav .subnav__item { margin: 0; }

@media (max-width: 1024px) {
    .nav-menu__item:hover > .subnav {
        grid-template-columns: repeat(2, minmax(200px, 1fr));
        min-width: 460px;
    }
}

@media (max-width: 768px) {
    .nav-menu__item > .subnav { display: none; }

    /* Off-canvas menu scroll */
    .header-nav-menu {
        max-height: 100vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 80px;
    }
    /* Stack items and remove grid/flyout specifics */
    .wrapper.nav-menu { flex-direction: column; align-items: stretch; gap: 0; }
    .nav-menu__item { border-bottom: 1px solid var(--border-color); }
    .nav-menu__link { padding: 16px 0; font-size: 16px; }

    /* First-level subnav: всегда виден список второго уровня */
    .nav-menu__item > .subnav {
        position: static !important;
        display: block !important;
        box-shadow: none !important;
        border: none !important;
        border-radius: 0 !important;
        padding: 6px 0 6px 14px !important; /* базовый отступ слева */
        background: transparent !important;
        min-width: auto !important;
        grid-template-columns: none !important;
        gap: 0 !important;
        margin-left: 0 !important;
    }

    /* Вложенные (третий уровень) по умолчанию скрыты; открываются по клику (класс .open в JS) */
    .subnav__item.with-childrens { padding-right: 0; }
    .subnav__item.with-childrens > .subnav { display: none !important; position: static !important; padding-left: 22px !important; }
    .subnav__item.open > .subnav { display: block !important; }

    /* На мобильных отключаем анимацию появления подпунктов и показываем сразу */
    .subnav .fadeInDownCustom { transform: none !important; opacity: 1 !important; }
}

/* --- Right-edge protection: open last 3 top-level dropdowns to the left --- */
/* Align first-level dropdown panel to the left for the last three root items */
.wrapper.nav-menu > .nav-menu__item:nth-last-child(-n+3) > .subnav {
    left: auto !important;
    right: -30px !important; /* mirror of margin-left */
    margin-left: 0 !important;
}

/* Nested flyouts inside those last items should open to the left */
.wrapper.nav-menu > .nav-menu__item:nth-last-child(-n+3) .subnav__item.with-childrens > .subnav {
    left: auto !important;
    right: calc(100% + 16px) !important;
}

/* Adjust hover bridge to the left side for those items to avoid hover gap */
.wrapper.nav-menu > .nav-menu__item:nth-last-child(-n+3) .subnav__item.with-childrens::after {
    right: auto !important;
    left: 0 !important;
}
