/* KFK Project Chips 1.0.6
 * Оформление ОТДЕЛЬНОЙ карточки: как оригинальные персиковые теги до установки 1.0.0.
 * Листинг: компактное оформление только для новых бань BN-*.
 */
.kfk-domk-tags .kfkpc-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    column-gap: 6px;
    row-gap: 8px;
    list-style: none;
    padding: 0;
    margin: 0 0 16px;
}
.kfk-domk-tags .kfkpc-list > li.kfkpc-item {
    display: block;
    padding: 0;
    margin: 0;
    list-style: none;
    background: transparent;
    border: 0;
}
.kfk-domk-tags .kfkpc-list > li.kfkpc-item > .kfkpc-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-height: 36px;
    padding: 7px 19px;
    border-radius: 999px;
    background: #f8ddbc;
    color: #000;
    font-size: 16px;
    font-weight: 400;
    line-height: 22px;
    white-space: nowrap;
    text-decoration: none;
}
/* В остальных блоках страницы и на листингах сохраняются размеры и стили темы. */
.kfkpc-item .kfkpc-chip { color: inherit; font: inherit; }
@media (max-width: 480px) {
    .kfk-domk-tags .kfkpc-list > li.kfkpc-item > .kfkpc-chip {
        padding: 7px 14px;
        font-size: 14px;
        line-height: 20px;
    }
}


/* 1.0.4 — аккуратный листинг импортированных бань.
 * Метка kfkpc-bath-listing ставится только карточкам с подтвержденным кодом BN-*.
 * Обычные дома, изделия, старые бани и отдельная страница проекта не затрагиваются.
 */
.related-bot ul.kfkpc-bath-listing {
    display: flex !important;
    flex-flow: row wrap !important;
    justify-content: flex-start !important;
    align-items: flex-start !important;
    gap: 6px !important;
    margin: 2px 0 14px !important;
    padding: 0 !important;
    list-style: none !important;
    max-width: 100%;
}
.related-bot ul.kfkpc-bath-listing > li.kfkpc-item {
    display: block !important;
    flex: 0 1 auto !important;
    float: none !important;
    width: auto !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    list-style: none !important;
}
.related-bot ul.kfkpc-bath-listing > li.kfkpc-item > .kfkpc-chip {
    display: inline-flex !important;
    align-items: center;
    box-sizing: border-box;
    max-width: 100%;
    padding: 5px 10px !important;
    border-radius: 999px !important;
    border: 0 !important;
    background: #f8ddbc !important;
    color: #372513 !important;
    font-family: inherit !important;
    font-size: 12.5px !important;
    font-weight: 500 !important;
    line-height: 1.3 !important;
    white-space: normal;
    text-decoration: none !important;
}

/* Заголовок больше не делит узкую строку с ценой.
 * Фильтр :has() ограничивает правила карточками с коротким списком BN-*.
 */
.related-mid:has(~ .related-bot ul.kfkpc-bath-listing) {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    gap: 7px !important;
    height: auto !important;
    min-height: 0 !important;
    width: 100% !important;
    margin-bottom: 12px !important;
}
.related-mid:has(~ .related-bot ul.kfkpc-bath-listing) .uk-h3 {
    display: block !important;
    position: static !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    float: none !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
    overflow-wrap: anywhere;
    text-align: left !important;
}
.related-mid:has(~ .related-bot ul.kfkpc-bath-listing) .related-price {
    display: block !important;
    position: static !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    float: none !important;
    clear: both !important;
    text-align: left !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
}
.related-mid:has(~ .related-bot ul.kfkpc-bath-listing) .related-price .kfk-pr-zapr {
    white-space: nowrap;
}
/* Если тема использует более общий контейнер карточки — сохраняем кнопку ниже чипов. */
.related-bot:has(ul.kfkpc-bath-listing) .cat-more {
    clear: both;
    margin-top: 0 !important;
}
@media (max-width: 480px) {
    .related-bot ul.kfkpc-bath-listing > li.kfkpc-item > .kfkpc-chip {
        font-size: 12px !important;
        padding: 5px 9px !important;
    }
}


