/*
 * Epil: главная - строка VIP / «Рекомендуем» и 16 студий (epil_home_studios), плитки видов эпиляции (epil_home_categories).
 * Карточки - те же, что в каталоге (views/catalog/card.php, стили catalog-explorer.css), здесь - вертикальный вид.
 */
.epil-homes,
.epil-homecats {
    --mx-accent: var(--e-global-color-lprimary1, #e898f7);
    --mx-accent-dark: #c55fe6;
    --mx-accent-soft: #fbf0fe;
    --mx-text: var(--e-global-color-lcolor1, #374b5c);
    --mx-muted: var(--e-global-color-lcolor2, #73818c);
    --mx-line: var(--e-global-color-lcolor3, #d5e3ee);
    --mx-soft: var(--e-global-color-lcolor4, #f2f4f8);
    --mx-premium: #8b7ae6;
    --mx-premium-soft: #f5f2ff;
    --mx-green: #22c55e;
    --mx-star: #ffb800;

    color: var(--mx-text);
    font-family: var(--epil-font-text, inherit);
    font-size: 14px;
}

.epil-homes *,
.epil-homes *::before,
.epil-homes *::after,
.epil-homecats *,
.epil-homecats *::before,
.epil-homecats *::after {
    box-sizing: border-box;
}

/* ===== Заголовок «Лучшие студии в [Ташкенте ▾]» - город открывает окошко выбора (стиль - как заголовки секций темы) ===== */
.epil-homes__head {
    margin-bottom: 26px;
}

html body .epil-homes__heading {
    margin: 0;
    color: var(--mx-text);
    font-family: var(--epil-font-heading, Manrope, Inter, sans-serif);
    font-size: 36px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.015em;
}

html body .epil-homes__city-btn {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    margin: 0;
    padding: 0 2px;
    border: 0;
    border-bottom: 3px dashed rgba(216, 110, 236, .45);
    border-radius: 0;
    background: none;
    color: var(--mx-accent, #e898f7);
    font: inherit;
    letter-spacing: inherit;
    line-height: inherit;
    cursor: pointer;
    transition: color .15s ease, border-color .15s ease;
}

html body .epil-homes__city-btn:hover,
html body .epil-homes__city-btn:focus-visible {
    border-bottom-color: #d86eec;
    background: none;
    color: #c55fe6;
}

.epil-homes__city-btn:focus-visible {
    outline: 2px solid #d86eec;
    outline-offset: 4px;
}

.epil-homes__caret {
    align-self: center;
    width: .6em;
    height: .6em;
    transition: transform .15s ease;
}

.epil-homes__city-btn:hover .epil-homes__caret {
    transform: translateY(2px);
}

html body .epil-homes__fallback {
    margin: 8px 0 0;
    color: var(--mx-muted);
    font-size: 14px;
}

/* ===== Шапки блоков ===== */
.epil-homes__block + .epil-homes__block {
    margin-top: 48px;
}

.epil-homes__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

/* «VIP и рекомендуемые» - жёлтая плашка в цвет VIP-стикера */
.epil-homes__label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 14px 0 10px;
    border-radius: 999px;
    background: #fef9c3;
    color: #713f12;
    font-size: 13px;
    font-weight: 700;
}

.epil-homes__label svg {
    width: 16px;
    height: 16px;
    color: #ca8a04;
}

html body .epil-homes__title {
    margin: 0;
    color: var(--mx-text);
    font-family: var(--epil-font-heading, inherit);
    font-size: 24px;
    font-weight: 700;
    line-height: 1.25;
}

.epil-homes__footer {
    display: flex;
    justify-content: center;
    margin-top: 28px;
}

html body .epil-homes__more {
    height: 46px;
    padding: 0 28px;
    font-size: 14px;
}

html body .epil-homes__all {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 6px;
    color: #b44fc9;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.epil-homes__all svg {
    width: 18px;
    height: 18px;
    transition: transform .15s ease;
}

.epil-homes__all:hover svg {
    transform: translateX(3px);
}

/* ===== Сетка: карточка каталога в вертикальном виде ===== */
.epil-homes__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.epil-homes .epil-catx-card {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    gap: 12px;
}

html body .epil-homes .epil-catx-card__img {
    min-height: 0;
    aspect-ratio: 4 / 3;
}

.epil-homes .epil-catx-card__body {
    padding: 0 4px 4px;
}

html body .epil-homes .epil-catx-card__name {
    font-size: 16px;
}

/* Теги категорий - в каталоге; на главной карточки одной высоты */
.epil-homes .epil-catx-card__tags {
    display: none;
}

/* Внизу карточки - «Подробнее» на всю ширину и иконка мессенджера; «Онлайн-запись» - на странице студии */
.epil-homes .epil-catx-card__actions {
    flex-wrap: nowrap;
}

.epil-homes .epil-catx-btn--primary {
    flex: 1 1 auto;
}

.epil-homes .epil-catx-btn--outline {
    display: none;
}

@media (max-width: 1100px) {
    .epil-homes__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Телефон: карточки листаются вбок, видно край следующей карточки */
@media (max-width: 767px) {
    .epil-homes__head {
        margin-bottom: 16px;
    }

    html body .epil-homes__heading {
        font-size: 26px;
    }

    .epil-homes__block + .epil-homes__block {
        margin-top: 32px;
    }

    .epil-homes__bar {
        margin-bottom: 12px;
    }

    html body .epil-homes__title {
        font-size: 20px;
    }

    .epil-homes__footer {
        margin-top: 8px;
    }

    .epil-homes__grid {
        grid-template-columns: none;
        grid-auto-columns: 82%;
        grid-auto-flow: column;
        gap: 12px;
        margin: 0 -16px;
        padding: 4px 16px 14px;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scroll-padding: 0 16px;
        scrollbar-width: none;
    }

    .epil-homes__grid::-webkit-scrollbar {
        display: none;
    }

    .epil-homes .epil-catx-card {
        scroll-snap-align: start;
    }
}

/* ===== Плитки видов лазерной эпиляции ===== */
.epil-homecats__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.epil-homecats__grid li {
    margin: 0;
}

html body .epil-homecats__tile {
    display: flex;
    align-items: center;
    gap: 16px;
    height: 100%;
    padding: 18px 20px;
    border: 1.5px solid transparent;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .06);
    color: var(--mx-text);
    text-decoration: none;
    transition: box-shadow .15s ease, transform .15s ease, border-color .15s ease;
}

html body .epil-homecats__tile:hover {
    border-color: #d86eec;
    box-shadow: 0 14px 34px rgba(15, 23, 42, .12);
    color: var(--mx-text);
    transform: translateY(-2px);
}

.epil-homecats__icon {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: #fbeefe;
    color: #b44fc9;
}

.epil-homecats__icon svg {
    width: 28px;
    height: 28px;
}

.epil-homecats__text {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.epil-homecats__name {
    font-family: var(--epil-font-heading, inherit);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
}

.epil-homecats__count {
    color: var(--mx-muted);
    font-size: 13px;
}

.epil-homecats__arrow {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    color: #d86eec;
    transition: transform .15s ease;
}

.epil-homecats__tile:hover .epil-homecats__arrow {
    transform: translateX(3px);
}

@media (max-width: 1100px) {
    .epil-homecats__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .epil-homecats__grid {
        gap: 10px;
    }

    html body .epil-homecats__tile {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 14px;
        border-radius: 16px;
    }

    .epil-homecats__icon {
        width: 42px;
        height: 42px;
        border-radius: 12px;
    }

    .epil-homecats__icon svg {
        width: 22px;
        height: 22px;
    }

    .epil-homecats__name {
        font-size: 14px;
    }

    .epil-homecats__arrow {
        display: none;
    }
}
