/* Partner card for warmcontour portal.main */

.p-card,
.p-card * {
    box-sizing: border-box;
}

.p-card {
    --card-pad: 14px;
    --card-radius: 12px;
    --card-bg: #fff;
    --card-muted: #616776;
    --card-soft: #f5f6f8;
    --card-soft-2: #f8f9fb;
    --card-red: #b30000;
    --card-text: #111;

    width: 100%;
    min-width: 0;
    min-height: 487px;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: var(--card-radius);
    background: var(--card-bg);
    color: var(--card-text);
    text-decoration: none;
}

/* gallery */

.p-card__media {
    position: relative;
    width: 100%;
    height: 231px;
    min-height: 231px;
    overflow: hidden;
    background: #f1f3f5;
}

.p-card__media-track {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform .28s ease;
}

.p-card__media-slide {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    min-height: 231px;
    border: 0;
    padding: 0;
    background-color: #f1f3f5;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    font-size: 0;
    line-height: 0;
}

.p-card__media-nav {
    position: absolute;
    top: 50%;
    z-index: 5;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 10px;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, .9);
    color: #111;
    cursor: pointer;
    font-size: 22px;
    line-height: 34px;
    text-align: center;
    transition: opacity .18s ease, visibility .18s ease, background .18s ease;
}

/* Стрелки прячутся до наведения только там, где наведение есть (мышь). Раньше они были скрыты
   всегда: на телефоне и с клавиатуры листать фото было нельзя. */
@media (hover: hover) {
    .p-card__media-nav {
        opacity: 0;
        visibility: hidden;
    }

    .p-card__media:hover .p-card__media-nav,
    .p-card__media:focus-within .p-card__media-nav {
        opacity: 1;
        visibility: visible;
    }
}

.p-card__media-nav--prev {
    left: 10px;
}

.p-card__media-nav--next {
    right: 10px;
}

.p-card__media-dots {
    position: absolute;
    left: 50%;
    bottom: 10px;
    z-index: 4;
    display: flex;
    gap: 6px;
    transform: translateX(-50%);
}

.p-dot {
    width: 6px;
    height: 6px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, .55);
    cursor: pointer;
    font-size: 0;
}

.p-dot.is-active {
    background: rgba(255, 255, 255, .95);
}

/* Зона нажатия точки: 24 px в высоту и весь шаг между точками в ширину, видимая точка — те же 6 px.
   На сенсорных экранах точки разнесены, чтобы зона была 24×24 и не перекрывала соседнюю. */
.p-dot {
    position: relative;
}

.p-dot::before {
    content: "";
    position: absolute;
    inset: -9px -3px;
}

.p-dot:focus-visible,
.p-card__media-nav:focus-visible,
.p-btn:focus-visible {
    outline: 2px solid #b30000;
    outline-offset: 2px;
}

@media (pointer: coarse) {
    .p-card__media-dots {
        gap: 18px;
    }

    .p-dot::before {
        inset: -9px;
    }
}

/* body */

.p-card__body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    padding: var(--card-pad);
}

