/* Reset & Base Styles */
/* Global Elements */

h2 {
    margin-bottom: 100px;
}

/* Container */
section,
header {
    min-width: 0;
}

/* ============================================
   HEADER
   ============================================ */
.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

/* ============================================
   MODAL
   ============================================ */

/* ===================== */
/* БАЗА offcanvas меню   */
/* ===================== */

.logo-desktop {
    display: block;
}

/* ============================================
   FILTER SECTION
   ============================================ */

.filter-section {
    margin-top: 15px;
}

.filter-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.filter-content {
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
    padding: 0 20px;
    gap: 10px;
    background-color: var(--color-bg-alt);
    border-radius: 20px;
    height: 90px;
    width: 100%;
    margin-bottom: 30px;
    transition: all 0.3s ease;
}

/* Класс для фиксированного состояния при скролле */
.filter-content.is-fixed {
    position: fixed;
    top: 80px;
    /*left: 50%;
    transform: translateX(-50%);*/
    max-width: calc(var(--container-max-width) - 40px);
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.menu {
    font-size: 16px;
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-bg);
    border-radius: 10px;
    width: fit-content;
    display: flex;
    list-style: none;
}

.menu a {
    text-decoration: none;
    color: inherit;
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
}

.menu .link {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px 36px;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.48s cubic-bezier(0.23, 1, 0.32, 1);
}

.menu .link::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-primary);
    z-index: -1;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.48s cubic-bezier(0.23, 1, 0.32, 1);
}

.menu .link svg {
    width: 14px;
    height: 14px;
    fill: #000000;
    transition: all 0.48s cubic-bezier(0.23, 1, 0.32, 1);
}

.menu .item {
    position: relative;
}

.menu .item .submenu {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: absolute;
    top: 100%;
    border-radius: 0 0 16px 16px;
    left: 0;
    width: 100%;
    overflow: hidden;
    border: 1px solid #cccccc;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-12px);
    transition: all 0.48s cubic-bezier(0.23, 1, 0.32, 1);
    z-index: 1;
    pointer-events: none;
    list-style: none;
}

.menu .item:hover .submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
    border-color: var(--color-primary);
    z-index: 5;
}

.menu .item:hover .link {
    color: var(--color-text);
    border-radius: 16px 16px 0 0;
}

.menu .item:hover .link::after {
    transform: scaleX(1);
    transform-origin: right;
}

.menu .item:hover .link svg {
    fill: #ffffff;
    transform: rotate(-180deg);
}

.submenu .submenu-item {
    width: 100%;
    transition: all 0.48s cubic-bezier(0.23, 1, 0.32, 1);
    background-color: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    padding: 0 20px;
}

.submenu .submenu-item .filter-section {
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.submenu .submenu-link {
    display: block;
    padding: 12px 24px;
    width: 100%;
    position: relative;
    text-align: center;
    transition: all 0.48s cubic-bezier(0.23, 1, 0.32, 1);
}

.submenu .submenu-item:last-child .submenu-link {
    border-bottom: none;
}

.submenu .submenu-link::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    transform: scaleX(0);
    width: 100%;
    height: 100%;
    background-color: var(--color-primary);
    z-index: -1;
    transform-origin: left;
    transition: transform 0.48s cubic-bezier(0.23, 1, 0.32, 1);
}

.submenu .submenu-link:hover:before {
    transform: scaleX(1);
    transform-origin: right;
}

.submenu .submenu-link:hover {
    background-color: var(--color-primary);
}

.filter-button.desktop {
    background-color: var(--color-primary);
    color: var(--color-bg);
    border-radius: 10px;
    padding: 20px 20px;
    font-size: 16px;
}

.filter-button:hover {
    background-color: var(--color-primary-hover);
}

.specialists-cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(250px, 1fr)); /* 3 колонки: минимум 250px на карточку, остальное — равномерно */
    grid-auto-rows: auto; /* Высота строк по содержимому, без растяжки */
    width: 100%;
    gap: 20px;
}

