/* Текстовые страницы (include/text_page_top.php): «Покупателям», «Партнерам»,
   «О нас», «Поддержка». Текст прямо на сером фоне страницы (без белой
   подложки); карточки и выноски внутри — белые; типографика длинного текста. */
.text-page {
    position: relative;
    line-height: 1.6;
}
.text-page > :last-child {
    margin-bottom: 0;
}
.text-page h2 {
    font-size: 1.5rem;
    margin: 2rem 0 1rem;
}
.text-page h3 {
    font-size: 1.25rem;
    margin: 1.75rem 0 .75rem;
}
.text-page h4 {
    font-size: 1.05rem;
    margin: 1.25rem 0 .5rem;
}
.text-page > h2:first-child,
.text-page > h3:first-child {
    margin-top: 0;
}
.text-page p,
.text-page ul,
.text-page ol {
    margin-bottom: 1rem;
}
.text-page ul,
.text-page ol {
    padding-left: 1.25rem;
}
.text-page li + li {
    margin-top: .35rem;
}
.text-page a {
    color: #1976d2;
}
.text-page .lead {
    font-size: 1.1rem;
}

/* Таблица «название — значение» (реквизиты, контакты, оплата). */
.text-page .text-page__props {
    width: 100%;
    margin-bottom: 1.5rem;
    border-collapse: collapse;
}
.text-page .text-page__props th,
.text-page .text-page__props td {
    padding: .6rem 0;
    border-bottom: 1px solid #dcdcdc;
    vertical-align: top;
}
.text-page .text-page__props th {
    width: 40%;
    padding-right: 1.5rem;
    font-weight: 500;
    color: #6c757d;
}
@media (max-width: 575.98px) {
    .text-page .text-page__props th,
    .text-page .text-page__props td {
        display: block;
        width: 100%;
        padding: 0;
        border: 0;
    }
    .text-page .text-page__props th {
        padding-top: .75rem;
    }
    .text-page .text-page__props td {
        padding-bottom: .75rem;
        border-bottom: 1px solid #dcdcdc;
    }
}

/* Карточки внутри текста (способы оплаты/доставки, вакансии, отзывы). */
.text-page .text-page__cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.text-page .text-page__card {
    position: relative;
    padding: 1.25rem;
    background: #ffffff;
}
/* Скошенный угол у карточки — как у блоков сайта. */
.text-page .text-page__card:after {
    -webkit-box-sizing: border-box;
            box-sizing: border-box;
    border-style: solid;
    border-color: transparent;
    border-width: 10px;
    content: "";
    display: block;
    bottom: 0;
    position: absolute;
    height: 0;
    border-bottom-color: #efefef;
    border-right-color: #efefef;
    right: 0;
}
.text-page .text-page__card h3,
.text-page .text-page__card h4 {
    margin-top: 0;
}
.text-page .text-page__card > :last-child {
    margin-bottom: 0;
}
.text-page .text-page__note {
    padding: 1rem 1.25rem;
    border-left: 3px solid #1976d2;
    background: #ffffff;
    margin-bottom: 1.5rem;
}

/* Карточка с логотипом (транспортные компании). */
.text-page .text-page__card--logo {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 96px;
}
.text-page .text-page__card--logo img {
    max-width: 100%;
    height: 32px;
}

/* Отзывы. */
.text-page .review + .review {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #dcdcdc;
}
.text-page .review__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .25rem 1rem;
    margin-bottom: .5rem;
}
.text-page .review__author {
    font-weight: 500;
}

/* Вопросы и ответы — раскрывающиеся <details>. */
.text-page .faq details {
    border-bottom: 1px solid #dcdcdc;
}
.text-page .faq summary {
    position: relative;
    padding: 1rem 2rem 1rem 0;
    font-weight: 500;
    cursor: pointer;
    list-style: none;
}
.text-page .faq summary::-webkit-details-marker {
    display: none;
}
.text-page .faq summary:after {
    content: "+";
    position: absolute;
    right: 0;
    top: .85rem;
    font-size: 1.25rem;
    line-height: 1;
    color: #1976d2;
}
.text-page .faq details[open] summary:after {
    content: "−";
}
.text-page .faq summary:focus-visible {
    outline: 2px solid #1976d2;
    outline-offset: 2px;
}
.text-page .faq details > div {
    padding-bottom: 1rem;
}