.p-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.p-card__head-left {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.p-card__logo {
    flex: 0 0 60px;
    width: 60px;
    height: 60px;
    overflow: hidden;
    border-radius: 10px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.p-card__logo img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

.p-card__title {
    min-width: 0;
}

.p-card__title a {
    display: -webkit-box;
    overflow: hidden;
    color: #111;
    font-size: 17px;
    line-height: 1.28;
    font-weight: 700;
    text-decoration: none;
    word-break: break-word;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.p-card__tag {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    padding: 8px 10px;
    border-radius: 8px;
    background: #f8f9fb;
    color: #5b606a;
    font-size: 12px;
    line-height: 1.2;
    white-space: nowrap;
}

.p-card__meta {
    margin: 10px 0 0;
    color: #616776;
    font-size: 13px;
    line-height: 1.35;
}

.p-card__rating-label {
    margin: 14px 0 0;
    color: #616776;
    font-size: 12px;
    line-height: 1.2;
}

.p-card__rating {
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 6px 0 0;
}

/* Оценка кладки и балл — вид метки .wpa-badge общего слоя (19.11.2026), как в каталоге компаний */
.p-card__badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 26px;
    padding: 0 10px;
    border-radius: var(--tc-radius-pill, 999px);
    background: var(--tc-fill, #f1f3f5);
    color: var(--tc-text, #111111);
    font-size: 12px;
    line-height: 1.2;
    font-weight: 500;
    white-space: nowrap;
}

.p-card__badge::before {
    content: "";
    flex: none;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--tc-muted-soft, #6b7280);
}

.p-card__badge--excellent,
.p-card__badge--good {
    background: var(--tc-success-bg, #e9f8ef);
    color: var(--tc-success, #1f7a3a);
}

.p-card__badge--excellent::before,
.p-card__badge--good::before {
    background: var(--tc-success, #1f7a3a);
}

.p-card__badge--ok::before {
    background: var(--tc-warning-dot, #c98200);
}

.p-card__badge--placeholder {
    color: var(--tc-muted, #616776);
}

.p-card__badge--bad {
    background: var(--tc-danger-bg, #fff2f2);
    color: var(--tc-danger, #b30000);
}

.p-card__badge--bad::before {
    background: var(--tc-danger, #b30000);
}

.p-card__score {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 26px;
    padding: 0 10px;
    border-radius: var(--tc-radius-pill, 999px);
    background: var(--tc-fill, #f1f3f5);
    color: var(--tc-muted, #616776);
    font-size: 12px;
    line-height: 1.2;
    font-weight: 500;
    white-space: nowrap;
}

.p-card__info {
    position: relative;
    width: 18px;
    height: 18px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #e6e8ec;
    color: #616776;
    -webkit-appearance: none;
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    font-size: 12px;
    line-height: 1;
    font-weight: 700;
    cursor: help;
}

/* Зона нажатия 24×24 без изменения видимого кружка 18×18. */
.p-card__info::before {
    content: "";
    position: absolute;
    inset: -3px;
}

.p-card__info:focus-visible {
    outline: 2px solid #b30000;
    outline-offset: 2px;
}

/* Подсказка выровнена по правому краю кнопки: «i» стоит у правого края карточки,
   а карточка обрезает всё, что выходит за неё (overflow: hidden), — по центру текст срезался.
   border-box: 230px вместе с отступами — помещается в карточку при ширине окна 1281–1500 px. */
.p-card__info::after {
    content: attr(data-tooltip);
    position: absolute;
    right: -6px;
    bottom: calc(100% + 10px);
    z-index: 50;
    box-sizing: border-box;
    width: 230px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 18px rgba(0, 0, 0, .08);
    color: #111;
    font-size: 12px;
    line-height: 1.35;
    font-weight: 500;
    text-align: left;
    white-space: normal;
    /* display:none, а не opacity:0 — скрытый тултип не должен расширять
       scroll-область страницы (горизонтальное переполнение на мобильных) */
    display: none;
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s ease, transform .15s ease;
}

/* :focus — подсказка открывается и по нажатию (телефон, мышь); is-tip-dismissed — закрыта по Escape (script.js). */
.p-card__info:hover::after,
.p-card__info:focus::after {
    display: block;
    opacity: 1;
    transform: translateY(-2px);
}

.p-card__info.is-tip-dismissed::after {
    display: none;
}

.p-card__kpis {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.p-card__kpi {
    min-width: 0;
    padding: 10px;
    border-radius: 8px;
    background: #f8f9fb;
}

.p-card__kpi span {
    display: block;
    color: #616776;
    font-size: 12px;
    line-height: 1.2;
    font-weight: 500;
}

.p-card__kpi-value {
    display: block;
    margin-top: 8px;
    color: #000;
    font-size: 16px;
    line-height: 1;
    font-weight: 600;
}

.p-card__actions {
    display: flex;
    gap: 10px;
    margin-top: auto;
    padding-top: 14px;
}

/* «Подробнее» — .wpa-btn общего слоя (ui.css, 18.11.2026): была красной — в ленте карточек выходило
   по красной кнопке на каждую; страница с карточкой должна подключать ui.css (главная портала — да). */
.p-btn {
    flex: 1 1 auto;
}

/* Hide global drawer until JS opens it */

.bdrawer {
    display: none;
}

.bdrawer.is-open {
    display: block;
}

/* Drawer */

.bdrawer {
    position: fixed;
    inset: 0;
    z-index: 999999;
}

.bdrawer__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .45);
}

.bdrawer__panel {
    position: absolute;
    top: 0;
    right: 0;
    width: min(560px, 92vw);
    height: 100%;
    overflow: auto;
    background: #fff;
}

.bdrawer__close {
    position: sticky;
    top: 0;
    z-index: 5;
    width: 100%;
    min-height: 54px;
    border: 0;
    border-bottom: 1px solid #f1f3f5;
    background: #fff;
    color: #b30000;
    cursor: pointer;
    text-align: right;
    padding: 0 20px;
    font-weight: 700;
}

.bdrawer__content {
    padding: 24px;
}

/* Portal section grid */

.wc-partners-section {
    margin-bottom: 250px;
}

.wc-partners-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr)) 410px;
    gap: 20px;
    align-items: stretch;
}

.wc-partners-catalog-card {
    min-height: 487px;
    border-radius: 10px;
    background: #fff;
    color: #000;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 28px;
    text-align: center;
}

.wc-partners-catalog-card__icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: #f1f3f5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 34px;
    line-height: 1;
}

.wc-partners-catalog-card__title {
    max-width: 260px;
    font-size: 28px;
    line-height: 1.12;
    font-weight: 500;
}

@media (max-width: 1500px) {
    .wc-partners-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) 340px;
    }
}

@media (max-width: 1280px) {
    .wc-partners-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .wc-partners-catalog-card {
        min-height: 320px;
    }
}

@media (max-width: 760px) {
    .wc-partners-grid {
        grid-template-columns: 1fr;
    }
}