/* 1.0.5 — единый макет карточек бань в каталоге.
 * Не полагаемся на соседство related-mid и related-bot (как в 1.0.4):
 * в живой теме между ними могут быть дополнительные контейнеры.
 * Скоуп: только архивы бань + карточки с маркером kfkpc-bath-listing.
 */
body.kfkpc-bath-archive .kfk-domk-related-item,
.kfk-domk-related-item:has(ul.kfkpc-bath-listing) {
    display: flex !important;
    flex-direction: column !important;
    align-self: stretch;
}
body.kfkpc-bath-archive .kfk-domk-related-item-ins,
.kfk-domk-related-item-ins:has(ul.kfkpc-bath-listing) {
    display: flex !important;
    flex-direction: column !important;
    box-sizing: border-box !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 495px;
}
/* Название и цена — два самостоятельных ряда без 30%-ной колонки. */
body.kfkpc-bath-archive .related-mid,
.kfk-domk-related-item-ins:has(ul.kfkpc-bath-listing) .related-mid {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    gap: 9px !important;
    box-sizing: border-box !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 13px 0 12px !important;
    padding: 0 !important;
    float: none !important;
}
body.kfkpc-bath-archive .related-mid .uk-h3,
.kfk-domk-related-item-ins:has(ul.kfkpc-bath-listing) .related-mid .uk-h3 {
    display: block !important;
    flex: none !important;
    float: none !important;
    position: static !important;
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 44px !important;
    margin: 0 !important;
    padding: 0 !important;
    text-align: left !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
    overflow-wrap: break-word !important;
    white-space: normal !important;
}
body.kfkpc-bath-archive .related-mid .related-price,
.kfk-domk-related-item-ins:has(ul.kfkpc-bath-listing) .related-mid .related-price {
    display: block !important;
    flex: none !important;
    float: none !important;
    clear: both !important;
    position: static !important;
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 9px 0 0 !important;
    border-top: 1px solid rgba(156, 105, 45, .14) !important;
    text-align: left !important;
    color: #392719 !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    line-height: 1.35 !important;
    white-space: normal !important;
}
body.kfkpc-bath-archive .related-mid .related-price .kfk-pr-zapr,
.kfk-domk-related-item-ins:has(ul.kfkpc-bath-listing) .related-price .kfk-pr-zapr {
    display: inline !important;
    font-size: inherit !important;
    line-height: inherit !important;
    font-weight: inherit !important;
    white-space: normal !important;
}
/* Списки и кнопка располагаются одинаково у новых и существующих бань. */
body.kfkpc-bath-archive .related-bot,
.kfk-domk-related-item-ins:has(ul.kfkpc-bath-listing) .related-bot {
    display: flex !important;
    flex: 1 0 auto !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    box-sizing: border-box !important;
    width: 100% !important;
    margin-top: 0 !important;
}
body.kfkpc-bath-archive .related-bot > ul,
.kfk-domk-related-item-ins:has(ul.kfkpc-bath-listing) .related-bot ul.kfkpc-bath-listing {
    display: flex !important;
    flex-flow: row wrap !important;
    align-content: flex-start !important;
    align-items: center !important;
    gap: 6px !important;
    width: 100% !important;
    margin: 0 0 12px !important;
    padding: 0 !important;
    list-style: none !important;
}
body.kfkpc-bath-archive .related-bot > ul > li,
.kfk-domk-related-item-ins:has(ul.kfkpc-bath-listing) .related-bot ul.kfkpc-bath-listing > li {
    display: inline-flex !important;
    align-items: center !important;
    flex: none !important;
    float: none !important;
    box-sizing: border-box !important;
    max-width: 100% !important;
    width: auto !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 5px 10px !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: #f8ddbc !important;
    color: #372513 !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    line-height: 1.25 !important;
    list-style: none !important;
    white-space: normal !important;
}
body.kfkpc-bath-archive .related-bot > ul > li .kfkpc-chip,
.kfk-domk-related-item-ins:has(ul.kfkpc-bath-listing) ul.kfkpc-bath-listing > li .kfkpc-chip {
    display: inline !important;
    box-sizing: border-box !important;
    padding: 0 !important;
    margin: 0 !important;
    min-height: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: inherit !important;
    font: inherit !important;
    white-space: inherit !important;
}
body.kfkpc-bath-archive .related-bot .cat-more,
.kfk-domk-related-item-ins:has(ul.kfkpc-bath-listing) .related-bot .cat-more {
    display: block !important;
    float: none !important;
    clear: both !important;
    margin: auto 0 0 !important;
    padding: 8px 0 0 !important;
    align-self: flex-start !important;
}
@media (max-width: 767px) {
    body.kfkpc-bath-archive .kfk-domk-related-item-ins,
    .kfk-domk-related-item-ins:has(ul.kfkpc-bath-listing) {
        min-height: 0 !important;
    }
    body.kfkpc-bath-archive .related-mid .uk-h3,
    .kfk-domk-related-item-ins:has(ul.kfkpc-bath-listing) .related-mid .uk-h3 {
        min-height: 0 !important;
    }
}

