/**
 * Стили каталога Маркета — поверх классов темы DirectTalk.
 *
 * Используем родные .slider__item / .img-wrapper / .price / .btn-white-outlined,
 * добавляем только то чего нет: тип объявления, владелец карточкой,
 * категория-крошка, сетка каталога.
 */

/* ==========================================================
   Сетка каталога
   ========================================================== */
.market-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

/* ==========================================================
   Карточка (расширение .slider__item)
   ========================================================== */
.market-card {
    background: #F8F8F8;
    border: 1px solid #C4C4C4;
    border-radius: 7px;
    padding: 16px 18px 18px;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: box-shadow 0.2s, border-color 0.2s, transform 0.2s;
    color: inherit;
    overflow: hidden;
}
.market-card:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
    border-color: transparent;
    transform: translateY(-2px);
}

/* Внутренние ссылки на детальную (картинка, заголовок) — без декорации,
   но при hover карточки заголовок подсвечивается красным. */
.market-card__media-link,
.market-card__name-link {
    display: block;
    text-decoration: none;
    color: inherit;
}
.market-card__media-link:hover,
.market-card__name-link:hover {
    text-decoration: none;
    color: inherit;
}
.market-card:hover .market-card__name { color: #d42f2f; }
.market-card__name { transition: color 0.15s; }
.market-card:hover .floatEditLink.hidden {
    display: block;
}

/* Тип объявления — диагональный «уголок» в верхнем-левом углу */
.market-card__type {
    position: absolute;
    top: 0;
    left: 0;
    padding: 6px 16px 6px 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #fff;
    z-index: 2;
    border-radius: 7px 0 12px 0;
    line-height: 1;
}
.market-card__type--sell { background: #d42f2f; }
.market-card__type--buy  { background: #2563eb; }

/* Картинка */
.market-card .img-wrapper {
    width: 100%;
    aspect-ratio: 4 / 3;
    background: #fff;
    border-radius: 7px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}
.market-card .img-wrapper .item-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.market-card .img-wrapper--placeholder .item-image {
    width: 50%;
    height: auto;
    opacity: 0.3;
    object-fit: contain;
}

/* Категория (хлебная крошка над названием) */
.market-card__category {
    font-size: 12px;
    color: #898989;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Название */
.market-card__name {
    font-weight: 600;
    font-size: 15px;
    line-height: 19px;
    color: #1a1a1a;
    margin: 0 0 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    min-height: 38px;
}

/* Цена */
.market-card__price {
    font-weight: 700;
    font-size: 20px;
    line-height: 24px;
    color: #d42f2f;
    margin: 0 0 12px;
}
.market-card__price--buy {
    color: #2563eb;
}
.market-card__price--empty {
    color: #898989;
    font-size: 14px;
    font-weight: 500;
}

/* Владелец */
.market-card__owner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 0;
    margin: 0 -2px 12px;
    border-top: 1px solid #e6e6e6;
    text-decoration: none;
    color: inherit;
    transition: color 0.15s;
}
.market-card__owner:hover {
    text-decoration: none;
    color: #d42f2f;
}
.market-card__owner:hover .market-card__owner-name { color: #d42f2f; }
.market-card__owner-photo {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: #eee;
}
.market-card__owner-name {
    font-size: 13px;
    color: #4a4a4a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Действия — кнопки занимают равную ширину */
.market-card__actions {
    margin-top: auto;
    display: flex;
    gap: 6px;
}
.market-card__actions .btn {
    flex: 1;
    padding: 8px 10px;
    font-size: 13px;
    text-align: center;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}
/* Когда обе кнопки — «Подробнее» уже, «Написать» доминирует */
.market-card__actions .btn-red { flex: 1.2; }
.market-card__chat-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.market-card__chat-btn .icon-svg {
    width: 14px;
    height: 14px;
    display: inline-block;
}
.market-card__chat-btn .icon { display: inline-block; }

/* Выбираемая карточка (для импорта «Добавить к себе») */
.market-card--selectable {
    cursor: pointer;
}
.market-card--selectable:has(.market-import__check:checked) {
    border-color: #d42f2f;
    box-shadow: 0 0 0 2px rgba(212, 47, 47, 0.15);
}
.market-card--selectable .market-import__check {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 22px;
    height: 22px;
    z-index: 4;
    cursor: pointer;
    accent-color: #d42f2f;
}

/* Carendашик-edit в правом-верхнем углу */
.market-card__edit {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    transition: background 0.15s;
}
.market-card__edit:hover { background: #fff; }

/* ==========================================================
   Toolbar / Filters
   ========================================================== */
.market-toolbar {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 14px 18px;
    background: #f8f8f8;
    border: 1px solid #e6e6e6;
    border-radius: 7px;
}
.market-toolbar__field {
    flex: 0 1 auto;
}
.market-toolbar__field--search { flex: 1 1 260px; min-width: 200px; }
.market-toolbar .form-control {
    height: 40px;
    padding: 8px 12px;
    border: 1px solid #c4c4c4;
    border-radius: 7px;
    background: #fff;
    font-size: 14px;
    color: #1a1a1a;
}
.market-toolbar .form-control:focus {
    outline: none;
    border-color: #d42f2f;
}
.market-toolbar select.form-control {
    min-width: 140px;
    cursor: pointer;
}
.market-toolbar__price {
    width: 110px;
}
.market-toolbar__results {
    color: #898989;
    font-size: 14px;
    margin-bottom: 16px;
}
.market-toolbar__results strong { color: #1a1a1a; }

/* ==========================================================
   Пагинация
   ========================================================== */
.market-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 30px;
}
.market-pagination__page {
    min-width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    border: 1px solid #c4c4c4;
    border-radius: 7px;
    background: #fff;
    text-decoration: none;
    color: #1a1a1a;
    font-size: 14px;
    transition: border-color 0.15s;
}
.market-pagination__page:hover {
    border-color: #d42f2f;
    text-decoration: none;
    color: #1a1a1a;
}
.market-pagination__page--active {
    background: #d42f2f;
    color: #fff;
    border-color: #d42f2f;
}
.market-pagination__page--active:hover { color: #fff; }
.market-pagination__gap { color: #c4c4c4; padding: 0 4px; }

/* ==========================================================
   Empty / states
   ========================================================== */
.market-empty {
    padding: 60px 20px;
    text-align: center;
    color: #898989;
    background: #f8f8f8;
    border: 1px solid #e6e6e6;
    border-radius: 7px;
}

/* ==========================================================
   Детальная страница товара
   ========================================================== */
.market-detail {
    padding: 24px 0 60px;
    background:
        radial-gradient(900px 400px at 100% -50px, rgba(227, 0, 43, 0.04), transparent 60%),
        #fafafa;
}
.market-detail__container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}
.market-detail__breadcrumb {
    margin-bottom: 18px;
    font-size: 13px;
    color: #9aa0a6;
}
.market-detail__breadcrumb a {
    color: #9aa0a6;
    text-decoration: none;
    transition: color 0.15s;
}
.market-detail__breadcrumb a:hover { color: #E3002B; }
.market-detail__breadcrumb-sep { margin: 0 8px; color: #d0d0d0; }
.market-detail__breadcrumb span:last-child { color: #1a1a1a; font-weight: 500; }

/* Заголовок над grid'ом: тип объявления + название во всю ширину */
.market-detail .market-detail__header {
    display: flex !important;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    text-align: left;
}
.market-detail .market-detail__type {
    display: inline-block !important;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #fff;
    border-radius: 4px;
    line-height: 1;
    flex-shrink: 0;
    width: auto;
}

.market-detail__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
    gap: 32px;
    align-items: start;
    margin-bottom: 30px;
}

/* === Галерея === */
.market-detail__gallery {
    position: relative;
}
.market-detail__type--sell { background: #d42f2f; }
.market-detail__type--buy { background: #2563eb; }

.market-detail__main-photo {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    max-height: 520px;
    background: #fff;
    border: 1px solid #ececec;
    border-radius: 18px;
    overflow: hidden;
    margin-bottom: 14px;
    box-shadow: 0 10px 30px rgba(20, 21, 26, 0.06);
}
.market-detail__main-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.market-detail__main-photo:hover img { transform: scale(1.06); }

/* Бейдж состояния поверх фото */
.market-detail__photo-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 2;
    padding: 7px 14px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.3px;
    border-radius: 999px;
    color: #fff;
    background: #14151a;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(4px);
}
.market-detail__photo-badge--new { background: linear-gradient(135deg, #16a34a, #15803d); }
.market-detail__photo-badge--used { background: linear-gradient(135deg, #d97706, #b45309); }
.market-detail__main-photo--placeholder {
    aspect-ratio: auto;
    height: 260px;
    background: #f8f8f8;
}
.market-detail__main-photo--placeholder img {
    object-fit: contain;
    opacity: 0.18;
    padding: 70px;
    max-height: 100%;
}

.market-detail__thumbs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.market-detail__thumb {
    width: 78px;
    height: 78px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 12px;
    background: #f4f4f5;
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.18s, transform 0.18s, box-shadow 0.18s;
}
.market-detail__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.market-detail__thumb:hover { border-color: #f1a9b6; transform: translateY(-2px); }
.market-detail__thumb--active {
    border-color: #E3002B;
    box-shadow: 0 6px 16px rgba(227, 0, 43, 0.22);
}

/* === Инфо-сайдбар === */
.market-detail__info {
    position: sticky;
    top: 20px;
    float: none;
    width: 100%;
    box-sizing: border-box;
    background: #fff;
    border: 1px solid #ececec;
    border-radius: 18px;
    padding: 22px;
    box-shadow: 0 10px 30px rgba(20, 21, 26, 0.06);
}
.market-detail .market-detail__name {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 32px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: #14151a;
    flex: 1;
    text-align: left;
}
.market-detail .market-detail__name::before,
.market-detail .market-detail__name::after { display: none !important; content: none !important; }

.market-detail__price-block {
    padding: 20px 22px;
    border-radius: 14px;
    margin-bottom: 18px;
    background: linear-gradient(135deg, #fff1f3 0%, #ffe9ec 100%);
    border: 1px solid #ffd6dd;
}
.market-detail__price-block--buy {
    background: linear-gradient(135deg, #eef4ff 0%, #e4edff 100%);
    border-color: #cfe0ff;
}
.market-detail__price-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #b0707a;
    margin-bottom: 2px;
}
.market-detail__price-value {
    font-size: 38px;
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: #E3002B;
}
.market-detail__price-block--buy .market-detail__price-value { color: #2563eb; }
.market-detail__price-value span {
    font-weight: 500;
    font-size: 22px;
}

/* === Карточка продавца === */
.market-detail__seller-card {
    background: #f8f8f8;
    border: 1px solid #e6e6e6;
    border-radius: 7px;
    padding: 16px 18px;
    margin-bottom: 18px;
}
.market-detail__seller-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #898989;
    margin-bottom: 10px;
}
.market-detail__seller-link {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: inherit;
}
.market-detail__seller-link:hover { text-decoration: none; }
.market-detail__seller-link:hover .market-detail__seller-name { color: #d42f2f; }
.market-detail__seller-photo {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: #eee;
}
.market-detail__seller-info { flex: 1; min-width: 0; overflow: hidden; }
.market-detail__seller-name {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.3;
    margin-bottom: 4px;
    transition: color 0.15s;
    word-break: break-word;
}
.market-detail__seller-meta {
    font-size: 13px;
    color: #898989;
}

/* === Кнопки действий === */
.market-detail__actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.market-detail__actions .btn {
    width: 100%;
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.market-detail__actions .icon-svg {
    width: 16px;
    height: 16px;
    display: inline-block;
}

/* === Боковая сводка: ключевые характеристики + мета === */
.market-detail__side-specs {
    margin-top: 20px;
    padding: 20px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
}
.market-detail__side-specs-title {
    font-size: 15px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 14px;
}
.market-detail__side-specs-list { margin: 0; }
.market-detail__side-spec {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #f1f1f1;
    font-size: 14px;
}
.market-detail__side-spec:last-child { border-bottom: none; }
.market-detail__side-spec dt { color: #898989; flex: 0 0 auto; }
.market-detail__side-spec dd { margin: 0; color: #1a1a1a; font-weight: 600; text-align: right; }
.market-detail__side-specs-more {
    display: inline-block;
    margin-top: 12px;
    font-size: 13px;
    color: #d42f2f;
    text-decoration: none;
}
.market-detail__side-specs-more:hover { text-decoration: underline; }
.market-detail__side-meta {
    margin-top: 16px;
    padding: 14px 20px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fafafa;
}
.market-detail__side-meta-row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: #898989;
}
.market-detail__side-meta-row strong { color: #1a1a1a; }

/* Блок преимуществ / доверия */
.market-detail__trust {
    list-style: none;
    margin: 18px 0 0;
    padding: 16px 0 0;
    border-top: 1px dashed #ececec;
}
.market-detail__trust-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #4a4a4a;
    line-height: 1.35;
    padding: 7px 0;
}
.market-detail__trust-icon {
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #fff1f3;
    font-size: 14px;
}

/* === Звёзды рейтинга === */
.market-stars { display: inline-flex; gap: 2px; line-height: 1; }
.market-stars__s { color: #e0e0e0; font-size: 16px; }
.market-stars__s--on { color: #ffb400; }
.market-stars--sm .market-stars__s { font-size: 13px; }
.market-stars--lg .market-stars__s { font-size: 22px; }

/* Рейтинг у заголовка */
.market-detail__rating {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    text-decoration: none;
    font-size: 14px;
    color: #898989;
}
.market-detail__rating strong { color: #1a1a1a; font-size: 15px; }
.market-detail__rating:hover span { color: #E3002B; }

/* === Секция отзывов === */
.market-reviews {
    margin-top: 36px;
    padding-top: 30px;
    border-top: 1px solid #ececec;
}
.market-reviews__title { font-size: 22px; font-weight: 800; letter-spacing: -0.01em; color: #14151a; margin: 0 0 22px; }
.market-reviews__summary {
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
    align-items: center;
    padding: 22px 24px;
    background: #fff;
    border: 1px solid #ececec;
    border-radius: 16px;
    margin-bottom: 24px;
    box-shadow: 0 8px 24px rgba(20,21,26,0.05);
}
.market-reviews__score { text-align: center; }
.market-reviews__score-value { font-size: 44px; font-weight: 800; line-height: 1; color: #14151a; letter-spacing: -0.02em; }
.market-reviews__score .market-stars { margin: 6px 0 4px; }
.market-reviews__score-count { font-size: 12px; color: #898989; }
.market-reviews__dist { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 6px; }
.market-reviews__dist-row { display: flex; align-items: center; gap: 10px; font-size: 12px; color: #898989; }
.market-reviews__dist-label { flex: 0 0 32px; }
.market-reviews__dist-bar { flex: 1; height: 7px; background: #f0f0f0; border-radius: 999px; overflow: hidden; }
.market-reviews__dist-bar span { display: block; height: 100%; background: #ffb400; border-radius: 999px; }
.market-reviews__dist-num { flex: 0 0 24px; text-align: right; }

/* Форма отзыва */
.market-reviews__form {
    background: #fff;
    border: 1px solid #ececec;
    border-radius: 16px;
    padding: 22px 24px;
    margin-bottom: 24px;
}
.market-reviews__form-title { font-weight: 700; margin-bottom: 12px; color: #14151a; }
.market-reviews__rate { display: inline-flex; gap: 4px; margin-bottom: 14px; }
.market-reviews__rate-star {
    border: none; background: none; cursor: pointer; padding: 0;
    font-size: 30px; line-height: 1; color: #e0e0e0; transition: color 0.12s, transform 0.12s;
}
.market-reviews__rate-star:hover { transform: scale(1.15); }
.market-reviews__rate-star.is-on { color: #ffb400; }
.market-reviews__textarea {
    display: block; width: 100%; box-sizing: border-box;
    border: 1px solid #d6d6d6; border-radius: 10px; padding: 12px 14px;
    font-family: inherit; font-size: 14px; resize: vertical; margin-bottom: 14px;
}
.market-reviews__textarea:focus { outline: none; border-color: #E3002B; }
.market-reviews__submit { padding: 11px 26px; }
.market-reviews__msg { margin-left: 14px; font-size: 13px; }
.market-reviews__msg.is-ok { color: #16a34a; }
.market-reviews__msg.is-err { color: #E3002B; }
.market-reviews__guest { color: #898989; padding: 16px 0; }

/* Список отзывов */
.market-reviews__list { display: flex; flex-direction: column; gap: 18px; }
.market-reviews__empty { color: #898989; padding: 10px 0; }
.market-reviews__item { display: flex; gap: 14px; padding: 18px 20px; background: #fff; border: 1px solid #ececec; border-radius: 14px; }
.market-reviews__avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: #f3f4f6; }
.market-reviews__body { flex: 1; min-width: 0; }
.market-reviews__item-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.market-reviews__author { font-weight: 700; color: #14151a; text-decoration: none; }
.market-reviews__author:hover { color: #E3002B; }
.market-reviews__text { color: #4a4a4a; font-size: 14px; line-height: 1.5; }

/* === Описание === */
.market-detail__description-block {
    background: #fff;
    border: 1px solid #e6e6e6;
    border-radius: 7px;
    padding: 24px 28px;
    margin-top: 10px;
}
.market-detail .market-detail__section-title {
    margin: 0 0 14px !important;
    padding: 0 !important;
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    text-align: left;
    line-height: 1.3;
}
.market-detail .market-detail__section-title::before,
.market-detail .market-detail__section-title::after { display: none !important; content: none !important; }
.market-detail .market-detail__description {
    font-size: 15px;
    line-height: 1.6;
    color: #4a4a4a;
    white-space: pre-wrap;
    text-align: left;
}

/* Chips — компактные бейджи под заголовком */
.market-detail__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 22px;
}
.market-detail__chip {
    padding: 6px 14px;
    background: #f8f8f8;
    border: 1px solid #e6e6e6;
    border-radius: 999px;
    font-size: 13px;
    color: #4a4a4a;
}
.market-detail__chip strong { color: #1a1a1a; font-weight: 600; }
.market-detail__chip--new {
    background: #dcfce7;
    border-color: #86efac;
    color: #15803d;
    font-weight: 600;
}
.market-detail__chip--used {
    background: #fef3c7;
    border-color: #fcd34d;
    color: #92400e;
    font-weight: 600;
}
.market-detail__chip--delivery {
    background: #dbeafe;
    border-color: #93c5fd;
    color: #1d4ed8;
}

/* Цена + метa */
.market-detail .market-detail__price-meta {
    margin-top: 6px;
    font-size: 13px;
    color: #898989;
}

/* Stock indicator */
.market-detail__stock {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #f8f8f8;
    border-radius: 7px;
    margin-bottom: 18px;
    font-size: 14px;
}
.market-detail__stock-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.market-detail__stock-dot--in { background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2); }
.market-detail__stock-dot--low { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2); }
.market-detail__stock-dot--out { background: #94a3b8; }

/* Tabs */
.market-detail__tabs {
    margin-top: 30px;
}
.market-detail__tabs-head {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid #e6e6e6;
    margin-bottom: 22px;
}
.market-detail__tab {
    padding: 12px 24px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #898989;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.15s;
}
.market-detail__tab:hover { color: #1a1a1a; }
.market-detail__tab--active { color: #d42f2f; border-bottom-color: #d42f2f; }
.market-detail__tab-pane { display: none; }
.market-detail__tab-pane--active { display: block; }

/* Spec table */
.market-detail .market-detail__specs {
    width: 100%;
    max-width: 800px;
    border-collapse: collapse;
    background: #fff;
    border-radius: 7px;
    overflow: hidden;
}
.market-detail .market-detail__specs tr { border-bottom: 1px solid #f0f0f0; }
.market-detail .market-detail__specs tr:last-child { border-bottom: none; }
.market-detail .market-detail__specs th {
    padding: 12px 18px;
    text-align: left;
    width: 200px;
    color: #898989;
    font-weight: 500;
    background: #fafafa;
    font-size: 14px;
}
.market-detail .market-detail__specs td {
    padding: 12px 18px;
    color: #1a1a1a;
    font-size: 14px;
    font-weight: 500;
}

/* Delivery */
.market-detail__delivery-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 800px;
}
.market-detail__delivery-item {
    display: flex;
    gap: 16px;
    padding: 16px 20px;
    background: #f8f8f8;
    border: 1px solid #e6e6e6;
    border-radius: 7px;
}
.market-detail__delivery-item .icon-svg {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    color: #d42f2f;
}
.market-detail__delivery-name {
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 4px;
}
.market-detail__delivery-hint {
    color: #898989;
    font-size: 14px;
    line-height: 1.5;
}

/* Primary action */
.market-detail__action-primary { font-size: 16px !important; }

/* === Responsive === */
@media (max-width: 880px) {
    .market-detail__grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .market-detail__info { position: static; }
    .market-detail__name { font-size: 22px; }
    .market-detail__price-value { font-size: 26px; }
    .market-detail .market-detail__specs th { width: 140px; }
}

/* ==========================================================
   Страница add/edit товара
   ========================================================== */
.market-form-page {
    max-width: 720px;
    background: #fff;
    border: 1px solid #e6e6e6;
    border-radius: 7px;
    padding: 30px 32px;
}
.market-form-page__row { margin-bottom: 22px; }
.market-form-page__label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #1a1a1a;
    font-size: 14px;
}
.market-form-page__required { color: #d42f2f; }
.market-form-page__input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #c4c4c4;
    border-radius: 7px;
    background: #fff;
    font-size: 14px;
    box-sizing: border-box;
    font-family: inherit;
}
.market-form-page__input:focus {
    outline: none;
    border-color: #d42f2f;
}
.market-form-page__input--narrow { max-width: 220px; }
.market-form-page__input--textarea { resize: vertical; min-height: 120px; line-height: 1.5; }
.market-form-page__hint {
    display: block;
    color: #898989;
    font-size: 12px;
    margin-top: 6px;
}

/* Тип объявления — двукнопочный toggle */
.market-form-page__offer-toggle {
    display: inline-flex;
    border: 1px solid #c4c4c4;
    border-radius: 7px;
    overflow: hidden;
}
.market-form-page__offer-option {
    display: inline-flex;
    align-items: center;
    padding: 10px 24px;
    cursor: pointer;
    background: #fff;
    color: #4a4a4a;
    font-weight: 600;
    transition: background 0.15s, color 0.15s;
    margin: 0;
}
.market-form-page__offer-option:not(:last-child) { border-right: 1px solid #c4c4c4; }
.market-form-page__offer-option input { display: none; }
.market-form-page__offer-option.is-active { background: #d42f2f; color: #fff; }
.market-form-page__offer-option--buy.is-active { background: #2563eb; }

/* Фото */
.market-form-page__photos-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}
.market-form-page__photo {
    position: relative;
    width: 100px;
    height: 100px;
    border: 2px solid #d42f2f;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    margin: 0;
    transition: border-color 0.15s, opacity 0.15s;
}
.market-form-page__photo input { position: absolute; top: 6px; left: 6px; z-index: 2; accent-color: #d42f2f; }
.market-form-page__photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.market-form-page__photo:has(input:not(:checked)) {
    border-color: #c4c4c4;
    opacity: 0.5;
}
.market-form-page__photo:has(input:not(:checked)) .market-form-page__photo-remove::before { content: '✓ Вернуть'; }
.market-form-page__photo-remove {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 4px 6px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 11px;
    text-align: center;
}
.market-form-page__photo-remove::before { content: '✕ Убрать'; }
.market-form-page__file {
    padding: 10px;
    border: 1px dashed #c4c4c4;
    border-radius: 7px;
    background: #fafafa;
    cursor: pointer;
    width: 100%;
    box-sizing: border-box;
}

/* Действия */
.market-form-page__actions {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
    margin-top: 6px;
}
.market-form-page__btn-primary { padding: 12px 28px !important; font-size: 15px; }
.market-form-page__btn-delete {
    margin-left: auto;
    color: #d42f2f;
    border-color: #fca5a5;
}
.market-form-page__btn-delete:hover {
    background: #d42f2f;
    color: #fff;
    border-color: #d42f2f;
}

.market-form-page__alert {
    padding: 12px 16px;
    border-radius: 7px;
    margin-bottom: 18px;
    font-size: 14px;
}
.market-form-page__alert--error {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #991b1b;
}

/* Секции внутри формы */
.market-form-page__section-title {
    margin: 32px 0 18px;
    padding-top: 22px;
    border-top: 1px solid #f0f0f0;
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Двухколоночная сетка для характеристик */
.market-form-page__grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 22px;
}
.market-form-page__grid-2 .market-form-page__row { margin-bottom: 0; }

/* Произвольные характеристики */
.market-form-page__attrs {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
}
.market-form-page__attr-row {
    display: grid;
    grid-template-columns: 1fr 1fr 36px;
    gap: 8px;
}
.market-form-page__attr-remove {
    width: 36px;
    height: 36px;
    border: 1px solid #e6e6e6;
    background: #fff;
    border-radius: 7px;
    cursor: pointer;
    font-size: 20px;
    color: #898989;
    transition: all 0.15s;
}
.market-form-page__attr-remove:hover {
    border-color: #fca5a5;
    color: #d42f2f;
}
.market-form-page__attr-add {
    padding: 8px 16px;
    border: 1px dashed #c4c4c4;
    background: #fff;
    border-radius: 7px;
    cursor: pointer;
    font-size: 13px;
    color: #4a4a4a;
    transition: all 0.15s;
}
.market-form-page__attr-add:hover {
    border-color: #d42f2f;
    color: #d42f2f;
}

/* Способы доставки */
.market-form-page__delivery-checkboxes {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.market-form-page__delivery-option {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border: 1px solid #c4c4c4;
    border-radius: 7px;
    cursor: pointer;
    margin: 0;
    transition: all 0.15s;
    background: #fff;
}
.market-form-page__delivery-option:has(input:checked) {
    border-color: #d42f2f;
    background: #fef2f2;
}
.market-form-page__delivery-option input { accent-color: #d42f2f; }
.market-form-page__delivery-option span { font-weight: 500; color: #1a1a1a; }

@media (max-width: 640px) {
    .market-form-page__grid-2 { grid-template-columns: 1fr; }
    .market-form-page__attr-row { grid-template-columns: 1fr; }
}

/* JS-toggle для активного offer-option */
.market-form-page__offer-option:has(input:checked) {
    background: #d42f2f;
    color: #fff;
}
.market-form-page__offer-option--buy:has(input:checked) {
    background: #2563eb;
}

/* === Wizard === */
.market-wizard { width: 100%; }

.market-wizard__steps {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 12px;
}
.market-wizard__step {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 8px;
    background: #f9fafb;
    color: #6b7280;
    font-weight: 500;
    font-size: 14px;
    border: 1px solid transparent;
}
.market-wizard__step span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px; height: 24px;
    border-radius: 50%;
    background: #e5e7eb;
    color: #6b7280;
    font-weight: 700;
    font-size: 13px;
}
.market-wizard__step.is-active {
    background: #fff;
    color: #d42f2f;
    border-color: #d42f2f;
}
.market-wizard__step.is-active span {
    background: #d42f2f;
    color: #fff;
}
.market-wizard__step.is-done {
    color: #16a34a;
    background: #f0fdf4;
}
.market-wizard__step.is-done span {
    background: #16a34a;
    color: #fff;
}

.market-wizard__pane { display: none; }
.market-wizard__pane.is-active { display: block; animation: market-wiz-fade .2s ease; }
@keyframes market-wiz-fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.market-wizard__nav {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.market-wizard__details {
    margin-top: 16px;
    padding: 14px 16px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}
.market-wizard__details > summary {
    cursor: pointer;
    font-weight: 600;
    color: #374151;
    user-select: none;
    list-style: none;
}
.market-wizard__details > summary::before {
    content: '▸';
    display: inline-block;
    margin-right: 8px;
    transition: transform .15s;
}
.market-wizard__details[open] > summary::before { transform: rotate(90deg); }

.market-wizard__search-results {
    margin-top: 8px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    max-height: 360px;
    overflow-y: auto;
    background: #fff;
}
.market-wizard__search-results:empty { display: none; }

.market-wizard__result {
    display: grid;
    grid-template-columns: 56px 1fr;
    gap: 12px;
    align-items: center;
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
    transition: background .1s;
}
.market-wizard__result:hover { background: #fff7ed; }
.market-wizard__result:last-child { border-bottom: none; }
.market-wizard__result img {
    width: 56px; height: 56px;
    object-fit: cover;
    border-radius: 6px;
    background: #f3f4f6;
}
.market-wizard__result-name {
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 4px;
}
.market-wizard__result-meta {
    font-size: 12px;
    color: #6b7280;
}
.market-wizard__result-pending {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 6px;
    background: #fef3c7;
    color: #92400e;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}
.market-wizard__no-results {
    padding: 16px;
    text-align: center;
    color: #6b7280;
    font-size: 13px;
}

.market-wizard__selected-product {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    padding: 12px 14px;
    background: #ecfdf5;
    border: 1px solid #6ee7b7;
    border-radius: 8px;
    color: #065f46;
}
.market-wizard__clear {
    margin-left: auto;
    background: none;
    border: none;
    color: #065f46;
    cursor: pointer;
    font-weight: 600;
    padding: 4px 8px;
}
.market-wizard__clear:hover { color: #d42f2f; }

.market-form-page__alert--info {
    padding: 10px 14px;
    background: #eff6ff;
    border: 1px solid #93c5fd;
    color: #1e40af;
    border-radius: 6px;
    margin-bottom: 16px;
}

/* === Блок предложений на детальной === */
.market-offers { margin: 32px 0; }
.market-offers__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.market-offers__sort {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #898989;
}
.market-offers__sort-select {
    border: 1px solid #ececec;
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
    background: #fff;
    cursor: pointer;
    font-family: inherit;
    transition: border-color 0.15s;
}
.market-offers__sort-select:hover { border-color: #ffd6dd; }
.market-offers__sort-select:focus { outline: none; border-color: #E3002B; }
.market-offers__title {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 16px;
}
.market-offers__list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}
.market-offers__card {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(220px, 2fr) auto;
    gap: 16px;
    align-items: center;
    padding: 18px 20px;
    border: 1px solid #ececec;
    border-radius: 16px;
    background: #fff;
    transition: box-shadow .2s, border-color .2s, transform .2s;
}
.market-offers__card:hover {
    border-color: #ffd6dd;
    box-shadow: 0 12px 28px rgba(20, 21, 26, 0.08);
    transform: translateY(-2px);
}
.market-offers__seller-verified {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    margin-left: 6px;
    border-radius: 50%;
    background: #16a34a;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    vertical-align: middle;
}
.market-offers__seller {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
}
.market-offers__seller-photo {
    width: 48px; height: 48px;
    border-radius: 50%;
    object-fit: cover;
    background: #f3f4f6;
}
.market-offers__seller-name {
    font-weight: 600;
    color: #1a1a1a;
}
.market-offers__seller-meta {
    font-size: 12px;
    color: #6b7280;
}
.market-offers__details { display: flex; flex-direction: column; gap: 6px; }
.market-offers__price {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
}
.market-offers__price span { font-size: 14px; color: #6b7280; font-weight: 500; }
.market-offers__price--negotiable {
    font-size: 16px;
    color: #6b7280;
    font-weight: 600;
}
.market-offers__stock {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #6b7280;
}
.market-offers__stock-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    display: inline-block;
}
.market-offers__stock-dot--in { background: #10b981; }
.market-offers__stock-dot--low { background: #f59e0b; }
.market-offers__stock-dot--out { background: #ef4444; }
.market-offers__delivery {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}
.market-offers__delivery-chip {
    padding: 2px 8px;
    border-radius: 4px;
    background: #f3f4f6;
    color: #4b5563;
    font-size: 11px;
    font-weight: 500;
}
.market-offers__custom-name {
    font-size: 13px;
    color: #6b7280;
    font-style: italic;
}
.market-offers__actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 140px;
}
.market-offers__actions .btn { width: 100%; text-align: center; }
.market-offers--empty {
    padding: 32px;
    text-align: center;
    background: #f9fafb;
    border: 1px dashed #e5e7eb;
    border-radius: 12px;
    color: #6b7280;
}

@media (max-width: 720px) {
    .market-offers__card {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .market-offers__actions { flex-direction: row; }
}

/* Каталог: метки количества предложений на карточке */
.market-card__offers-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 6px 0;
}
.market-card__offers-chip {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}
.market-card__offers-chip--sell { background: #fef2f2; color: #b91c1c; }
.market-card__offers-chip--buy  { background: #eff6ff; color: #1e40af; }
.market-card__offers-chip--empty { background: #f3f4f6; color: #6b7280; }

/* Метка «на модерации» на карточке в кабинете */
.market-card__pending-mark {
    position: absolute;
    top: 8px;
    right: 36px;
    padding: 2px 6px;
    background: #fef3c7;
    color: #92400e;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}
