.ats-service-results__grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/**
 * Card
 */
.ats-service-card {
    border-radius: 20px;
    overflow: hidden;
}


a.ats-service-card__link-wrapper {
    display: block;
    position:relative;
    height: 100%;
    width: 100%;
    text-decoration: none;
}

a.ats-service-card__link-wrapper,
a.ats-service-card__link-wrapper:hover,
a.ats-service-card__link-wrapper:focus,
a.ats-service-card__link-wrapper:active,
a.ats-service-card__link-wrapper:visited {
    color: var(--pure-white);
}

.ats-service-card__media {
    position: relative;
    overflow: hidden;
    height: 340px;
}

.cards--short-mobile .ats-service-card__media {
    height: 228px;
}

.ats-service-card__media .ats-service-card__img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ats-service-card__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.45);
    xxbackdrop-filter: blur(2px);
    transition: opacity 0.5s ease;
    z-index: 1;
}

.ats-service-card__focus {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    z-index: 3;
    transition: opacity 0.4s ease;
}

.ats-service-card__focus::before {
    content: '';
    width: 160px;
    height: 160px;
    background: rgba(255,255,255,0.85);
    border-radius: 50%;
    backdrop-filter: blur(1px);
}

.ats-service-card__focus-arrow {
    position: absolute;
    font-size: 36px;
    color: #000;
}

.ats-service-card__arrow {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 27px;
    height: 27px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    z-index: 4;
    transition:
            transform 0.5s ease,
            opacity 0.3s ease;
}

/* Badge */

.ats-service-card__badge {
    position: absolute;
    top: 20px;
    left: 20px;
    padding: 5px 10px;
    font-size: 14px;
    border-radius: 999px;
    background: rgba(255,255,255,0.25);
    backdrop-filter: blur(6px);
    z-index: 4;
}

/* Content */
.ats-service-card__content {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 20px;
    z-index: 5;
    background: linear-gradient(
            to top,
            rgba(0,0,0,0.85),
            rgba(0,0,0,0)
    );
}

.ats-service-card__title {
    display: block;
    margin: 0 0 10px;
    color: var(--pure-white);
    font-family: "Ivy Presto Text", Helvetica, Arial, serif;
    font-size: 22px;
    font-weight: 300;
}


.ats-service-card__subtitle {
    font-size: 16px;
    line-height: 1.3;
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--pure-white);
}

.ats-service-card__meta {
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
}

.ats-service-card__item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.ats-service-card__label {
    font-size: 14px;
    font-weight: 700;
    text-transform: lowercase;
}

.ats-service-card__value {
    font-size: 18px;
    font-weight: 300;
}

/**
  * Buttons
 */

/* --- FILTER ---*/
.ats-btn-trigger-filter {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 14px 22px;
    width: 100%;
    color: var(--pure-white);
    font-size: 18px;
    background-color: var(--main-accent);
    border: 1px solid var(--main-accent);
    border-radius: 100px;
}

.ats-btn-trigger-filter .ats-btn-arrow {
    color: var(--pure-white);
    padding-bottom: 5px;
}

/* --- SORT (DROPDOWN) --- */

.ats-custom-sort {
    position: relative;
    display: block;
    width: 100%;
    min-width: 220px;
    font-family: inherit;
    z-index: 20;
}

