/*
 * Типографика сайта — единый источник истины (epil-core, модуль Typography).
 * Manrope — заголовки, Inter — текст. Размеры заголовков плавно меняются от 375 до 1440 px (clamp).
 *
 * Тема Listivo берёт шрифты из глобальных переменных Elementor (--e-global-typography-*). Kit Elementor задаёт их
 * селектором .elementor-kit-<id> (в т.ч. в @media); здесь они переопределяются селектором с большей специфичностью,
 * поэтому шкала одинакова на всех страницах независимо от настроек в базе.
 */
:root,
html body,
html body[class*="elementor-kit-"] {
    /* Семейства */
    --epil-font-heading: "Manrope", "Inter", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
    --epil-font-text: "Inter", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;

    /* Шкала: 13 / 14 / 16 / 18 — текст; заголовки — плавно телефон → компьютер */
    --epil-fs-h1: clamp(32px, 26.37px + 1.502vw, 48px);
    --epil-fs-h2: clamp(26px, 22.48px + 0.939vw, 36px);
    --epil-fs-h3: clamp(22px, 19.89px + 0.563vw, 28px);
    --epil-fs-h4: clamp(19px, 17.94px + 0.282vw, 22px);
    --epil-fs-h5: clamp(17px, 16.65px + 0.094vw, 18px);
    --epil-fs-h6: 16px;
    --epil-fs-lg: 18px;
    --epil-fs-text: 16px;
    --epil-fs-sm: 14px;
    --epil-fs-xs: 13px;

    /* Переменные темы Listivo */
    --font-heading: var(--epil-font-heading);
    --font-text: var(--epil-font-text);

    /* Глобальная типографика Elementor / Listivo (системные стили kit-а) */
    --e-global-typography-lheading1-font-family: var(--epil-font-heading);
    --e-global-typography-lheading1-font-size: var(--epil-fs-h1);
    --e-global-typography-lheading1-font-weight: 700;
    --e-global-typography-lheading1-line-height: 1.15;
    --e-global-typography-lheading1-letter-spacing: -0.02em;

    --e-global-typography-lheading2-font-family: var(--epil-font-heading);
    --e-global-typography-lheading2-font-size: var(--epil-fs-h2);
    --e-global-typography-lheading2-font-weight: 700;
    --e-global-typography-lheading2-line-height: 1.2;
    --e-global-typography-lheading2-letter-spacing: -0.015em;

    --e-global-typography-lheading3-font-family: var(--epil-font-heading);
    --e-global-typography-lheading3-font-size: var(--epil-fs-h3);
    --e-global-typography-lheading3-font-weight: 700;
    --e-global-typography-lheading3-line-height: 1.25;
    --e-global-typography-lheading3-letter-spacing: -0.01em;

    --e-global-typography-lheading4-font-family: var(--epil-font-heading);
    --e-global-typography-lheading4-font-size: var(--epil-fs-h4);
    --e-global-typography-lheading4-font-weight: 700;
    --e-global-typography-lheading4-line-height: 1.3;
    --e-global-typography-lheading4-letter-spacing: -0.005em;

    --e-global-typography-lheading5-font-family: var(--epil-font-heading);
    --e-global-typography-lheading5-font-size: var(--epil-fs-h5);
    --e-global-typography-lheading5-font-weight: 600;
    --e-global-typography-lheading5-line-height: 1.35;
    --e-global-typography-lheading5-letter-spacing: 0;

    --e-global-typography-lheading6-font-family: var(--epil-font-heading);
    --e-global-typography-lheading6-font-size: var(--epil-fs-h6);
    --e-global-typography-lheading6-font-weight: 600;
    --e-global-typography-lheading6-line-height: 1.4;
    --e-global-typography-lheading6-letter-spacing: 0;

    --e-global-typography-llabel-font-family: var(--epil-font-text);
    --e-global-typography-llabel-font-size: var(--epil-fs-sm);
    --e-global-typography-llabel-font-weight: 500;
    --e-global-typography-llabel-line-height: 1.4;
    --e-global-typography-llabel-letter-spacing: 0;

    --e-global-typography-ltext1-font-family: var(--epil-font-text);
    --e-global-typography-ltext1-font-size: var(--epil-fs-text);
    --e-global-typography-ltext1-font-weight: 400;
    --e-global-typography-ltext1-line-height: 1.6;
    --e-global-typography-ltext1-letter-spacing: 0;

    --e-global-typography-ltext1bold-font-family: var(--epil-font-text);
    --e-global-typography-ltext1bold-font-size: var(--epil-fs-text);
    --e-global-typography-ltext1bold-font-weight: 600;
    --e-global-typography-ltext1bold-line-height: 1.6;
    --e-global-typography-ltext1bold-letter-spacing: 0;

    --e-global-typography-ltext2-font-family: var(--epil-font-text);
    --e-global-typography-ltext2-font-size: var(--epil-fs-sm);
    --e-global-typography-ltext2-font-weight: 400;
    --e-global-typography-ltext2-line-height: 1.5;
    --e-global-typography-ltext2-letter-spacing: 0;

    --e-global-typography-ltext2bold-font-family: var(--epil-font-text);
    --e-global-typography-ltext2bold-font-size: var(--epil-fs-sm);
    --e-global-typography-ltext2bold-font-weight: 600;
    --e-global-typography-ltext2bold-line-height: 1.5;
    --e-global-typography-ltext2bold-letter-spacing: 0;

    /* Системные стили Elementor по умолчанию (для виджетов без своих настроек) */
    --e-global-typography-primary-font-family: var(--epil-font-heading);
    --e-global-typography-primary-font-weight: 700;
    --e-global-typography-secondary-font-family: var(--epil-font-heading);
    --e-global-typography-secondary-font-weight: 600;
    --e-global-typography-text-font-family: var(--epil-font-text);
    --e-global-typography-text-font-weight: 400;
    --e-global-typography-accent-font-family: var(--epil-font-text);
    --e-global-typography-accent-font-weight: 600;
}

