/* Кастомные стили поверх вёрстки: счётчики, активные состояния, тосты */

/* ─── Поиск в шапке ─────────────────────────────────────────────────────────── */
.header__search { position: relative; }

.header__search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,.10);
    list-style: none;
    margin: 0;
    padding: 4px 0;
    max-height: 420px;
    overflow-y: auto;
}
.header__search-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    cursor: pointer;
    font-size: 14px;
    transition: background .15s;
}
.header__search-item:hover { background: #f6f6f6; }
.header__search-thumb {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}
.header__search-name { flex: 1; }
.header__search-price { color: #ff7f00; font-weight: 600; white-space: nowrap; }
.header__search-item--more { color: #ff7f00; font-weight: 600; justify-content: center; border-top: 1px solid #eee; }

/* ─── Страница новостей (список) ─────────────────────────────────────────────── */
.news__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
    margin-top: 24px;
}
.news__empty { padding: 32px 0; color: #888; }
.news__pagination { margin-top: 32px; }

/* ─── Страница статьи ────────────────────────────────────────────────────────── */
.article-single__cover {
    width: 100%;
    max-height: 420px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 24px;
}
.article-single__meta { display: flex; gap: 16px; color: #888; font-size: 14px; margin-bottom: 12px; }
.article-single__category { color: #ff7f00; font-weight: 600; }
.article-single__title { margin-bottom: 16px; }
.article-single__excerpt { font-size: 16px; color: #555; margin-bottom: 24px; font-style: italic; }
.article-single__content { line-height: 1.8; }
.article-single__back {
    display: inline-block;
    margin-top: 40px;
    color: #ff7f00;
    font-weight: 600;
    text-decoration: none;
}
.article-single__back:hover { text-decoration: underline; }
.page__news--full, .page__article-full { padding: 40px 0 80px; }


/* Бейдж-счётчик на иконке шапки (кружок над иконкой) */
.header-bot__link {
    position: relative;
}

.header-bot__count {
    position: absolute;
    top: -8px;
    left: calc(50% + 4px);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: #ff7f00;
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    line-height: 1;
}

/* Кнопка «В корзину» на карточке (без конфликта со script.js клиента) */
.pc-buy {
    display: block;
    width: 100%;
    border: none;
    cursor: pointer;
    border-radius: 8px;
    padding: 12px 10px 13px;
    background: #ff7f00;
    color: #fff;
    font-family: var(--second-family);
    font-weight: 600;
    font-size: 14px;
    line-height: 124%;
    text-align: center;
    transition: ease .2s;
}

.pc-buy:hover {
    opacity: .9;
}

/* Страницы входа / регистрации */
.page__auth {
    padding: 60px 0 90px;
}

.auth-box {
    max-width: 460px;
    margin: 0 auto;
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 16px;
    padding: 36px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .04);
}

.auth-box__title {
    font-family: var(--second-family);
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 24px;
    text-align: center;
    color: #090404;
}

.auth-field {
    display: block;
    margin-bottom: 16px;
}

.auth-field span {
    display: block;
    font-size: 14px;
    color: #575757;
    margin-bottom: 6px;
}

.auth-field input {
    width: 100%;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 15px;
    transition: border-color .2s;
}

.auth-field input:focus {
    outline: none;
    border-color: #ff7f00;
}

.auth-remember {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #575757;
    margin-bottom: 20px;
    cursor: pointer;
}

.auth-remember input {
    width: auto;
}

.auth-submit {
    width: 100%;
    border: none;
    cursor: pointer;
    background: #ff7f00;
    color: #fff;
    border-radius: 8px;
    padding: 14px;
    font-size: 15px;
    font-weight: 600;
    transition: opacity .2s;
}

.auth-submit:hover {
    opacity: .9;
}

.auth-alt {
    text-align: center;
    margin-top: 18px;
    font-size: 14px;
    color: #575757;
}

.auth-alt a {
    color: #ff7f00;
}

.auth-error {
    background: #fdecec;
    color: #b0413e;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 16px;
    font-size: 14px;
}

/* Кнопка «Войти с Яндекс ID» */
.yandex-login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    margin-top: 12px;
    padding: 12px;
    border-radius: 8px;
    background: #000;
    color: #fff;
    font-size: 15px;
    font-weight: 500;
    transition: opacity .2s;
}

.yandex-login-btn:hover {
    opacity: .85;
}

.yandex-login-btn__logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fc3f1d;
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    line-height: 1;
}

/* Активное избранное / сравнение на карточке */
.items__card-btn.is-active {
    background: #ff7f00;
}

.items__card-btn.is-active svg path {
    fill: #fff;
}

/* Тост-уведомление */
.app-toast {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 99999;
    max-width: 320px;
    background: #090404;
    color: #fff;
    padding: 12px 18px;
    border-radius: 8px;
    font-size: 14px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
    opacity: 0;
    transform: translateY(12px);
    transition: opacity .25s, transform .25s;
    pointer-events: none;
}

.app-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Текстовые страницы (О компании, Доставка, Оферта…) */
.page__content {
    padding: 40px 0 60px;
}
.page__content-title {
    font-size: 32px;
    font-weight: 600;
    color: #090404;
    margin-bottom: 24px;
}
.page__content-body {
    max-width: 900px;
    font-size: 16px;
    line-height: 1.7;
    color: #2b2b2b;
}
.page__content-body h2 { font-size: 22px; font-weight: 600; margin: 28px 0 12px; }
.page__content-body h3 { font-size: 18px; font-weight: 600; margin: 22px 0 10px; }
.page__content-body p { margin-bottom: 14px; }
.page__content-body ul,
.page__content-body ol { margin: 0 0 14px 22px; }
.page__content-body li { margin-bottom: 6px; }
.page__content-body a { color: #ff7f00; text-decoration: underline; }
.page__content-body table { border-collapse: collapse; margin: 14px 0; width: 100%; }
.page__content-body td,
.page__content-body th { border: 1px solid #e5e5e5; padding: 8px 12px; }

/* Текстовая страница — обёртка/типографика */
.page__content .container { max-width: 1000px; }
.page__content-body strong { color: #090404; }
.page__content-body ul li::marker { color: #ff7f00; }

/* Пагинация каталога — неактивная стрелка */
.carpets__link.is-disabled { opacity: .35; pointer-events: none; cursor: default; }

/* СДЭК на оформлении: автокомплит города и результат расчёта */
.cdek-suggest {
    position: absolute; left: 0; right: 0; top: 100%; z-index: 30;
    background: #fff; border: 1px solid #eee; border-radius: 10px; margin-top: 4px;
    max-height: 240px; overflow-y: auto; box-shadow: 0 8px 24px rgba(0,0,0,.08); display: none;
}
.cdek-suggest.is-open { display: block; }
.cdek-suggest li { padding: 10px 14px; cursor: pointer; font-size: 14px; }
.cdek-suggest li:hover { background: #f6f6f6; }
.cdek-suggest li small { color: #999; }
.cdek-result { margin-top: 10px; font-size: 14px; color: #090404; }
.cdek-result.is-cost { padding: 12px 14px; background: #f6f6f6; border-radius: 10px; }
.cdek-result b { color: #ff7f00; }
.cdek-result .cdek-muted { color: #999; }

/* Шаг доставки СДЭК: одноколоночная раскладка вместо жёсткой сетки 2×2 (без переполнения) */
.order__form-labels--delivery {
    display: flex !important;
    flex-direction: column;
    gap: 18px;
}
.order__form-labels--delivery .order__form-label {
    grid-column: auto !important;
    grid-row: auto !important;
    min-width: 0;          /* позволяет полям сжиматься (фикс переполнения) */
    width: 100%;
    flex: none;
}
.order__form-labels--delivery .order__form-input {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}
.order__form-labels--delivery select.order__form-input {
    text-overflow: ellipsis;
}
.order__form-labels--delivery .cdek-result { word-break: break-word; }

/* ─── Фильтр каталога ─────────────────────────────────────────────────────── */

/* Счётчик «Найдено N товаров» */
.carpets-counter {
    font-size: 14px;
    color: #888;
    margin-bottom: 8px;
}

/* Скрытые пункты аккордеона (показываются по «Показать ещё») */
.carpets__accordion-item.is-hidden {
    display: none;
}

/* Выделить выбранный пункт фильтра */
.carpets__accordion-checkbox:checked + .carpets__accordion-size {
    color: #ff7f00;
    font-weight: 600;
}

/* Кнопка «Показать ещё» в сетке товаров */
.carpets__show-more {
    display: block;
    margin: 24px auto 0;
    padding: 12px 36px;
    border: 2px solid #ff7f00;
    border-radius: 8px;
    background: transparent;
    color: #ff7f00;
    font-family: var(--second-family);
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: background .2s, color .2s;
}
.carpets__show-more:hover {
    background: #ff7f00;
    color: #fff;
}
.carpets__show-more[hidden] {
    display: none;
}

/* Состояние загрузки сетки */
.items__cards-container.is-loading {
    opacity: .5;
    pointer-events: none;
    transition: opacity .2s;
}

/* Сообщение «Товары не найдены» */
.catalog-empty {
    padding: 32px 20px;
    color: #888;
    font-size: 16px;
    grid-column: 1 / -1;
}

/* ─── Страница контактов ──────────────────────────────────────────────────── */
.contacts-hero { padding: 48px 0; background: linear-gradient(135deg, #f8f8f8 0%, #fff 100%); }
.contacts-hero__inner { text-align: center; max-width: 800px; margin: 0 auto; }
.contacts-hero__title { margin-bottom: 16px; }
.contacts-hero__subtitle { font-size: 18px; line-height: 140%; color: #575757; }

.contacts-info { padding: 64px 0; }
.contacts-info__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.contacts-info__card {
    background: #f8f8f8; border-radius: 16px; padding: 32px 24px;
    display: flex; flex-direction: column; gap: 16px; text-align: center;
    transition: all 0.3s ease;
}
.contacts-info__card:hover { background: #fff; box-shadow: 0 4px 20px rgba(0,0,0,.08); transform: translateY(-4px); }
.contacts-info__icon { margin: 0 auto; }
.contacts-info__card-title { font-weight: 600; font-size: 18px; line-height: 140%; color: #090404; }
.contacts-info__link { font-size: 14px; line-height: 160%; color: #575757; transition: color .2s; }
.contacts-info__link:hover { color: #ff7f00; }
.contacts-info__text { font-size: 14px; line-height: 160%; color: #575757; }

.contacts-form { padding: 64px 0; background: #f8f8f8; }
.contacts-form__inner { max-width: 800px; margin: 0 auto; text-align: center; }
.contacts-form__title { margin-bottom: 12px; }
.contacts-form__subtitle { font-size: 16px; line-height: 140%; color: #575757; margin-bottom: 40px; }
.contacts-form__form { display: flex; flex-direction: column; gap: 24px; }
.contacts-form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.contacts-form__group { display: flex; flex-direction: column; gap: 8px; text-align: left; }
.contacts-form__label { font-weight: 500; font-size: 14px; color: #090404; }
.contacts-form__input,
.contacts-form__textarea {
    border: 1px solid #e0e0e0; border-radius: 12px; padding: 16px;
    font-size: 14px; color: #090404; background: #fff; transition: border-color .2s;
}
.contacts-form__input:focus,
.contacts-form__textarea:focus { border-color: #ff7f00; outline: none; }
.contacts-form__input::placeholder,
.contacts-form__textarea::placeholder { color: #999; }
.contacts-form__textarea { resize: vertical; min-height: 120px; }
.contacts-form__submit {
    border-radius: 12px; padding: 16px 32px; font-weight: 500;
    font-size: 16px; color: #fff; transition: background .2s;
    max-width: 300px; margin: 8px auto 0;
}
.contacts-form__submit:hover { background: #e67300; }
.cf-result { padding: 12px 16px; border-radius: 8px; font-size: 14px; margin-top: -8px; }
.cf-result--ok { background: #e8f5e9; color: #2e7d32; }
.cf-result--err { background: #fdecec; color: #b0413e; }

.contacts-requisites { padding: 64px 0; background: #fff; }
.contacts-requisites__inner { text-align: center; }
.contacts-requisites__title { margin-bottom: 40px; }
.contacts-requisites__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 32px; text-align: left; }
.contacts-requisites__block { background: #f8f8f8; border-radius: 16px; padding: 32px; }
.contacts-requisites__subtitle { font-weight: 600; font-size: 20px; color: #090404; margin-bottom: 24px; }
.contacts-requisites__items { display: flex; flex-direction: column; gap: 16px; }
.contacts-requisites__item {
    display: flex; flex-direction: column; gap: 6px;
    padding-bottom: 16px; border-bottom: 1px solid rgba(0,0,0,.08);
}
.contacts-requisites__item:last-child { border-bottom: none; padding-bottom: 0; }
.contacts-requisites__label { font-weight: 500; font-size: 14px; color: #999; }
.contacts-requisites__value { font-weight: 500; font-size: 16px; color: #090404; word-break: break-word; }

@media (max-width: 1024px) {
    .contacts-info__grid { grid-template-columns: repeat(2, 1fr); }
    .contacts-form__row { grid-template-columns: 1fr; }
    .contacts-requisites__grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .contacts-hero { padding: 32px 0; }
    .contacts-info { padding: 48px 0; }
    .contacts-info__grid { grid-template-columns: 1fr; }
    .contacts-form { padding: 48px 0; }
    .contacts-form__subtitle { margin-bottom: 32px; }
    .contacts-requisites { padding: 48px 0; }
    .contacts-requisites__block { padding: 24px; }
}
@media (max-width: 480px) { .contacts-form__submit { max-width: 100%; } }

/* ─── Контейнер карты-виджета ПВЗ СДЭК (нужна высота) ─────────────────────── */
/* Контейнер карты-виджета ПВЗ СДЭК (нужна высота) */
.cdek-map {
    width: 100%;
    height: 520px;
    border: 1px solid #eee;
    border-radius: 12px;
    overflow: hidden;
}
@media (max-width: 600px) { .cdek-map { height: 420px; } }

/* ─── Мобильный header 375px fix ─────────────────────────────────────────── */
html, body { overflow-x: hidden; }
@media (max-width: 390px) {
    .header-bot { gap: 8px; }
    .header-bot__right { gap: 4px; }
    .header-bot__list { gap: 3px; }
    .header-bot__item { padding: 8px; }
    .burger-btn { margin-left: 2px; }
}

/* ─── Фикс галереи товара на мобиле/планшете ─────────────────────────────── */
/* На ≤1120px style.css снимает ограничение ширины (.product-card__main { max-width: unset })
   → контейнер главного Swiper раздувается до ширины контента (десятки млн px),
   активный слайд уезжает за обрезанный overflow-x край → главное фото пустое.
   Возвращаем жёсткое ограничение шириной родителя, чтобы Swiper мерил верно. */
@media (max-width: 1120px) {
    .product-card__sliders .product-card__main {
        max-width: 100%;
        width: 100%;
        min-width: 0;
    }
    .product-card__sliders .product-card__main-slider {
        max-width: 100%;
        overflow: hidden;
    }
}