/* Кнопка-триггер (видимая часть) */
.ats-custom-sort__trigger {
    display: flex;
    align-items: center;
    flex-direction: row;
    justify-content: center;
    gap: 10px;
    padding: 12px 20px;
    width: 100%;
    background-color: var(--main-accent);
    border: 1px solid var(--main-accent);
    border-radius: 100px;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.ats-custom-sort__trigger:hover {
    border-color: #D4C6B0;
}

.ats-custom-sort__trigger .ats-btn-arrow {
    color: var(--pure-white);
    padding-bottom: 5px;
}

.ats-custom-sort.open .ats-custom-sort__trigger {
    border-color: #D4C6B0;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

/* Иконка и текст */
.ats-icon-sort {
    display: flex;
    align-items: center;
    color: var(--pure-white);
}

.ats-current-sort-label {
    flex-grow: 0;
    font-size: 18px;
    font-weight: 300;
    color: var(--pure-white);
}

.ats-btn-arrow {
    transition: transform 0.3s ease;
    color: #888;
}

/* Поворот стрелки при открытии */
.ats-custom-sort.open .ats-btn-arrow {
    transform: rotate(180deg);
}

/* Dropdown */
.ats-custom-sort__dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #D4C6B0;
    border-top: none;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);

    /* Скрытие */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

/* Состояние открыто */
.ats-custom-sort.open .ats-custom-sort__dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.ats-custom-sort__list {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Элемент списка */
.ats-custom-sort__item {
    padding: 10px 20px;
    cursor: pointer;
    color: #555;
    transition: background 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ats-custom-sort__item:hover {
    background-color: #f9f9f9;
    color: #000;
}

/* Активный элемент */
.ats-custom-sort__item.active {
    background-color: #f5f5f5;
    font-weight: 600;
    color: #D4C6B0;
}

.check-icon {
    font-weight: bold;
}

/**
  * ATS Filter Form
 */
.ats-filter-body {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.ats-filter-section {
    padding: 15px;
    border-bottom: 1px solid var(--dark-40);
}
.ats-filter-sections .ats-filter-section:last-child {
    border-bottom: none;
}

.ats-filter-section__title {
    font-size: 20px;
    font-weight: 400;
}
.ats-filter-option {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    padding-bottom: 10px;
}
.ats-filter-checkbox {
    line-height: 1.25;
}

.ats-filter-actions {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap:10px;
    padding: 15px;
}

.ats-filter-button {
    flex: 0 0 50%;
    padding: 15px 30px;
    border-radius: 100px;
}

.ats-filter-button.ats-filter-button--apply {
    color: var(--pure-white);
    background: linear-gradient(93.26deg, #CABD91 0%, #9D915D 100%);
}

.ats-filter-button.ats-filter-button--reset {
    color: var(--dark);
    background: transparent;
}

/**
 * Filter form
 */
.ats-filter-checkbox__count {
    display: none;
}

/* --- PRICE SLIDER (jQuery UI Styling) --- */
/* --- СЛАЙДЕР ЦЕНЫ (jQuery UI) --- */

/* Контейнер слайдера */
.ats-price-range__slider-wrapper {
    height: 30px; /* Место под слайдер */
    display: flex;
    align-items: center;
    padding: 0 8px; /* Отступ под половину ширины ручки */
    margin-bottom: 20px;
}

/* Полоса (трек) */
#ats-price-slider.ui-slider {
    position: relative;
    width: 100%;
    height: 2px; /* Тонкая линия */
    background: #E0E0E0;
    border: none;
    border-radius: 2px;
}

/* Заполненная часть (Range) */
#ats-price-slider .ui-slider-range {
    position: absolute;
    height: 100%;
    background: #5E5E5E; /* Цвет активной линии */
    display: block;
    top: 0;
}

/* Ручки (Handles) */
#ats-price-slider .ui-slider-handle {
    position: absolute;
    width: 16px;
    height: 16px;
    background: #5E5E5E; /* Цвет ручки */
    border-radius: 50%;
    top: 50%;
    margin-top: -8px; /* Половина высоты */
    margin-left: -8px; /* Половина ширины */
    cursor: pointer;
    outline: none;
    z-index: 2;
    touch-action: none; /* Важно для мобильных */
}

#ats-price-slider .ui-slider-handle:hover,
#ats-price-slider .ui-slider-handle:focus {
    background: #333;
    transform: scale(1.1);
}

.ats-price-range__inputs {
    display: flex;
    flex-direction: row;
    align-items: center;
    width: 100%;
}

.ats-price-range__input-group {
    position: relative;
    flex: 1 1 50%;
}

.ats-price-range__input-group label {
    display: none;
}
.ats-price-range__input-group input {
    display: inline-block;
    box-sizing: border-box;
    width: 100%;
    font-size: 18px;
    padding: 12px 24px;
    border: 1px solid var(--dark-15);
    border-radius: 100px;
}

.ats-price-range__currency {
    display: none ;
}

.ats-price-range__separator {
    flex: 0 0 16px;
    width: 16px;
    margin: 0 20px;
    text-align: center;
}

/** =====================
  *        DESKTOP
  * =====================
 */
@media (min-width: 1025px) {

    /* Buttons */
    .ats-btn-trigger-filter {
        width:auto;
    }

    .ats-custom-sort {
        display: inline-block;
        width:auto;
    }

    .ats-custom-sort__trigger {
        width: auto;
    }

    /* Filter form */

    .ats-filter-section {
        padding: 30px 60px;
    }

    .ats-filter-section:last-child {
        padding-bottom: 30px;
    }

    .ats-filter-actions {
        gap: 20px;
        padding: 30px 60px;
    }

    .ats-price-range__currency {
        display: none ;
        position: absolute;
        top: 15px;
        right: 50px;
    }



    /* Grid */
    .ats-service-results__grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 40px;
    }
    .ats-service-card {
        max-width: 437px;
        border-radius: 10px;
    }

    .ats-service-card__media,
    .cards--short-mobile .ats-service-card__media {
        height: 525px;
    }
}