body {
    font-family: var(--epil-font-text);
    font-size: var(--epil-fs-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Заголовки в обычном контенте (блог, описание студии, страницы без Elementor-настроек) */
h1, h2, h3, h4, h5, h6,
.elementor-heading-title {
    font-family: var(--epil-font-heading);
}

.entry-content h1, .listivo-listing-section__text h1 { font-size: var(--epil-fs-h1); line-height: 1.15; }
.entry-content h2, .listivo-listing-section__text h2 { font-size: var(--epil-fs-h2); line-height: 1.2; }
.entry-content h3, .listivo-listing-section__text h3 { font-size: var(--epil-fs-h4); line-height: 1.3; }
.entry-content h4, .listivo-listing-section__text h4 { font-size: var(--epil-fs-h5); line-height: 1.35; }

/* Цифры (цены, телефоны, рейтинги) — одной ширины и на одной линии */
.price-table,
.listivo-listing-card-row__price,
.listivo-listing-card-v3__price,
.epil-ratings,
.epil-contacts__phone,
.epil-card-stars {
    font-variant-numeric: tabular-nums lining-nums;
}

/* Тема рисует крупные цифры (счётчики, значения характеристик) декоративным Monoton — заменяем на шрифт заголовков */
html body .listivo-attributes-v3__value,
html body .listivo-stats-v3__value {
    font-family: var(--epil-font-heading);
    font-weight: 700;
    font-variant-numeric: tabular-nums lining-nums;
}

/* Карта Leaflet (кнопки масштаба, подпись OpenStreetMap) — шрифт сайта вместо Helvetica */
html body .leaflet-container,
html body .leaflet-container .leaflet-control-zoom-in,
html body .leaflet-container .leaflet-control-zoom-out {
    font-family: var(--epil-font-text);
}

/* Поля ввода и кнопки — тем же шрифтом, что и текст */
input, select, textarea, button {
    font-family: var(--epil-font-text);
}

/* Преимущества студии (виджет «Атрибуты» на странице студии) — компактные плашки в строку с переносом.
   Additional CSS ставит их столбиком с !important; селектор с html body специфичнее и побеждает. */
html body .listivo-listing-attributes .listivo-tags {
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 6px 8px !important;
}

html body .listivo-listing-attributes .listivo-tags .listivo-tag {
    padding: 4px 10px !important;
    border-radius: 6px !important;
    font-size: var(--epil-fs-xs);
    font-weight: 500;
    line-height: 1.4;
    white-space: nowrap;
}

/* Хлебные крошки и виды эпиляции на странице студии — тем же размером, что плашки-преимущества (13 px) */
html body .listivo-breadcrumbs-v2__item,
html body .listivo-breadcrumbs-v2__separator {
    font-size: var(--epil-fs-xs) !important;
    line-height: 1.4 !important;
}

html body .listivo-listing-attributes-v3 {
    gap: 6px 8px !important;
}

html body .listivo-listing-attribute-v3 {
    height: auto !important;
    min-height: 0 !important;
    padding: 4px 10px !important;
    border-radius: 6px !important;
    font-size: var(--epil-fs-xs) !important;
    font-weight: 500;
    line-height: 1.4 !important;
}