.specialist-card {
    display: flex;
    flex-direction: column;
    border-radius: 20px;
    overflow: hidden;
    width: 100%; /* Заполняет всю ячейку грида, без фиксированного % */
    position: relative;
    /* Добавьте min-width, если нужно жёстко защитить от сжатия ниже определённого размера */
    /* min-width: 250px; — раскомментируйте, если контейнер очень узкий */
}

.specialist-card-image {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.sp-ci-wrap {
    position: relative;
}

.specialist-card-image img {
    width: 240px;
    height: 240px;
    display: block;
    border-radius: 20px;
    object-fit: cover;
    pointer-events: none;

}

.heart {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 25px;
    height: 25px;
    cursor: pointer;
}

.heart-path {
    stroke: #A6A6A6; /* Исходный серый контур */
    fill: none; /* Без заливки изначально */
    transition: fill 0.3s ease, stroke 0.3s ease; /* Плавный переход */
}

.heart.active .heart-path {
    fill: #FF3F7F; /* Заливка цветом при активном состоянии */
    stroke: none; /* Контур тоже в цвет (опционально, для жирности) */
}

.specialist-card-name {
    position: relative;
    background-color: #9AC355;
    padding: 5px;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    color: #fff;
    border-radius: 20px;
    width: 100%;
    margin-top: -50px;
    z-index: 1;
}

.specialist-card-name:hover {
    background-color: var(--color-primary-hover);
    text-decoration: none;
    cursor: pointer;
}

.specialist-card-name p:first-child {
    line-height: 1;
    margin-bottom: 5px;
}

.specialist-card-name p:last-child {
    line-height: 1;
    font-size: 16px;
    height: 48px;
}

.specialist-card-description {
    flex: 1;
    position: relative;
    top: -17px;
    background-color: white;
    border-radius: 0 0 20px 20px;
    padding: 15px;
    font-size: 14px;
    color: #333;
    border: 1px solid var(--color-primary);
    height: 120px;
}

.specialist-discription {
    font-family: Montserrat;
    font-weight: 400;
    font-style: normal;
    font-size: 18px;
    line-height: 100%;
    letter-spacing: 0%;
    text-align: center;
    vertical-align: middle;
}

.specialist-card-description p {
    margin: 5px 0;
}

.specialist-card-description ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0 10px;
    line-height: 1.3;
}

.specialist-card-description li {
    position: relative;
    padding-left: 15px;
    font-size: 14px;
}

.specialist-card-description li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.adult::before {
    background-color: #BEF574; /* green */
}

.teen::before {
    background-color: #8E74F5; /* purple */
}

.family::before {
    background-color: #F58E74; /* red */
}

.filter-button.mobile {
    display: none;

}


/* Add this to your CSS */

/* Modal overlay */
.filter-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.filter-modal.open {
    display: block;
    opacity: 1;
}