/* Термины (политика cookie). */
.text-page .text-page__terms dt {
    font-weight: 500;
}
.text-page .text-page__terms dd {
    margin: 0 0 1rem;
}

/* Подписка на рассылку (js/subscribe.js): «Будьте в курсе» и подвал. */
.subscribe-trap {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}
.subscribe-status:empty {
    display: none;
}
.subscribe-status.is-success {
    color: #28a745;
}
.subscribe-status.is-error {
    color: #dc3545;
}
/* «Отписаться от рассылки» — ссылкой рядом с кнопкой. */
.subscribe-mode-toggle {
    margin: .5rem 0 .5rem 1.5rem;
    padding: 0;
    border: 0;
    background: none;
    color: #6c757d;
    text-decoration: underline;
    cursor: pointer;
}
.subscribe-mode-toggle:hover,
.subscribe-mode-toggle:focus {
    color: #1976d2;
}
#footer .subscribe-status.is-success {
    color: #8fdc9f;
}
#footer .subscribe-status.is-error {
    color: #ff9aa4;
}
#footer .subscribe-consent {
    opacity: .6;
}
#footer .subscribe-consent a {
    color: inherit;
    text-decoration: underline;
}

/* Скриншоты в тексте («Гайд по сайту»): белая рамка, подпись, по клику —
   полный размер (fancybox, data-fancybox="guide"). */
.text-page .guide-shot {
    margin: 0 0 1.75rem;
}
.text-page .guide-shot a {
    display: block;
    padding: 6px;
    background: #ffffff;
    -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
            box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
    cursor: zoom-in;
}
.text-page .guide-shot img {
    display: block;
    width: 100%;
    height: auto;
}
.text-page .guide-shot figcaption {
    margin-top: .5rem;
    font-size: .875rem;
    color: #6c757d;
}
/* Скриншот телефона — узкий. */
.text-page .guide-shot--phone {
    max-width: 280px;
}
/* Письмо — шириной с почтовую программу. */
.text-page .guide-shot--mail {
    max-width: 440px;
}
.text-page code {
    padding: .1rem .3rem;
    background: #ffffff;
    color: #212529;
}

/* Раздел партнёра: шапка уезжает вверх (#header.partner-page), поэтому
   Заказы / Избранное / Корзина / профиль дублируются вертикальной панелью
   справа — только иконки со счётчиками, закреплена при прокрутке
   (header.php, include/header_actions.php). Пока выезжает шапка — панель
   прозрачная. */
.partner-actions {
    display: none;
}
#header.partner-page ~ .partner-actions {
    position: fixed;
    top: 60px;
    right: 0;
    z-index: 78;
    display: block;
    transition: opacity 0.3s;
}
#header.partner-page:hover ~ .partner-actions {
    opacity: 0;
    pointer-events: none;
}
/* Открыто большое меню (#header.bg-menu-active) — панель его не перекрывает. */
#header.partner-page.bg-menu-active ~ .partner-actions {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.partner-actions .header__actions {
    display: flex;
    flex-direction: column;
}
.partner-actions .header__action-link {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border: none;
    background: none;
    text-decoration: none;
    transition: 0.3s;
}
/* Все иконки — на любой ширине (в шапке часть скрыта до sm: d-none d-sm-flex). */
.partner-actions .header__action-link.d-none {
    display: flex !important;
}
/* Подписи не нужны — только иконки (подсказка — title). */
.partner-actions .header__action-link span {
    display: none !important;
}
.partner-actions .header__action-link .header__action-icon {
    width: 20px;
    height: 27px;
    color: #111111;
    fill: none;
    stroke: #111111;
}
.partner-actions .header__action-link .header__action-count {
    position: absolute;
    top: 12px;
    left: 32px;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 17px;
    height: 17px;
    border: 1px solid #ffffff;
    border-radius: 50%;
    background-color: #111111;
    color: #ffffff;
    font-size: 0.625rem;
    line-height: 1;
}
.partner-actions .header__action-link:hover {
    opacity: 0.6;
}
/* Меньше 768px — панель внизу экрана, горизонтальная, на белой подложке;
   подвал получает отступ снизу, чтобы панель его не закрывала. */