/* 1.0.6 — JS attaches these classes after locating the actual price/title DOM.
 * The inline important declarations on these two nodes override old theme floats. */
body.kfkpc-bath-archive .kfkpc-price-stack {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    grid-column: 1 / -1 !important;
    box-sizing: border-box !important;
}
body.kfkpc-bath-archive .kfkpc-price-stack > .kfkpc-price-stack-title,
body.kfkpc-bath-archive .kfkpc-price-stack > .kfkpc-price-stack-value {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    float: none !important;
    position: static !important;
    text-align: left !important;
    white-space: normal !important;
}

/* 1.0.7 — uniform visual hierarchy for baths. Content heights are
 * synchronized by listing-price-stack.js only within each actual desktop row.
 * The price-on-request label uses the same typographic weight as numeric prices.
 */
body.kfkpc-bath-archive .kfkpc-price-stack-value,
body.kfkpc-bath-archive .kfkpc-price-stack-value .kfk-pr-zapr {
    font-weight: 600 !important;
    line-height: 1.4 !important;
}


/* 1.0.8 — target the actual <ul> marker, NOT a presumed parent class.
 * Keep a real inter-row gap when imported BN-* chips wrap. Older baths without
 * .kfkpc-item do not get their chip style changed. No card-title/price changes.
 */
body.kfkpc-bath-archive ul.kfkpc-bath-listing:has(> li.kfkpc-item) {
    display: flex !important;
    flex-flow: row wrap !important;
    align-items: flex-start !important;
    align-content: flex-start !important;
    justify-content: flex-start !important;
    column-gap: 6px !important;
    row-gap: 10px !important;
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    padding: 0 !important;
    margin: 0 0 14px !important;
    list-style: none !important;
    line-height: normal !important;
}
body.kfkpc-bath-archive ul.kfkpc-bath-listing > li.kfkpc-item {
    display: inline-flex !important;
    flex: 0 0 auto !important;
    align-items: center !important;
    align-self: auto !important;
    box-sizing: border-box !important;
    position: static !important;
    float: none !important;
    clear: none !important;
    max-width: 100% !important;
    width: auto !important;
    min-height: 24px !important;
    height: auto !important;
    margin: 0 !important;
    padding: 3px 9px !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: #f8ddbc !important;
    font-size: 12px !important;
    line-height: 18px !important;
    font-weight: 500 !important;
    color: #372513 !important;
    white-space: normal !important;
    text-indent: 0 !important;
    transform: none !important;
}
body.kfkpc-bath-archive ul.kfkpc-bath-listing > li.kfkpc-item > span.kfkpc-chip {
    display: block !important;
    box-sizing: border-box !important;
    width: auto !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    color: inherit !important;
    font-size: inherit !important;
    font-weight: inherit !important;
    line-height: inherit !important;
    white-space: normal !important;
    position: static !important;
    transform: none !important;
}