/* Panel */
.filter-panel {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: var(--color-bg-alt, #ffffff);
    border-radius: 20px;
    padding: 24px;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    font-family: 'Montserrat', sans-serif;
}

/* Close button */
.close-btn {
    position: absolute;
    top: 16px;
    right: 20px;
    background: none;
    border: none;
    font-size: 28px;
    color: var(--color-primary);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.close-btn:hover {
    background-color: #f0f0f0;
    color: #666;
}

/* Body */
.filter-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 20px;
}

.filter-column {
    display: flex;
    flex-direction: column;
    gap: 0px;
}

/* Sections */


.filter-section h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text, #333333);
    margin: 0 0 12px 0;
    line-height: 1.5;
    padding-top: 4px;
    padding-bottom: 4px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.cost-section {
    grid-column: 1 / -1;
    padding-top: 10px;
    border-top: 1px solid #e0e0e0;
}

/* Checkbox labels */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 14px;
    color: var(--color-text, #333333);
    line-height: 1.4;
    padding: 4px 0;
}

.checkbox-label input {
    margin: 10px;
}

/* Custom checkbox (circle style) */
.custom-radio {
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #d0d0d0;
    position: relative;
    cursor: pointer;
    flex-shrink: 0;
}

.custom-checkbox {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.checkbox-label {
    display: flex;
    align-items: center;
    position: relative;
    cursor: pointer;
    padding-left: 35px;
    user-select: none;
}

.checkmark {
    position: absolute;
    left: 0;
    height: 20px;
    width: 20px;
    border-radius: 5px;
    border: 2px solid #d0d0d0;
    background-color: #fff;
    transition: all 0.2s ease;
}

.custom-checkbox:checked + .checkmark:after {
    content: "";
    position: absolute;
    display: block;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid var(--color-primary);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.custom-radio:checked,
.custom-radio.checked {
    border-color: var(--color-primary, #9AC355);
    background-color: var(--color-primary, #9AC355);
}

.custom-radio:checked::after,
.custom-radio.checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background-color: #ffffff;
    border-radius: 50%;
}

/*-{-gvv-*/
.filter-sticky .dropdown-menu:first-child .item {
    min-width: 266px;
}

.filter-sticky .dropdown-menu:nth-child(2) .item {
    min-width: 319px;
}

.filter-sticky .dropdown-menu:nth-child(3) .item {
    min-width: 273px;
}

.filter-sticky a.link {
    justify-content: space-between;
}

.submenu .submenu-item .filter-section input[type="checkbox"],
#psyfilter-modal input[type="checkbox"] {
    margin-right: 10px;
}

.submenu .submenu-item .quick-specializ {
    flex-direction: column;
    align-items: flex-start;
}

.submenu .submenu-item .filter-section label,
#psyfilter-modal label {
    display: flex;
    align-items: center;
    width: fit-content;
}

.filter-section label span {
    max-width: 90%;
    line-height: 1;
}

.qfilter-input {
    width: 100%;
    padding: 12px 36px;
    border: none;
    border-radius: 16px;
    background-color: #ffffff;
    font-family: 'Montserrat', sans-serif;
    font-size: 16px;
    letter-spacing: 0.5px;
    color: var(--color-text, #333333);
    line-height: 1.6;
    transition: border-color 0.2s ease;
    outline: none;
}

.paginator {
    display: flex;
    justify-content: center;
    width: 100%;
    margin: 1em 0;
}

.paginator ul {
    display: flex;
    /*width: 90%;
    max-width: 768px;
    text-align: center;
    list-style: none;*/
}

.paginator li {
    display: inline-block;
}

.paginator a, .paginator span {
    text-decoration: none;
    display: inline-block;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    padding: .1rem .5rem;
    font-size: 17px;
    font-weight: 700;
    color: var(--color-primary);
}

.paginator a.disabled {
    opacity: 0.3;
    pointer-events: none;
}

.paginator a.current {
    margin-top: -5px;
    padding: 0 .5rem;
    font-size: 1.2rem;
    color: #798d5a;
    /*#ef5e2e*/
    /* border-color: #4267b2; */
    /* color: #ffffff; */
    pointer-events: none;
}

/*-gvv-}-*/
/* Inputs and selects */

.filter-input,
.filter-select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    background-color: #ffffff;
    font-size: 14px;
    color: var(--color-text, #333333);
    line-height: 1.4;
    transition: border-color 0.2s ease;
}

.filter-input:focus,
.filter-select:focus {
    outline: none;
    border-color: var(--color-primary, #9AC355);
}

.filter-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
}

/* Footer */
.filter-footer {
    display: flex;
    justify-content: center;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.apply-btn {
    background-color: var(--color-primary, #9AC355);
    color: var(--color-bg, #ffffff);
    border: none;
    border-radius: 10px;
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
    white-space: nowrap;
}

.apply-btn:hover {
    background-color: var(--color-primary-hover, #7ea84a);
}

/*-{-gvv-*/
.qf-submenu {
    display: flex;
    justify-content: space-around;
    width: 100%;
    padding: 10px;
    background-color: var(--color-bg-alt);
}

.qf-submenu div {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.qf-submenu .custom-radio {
    display: inline-block;
    margin-right: 10px;
}

/*-gvv-}-*/

/* Mobile adaptations (one column, full screen) */
@media (max-width: 1024px) {
    /* Tablet: same as desktop */
}

@media (max-width: 768px) {
    .filter-modal.open {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .filter-panel {
        position: static;
        transform: none;
        width: 100%;
        height: 100vh;
        max-height: none;
        border-radius: 0;
        padding: 20px;
        display: flex;
        flex-direction: column;
    }

    .close-btn {
        top: 16px;
        right: 16px;
    }

    .filter-body {
        display: block;
        gap: 20px;
        flex: 1;
        overflow-y: auto;
    }

    .filter-column {
        gap: 0px;
    }

    .cost-section {
        grid-column: unset;
        border-top: 1px solid #e0e0e0;
        padding-top: 20px;
        margin-top: 0;
    }

    .filter-section h3 {
        font-size: 15px;
        line-height: 1.6;
        padding-top: 6px;
        padding-bottom: 6px;
    }

    .checkbox-label {
        font-size: 14px;
        gap: 10px;
    }

    .custom-radio {
        width: 18px;
        height: 18px;
    }

    .filter-input,
    .filter-select {
        padding: 12px 14px;
        font-size: 14px;
    }

    .filter-footer {
        padding: 20px 0 0;
        margin-bottom: 30px;
    }

    .apply-btn {
        width: 100%;
        padding: 16px;
        font-size: 16px;
    }
}

/* Very small screens */
@media (max-width: 480px) {
    .filter-panel {
        padding: 16px;
    }

    .filter-body {
        gap: 16px;
    }

    .filter-column {
        gap: 0px;
    }


    .filter-section h3 {
        font-size: 14px;
        line-height: 1.6;
        padding-top: 6px;
        padding-bottom: 6px;
    }

    .checkbox-label {
        font-size: 13px;
        gap: 8px;
    }
}

@media (max-width: 1280px) {
    .logo-desktop {
        display: none;
    }

    .hero-title--desktop {
        display: none;
    }

    .hero-title--tablet {
        display: inline-block; /* или block — в зависимости от места */
    }

    .top-header-title {
        font-size: 34px;
    }

    .top-header-link {
        font-size: 20px;
    }

    /* gvv пока убрал */
    /*.specialists-cards {
        grid-template-columns: repeat(2, minmax(250px, 1fr));
    }*/
    .specialist-card-description {
        font-size: 12px;
    }

    .specialist-card-name {
        font-size: 16px;
        margin-top: -45px;
    }

    .surname-menu {
        display: none;
    }

    .link span {
        display: block; /* Или inline-block, если нужно в строке */
        white-space: nowrap; /* Запрещает перенос строк, текст в одну линию */
        overflow: hidden; /* Скрывает переполнение */
        text-overflow: ellipsis; /* Добавляет троеточия в конце при переполнении */
        max-width: 100%; /* Ограничивает ширину до родительского блока (или укажите фиксированную, напр. 200px) */
    }

    .filter-content.is-fixed {
        top: 75px; /* Fixed отступ для планшетов */
        max-width: calc(100% - 40px);
    }
}

@media (max-width: 1100px) {
    .specialists-cards {
        grid-template-columns: repeat(3, minmax(250px, 1fr));
    }
}

@media (max-width: 860px) {
    .specialists-cards {
        grid-template-columns: repeat(2, minmax(250px, 1fr));
    }
}

@media (max-width: 767px) {
    .logo-desktop {
        display: none;
    }

    .hero-title--desktop {
        display: none;
    }

    .hero-title--tablet {
        display: inline-block; /* или block — в зависимости от места */
    }

    .specialists-cards {
        grid-template-columns: repeat(1, 1fr);
        justify-content: center;
    }

    .filter-content {
        flex-direction: row; /* Остаётся в ряд, но сжимается */
        justify-content: space-around; /* Выравнивание по левому краю для компактности */
        align-items: center;
        padding: 15px 0px; /* Меньше padding на мобильных */
        gap: 8px; /* Меньший gap */
        height: auto; /* Убираем фиксированную высоту, чтобы подстраивалось */
        min-height: 50px; /* Минимальная высота для мобильных */
        flex-wrap: nowrap; /* Не переносим, чтобы всё в одну строку */
        border-radius: 10px;
    }

    .filter-content.is-fixed {
        top: 70px; /* Fixed отступ для мобильных */
        max-width: calc(100% - 30px);
    }

    .specialist-card {
        display: flex;
        flex-direction: column;
        /*justify-content: center;*/
        align-items: center;
    }

    .specialist-card a,
    .specialist-card-description {
        max-width: 362px;
        width: 100%;
    }

    .specialist-card-description {
        font-size: 12px;
        height: auto;
        top: -20px;
    }

    .specialist-card-name {
        left: 0;
        /*right: 75px;*/
        width: 100%;
        margin-top: -50px;
        font-size: 16px;
    }

    .specialist-card-name p:last-child {
        height: auto;
        min-height: 16px;
    }

    .top-header-title {
        font-size: 20px;
    }

    .top-header-link {
        font-size: 16px;
    }

    /*.specialist-card-image img {
        width: 250px;
    }*/
    .surname-menu,
    .who-menu {
        display: none; /* Или opacity: 0.5; pointer-events: none; если нужно визуально показать как disabled */
    }

    .session-menu {
        flex: 1; /* Занимает доступное пространство */
        min-width: 150px; /* Минимальная ширина, чтобы не сжимался слишком */
    }

    .session-menu .link {
        display: flex;
        justify-content: start;
        align-items: center;
        padding: 15px 20px; /* Меньше padding для компактности */
        font-size: 14px; /* Меньший шрифт */
        gap: 8px; /* Меньший gap между текстом и иконкой */
        width: auto;
    }

    .filter-sticky .dropdown-menu:first-child .item {
        min-width: auto;
        width: 100%;
    }

    .link span {
        display: block; /* Или inline-block, если нужно в строке */
        white-space: nowrap; /* Запрещает перенос строк, текст в одну линию */
        overflow: hidden; /* Скрывает переполнение */
        text-overflow: ellipsis; /* Добавляет троеточия в конце при переполнении */
        max-width: 100%; /* Ограничивает ширину до родительского блока (или укажите фиксированную, напр. 200px) */
    }

    .filter-button.mobile {
        display: block;
    }

    .filter-button.desktop {
        display: none;
    }
}

@media (max-width: 399px) {
    .specialist-card a,
    .specialist-card-description {
        width: 80%;
    }

    .specialist-card-image {
        width: 60%;
    }

    .filter-button.mobile {
        display: block;
    }

    .filter-button.desktop {
        display: none;
    }

    .filter-content {
        padding: 10px 8px;
        gap: 6px;
    }

    .filter-content.is-fixed {
        top: 70px; /* Fixed отступ для маленьких экранов */
        max-width: calc(100% - 20px);
    }

    .surname-menu {
        min-width: 120px;
    }

    .surname-menu .link {
        padding: 8px 16px;
        font-size: 13px;
    }
}

.custom-multiselect {
    position: relative;
    /*width: 200px;*/
}

.select-box {
    border: 1px solid var(--color-primary);
    padding: 8px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    border-radius: 5px;
    background-color: var(--color-bg);
}

.options-container {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    border: 1px solid #ccc;
    background: white;
    z-index: 1000;
}

.opt-methods {
    max-height: 40vh;
    overflow: auto;
}

.option {
    display: block;
    padding: 8px;
    cursor: pointer;
}

.option input {
    margin-right: 8px;
}

.option:hover {
    background: transparent;
}

.option input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border: 1px solid #ccc;
    background-color: #fff;
    position: relative;
}

.option input[type="checkbox"]:checked {
    border-color: green;
    background-color: #fff;
}

.option input[type="checkbox"]:checked::before {
    content: "✓";
    position: absolute;
    top: -2px;
    left: 2px;
    color: var(--color-primary);
    font-size: 14px;
    font-weight: bold;
}