@media (max-width: 767.98px) {
    #header.partner-page ~ .partner-actions {
        top: auto;
        right: 0;
        bottom: 0;
        left: 0;
        background: #ffffff;
        box-shadow: 0 -1px 3px rgba(0, 0, 0, .08);
        transition: opacity 0.3s, bottom 0.3s;
    }
    /* Нижняя полоса сайта (.sidebar, до 992px) выезжает при прокрутке вниз —
       панель поднимается над ней. */
    #header.partner-page ~ .sidebar:not(.overtop-page) ~ .partner-actions {
        bottom: 60px;
    }
    .partner-actions .header__actions {
        flex-direction: row;
        justify-content: space-around;
    }
    .partner-actions .header__action-link {
        flex: 1 1 0;
        width: auto;
    }
    .partner-actions .header__action-link .header__action-count {
        left: 50%;
        margin-left: 2px;
    }
    #header.partner-page ~ #footer {
        padding-bottom: 60px;
    }
}

/* Поиск в шапке (js/header-search.js): группы совпадений — категории,
   товары, партнёры, новости. Блок остаётся открытым, пока курсор над ним
   (иначе клик по ссылке терялся бы при потере фокуса строкой); на широком
   экране шире строки, с прокруткой при длинном списке. */
.header__search-input .header-search:hover,
.header__search-input .header-search:hover + .search-result-bg {
    opacity: 1;
    visibility: visible;
}
.header__search-input .header-search .search-result-block-wrap {
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}
@media (min-width: 992px) {
    .header__search-input .header-search {
        min-width: 460px;
    }
}
/* На широком экране поиск в шапке — как в мобильной версии: в строке
   только иконка (.header__action-link-search), по клику строка поиска
   выезжает панелью под шапкой (js/scripts.js — .header-search-visible).
   Правила повторяют мобильные из styles.min.css (max-width: 991.98px). */
@media (min-width: 992px) {
    #header .header .header__search {
        position: absolute;
        top: 100%;
        left: 0;
        opacity: 0;
        visibility: hidden;
        border-bottom: 1px solid #e1e1e1;
    }
    #header .header .header__search.header-search-visible {
        background: #fff;
        opacity: 1;
        visibility: visible;
    }
}
/* Лупа поиска в шапке: при открытой панели превращается в крестик
   (.is-open ставит js/scripts.js) — так же, как бургер меню. */
#header .header .header__actions .header__action-link-search svg {
    transition: opacity .3s;
}
#header .header .header__actions .header__action-link-search svg:nth-child(2) {
    opacity: 0;
    margin-left: -20px;
}
#header .header .header__actions .header__action-link-search.is-open svg:first-child {
    opacity: 0;
}
#header .header .header__actions .header__action-link-search.is-open svg:nth-child(2) {
    opacity: 1;
}
.header-search__group + .header-search__group {
    margin-top: 1rem;
}
.header-search__group h6 {
    margin-bottom: .5rem;
}
.header__search-input .header-search ul li a.header-search__item {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 6px 0;
}
.header-search__thumb {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    margin-right: 12px;
    border-radius: 4px;
    background: #f3f3f3 center / contain no-repeat;
}
.header-search__text {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-width: 0;
}
.header-search__name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.header-search__name b {
    font-weight: 600;
}
.header-search__hint {
    color: #6c757d;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.header-search__price {
    flex: 0 0 auto;
    margin-left: 12px;
    color: #e3262f;
    font-weight: 500;
    white-space: nowrap;
}
.header-search__price s {
    color: #6c757d;
    font-weight: 400;
}
.header-search__all {
    display: inline-block;
    margin-top: .5rem;
    color: #1976d2;
}

/* Шапка: название Reppa и под ним синим расшифровка «Ресурс Портала
   Поставщиков» (header.php). Буквы — как раньше отдельные span с
   подсветкой при наведении (styles.css #header .logo .name span). */
#header .header .logo .name--tagline {
    flex-direction: column;
    justify-content: center;
    line-height: 1;
}
#header .header .logo .name--tagline .name__word {
    display: flex;
    padding: 0;
}
#header .header .logo .name--tagline .name__tagline {
    padding: 0 1px;
    margin-top: 4px;
    font-size: .68rem;
    font-weight: 500;
    letter-spacing: .02em;
    white-space: nowrap;
    color: #1976d2;
}
#header .header .logo .name--tagline .name__tagline:hover {
    color: #1976d2;
}

/* Открыто глобальное меню — шапка синяя, синяя расшифровка на ней не
   видна: белым, как и само название. */
#header.bg-menu-active .header .logo .name--tagline .name__tagline,
#header.bg-menu-active .header .logo .name--tagline .name__tagline:hover {
    color: rgba(255, 255, 255, .85);
}

/* Карточка товара в списках: название обычным начертанием, цена ближе
   к названию и к кнопке «В корзину» (артикул и остаток из карточки убраны,
   include/product_card.php, js/catalog-common.js). */
.product-card .product-card__info {
    padding-bottom: 10px;
}
.product-card .product-card__info h3 {
    font-weight: 400;
    margin-bottom: 4px;
    /* Не больше 2 строк (было 3, styles.css: height 60px, line-clamp 3);
       высота фиксирована — полосы с ценой в ряду на одной линии. */
    height: 2.4em;
    line-height: 1.2;
    -webkit-line-clamp: 2;
    line-clamp: 2;
}
.product-card .product-card__info .price {
    margin-bottom: 0 !important;
}
.product-card .product-card__info .text-secondary {
    margin-top: 4px;
}

/* Нижняя полоса карточки товара: слева цена, справа кнопка-иконка
   (корзина / удалить из корзины). Поле количества .cart-cnt не показываем
   ни до, ни после добавления — количество меняется в корзине. */
.product-card .product-card__actions .cart-cnt,
.product-card .product-card__actions.in-cart .cart-cnt {
    display: none;
}
.product-card .product-card__actions .product-card__price {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 52px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 10px 0 20px;
    margin: 0;
    background: #ffffff;
    color: #6c757d;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
}
.product-card .product-card__actions .product-card__price s {
    font-size: .8rem;
}
.product-card .product-card__actions .product-card__price b {
    font-size: 1.2rem;
}
.product-card .product-card__actions .f-button,
.product-card .product-card__actions.in-cart .f-button {
    flex: 0 0 auto;
    width: auto;
    min-width: 0;
    height: 52px;
    /* Справа к кнопке пристроен уголок ::after шириной 15px (margin-right
       под него) — справа отступ меньше, иконка по центру видимой кнопки. */
    padding-left: 20px;
    padding-right: 5px;
    margin-right: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.product-card .product-card__actions .f-button.d-none {
    display: none;
}
@media (max-width: 576px) and (min-width: 519px) {
    /* styles.css на этой ширине ставил кнопку под поле количества
       (display: block) — у полосы с ценой и иконкой ряд остаётся рядом. */
    .product-list .product-item .product-card__actions {
        display: flex;
    }
    .product-list .product-item .product-card__actions .f-button {
        width: auto;
        margin-left: 0;
        padding-right: 5px;
    }
}
@media (max-width: 400px) {
    .product-card .product-card__actions .product-card__price {
        padding-left: 12px;
    }
    .product-card .product-card__actions .f-button,
    .product-card .product-card__actions.in-cart .f-button {
        padding-left: 14px;
        padding-right: 2px;
    }
}
.product-card .product-card__actions .product-card__price .product-card__stock {
    font-size: .75rem;
}
.product-card .product-card__actions .f-button[disabled] {
    opacity: .35;
    cursor: not-allowed;
}
