/* ==========================================
   FEED — showcase grid, categories, sorting, .app-footer
   ========================================== */

/* 2. Карточка витрины/ленты — визуал (геометрия в layout.css) */
.main-feed-card {
    position: relative !important;
    background-color: transparent !important;
  /* backdrop-filter на самом контейнере ломает sticky у .feed-signboard — перенесён на ::before */
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border-radius: 16px !important;
    border: none !important;
    box-shadow: none !important;
    padding-top: 0 !important; /* Плашка вплотную к верху — без белой полосы */
    padding-bottom: 8px !important; /* Без legacy-зазора от двойного скролла */
    overflow: visible !important;
}

/* Стеклянный фон карточки — только экран создания; на главной ленте карточки на фоне страницы */
#screen-main > .main-feed-card::before {
    display: none !important;
    content: none !important;
}

.main-feed-card::before {
    content: '' !important;
    position: absolute !important;
    inset: 0 !important;
    border-radius: inherit !important;
    /* Лёгкая матовая подложка без backdrop-filter — sticky-плашка уже даёт размытие при скролле */
    background: var(--bg-glass-sticky, linear-gradient(135deg, rgba(255, 255, 255, 0.92) 0%, rgba(255, 255, 255, 0.78) 100%)) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border: 1px solid var(--border-glass, rgba(255, 255, 255, 0.6)) !important;
    box-shadow: var(--glass-highlight, inset 0 1px 1px 0 rgba(255, 255, 255, 0.7)), var(--shadow-glass, 0 8px 32px rgba(0, 0, 0, 0.06)) !important;
    z-index: 0 !important;
    pointer-events: none !important;
}

.main-feed-card > .feed-container {
    position: relative !important;
    z-index: 1 !important;
}

/* Обёртка шапки ленты и списка товаров — единый sticky-контекст */
.main-feed-card .feed-container {
    --feed-sep: 0;
    --feed-collapse: 0; /* мета (сортировка/счётчик) снята — коллапса нет */
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    align-items: stretch !important; /* center на flex-родителе ломает sticky у .feed-signboard */
    overflow: visible !important;
    overflow-anchor: none !important; /* не дёргать scrollY при смене высоты sticky-шапки */
}

/* Подвал — одинаковый на всех вкладках Tab Bar.
   На #screen-main футер живёт внутри .feed-container (см. index.html) —
   там же, где считается --feed-sep, чтобы получать тот же компенсирующий
   сдвиг, что и #products-feed при полностью прилипшей шапке. */
#screen-main .feed-container > .app-footer,
#screen-stories > .app-footer,
#screen-profile > .app-footer {
    background: transparent !important;
    text-align: center !important;
    padding: 0 !important;
    margin: var(--content-gutter, 4px) 0 !important;
    flex-shrink: 0 !important;
}

/* Главная: экран на всю высоту фрейма, подпись футера — по центру оставшегося места */
#screen-main:not(.hidden) {
    display: flex !important;
    flex-direction: column !important;
    min-height: calc(100vh - 8px) !important;
}

#screen-main:not(.hidden) > .main-feed-card {
    flex: 1 1 auto !important;
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
}

#screen-main:not(.hidden) .feed-container {
    flex: 1 1 auto !important;
}

#screen-main .feed-container > .app-footer {
    flex: 1 1 auto !important;
    flex-shrink: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    min-height: 64px !important;
    margin-bottom: var(--content-gutter, 4px) !important;
}

.app-footer {
    background: transparent !important;
    text-align: center !important;
    padding: 4px 0 8px 0 !important;
    margin: var(--content-gutter, 4px) 0 !important;
}

.app-footer p {
    color: rgba(255, 255, 255, 0.8) !important; /* Светлый читаемый текст на зеленом */
    font-size: 0.75rem !important;
    margin: 3px 0 !important;
}

.footer-sub {
    color: rgba(255, 255, 255, 0.55) !important;
    font-size: 0.7rem !important;
}

/* Первая строка бренд-карточки: название и район по углам */
.brand-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 4px !important;
}

/* Плашка «Сначала свежие» — базовые стили (переопределяются в .feed-controls-bar) */
.sort-badge-btn {
    background: #f0f2f1 !important;
    border: none !important;
    color: #4b5563 !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    padding: 6px 12px !important;
    border-radius: 9999px !important;
    cursor: pointer !important;
    margin: 0 !important;
    white-space: nowrap;
}

/* Legacy: кнопка сортировки */
.sort-row {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    width: 100%;
}

/* 4. Лента товаров (legacy / вне main-feed-card) */
.products-feed {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    margin: 0 16px 24px 16px;
    width: auto;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: none;
    overflow: visible;
}

/* Старые плашки категорий больше не показываем в ленте */
#categories-container {
    display: none !important;
}

/* 4. Анимация плавного появления списка категорий при загрузке (Slide-in-up) */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Старые плашки категорий отключены — вместо них лента товаров */
.category-card {
    display: none !important;
}

/* Градиентный оверлей для читаемости текста (legacy, скрыт вместе с карточкой) */
.category-card::after {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.15) 0%, rgba(0, 0, 0, 0.35) 40%, rgba(0, 0, 0, 0.75) 100%) !important;
    z-index: 1 !important;
    pointer-events: none !important;
    transition: background 0.3s ease !important;
}

/* 3. Эффект 'всплытия' для карточек категорий */
.category-card:hover {
    transform: translateY(-5px) !important; /* Приподнимаем карточку */
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15) !important; /* Делаем тень глубже */
    cursor: pointer;
}

/* Усиливаем градиент при наведении для глубины */
.category-card:hover::after {
    background: linear-gradient(180deg, rgba(0,0,0,0.05) 0%, rgba(0,0,0,0.8) 100%) !important;
}

/* Контейнер заголовка категории (где стрелка назад и название) */
.category-header,
[class*="category-title-container"],
#screen-products > div:first-child {
    padding: 16px 20px 4px 20px; /* Выравниваем по бокам и делаем аккуратный отступ */
    display: flex;
    align-items: center;
    gap: 12px;
}

.feed-header-section {
    margin: 0;
}

/* Сентинел для прогресса отделения sticky у .feed-signboard */
.feed-signboard-sentinel {
    height: 0 !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    pointer-events: none !important;
    visibility: hidden !important;
}

#screen-main > .main-feed-card {
    border-radius: 0 !important;
    padding-bottom: 0 !important;
}

#screen-create > .main-feed-card {
    border-radius: 0 !important;
    padding-bottom: 0 !important;
}

#screen-create > .main-feed-card::before {
    display: none !important;
    content: none !important;
}

#screen-product > .product-detail-shell {
    border-radius: 0 !important;
    padding-bottom: 0 !important;
}

#screen-product > .product-detail-shell::before {
    display: none !important;
    content: none !important;
}

#screen-product .product-detail-signboard {
    margin: 0 var(--content-gutter, 4px) var(--content-gutter, 4px) !important;
    width: auto !important;
}

/* Единая sticky-шапка: layout-высота стабильна; визуальный коллапс — compositor-only */
#screen-main .feed-signboard,
#screen-main .feed-sticky-header,
#screen-create .create-form-signboard,
#screen-product .product-detail-signboard,
.main-feed-card .feed-signboard,
.feed-signboard {
    --feed-meta-slot: 40px;
    margin: 0 !important;
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border-radius: 16px !important;
    padding: 10px 12px 8px 12px !important;
    border: none !important;
    box-shadow: none !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: center !important;
    gap: 10px !important;
    box-sizing: border-box !important;
    width: 100% !important;
    overflow: hidden !important; /* Overflow Guard: обрезка стекла по скруглению (DESIGN_SYSTEM.md §7 п.4) */
    flex-shrink: 0 !important;
    position: -webkit-sticky !important;
    position: sticky !important;
    top: var(--sticky-float-top, 4px) !important;
    z-index: 100 !important;
    isolation: isolate;
    pointer-events: none !important;
}

/* Главная: вся sticky-шапка ловит тач — жест категорий не уходит в галерею карточек снизу */
#screen-main .feed-signboard,
#screen-main .feed-sticky-header {
    pointer-events: auto !important;
}

/* Главная: без меты — нижний паддинг шапки = ритм к карточкам, без пустого слота */
#screen-main .feed-signboard {
    padding-bottom: var(--content-gutter, 4px) !important;
}

#screen-create .create-form-signboard::before,
#screen-product .product-detail-signboard::before {
    content: '' !important;
    position: absolute !important;
    inset: 0 !important;
    border-radius: inherit !important;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.88) 0%, rgba(255, 255, 255, 0.68) 100%) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border: 1px solid rgba(255, 255, 255, 0.6) !important;
    box-shadow: inset 0 1px 1px 0 rgba(255, 255, 255, 0.7) !important;
    box-sizing: border-box !important;
    opacity: 1 !important;
    pointer-events: none !important;
    z-index: 0 !important;
}

/* Слой стекла главной: статичный, на всю шапку (меты нет — не ужимать снизу) */
#screen-main .feed-signboard::before,
#screen-main .feed-sticky-header::before,
.main-feed-card .feed-signboard::before,
.feed-signboard::before {
    content: '' !important;
    position: absolute !important;
    inset: 0 !important;
    border-radius: inherit !important;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.88) 0%, rgba(255, 255, 255, 0.68) 100%) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border: 1px solid rgba(255, 255, 255, 0.6) !important;
    box-shadow: inset 0 1px 1px 0 rgba(255, 255, 255, 0.7) !important;
    box-sizing: border-box !important;
    opacity: 1 !important;
    pointer-events: none !important;
    z-index: 0 !important;
    /* box-shadow при прилипании переключается мгновенно (без transition) —
       анимация box-shadow дорого перерисовывается на слабых CPU. */
}

#screen-main .feed-signboard.is-stuck::before,
#screen-main .feed-sticky-header.is-stuck::before,
.feed-signboard.is-stuck::before,
.feed-sticky-header.is-stuck::before {
    border-radius: 16px !important;
    box-shadow:
        inset 0 1px 1px 0 rgba(255, 255, 255, 0.7),
        0 8px 32px rgba(0, 0, 0, 0.06) !important;
}

/* Капсула поиска — на обёртке, чтобы крестик жил внутри поля, а не под native input */
.feed-sticky-header .search-input-wrapper,
.feed-signboard .search-input-wrapper {
    border-radius: 12px !important;
    background-color: var(--bg-surface, #FFFFFF) !important;
    border: 1px solid var(--border-glass, rgba(255, 255, 255, 0.6)) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        var(--shadow-subtle, 0 4px 20px rgba(0, 0, 0, 0.03), 0 1px 2px rgba(0, 0, 0, 0.02)) !important;
}

.feed-sticky-header .search-input-wrapper:focus-within,
.feed-signboard .search-input-wrapper:focus-within {
    border-color: rgba(46, 102, 83, 0.35) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        0 0 0 3px rgba(46, 102, 83, 0.12),
        var(--shadow-subtle, 0 4px 20px rgba(0, 0, 0, 0.03), 0 1px 2px rgba(0, 0, 0, 0.02)) !important;
}

.feed-sticky-header .hero__search-input,
.feed-sticky-header .search-input,
.feed-signboard .hero__search-input,
.feed-signboard .search-input {
    border-radius: 12px !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.feed-sticky-header .hero__search-input:focus,
.feed-sticky-header .search-input:focus,
.feed-signboard .hero__search-input:focus,
.feed-signboard .search-input:focus,
#screen-main .feed-signboard #search-input:focus {
    border-color: transparent !important;
    box-shadow: none !important;
    outline: none !important;
}

.feed-sticky-header .add-product-btn,
.feed-signboard .add-product-btn {
    border-radius: 12px !important;
    font-weight: 700 !important;
    background: linear-gradient(135deg, #2E6653 0%, #1E5644 100%) !important;
    background-color: transparent !important;
    color: var(--text-on-brand, #FFFFFF) !important;
    border: 1px solid rgba(255, 255, 255, 0.28) !important;
    box-shadow:
        inset 0 1px 1px 0 rgba(255, 255, 255, 0.4),
        var(--shadow-subtle, 0 4px 20px rgba(0, 0, 0, 0.03), 0 1px 2px rgba(0, 0, 0, 0.02)) !important;
}

.feed-sticky-header .add-product-btn:hover,
.feed-signboard .add-product-btn:hover {
    background: linear-gradient(135deg, #357a65 0%, #1a4f40 100%) !important;
    color: var(--text-on-brand, #FFFFFF) !important;
    box-shadow:
        inset 0 1px 1px 0 rgba(255, 255, 255, 0.5),
        0 6px 16px -4px rgba(46, 102, 83, 0.28) !important;
}

.feed-sticky-header .add-product-btn:active,
.feed-signboard .add-product-btn:active {
    transform: scale(0.96) translateY(1px) !important;
    box-shadow:
        inset 0 1px 1px 0 rgba(255, 255, 255, 0.32),
        0 4px 12px -4px rgba(46, 102, 83, 0.28) !important;
}

.feed-sticky-header .category-filter-btn,
.feed-sticky-header .category-btn,
.feed-signboard .category-filter-btn,
.feed-signboard .category-btn {
    background: var(--bg-surface, #FFFFFF) !important;
    border: 1px solid var(--border-light, rgba(226, 232, 240, 0.8)) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5) !important;
    color: var(--text-primary, #111827) !important;
    padding: 6px 14px !important;
}

.feed-sticky-header .category-filter-btn.active,
.feed-sticky-header .category-btn.active,
.feed-signboard .category-filter-btn.active,
.feed-signboard .category-btn.active {
    background-color: var(--brand-light-bg, #EAF2EE) !important;
    color: var(--brand-primary, #2E6653) !important;
    border: 1px solid rgba(46, 102, 83, 0.35) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5) !important;
    font-weight: 600 !important;
}

#screen-main .feed-signboard.is-sort-open:not(.is-meta-inert),
.feed-signboard.is-sort-open:not(.is-meta-inert) {
    overflow: visible !important;
}

/* .is-stuck — маркер прилипания (геометрия ширины не меняется) */
#screen-main .feed-signboard.is-stuck,
#screen-main .feed-sticky-header.is-stuck,
.feed-sticky-header.is-stuck,
.feed-signboard.is-stuck {
    border-radius: 16px !important;
}

.main-feed-card .feed-signboard > *,
.feed-signboard > *,
.feed-sticky-header > * {
    position: relative !important;
    z-index: 1 !important;
    pointer-events: auto !important;
}

/* Поиск внутри единой sticky-шапки — без отдельной плашки */
.feed-sticky-header .search-control-panel,
.feed-signboard .search-control-panel {
    background: transparent !important;
    background-color: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Мета-строка: dissolve 1:1 с --feed-sep, без ускоренного snap */
#screen-main .feed-signboard .feed-controls-bar,
.feed-signboard .feed-controls-bar {
    position: relative !important;
    z-index: 2 !important;
    width: 100% !important;
    height: var(--feed-meta-slot, 40px) !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    flex-shrink: 0 !important;
    transform: translate3d(0, calc(var(--feed-sep, 0) * var(--feed-collapse, 50px) * -1), 0);
    opacity: calc(1 - var(--feed-sep, 0));
}

/* Категории и поиск выше меты */
#screen-main .feed-signboard .search-control-panel,
#screen-main .feed-signboard .categories-scroll,
#screen-main .feed-signboard .categories-row {
    z-index: 3 !important;
}

#screen-main .feed-signboard .feed-controls-bar__meta,
.feed-signboard .feed-controls-bar__meta {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
    height: var(--feed-meta-slot, 40px) !important;
    margin: 0 !important;
    padding: 4px 0 0 0 !important;
    box-sizing: border-box !important;
    gap: 12px !important;
}

#screen-main .feed-signboard.is-sort-open:not(.is-meta-inert) .feed-controls-bar,
.feed-signboard.is-sort-open:not(.is-meta-inert) .feed-controls-bar {
    overflow: visible !important;
    height: auto !important;
    min-height: var(--feed-meta-slot, 40px) !important;
    opacity: 1 !important;
    transform: none !important;
}

#screen-main .feed-signboard.is-sort-open:not(.is-meta-inert) .feed-controls-bar__meta,
.feed-signboard.is-sort-open:not(.is-meta-inert) .feed-controls-bar__meta {
    pointer-events: auto !important;
}

/* С начала коллапса мета некликабельна (visual-only) */
#screen-main .feed-signboard.is-meta-inert .feed-controls-bar,
.feed-signboard.is-meta-inert .feed-controls-bar {
    pointer-events: none !important;
}

#screen-main .feed-signboard.is-meta-collapsed .feed-controls-bar,
.feed-signboard.is-meta-collapsed .feed-controls-bar {
    opacity: 0 !important;
    visibility: hidden !important;
}

/* Лента сразу под шапкой — без компенсационного transform (меты нет) */
#screen-main .main-feed-card #products-feed {
    transform: none;
}

/* Legacy: сортировка вне signboard (экран создания и т.п.) */
.feed-container > .feed-controls-bar {
    position: relative !important;
    z-index: 1 !important;
    padding: 4px 16px 0 16px !important;
    margin: 0 !important;
}

/* Строка управления: сортировка слева, счётчик справа (уплывает вместе с лентой) */
.feed-controls-bar,
.feed-header-bar {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding: 0 4px !important;
    box-sizing: border-box !important;
    gap: 12px !important;
    position: relative !important;
    z-index: 10 !important; /* Поверх маски ленты */
    overflow: visible !important;
}

.sort-wrapper {
    display: flex !important;
    align-items: center !important;
    min-width: 0 !important;
}

.sort-wrapper .sort-badge-btn,
.feed-controls-bar .sort-badge-btn {
    font-size: 13px !important;
    font-weight: 500 !important;
    background: #f0f2f1 !important;
    padding: 6px 12px !important;
    border: none !important;
    color: #4b5563 !important;
    cursor: pointer !important;
    margin: 0 !important;
    white-space: nowrap !important;
    align-self: auto !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5) !important;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.2s ease !important;
}

.sort-wrapper .sort-badge-btn:active,
.feed-controls-bar .sort-badge-btn:active {
    transform: scale(0.97) !important;
}

.products-count-badge {
    font-size: 13px !important;
    font-weight: 500 !important;
    color: #6b7280 !important;
    background: #f3f4f6 !important;
    padding: 4px 10px !important;
    border-radius: 9999px !important;
    white-space: nowrap !important;
}

/* Выпадающее меню сортировки */
.sort-dropdown {
    position: relative !important;
    flex-shrink: 0 !important;
    overflow: visible !important;
}

.sort-dropdown-menu {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    z-index: 100 !important;
    min-width: 100% !important;
    width: max-content !important;
    max-width: 260px !important;
    margin: 0 !important;
    padding: 6px !important;
    list-style: none !important;
    background: #ffffff !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12) !important;
    box-sizing: border-box !important;
}

.sort-dropdown-menu[hidden] {
    display: none !important;
}

.sort-dropdown-item {
    display: block !important;
    width: 100% !important;
    padding: 9px 12px !important;
    margin: 0 !important;
    border: none !important;
    border-radius: 12px !important;
    background: transparent !important;
    color: #374151 !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    text-align: left !important;
    cursor: pointer !important;
    box-sizing: border-box !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

.sort-dropdown-item:hover {
    background: #f3f4f6 !important;
    color: #111827 !important;
}

.sort-dropdown-item.is-active,
.sort-dropdown-item[aria-selected="true"] {
    background: #f0fdf4 !important;
    color: #047857 !important;
    font-weight: 600 !important;
}

/* Empty state ленты — токены DESIGN_SYSTEM.md §3/§5 (не хардкод-зелёный) */
.feed-empty-state {
    width: calc(100% - 24px) !important;
    max-width: 100% !important;
    margin: 8px auto 0 auto !important;
    padding: 28px 20px 24px 20px !important;
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    gap: 10px !important;
    background: var(--bg-glass-sticky, linear-gradient(135deg, rgba(255, 255, 255, 0.88) 0%, rgba(255, 255, 255, 0.68) 100%)) !important;
    border: 1px solid var(--border-glass, rgba(255, 255, 255, 0.6)) !important;
    border-radius: var(--radius-card, 16px) !important;
    box-shadow: var(--glass-highlight, inset 0 1px 1px 0 rgba(255, 255, 255, 0.7)), var(--shadow-glass, 0 8px 32px rgba(0, 0, 0, 0.06)) !important;
    flex-shrink: 0 !important;
}

.feed-empty-state[hidden] {
    display: none !important;
}

.feed-empty-state__icon {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 64px !important;
    height: 64px !important;
    margin: 0 auto 4px auto !important;
    border-radius: 50% !important;
    background: var(--brand-light-bg, #EAF2EE) !important;
    color: var(--brand-primary, #2E6653) !important;
    flex-shrink: 0 !important;
}

.feed-empty-state__title {
    margin: 0 !important;
    font-size: 1.05rem !important;
    font-weight: 700 !important;
    line-height: 1.35 !important;
    color: var(--text-primary, #111827) !important;
}

.feed-empty-state__text {
    margin: 0 !important;
    max-width: 280px !important;
    font-size: 0.9rem !important;
    line-height: 1.45 !important;
    color: var(--text-secondary, #6B7280) !important;
}

/* Primary Solid (как «+ Продать», DESIGN_SYSTEM.md §5) */
.feed-empty-state__btn {
    margin-top: 6px !important;
    padding: 10px 20px !important;
    border: 1px solid rgba(255, 255, 255, 0.28) !important;
    border-radius: 12px !important;
    background: linear-gradient(135deg, var(--brand-primary, #2E6653) 0%, var(--brand-dark, #1E5644) 100%) !important;
    color: var(--text-on-brand, #FFFFFF) !important;
    font-size: 0.9rem !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
    box-shadow: inset 0 1px 1px 0 rgba(255, 255, 255, 0.4), var(--shadow-subtle, 0 4px 20px rgba(0, 0, 0, 0.03), 0 1px 2px rgba(0, 0, 0, 0.02)) !important;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease !important;
}

.feed-empty-state__btn:hover {
    box-shadow: inset 0 1px 1px 0 rgba(255, 255, 255, 0.5), 0 6px 16px -4px rgba(46, 102, 83, 0.28) !important;
}

.feed-empty-state__btn:active {
    transform: scale(0.97) !important;
}

/* Card Action Soft Fill (как «Связаться», DESIGN_SYSTEM.md §5) — для «Сбросить поиск» */
.feed-empty-state__btn--secondary {
    background: var(--brand-light-bg, #EAF2EE) !important;
    color: var(--brand-primary, #2E6653) !important;
    border: 1px solid rgba(46, 102, 83, 0.28) !important;
    box-shadow: var(--shadow-subtle, 0 4px 20px rgba(0, 0, 0, 0.03), 0 1px 2px rgba(0, 0, 0, 0.02)) !important;
}

.feed-empty-state__btn--secondary:hover {
    box-shadow: 0 6px 16px -4px rgba(46, 102, 83, 0.18) !important;
}

/* Скелетоны загрузки ленты */
@keyframes feedSkeletonPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.45;
    }
}

#products-feed.is-loading {
    overflow: visible !important;
}

.feed-skeleton-card {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 2px !important;
    border-radius: 16px !important;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.92) 0%, rgba(255, 255, 255, 0.78) 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.65) !important;
    overflow: hidden !important;
    flex-shrink: 0 !important;
    animation: feedSkeletonPulse 1.4s ease-in-out infinite;
    box-sizing: border-box !important;
    box-shadow: var(--shadow-subtle, 0 4px 20px rgba(0, 0, 0, 0.03), 0 1px 2px rgba(0, 0, 0, 0.02)) !important;
    display: flex !important;
    flex-direction: column !important;
    height: auto !important;
    min-height: auto !important;
    align-self: stretch !important;
}

.feed-skeleton-image {
    width: 100% !important;
    aspect-ratio: 4 / 5 !important;
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
    border-radius: 12px 12px 0 0 !important;
    background: #dfe4e8 !important;
    flex: 0 0 auto !important;
    flex-shrink: 0 !important;
}

.feed-skeleton-body {
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    padding: 8px !important;
    box-sizing: border-box !important;
    background: var(--bg-surface, #FFFFFF) !important;
    border-radius: 0 0 12px 12px !important;
    flex: 1 1 auto !important;
}

.feed-skeleton-line--price {
    width: 55% !important;
    height: 16px !important;
}

.feed-skeleton-line {
    height: 12px !important;
    border-radius: 6px !important;
    background: #dfe4e8 !important;
    flex-shrink: 0 !important;
}

.feed-skeleton-line--title {
    width: 70% !important;
    height: 14px !important;
}

.feed-skeleton-line--short {
    width: 45% !important;
}

.feed-skeleton-line--medium {
    width: 85% !important;
}

/* Список товаров — единый поток страницы, без изолированного скролла внутри ленты */
.main-feed-card .products-list,
.main-feed-card #products-feed,
.main-feed-card .products-feed,
.products-grid,
.products-wrapper,
.main-content,
#products-feed,
#products-list,
#products-container {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important; /* Центрирование карточек по горизонтали */
    background: transparent !important;
    background-color: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding-top: 0 !important;
    padding-bottom: 8px !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin: 0 auto !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
    /* Высота — только по содержимому, никаких лимитов и внутреннего скролла */
    height: auto !important;
    max-height: none !important;
    min-height: 0 !important;
    overflow: visible !important;
}

/* Единый ритм главной: --content-gutter между всеми блоками (DESIGN_SYSTEM.md §5) */
#screen-main .main-feed-card #products-feed,
#screen-main .main-feed-card .products-list {
    padding-top: var(--content-gutter, 4px) !important;
    padding-bottom: 0 !important;
    gap: var(--content-gutter, 4px) !important;
    align-items: stretch !important;
}

#screen-main .main-feed-card .product-card:not(.listing-preview-card),
#screen-main .main-feed-card .feed-skeleton-card,
#screen-main .main-feed-card .feed-empty-state {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
}

/* Последняя карточка — без legacy-отступа снизу */
.main-feed-card #products-feed > .product-card:last-child,
.main-feed-card #products-feed > .feed-skeleton-card:last-child {
    margin-bottom: 0 !important;
}

/* Empty state — небольшой воздух перед футером, чтобы не «прилипал» снизу */
.main-feed-card #products-feed > .feed-empty-state:last-child {
    margin-bottom: 16px !important;
}

.sub-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 10px;
    width: 100%;
    min-width: 0;
}

.logo-title {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 800;
    color: #059669 !important; /* Приглушенный зеленый бренд-цвет */
    letter-spacing: 0.02em;
    cursor: pointer;
}

.main-feed-header h1,
.main-feed-header h2,
.feed-title,
.brand-name,
.logo-title {
    margin-bottom: 4px !important;
}

.location-tag {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280; /* Мягкий серый цвет */
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: rgba(0, 0, 0, 0.04);
    padding: 4px 8px;
    border-radius: 6px;
    white-space: nowrap;
}

/* Шапка: заголовок и цена в одну строку (DESIGN_SYSTEM.md §5 Card Anatomy) */
.product-card .card-header,
.product-card .product-header,
.product-card .product-card-header {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 8px !important;
    width: 100% !important;
    margin: 0 0 8px 0 !important;
}

.product-card .card-header .product-card-title,
.product-card .card-header .product-title,
.product-card .card-header .card-title {
    flex: 1 1 auto !important;
    width: auto !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    font-size: 1rem !important;
    font-weight: 800 !important;
    color: var(--text-primary, #111827) !important;
    line-height: 1.25 !important;
    letter-spacing: 0.03em !important;
    text-transform: uppercase !important;
}

.product-card .product-price-box,
.product-card .card-header .product-price-box {
    display: inline-flex !important;
    align-items: baseline !important;
    flex-wrap: nowrap !important;
    flex: 0 0 auto !important;
    flex-shrink: 0 !important;
    margin-left: auto !important;
    align-self: center !important;
    white-space: nowrap !important;
    gap: 0 !important;
}

.main-feed-card .product-card .price-val,
.main-feed-card .product-card .product-card-price,
.main-feed-card .product-card .product-price {
    font-size: 1.125rem !important;
    font-weight: 700 !important;
    color: var(--brand-primary, #2E6653) !important;
    letter-spacing: -0.01em !important;
}

.main-feed-card .product-card .price-unit,
.main-feed-card .product-card .product-price-unit {
    color: var(--text-secondary, #6B7280) !important;
    font-size: 0.8125rem !important;
    font-weight: 500 !important;
}

.product-views,
.product-card .product-views {
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    font-size: 11px !important;
    font-weight: 500 !important;
    color: #636366 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    flex: 0 0 auto !important;
    flex-shrink: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    box-shadow: none !important;
}

.product-views-icon {
    width: 14px !important;
    height: 14px !important;
    display: block !important;
    flex-shrink: 0 !important;
}

.product-views-count {
    color: #636366 !important;
    font-size: 11px !important;
    font-weight: 500 !important;
    line-height: 1 !important;
}

/* Просмотры на фото: правый низ, над полоской галереи (.gallery-progress bottom: 10px) */
.product-card .product-views--on-media,
.product-views.product-views--on-media {
    position: absolute !important;
    right: 12px !important;
    bottom: 20px !important;
    left: auto !important;
    top: auto !important;
    z-index: 6 !important;
    gap: 4px !important;
    padding: 4px 8px !important;
    border-radius: 999px !important;
    background: rgba(0, 0, 0, 0.38) !important;
    color: #fff !important;
    font-size: 11px !important;
    backdrop-filter: blur(6px) !important;
    -webkit-backdrop-filter: blur(6px) !important;
    margin: 0 !important;
    pointer-events: none !important;
    flex-shrink: 0 !important;
}

.product-card .product-views--on-media .product-views-count {
    color: #fff !important;
}

.main-feed-card .product-card:not(.listing-preview-card) .seller-info .product-views,
.main-feed-card .product-card:not(.listing-preview-card) .product-author .product-views,
.main-feed-card .product-card:not(.listing-preview-card) .author-info .product-views {
    display: none !important;
}

.brand-block {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.brand-subtitle {
    margin: 0;
    font-size: 0.52rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: #6b7280;
    white-space: nowrap;
}

/* .feed-header-bar — удалён legacy-скрыватель, класс больше не используется в HTML */

/* Контейнер блока фильтров (legacy) */
.feed-filters-wrapper,
.filters-row,
.filters-bar,
.filter-controls-wrapper {
    display: none !important;
}

/* Внешний контейнер категорий — внутри белой карточки */
.categories-wrapper,
.categories-container,
.categories-scroll-container {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Внутренний прокручиваемый список категорий */
.categories-list,
.categories-scroll,
.categories-row,
.categories-scroll-row,
.category-tags {
    display: flex !important;
    flex-wrap: nowrap !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    white-space: nowrap !important;
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    padding-bottom: 2px !important;
    padding-top: 0 !important;
    margin: 0 auto !important;
    box-sizing: border-box !important;
    scrollbar-width: none !important;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
    min-width: 0;
}

.categories-row::-webkit-scrollbar,
.categories-scroll::-webkit-scrollbar,
.categories-scroll-row::-webkit-scrollbar,
.categories-scroll-container::-webkit-scrollbar,
.category-tags::-webkit-scrollbar {
    display: none;
}

.category-filter-btn,
.category-btn {
    background: var(--bg-surface, #FFFFFF);
    color: var(--text-primary, #111827);
    border: 1px solid var(--border-light, rgba(226, 232, 240, 0.8));
    padding: 6px 14px;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    /* Литая капсула: мягкий внутренний блик сверху (см. DESIGN_SYSTEM.md, п.2) */
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    flex-shrink: 0 !important;
    margin: 0;
}

.category-filter-btn:active,
.category-btn:active {
    transform: scale(0.97);
}

.category-btn:first-child,
.category-filter-btn:first-child {
    margin-left: 0 !important;
}

/* Активная выбранная категория — Filter Chip Active (DESIGN_SYSTEM.md §5) */
.category-filter-btn.active,
.category-btn.active,
.chip.active,
button[data-category].active {
    background-color: var(--brand-light-bg, #EAF2EE) !important;
    color: var(--brand-primary, #2E6653) !important;
    border: 1px solid rgba(46, 102, 83, 0.35) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5) !important;
    font-weight: 600 !important;
}

.sort-badge-btn:hover {
    background: #e5e7eb !important;
    color: #111827 !important;
}

/* Legacy: селект сортировки */
.sort-select-container,
.sort-select {
    align-self: flex-start !important;
}

.sort-select-container {
    display: inline-flex;
    align-items: center;
}

.sort-select {
    appearance: none;
    -webkit-appearance: none;
    background: #f3f4f6;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 20 20' fill='%236b7280'%3E%3Cpath d='M5.25 7.5L10 12.25L14.75 7.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 6px 28px 6px 12px;
    font-size: 0.8rem;
    color: #374151;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    margin: 0;
}

.sort-select:focus {
    border-color: #a7f3d0;
    box-shadow: 0 0 0 2px rgba(5, 150, 105, 0.15);
}

.sort-btn {
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    color: #4b5563;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    padding: 5px 10px;
    white-space: nowrap;
    flex-shrink: 0;
    margin: 2px 0 0 0;
    align-self: flex-start !important;
}

.sort-btn:hover {
    color: #111827;
}

/* Legacy-теги (на случай старой разметки) */
.tag,
.category-tag {
    flex-shrink: 0;
    margin: 0;
    padding: 6px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 9999px;
    background: #f3f4f6;
    color: #374151;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
}

.tag.is-active,
.category-tag.is-active {
    background: #059669 !important;
    color: #ffffff !important;
    border-color: #059669 !important;
    font-weight: 600;
}

.sort-chip {
    flex-shrink: 0;
    margin: 0;
    padding: 6px 10px;
    border: none;
    background: transparent;
    color: #6b7280;
    font-size: 0.85rem;
    white-space: nowrap;
    cursor: pointer;
}

/* Вертикальный список категорий */
#categories-container,
.categories-list,
.categories-grid {
    margin-top: 20px; /* Отделяет список категорий от верхней группы */
    padding: 0 16px 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    box-sizing: border-box;
    animation: fadeInUp 0.6s ease-out both;
}

.category-card-content {
    position: relative !important;
    z-index: 2 !important; /* Контент поверх градиента */
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 4px !important;
    width: 100% !important;
}

.category-title {
    font-size: 1.25rem !important;
    font-weight: 700 !important;
    margin: 0 !important;
    color: #ffffff !important;
    line-height: 1.15 !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35) !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 100% !important;
}

.category-count {
    font-size: 0.85rem !important;
    font-weight: 400 !important;
    color: rgba(255, 255, 255, 0.75) !important;
    margin: 0 !important;
    line-height: 1.2 !important;
}

/* Спрятать старые кружки / бейджи счётчиков */
.category-index,
.category-counter,
.category-status,
.category-card-bg,
.category-title-container,
.category-name {
    display: none !important;
}

/* Контейнер карточек на экране категории (не главная витрина) */
.products-container,
#screen-products .products-list,
#screen-products #products-list,
#products-list {
    margin-top: 16px; /* Отодвигаем карточки товаров вниз от заголовка */
    padding: 0 16px 24px 16px; /* Задаем боковые отступы для самих карточек */
    display: flex;
    flex-direction: column;
    gap: 14px; /* Расстояние между карточками товаров, если их будет несколько */
}

.empty-category-notice {
    background-color: #ffffff; /* Белая контрастная карточка */
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    color: #4a5568; /* Читаемый темно-серый цвет текста */
    font-size: 1.1rem;
    line-height: 1.5;
    margin: 20px 0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

/* ==========================================
   Галерея фото в карточке товара (горизонтальный скролл + progress-segments)
   ========================================== */

/* Обертка медиа-блока карточки */
.product-card-image,
.product-card-media,
.card-media {
    position: relative !important;
    width: 100% !important;
    height: 220px !important;
    min-height: 220px !important;
    max-height: 220px !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    flex-shrink: 0 !important;
    background: var(--brand-light-bg, #EAF2EE) !important;
    background-color: var(--brand-light-bg, #EAF2EE) !important;
    border-radius: 12px 12px 0 0 !important;
}

.product-card-image:has(.card-gallery-wrapper) {
    height: 220px !important;
    min-height: 220px !important;
    max-height: 220px !important;
    background: var(--brand-light-bg, #EAF2EE) !important;
    background-color: var(--brand-light-bg, #EAF2EE) !important;
}

/* Обертка медиа-блока — прямой потомок .product-card */
.product-card > .card-gallery-wrapper,
.card-gallery-wrapper,
.product-card-media {
    position: relative !important;
    display: block !important;
    width: 100% !important;
    height: 220px !important;
    min-height: 220px !important;
    max-height: 220px !important;
    background: var(--brand-light-bg, #EAF2EE) !important;
    background-color: var(--brand-light-bg, #EAF2EE) !important;
    overflow: hidden !important;
    border-radius: 12px 12px 0 0 !important;
    flex-shrink: 0 !important;
}

.card-gallery-scrim {
    position: absolute !important;
    inset: auto 0 0 0 !important;
    height: 56px !important;
    z-index: 4 !important;
    pointer-events: none !important;
    border-radius: 0 0 12px 12px !important;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.16) 0%, rgba(0, 0, 0, 0) 100%) !important;
}

.product-card-content {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    box-sizing: border-box !important;
    background: var(--bg-surface, #FFFFFF) !important;
    padding: 8px !important;
    gap: 0 !important;
    border-radius: 0 0 12px 12px !important;
}

/* Уровень 3: продавец и геопозиция — без внутренних border-линий */
.main-feed-card .product-card:not(.listing-preview-card) .seller-info,
.main-feed-card .product-card:not(.listing-preview-card) .product-author,
.main-feed-card .product-card:not(.listing-preview-card) .author-info {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 6px !important;
    width: 100% !important;
    margin: 8px 0 0 0 !important;
    padding: 0 !important;
    border: none !important;
    border-top: none !important;
    border-bottom: none !important;
    font-size: 0.8125rem !important;
    color: var(--text-secondary, #6B7280) !important;
    line-height: 1.35 !important;
}

.main-feed-card .product-card:not(.listing-preview-card) .seller-info .product-views,
.main-feed-card .product-card:not(.listing-preview-card) .product-author .product-views,
.main-feed-card .product-card:not(.listing-preview-card) .author-info .product-views {
    margin-left: auto !important;
}

.main-feed-card .product-card .seller-info strong,
.main-feed-card .product-card .product-author strong,
.main-feed-card .product-card .author-info strong {
    color: var(--text-primary, #111827) !important;
    font-weight: 600 !important;
    font-size: 0.875rem !important;
}

.main-feed-card .product-card .location-tag {
    color: var(--text-secondary, #6B7280) !important;
    font-size: 0.8125rem !important;
    font-weight: 500 !important;
}

/* Уровень 4: описание — воздух по сетке 8px, без border-разделителей */
.main-feed-card .product-card:not(.listing-preview-card) .product-desc-block {
    width: 100% !important;
    margin: 8px 0 0 0 !important;
    padding: 0 !important;
    border: none !important;
    border-top: none !important;
    border-bottom: none !important;
    gap: 4px !important;
}

/* Запрет внутренних линий-разделителей в белом блоке карточки (DESIGN_SYSTEM.md §5, §7) */
.main-feed-card .product-card:not(.listing-preview-card) .product-card-content > *,
.main-feed-card .product-card:not(.listing-preview-card) .card-body > * {
    border-top: none !important;
    border-bottom: none !important;
}

/* Описание в карточке: 2 строки + inline «… ещё ▾» */
.main-feed-card .product-card:not(.listing-preview-card) .product-card-content,
.main-feed-card .product-card:not(.listing-preview-card) .product-card-body,
.main-feed-card .product-card:not(.listing-preview-card) .product-card-info,
.main-feed-card .product-card:not(.listing-preview-card) .card-body,
.main-feed-card .product-card:not(.listing-preview-card) .card-content,
.product-card:not(.listing-preview-card) .product-card-content,
.product-card:not(.listing-preview-card) .product-card-body,
.product-card:not(.listing-preview-card) .product-card-info,
.product-card:not(.listing-preview-card) .card-body,
.product-card:not(.listing-preview-card) .card-content {
    min-height: max-content !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    background: var(--bg-surface, #FFFFFF) !important;
    padding: 8px !important;
    gap: 0 !important;
    border-radius: 0 0 12px 12px !important;
}

.product-card:not(.listing-preview-card).is-desc-expanded {
    height: auto !important;
    max-height: none !important;
    min-height: max-content !important;
}

.product-desc-block {
    width: 100% !important;
    margin: 0 !important;
    flex-shrink: 0 !important;
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 2px !important;
}

.product-desc-block.is-empty {
    display: none !important;
}

.product-desc-inner {
    position: relative !important;
    width: 100% !important;
    overflow: visible !important;
    flex-shrink: 0 !important;
    box-sizing: border-box !important;
}

.product-card:not(.listing-preview-card):not(.product-card--detail) .product-desc-text,
.product-card:not(.listing-preview-card):not(.product-card--detail) .product-desc-block .product-desc {
    margin: 0 !important;
    font-size: 0.875rem !important;
    white-space: normal !important;
    line-height: 1.45 !important;
    color: var(--text-secondary, #6B7280) !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
}

.product-card:not(.listing-preview-card) .product-desc-body {
    display: inline !important;
    white-space: pre-line !important;
}

.product-card:not(.listing-preview-card):not(.product-card--detail) .product-desc-block:not(.is-expanded) .product-desc-text {
    display: -webkit-box !important;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 2 !important;
    overflow: hidden !important;
}

.product-card:not(.listing-preview-card):not(.product-card--detail) .product-desc-block.is-expanded .product-desc-text {
    display: block !important;
    -webkit-line-clamp: unset !important;
    overflow: visible !important;
}

/* Хвост «… ещё ▾» inline сразу после текста */
.product-desc-tail {
    display: inline !important;
    white-space: nowrap !important;
    vertical-align: baseline !important;
    font-size: 12px !important;
    line-height: 1.35 !important;
    pointer-events: none !important;
    flex-shrink: 0 !important;
}

.product-desc-tail.hidden {
    display: none !important;
}

.product-desc-ellipsis {
    color: #71717a !important;
    font-size: 12px !important;
    line-height: 1.35 !important;
    pointer-events: none !important;
}

.product-desc-toggle {
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    font-size: 12px !important;
    font-weight: 400 !important;
    line-height: 1.35 !important;
    color: #71717a !important;
    cursor: pointer !important;
    pointer-events: auto !important;
    vertical-align: baseline !important;
    -webkit-tap-highlight-color: transparent !important;
    flex-shrink: 0 !important;
}

.product-desc-toggle--more {
    display: inline !important;
}

.product-desc-toggle--less {
    display: inline-block !important;
    margin: 4px 0 0 4px !important;
    position: relative !important;
    z-index: 1 !important;
}

.product-desc-toggle:hover,
.product-desc-toggle:active {
    color: #52525b !important;
}

.product-desc-toggle.hidden {
    display: none !important;
}

.listing-preview-card .product-desc-inner {
    max-height: none !important;
    transition: none !important;
}

.listing-preview-card .product-desc-tail,
.listing-preview-card .product-desc-toggle {
    display: none !important;
}

.product-card-buttons {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    width: 100% !important;
    margin-top: 12px !important;
    padding-top: 0 !important;
}

/* Кнопка «Связаться» в ленте — soft fill Card Action (DESIGN_SYSTEM.md §5) */
.main-feed-card .product-card:not(.listing-preview-card):not(.product-card--tile) .contact-btn,
.main-feed-card .product-card:not(.listing-preview-card):not(.product-card--tile) .btn-contact,
.main-feed-card .product-card:not(.listing-preview-card):not(.product-card--tile) .btn-primary-action,
.main-feed-card .product-card:not(.listing-preview-card):not(.product-card--tile) .card-action-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    flex: 1 1 auto !important;
    width: 100% !important;
    height: 44px !important;
    min-height: 44px !important;
    margin: 0 !important;
    padding: 0 16px !important;
    border-radius: 12px !important;
    font-size: 0.9375rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.01em !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
    background: var(--brand-light-bg, #EAF2EE) !important;
    color: var(--brand-primary, #2E6653) !important;
    border: 1px solid rgba(46, 102, 83, 0.28) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.55),
        var(--shadow-subtle, 0 4px 20px rgba(0, 0, 0, 0.03), 0 1px 2px rgba(0, 0, 0, 0.02)) !important;
    transition:
        transform 0.2s cubic-bezier(0.16, 1, 0.3, 1),
        background-color 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease !important;
}

.main-feed-card .product-card:not(.listing-preview-card) .contact-btn:hover,
.main-feed-card .product-card:not(.listing-preview-card) .btn-contact:hover,
.main-feed-card .product-card:not(.listing-preview-card) .btn-primary-action:hover,
.main-feed-card .product-card:not(.listing-preview-card) .card-action-btn:hover {
    background: #d9ebe3 !important;
    color: var(--brand-dark, #1E5644) !important;
    border-color: rgba(46, 102, 83, 0.45) !important;
}

.main-feed-card .product-card:not(.listing-preview-card) .contact-btn:active,
.main-feed-card .product-card:not(.listing-preview-card) .btn-contact:active,
.main-feed-card .product-card:not(.listing-preview-card) .btn-primary-action:active,
.main-feed-card .product-card:not(.listing-preview-card) .card-action-btn:active {
    transform: scale(0.97) !important;
}

/* Контакты в карточке — шторка от кнопки до верха карточки (поверх фото) */
.main-feed-card .product-card:not(.listing-preview-card).is-contact-open {
    overflow: hidden !important;
}

.main-feed-card .product-card.is-contact-open {
    position: relative !important;
    z-index: 3 !important;
}

.main-feed-card .product-card.is-contact-open .card-gallery-wrapper,
.main-feed-card .product-card.is-contact-open .product-card-main {
    transition: opacity 0.32s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.main-feed-card .product-card.is-contact-open .card-gallery-wrapper {
    opacity: 0.45 !important;
    pointer-events: none !important;
}

.main-feed-card .product-card-main {
    position: relative !important;
    z-index: 1 !important;
    transition: opacity 0.32s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.main-feed-card .product-card.is-contact-open .product-card-main {
    opacity: 0.35 !important;
    pointer-events: none !important;
}

.main-feed-card .product-card > .product-card-contact {
    position: absolute !important;
    inset: 0 !important;
    z-index: 9 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    margin: 0 !important;
    padding: 12px 10px calc(8px + 12px + 44px + 8px) 10px !important;
    border-radius: 14px !important;
    background: linear-gradient(135deg, #ffffff 0%, #f7faf8 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.65) !important;
    box-shadow:
        inset 0 1px 1px 0 rgba(255, 255, 255, 0.9),
        var(--shadow-glass, 0 8px 32px rgba(0, 0, 0, 0.06)) !important;
    box-sizing: border-box !important;
    transform-origin: bottom center !important;
    transform: scaleY(0) !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transition:
        transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
        opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1) !important;
    overflow: hidden !important;
    min-height: 0 !important;
}

.main-feed-card .product-card-contact__summary {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow: hidden !important;
}

.main-feed-card .product-card-contact__verify {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    gap: 12px !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    padding: 16px 14px !important;
    border-radius: 12px !important;
    background: var(--brand-light-bg, #EAF2EE) !important;
    box-sizing: border-box !important;
    flex: 1 1 auto !important;
}

.main-feed-card .product-card-contact__headline {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
    width: 100% !important;
    min-width: 0 !important;
}

.main-feed-card .product-card-contact__title {
    margin: 0 !important;
    font-size: 1.0625rem !important;
    font-weight: 800 !important;
    line-height: 1.2 !important;
    letter-spacing: -0.02em !important;
    color: var(--text-primary, #111827) !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
}

.main-feed-card .product-card-contact__price-box {
    display: inline-flex !important;
    align-items: baseline !important;
    gap: 4px !important;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
}

.main-feed-card .product-card-contact__price {
    font-size: 1.0625rem !important;
    font-weight: 800 !important;
    line-height: 1.2 !important;
    color: var(--brand-primary, #2E6653) !important;
}

.main-feed-card .product-card-contact__unit {
    font-size: 0.8125rem !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
    color: var(--text-secondary, #6B7280) !important;
}

.main-feed-card .product-card-contact__seller-line {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    min-width: 0 !important;
    width: 100% !important;
    padding-top: 12px !important;
    border-top: 1px solid rgba(46, 102, 83, 0.12) !important;
}

.main-feed-card .product-card-contact__avatar {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    border-radius: 9999px !important;
    background: var(--brand-primary, #2E6653) !important;
    color: #ffffff !important;
    font-size: 0.8125rem !important;
    font-weight: 700 !important;
    flex-shrink: 0 !important;
}

.main-feed-card .product-card-contact__seller-name {
    font-size: 0.875rem !important;
    font-weight: 600 !important;
    line-height: 1.25 !important;
    color: var(--text-primary, #111827) !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    flex-shrink: 1 !important;
    min-width: 0 !important;
}

.main-feed-card .product-card-contact__sep {
    color: var(--text-secondary, #6B7280) !important;
    font-weight: 700 !important;
    flex-shrink: 0 !important;
}

.main-feed-card .product-card-contact__location {
    font-size: 0.8125rem !important;
    font-weight: 500 !important;
    line-height: 1.25 !important;
    color: var(--text-secondary, #6B7280) !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    flex-shrink: 1 !important;
    min-width: 0 !important;
}

.main-feed-card .product-card-contact__actions {
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    width: 100% !important;
    flex: 0 0 auto !important;
    flex-shrink: 0 !important;
    margin-top: auto !important;
}

.main-feed-card .product-card.is-contact-open > .product-card-contact {
    transform: scaleY(1) !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

.main-feed-card .product-card.is-contact-open .manage-btn,
.main-feed-card .product-card.is-contact-open .btn-manage {
    z-index: 1 !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

.main-feed-card .product-card-buttons {
    position: relative !important;
    z-index: 10 !important;
    flex-shrink: 0 !important;
}

.main-feed-card .product-card-contact__lead {
    margin: 0 !important;
    font-size: 0.8125rem !important;
    font-weight: 600 !important;
    line-height: 1.3 !important;
    color: var(--text-secondary, #6B7280) !important;
    text-align: center !important;
    flex-shrink: 0 !important;
}

.main-feed-card .product-card-contact__options {
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    width: 100% !important;
    flex-shrink: 0 !important;
}

.main-feed-card .product-card-contact__option {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 10px !important;
    min-height: 48px !important;
    border: none !important;
    border-radius: 12px !important;
    text-align: left !important;
    cursor: pointer !important;
    box-sizing: border-box !important;
    flex-shrink: 0 !important;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.main-feed-card .product-card-contact__option--call {
    background: var(--brand-light-bg, #EAF2EE) !important;
    color: var(--brand-primary, #2E6653) !important;
}

.main-feed-card .product-card-contact__option--message {
    background: #e8f4fd !important;
    color: #0077ff !important;
}

.main-feed-card .product-card-contact__option.hidden {
    display: none !important;
}

.main-feed-card .product-card-contact__option:active {
    transform: scale(0.98) !important;
}

.main-feed-card .product-card-contact__option-icon {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    border-radius: 12px !important;
    background: rgba(255, 255, 255, 0.65) !important;
    flex-shrink: 0 !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7) !important;
}

.main-feed-card .product-card-contact__option-copy {
    display: flex !important;
    flex-direction: column !important;
    gap: 2px !important;
    min-width: 0 !important;
}

.main-feed-card .product-card-contact__option-copy strong {
    font-size: 0.875rem !important;
    font-weight: 700 !important;
    line-height: 1.25 !important;
}

.main-feed-card .product-card-contact__option-copy span {
    display: none !important;
}

.main-feed-card .product-card-contact__cancel {
    width: 100% !important;
    margin: 0 !important;
    padding: 8px 12px !important;
    min-height: 40px !important;
    border: none !important;
    border-radius: 12px !important;
    background: rgba(243, 244, 246, 0.85) !important;
    color: var(--text-primary, #111827) !important;
    font-size: 0.875rem !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
}

.main-feed-card .product-card-contact__cancel:active {
    transform: scale(0.98) !important;
}

/* Контейнер со скроллом */
.card-gallery {
    display: flex !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 220px !important;
    overflow-x: auto !important;
    scroll-snap-type: x mandatory !important;
    scroll-behavior: smooth !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
    background: var(--brand-light-bg, #EAF2EE) !important;
    background-color: var(--brand-light-bg, #EAF2EE) !important;
}

.card-gallery::-webkit-scrollbar {
    display: none !important;
}

/* Сами картинки внутри галереи */
.card-gallery img,
.card-gallery-wrapper img,
.product-card-image img,
.product-card-media img,
.card-media img {
    flex: 0 0 100% !important;
    width: 100% !important;
    min-width: 100% !important;
    height: 220px !important;
    min-height: 220px !important;
    max-height: 220px !important;
    object-fit: cover !important;
    object-position: center !important;
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    scroll-snap-align: start !important;
    background: var(--brand-light-bg, #EAF2EE) !important;
    background-color: var(--brand-light-bg, #EAF2EE) !important;
}

.gallery-progress {
    position: absolute !important;
    bottom: 10px !important;
    left: 12px !important;
    right: 12px !important;
    z-index: 5 !important;
    display: flex !important;
    gap: 4px !important;
    padding: 0 !important;
    pointer-events: none !important;
}

.gallery-progress-seg {
    flex: 1 1 0 !important;
    height: 2px !important;
    min-height: 2px !important;
    border-radius: 9999px !important;
    background: rgba(255, 255, 255, 0.4) !important;
    overflow: hidden !important;
    flex-shrink: 0 !important;
}

.gallery-progress-seg.is-complete,
.gallery-progress-seg.is-active {
    background: rgba(255, 255, 255, 0.95) !important;
}

/* Стеклянная рамка карточки товара (DESIGN_SYSTEM.md §2, §5) — без backdrop-filter */
.main-feed-card .product-card:not(.listing-preview-card):not(.product-card--detail),
.product-card:not(.listing-preview-card):not(.product-card--detail) {
    position: relative !important;
    padding: 2px !important;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.92) 0%, rgba(255, 255, 255, 0.78) 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.65) !important;
    border-radius: 16px !important;
    box-shadow: var(--shadow-subtle, 0 4px 20px rgba(0, 0, 0, 0.03), 0 1px 2px rgba(0, 0, 0, 0.02)) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    transition: none !important;
}

.product-card {
    position: relative !important;
    background: var(--bg-surface, #FFFFFF) !important;
    border: 1px solid var(--border-light, rgba(226, 232, 240, 0.8)) !important;
    border-radius: 16px !important;
    box-shadow: var(--shadow-subtle, 0 4px 20px rgba(0, 0, 0, 0.03), 0 1px 2px rgba(0, 0, 0, 0.02)) !important;
}

/* Кнопка управления карточкой — минималистичное меню (SVG, без эмодзи) */

.product-card .manage-btn,
.product-card .btn-manage,
.manage-btn,
.btn-manage {
    position: absolute !important;
    top: 14px !important;
    right: 14px !important;
    z-index: 8 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 32px !important;
    height: 32px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 1px solid rgba(255, 255, 255, 0.55) !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.88) !important;
    background-color: rgba(255, 255, 255, 0.88) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12) !important;
    color: #636366 !important;
    cursor: pointer !important;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.15s ease !important;
    flex-shrink: 0 !important;
    line-height: 0 !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    -webkit-tap-highlight-color: transparent !important;
    filter: none !important;
}

.product-card .manage-btn:hover,
.product-card .btn-manage:hover,
.manage-btn:hover,
.btn-manage:hover {
    background: rgba(255, 255, 255, 0.95) !important;
    background-color: rgba(255, 255, 255, 0.95) !important;
    opacity: 1 !important;
}

.product-card .manage-btn:active,
.btn-manage:active {
    transform: scale(0.96) !important;
}

.manage-btn-icon {
    width: 16px !important;
    height: 16px !important;
    display: block !important;
    pointer-events: none !important;
    fill: #8E8E93 !important;
    color: #8E8E93 !important;
    filter: none !important;
}

.manage-btn-icon circle {
    fill: #8E8E93 !important;
}

.listing-preview-card .manage-btn,
.listing-preview-card .btn-manage {
    display: none !important;
}

/* ==========================================
   Превью карточки в форме — визуал 1:1 с лентой (DESIGN_SYSTEM.md §5)
   ========================================== */
.listing-card-preview .listing-preview-card {
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 2px !important;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.92) 0%, rgba(255, 255, 255, 0.78) 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.65) !important;
    border-radius: 16px !important;
    box-shadow: var(--shadow-subtle, 0 4px 20px rgba(0, 0, 0, 0.03), 0 1px 2px rgba(0, 0, 0, 0.02)) !important;
    overflow: hidden !important;
    min-height: max-content !important;
    height: auto !important;
    flex-shrink: 0 !important;
}

.listing-card-preview .listing-preview-card > .product-card-contact {
    display: none !important;
}

.listing-card-preview .listing-preview-card .product-card-content,
.listing-card-preview .listing-preview-card .product-card-body,
.listing-card-preview .listing-preview-card .product-card-info,
.listing-card-preview .listing-preview-card .card-body,
.listing-card-preview .listing-preview-card .card-content {
    min-height: max-content !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    background: var(--bg-surface, #FFFFFF) !important;
    padding: 8px !important;
    gap: 0 !important;
    border-radius: 0 0 12px 12px !important;
}


.listing-card-preview .listing-preview-card .seller-info,
.listing-card-preview .listing-preview-card .product-author,
.listing-card-preview .listing-preview-card .author-info {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 6px !important;
    width: 100% !important;
    margin: 8px 0 0 0 !important;
    padding: 0 !important;
    border: none !important;
    font-size: 0.8125rem !important;
    color: var(--text-secondary, #6B7280) !important;
    line-height: 1.35 !important;
}

.listing-card-preview .listing-preview-card .seller-info strong,
.listing-card-preview .listing-preview-card .product-author strong,
.listing-card-preview .listing-preview-card .author-info strong {
    color: var(--text-primary, #111827) !important;
    font-weight: 600 !important;
    font-size: 0.875rem !important;
}

.listing-card-preview .listing-preview-card .location-tag {
    color: var(--text-secondary, #6B7280) !important;
    font-size: 0.8125rem !important;
    font-weight: 500 !important;
    background: transparent !important;
    padding: 0 !important;
    border-radius: 0 !important;
    text-transform: none !important;
    letter-spacing: normal !important;
}

.listing-card-preview .listing-preview-card .location-tag::before {
    content: "• " !important;
    margin: 0 4px !important;
    color: #94a3b8 !important;
}

.listing-card-preview .listing-preview-card .seller-info .product-views,
.listing-card-preview .listing-preview-card .product-author .product-views,
.listing-card-preview .listing-preview-card .author-info .product-views {
    margin-left: auto !important;
}

.listing-card-preview .listing-preview-card .product-desc-block {
    width: 100% !important;
    margin: 8px 0 0 0 !important;
    padding: 0 !important;
    border: none !important;
    gap: 4px !important;
}

.listing-card-preview .listing-preview-card .product-desc-text,
.listing-card-preview .listing-preview-card .product-desc-block .product-desc {
    margin: 0 !important;
    font-size: 0.875rem !important;
    white-space: pre-line !important;
    line-height: 1.45 !important;
    color: var(--text-secondary, #6B7280) !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    display: block !important;
    overflow: visible !important;
    max-height: none !important;
    -webkit-line-clamp: unset !important;
    -webkit-box-orient: unset !important;
}

.listing-card-preview .listing-preview-card .price-val,
.listing-card-preview .listing-preview-card .product-card-price,
.listing-card-preview .listing-preview-card .product-price {
    font-size: 1.125rem !important;
    font-weight: 700 !important;
    color: var(--brand-primary, #2E6653) !important;
    letter-spacing: -0.01em !important;
}

.listing-card-preview .listing-preview-card .price-unit,
.listing-card-preview .listing-preview-card .product-price-unit {
    color: var(--text-secondary, #6B7280) !important;
    font-size: 0.8125rem !important;
    font-weight: 500 !important;
}

.listing-card-preview .listing-preview-card .contact-btn,
.listing-card-preview .listing-preview-card .btn-contact,
.listing-card-preview .listing-preview-card .btn-primary-action,
.listing-card-preview .listing-preview-card .card-action-btn,
.listing-card-preview .listing-preview-card .product-card-buttons {
    display: none !important;
}

/* ==========================================
   Плитка ленты 2×N (4:5) + экран товара — §3.5 PRODUCT_ROADMAP
   ========================================== */

#screen-main .main-feed-card #products-feed,
#screen-main .main-feed-card .products-list {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: var(--content-gutter, 4px) !important;
    align-items: stretch !important;
    align-content: start !important;
    justify-items: stretch !important;
    flex: 0 0 auto !important;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

#screen-main .main-feed-card #products-feed > .feed-empty-state {
    grid-column: 1 / -1 !important;
}

/* Поиск/категория: ненужные плитки уходят из сетки — оставшиеся сдвигаются в начало ряда */
#screen-main .main-feed-card #products-feed > .product-card.is-feed-hidden,
#screen-main .main-feed-card #products-feed > .product-card.is-feed-collapsed {
    display: none !important;
}

#screen-main .main-feed-card .product-card--tile,
#screen-main .main-feed-card .feed-skeleton-card,
#screen-product .product-detail-more__grid .product-card--tile {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
}

/* Плитка: медиа 4:5. Safari: min-height:0 на flex-ребёнке схлопывает aspect-ratio,
   а height:100% у карточки тянется к высоте экрана — фото мельчает, «Открыть» уезжает вниз. */
.product-card--tile > .card-gallery-wrapper,
.product-card--tile .card-gallery-wrapper,
.listing-preview-card.product-card--tile > .card-gallery-wrapper {
    position: relative !important;
    aspect-ratio: 4 / 5 !important;
    width: 100% !important;
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
    flex: 0 0 auto !important;
    flex-shrink: 0 !important;
    overflow: hidden !important;
}

.product-card--tile .card-gallery {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
}

.product-card--tile .card-gallery img,
.product-card--tile .card-gallery-wrapper img {
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
}

.product-card--tile .gallery-progress {
    bottom: 6px !important;
    left: 6px !important;
    right: 6px !important;
}

/* Плитка: высота по контенту; stretch сетки выравнивает только ряд, не экран */
.product-card--tile {
    --tile-scale: 0.875;
    display: flex !important;
    flex-direction: column !important;
    height: auto !important;
    min-height: auto !important;
    align-self: stretch !important;
}

.product-card--tile .product-card-content,
.product-card--tile .product-card-body {
    flex: 1 1 auto !important;
    display: flex !important;
    flex-direction: column !important;
    min-height: 0 !important;
}

.product-card--tile .product-card-main {
    flex: 1 1 auto !important;
    display: flex !important;
    flex-direction: column !important;
    min-height: 0 !important;
}

.product-card--tile:not(.listing-preview-card) {
    cursor: pointer !important;
    -webkit-tap-highlight-color: transparent !important;
}

.product-card--tile:not(.listing-preview-card) .card-gallery {
    touch-action: pan-x pan-y !important;
}

/* Плитка: маркетплейс — цена, название, автор */
.product-card--tile .card-header,
.product-card--tile .product-card-header,
.product-card--tile .product-card-header--tile {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    gap: 4px !important;
    width: 100% !important;
    min-width: 0 !important;
    margin-bottom: 6px !important;
}

.product-card--tile .card-header .product-price-box {
    order: 1 !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: baseline !important;
    justify-content: flex-start !important;
    gap: 4px !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    z-index: auto !important;
    position: static !important;
    background: transparent !important;
    box-shadow: none !important;
}

.product-card--tile .card-header .product-card-title,
.product-card--tile .card-header .product-title,
.product-card--tile .card-header .card-title {
    order: 2 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    text-transform: uppercase !important;
    letter-spacing: 0.02em !important;
    font-weight: 500 !important;
    color: var(--text-primary, #111827) !important;
    display: block !important;
    -webkit-line-clamp: unset !important;
    line-clamp: unset !important;
    -webkit-box-orient: unset !important;
    -webkit-text-size-adjust: 100% !important;
    text-size-adjust: 100% !important;
    -webkit-mask-image: none !important;
    mask-image: none !important;
}

/* Плитка: имя + населённый пункт; для «Другой район» — без НП (полный адрес в деталке) */
#screen-main .main-feed-card .product-card--tile .seller-info,
#screen-main .main-feed-card .product-card--tile .product-author,
#screen-main .main-feed-card .product-card--tile .author-info,
.main-feed-card .product-card--tile .seller-info,
.main-feed-card .product-card--tile .product-author,
.main-feed-card .product-card--tile .author-info,
#screen-product .product-detail-more__grid .product-card--tile .seller-info,
#screen-product .product-detail-more__grid .product-card--tile .product-author,
#screen-product .product-detail-more__grid .product-card--tile .author-info {
    flex-wrap: nowrap !important;
    overflow: hidden !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin-top: 0 !important;
    margin-bottom: 4px !important;
}

#screen-main .main-feed-card .product-card--tile .seller-info strong,
#screen-main .main-feed-card .product-card--tile .product-author strong,
#screen-main .main-feed-card .product-card--tile .author-info strong,
.main-feed-card .product-card--tile .seller-info strong,
.main-feed-card .product-card--tile .product-author strong,
.main-feed-card .product-card--tile .author-info strong,
#listing-card-preview .product-card--tile .seller-info strong,
#listing-card-preview .product-card--tile .product-author strong,
#listing-card-preview .product-card--tile .author-info strong,
#screen-product .product-detail-more__grid .product-card--tile .seller-info strong,
#screen-product .product-detail-more__grid .product-card--tile .product-author strong,
#screen-product .product-detail-more__grid .product-card--tile .author-info strong {
    flex: 0 1 auto !important;
    min-width: 0 !important;
    max-width: 46% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    color: var(--text-secondary, #6B7280) !important;
    font-weight: 500 !important;
}

#screen-main .main-feed-card .product-card--tile .location-tag,
.main-feed-card .product-card--tile .location-tag,
#screen-product .product-detail-more__grid .product-card--tile .location-tag {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    display: block !important;
}

.product-card--tile .manage-btn,
.product-card--tile .product-views,
.product-card--tile .product-desc-block {
    display: none !important;
}

.product-card--tile .card-header .product-card-title,
.product-card--tile .card-header .product-title,
.product-card--tile .card-header .card-title {
    font-size: clamp(0.75rem, 3.4vw, calc(1rem * var(--tile-scale))) !important;
}

.main-feed-card .product-card--tile .price-val,
.main-feed-card .product-card--tile .product-card-price,
.main-feed-card .product-card--tile .product-price,
#screen-product .product-detail-more__grid .product-card--tile .price-val,
#screen-product .product-detail-more__grid .product-card--tile .product-card-price,
#screen-product .product-detail-more__grid .product-card--tile .product-price {
    font-size: clamp(0.875rem, 3.6vw, calc(1.0625rem * var(--tile-scale))) !important;
    font-weight: 700 !important;
    color: var(--brand-primary, #2E6653) !important;
    letter-spacing: -0.01em !important;
    flex-shrink: 1 !important;
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.main-feed-card .product-card--tile .price-unit,
.main-feed-card .product-card--tile .product-price-unit,
#screen-product .product-detail-more__grid .product-card--tile .price-unit,
#screen-product .product-detail-more__grid .product-card--tile .product-price-unit {
    font-size: clamp(0.625rem, 2.6vw, calc(0.75rem * var(--tile-scale))) !important;
    font-weight: 500 !important;
    color: var(--text-secondary, #6B7280) !important;
    flex-shrink: 1 !important;
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.main-feed-card .product-card--tile .seller-info,
.main-feed-card .product-card--tile .product-author,
.main-feed-card .product-card--tile .author-info,
#screen-product .product-detail-more__grid .product-card--tile .seller-info,
#screen-product .product-detail-more__grid .product-card--tile .product-author,
#screen-product .product-detail-more__grid .product-card--tile .author-info {
    font-size: calc(0.8125rem * var(--tile-scale)) !important;
}

.main-feed-card .product-card--tile .seller-info strong,
.main-feed-card .product-card--tile .product-author strong,
.main-feed-card .product-card--tile .author-info strong,
#screen-product .product-detail-more__grid .product-card--tile .seller-info strong,
#screen-product .product-detail-more__grid .product-card--tile .product-author strong,
#screen-product .product-detail-more__grid .product-card--tile .author-info strong {
    font-size: calc(0.8125rem * var(--tile-scale)) !important;
}

.main-feed-card .product-card--tile .location-tag,
#screen-product .product-detail-more__grid .product-card--tile .location-tag {
    font-size: calc(0.75rem * var(--tile-scale)) !important;
    color: var(--text-secondary, #6B7280) !important;
    font-weight: 500 !important;
}

/* Плитка: аватар 2A — компактный, без «плашки» */
#screen-main .main-feed-card .product-card--tile .seller-avatar,
.main-feed-card .product-card--tile .seller-avatar,
#listing-card-preview .product-card--tile .seller-avatar,
#screen-product .product-detail-more__grid .product-card--tile .seller-avatar {
    width: 16px !important;
    height: 16px !important;
    min-width: 16px !important;
    font-size: 0.5625rem !important;
    font-weight: 600 !important;
    background: rgba(46, 102, 83, 0.08) !important;
    color: var(--text-secondary, #6B7280) !important;
}

.product-detail-footer {
    display: block;
    width: 100%;
    margin: 8px 0 0 0;
    padding: 0;
    box-sizing: border-box;
    background: transparent;
    border: none;
    border-radius: 0;
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1.5;
    color: var(--text-secondary, #6B7280);
}

.product-detail-posted,
.product-detail-views-caption,
.product-detail-meta-sep {
    margin: 0;
    padding: 0;
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
    color: inherit;
}

.product-detail-meta {
    display: flex;
    align-items: center;
    margin: 16px 0 0 0;
    font-size: 0.8125rem;
    color: var(--text-secondary, #6B7280);
}

/* Экран товара (полноэкран) */
#screen-product.product-detail-screen {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 0;
    box-sizing: border-box;
    padding-top: var(--content-gutter, 4px);
    padding-bottom: 0;
    background: transparent;
}

#screen-product .product-detail-signboard {
    gap: 0 !important;
    flex-shrink: 0 !important;
    margin: 0 0 var(--content-gutter, 4px) 0 !important;
    width: 100% !important;
}

#screen-product .product-detail-mount {
    flex: 0 0 auto;
    width: 100%;
    padding: 8px var(--content-gutter, 4px);
    box-sizing: border-box;
    background: var(--bg-page, #F5F7F6);
    border-radius: 16px;
}

/* Экран детали: без карточной «плашки», flat-страница */
.product-card--detail {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    overflow: visible !important;
}

.product-card--detail > .card-gallery-wrapper {
    aspect-ratio: 4 / 5 !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    border-radius: 12px !important;
    overflow: hidden !important;
}

.product-card--detail .card-gallery {
    min-height: 0 !important;
    height: 100% !important;
}

.product-card--detail .card-gallery img {
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
}

.product-card--detail .product-card-content {
    padding: 12px 0 0 0 !important;
    gap: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
}

.product-card--detail .product-detail-footer {
    margin-top: 8px !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    font-size: 0.875rem !important;
    font-weight: 400 !important;
    line-height: 1.5 !important;
    color: var(--text-secondary, #6B7280) !important;
}

.product-detail-more {
    margin-top: 24px;
    padding: 16px 0 0 0;
    border-top: 1px solid var(--border-light, rgba(226, 232, 240, 0.8));
}

.product-detail-more__title {
    margin: 0 0 8px 0;
    padding: 0 8px;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary, #111827);
    letter-spacing: 0.01em;
}

.product-detail-more__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--content-gutter, 4px);
    align-items: stretch;
    justify-items: stretch;
    width: 100%;
}

.product-detail-more__grid .product-card--tile {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
}

.product-card--detail .product-card-content > * {
    border-top: none !important;
    border-bottom: none !important;
}

.product-card--detail .card-header {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: baseline !important;
    justify-content: space-between !important;
    gap: 16px !important;
    width: 100% !important;
    margin: 16px 0 0 0 !important;
    padding-bottom: 0 !important;
}

.product-card--detail .product-card-title,
.product-card--detail .product-card-title--detail {
    flex: 1 1 auto !important;
    width: auto !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding-left: 0 !important;
    border-left: none !important;
    box-sizing: border-box !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    line-height: 1.3 !important;
    letter-spacing: 0.01em !important;
    text-transform: none !important;
    color: var(--text-primary, #111827) !important;
}

.product-card--detail .product-price-box {
    margin-left: auto !important;
    align-self: baseline !important;
    flex: 0 0 auto !important;
    flex-shrink: 0 !important;
}

.product-card--detail .price-val,
.product-card--detail .product-card-price,
.product-card--detail .product-price {
    font-size: 1.25rem !important;
    font-weight: 800 !important;
    line-height: 1.25 !important;
    color: var(--brand-primary, #2E6653) !important;
}

.product-card--detail .price-unit,
.product-card--detail .product-price-unit {
    font-size: 0.8125rem !important;
    font-weight: 600 !important;
    color: var(--brand-dark, #1E5644) !important;
}

.product-card--detail .seller-info,
.product-card--detail .product-author,
.product-card--detail .author-info {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 6px !important;
    width: 100% !important;
    margin: 8px 0 0 0 !important;
    padding: 0 !important;
    border: none !important;
    font-size: 0.875rem !important;
    color: var(--text-secondary, #6B7280) !important;
    line-height: 1.4 !important;
}

.product-card--detail .seller-info strong,
.product-card--detail .product-author strong,
.product-card--detail .author-info strong {
    color: var(--text-secondary, #6B7280) !important;
    font-weight: 500 !important;
    font-size: 0.875rem !important;
}

.product-card--detail .seller-avatar {
    width: 24px !important;
    height: 24px !important;
    font-size: 0.75rem !important;
    background: rgba(46, 102, 83, 0.08) !important;
    color: var(--brand-primary, #2E6653) !important;
}

.product-card--detail .location-tag {
    text-transform: none !important;
    letter-spacing: 0 !important;
    white-space: normal !important;
    word-break: break-word !important;
    max-width: 100% !important;
    background: transparent !important;
    color: var(--text-secondary, #6B7280) !important;
    font-size: 0.8125rem !important;
    font-weight: 500 !important;
    padding: 0 !important;
    border-radius: 0 !important;
}

.product-card--detail .product-desc-block {
    margin-top: 8px !important;
}

.product-card--detail .product-desc-block--detail {
    width: 100% !important;
    margin: 8px 0 0 0 !important;
    padding: 0 !important;
    border: none !important;
}

.product-card--detail .product-desc-block--detail .product-desc-text,
.product-card--detail .product-desc-text--detail {
    margin: 0 !important;
    font-size: 0.875rem !important;
    line-height: 1.5 !important;
    color: var(--text-secondary, #6B7280) !important;
    white-space: pre-line !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    overflow: visible !important;
    display: block !important;
    -webkit-box-orient: unset !important;
    -webkit-line-clamp: unset !important;
}

.product-card--detail .product-detail-contacts {
    display: flex !important;
    flex-direction: row !important;
    align-items: stretch !important;
    gap: 8px !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

.product-card--detail .product-detail-contact-link--phone {
    flex: 1 1 80% !important;
    width: auto !important;
    min-width: 0 !important;
}

.product-card--detail .product-detail-contacts--with-vk .product-detail-contact-link--phone {
    flex: 1 1 calc(80% - 4px) !important;
    max-width: calc(80% - 4px) !important;
}

.product-card--detail .product-detail-phone-text {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    min-width: 0 !important;
}

.product-card--detail .product-detail-contact-link--vk {
    flex: 0 0 20% !important;
    width: 20% !important;
    max-width: 20% !important;
    min-width: 48px !important;
    padding: 0 6px !important;
    justify-content: center !important;
    align-self: stretch !important;
    min-height: 44px !important;
    height: 44px !important;
    border: 1px solid rgba(0, 119, 255, 0.28) !important;
    border-radius: 12px !important;
    background: rgba(0, 119, 255, 0.1) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55) !important;
    color: #0077FF !important;
    font-size: 0 !important;
}

.product-detail-contacts {
    display: flex;
    flex-direction: row;
    gap: 8px;
    margin-top: 0;
    padding: 0;
    border: none;
}

.product-card--detail .product-detail-contact-link--phone,
.product-card--detail .product-detail-contact-link--phone.btn-contact,
.product-card--detail .product-detail-contact-link--phone.contact-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    width: 100% !important;
    min-height: 44px !important;
    height: 44px !important;
    margin: 0 !important;
    padding: 0 16px !important;
    border-radius: 12px !important;
    font-size: 0.9375rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.01em !important;
    flex: none !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    font-family: inherit !important;
    cursor: pointer !important;
    background: var(--brand-light-bg, #EAF2EE) !important;
    color: var(--brand-primary, #2E6653) !important;
    border: 1px solid rgba(46, 102, 83, 0.28) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.55),
        var(--shadow-subtle, 0 4px 20px rgba(0, 0, 0, 0.03), 0 1px 2px rgba(0, 0, 0, 0.02)) !important;
}

.product-detail-contact-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 16px;
    border-radius: 12px;
    font-size: 0.9375rem;
    font-weight: 700;
    text-decoration: none;
    flex-shrink: 0;
    transition:
        transform 0.2s cubic-bezier(0.16, 1, 0.3, 1),
        background-color 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.product-detail-contact-link:active {
    transform: scale(0.97);
}

.product-detail-contact-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    display: block;
    pointer-events: none;
}

/* Card Action Soft Fill — телефон (DESIGN_SYSTEM.md §5) */
.product-detail-contact-link--phone {
    background: var(--brand-light-bg, #EAF2EE);
    color: var(--brand-primary, #2E6653);
    border: 1px solid rgba(46, 102, 83, 0.28);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.55),
        var(--shadow-subtle, 0 4px 20px rgba(0, 0, 0, 0.03), 0 1px 2px rgba(0, 0, 0, 0.02));
}

.product-detail-contact-link--phone:active {
    background: #cfe4da;
    color: var(--brand-dark, #1E5644);
}

.product-card--detail .product-detail-contact-link--vk {
    background: rgba(0, 119, 255, 0.1) !important;
    border: 1px solid rgba(0, 119, 255, 0.28) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55) !important;
    color: #0077FF !important;
    min-height: 44px !important;
    height: 44px !important;
    width: 20% !important;
    max-width: 20% !important;
    min-width: 48px !important;
    padding: 0 6px !important;
    font-size: 0 !important;
    justify-content: center !important;
    align-self: stretch !important;
}

.product-card--detail .product-detail-vk-icon {
    width: 22px !important;
    height: 22px !important;
    flex-shrink: 0 !important;
    display: block !important;
    pointer-events: none !important;
}

.product-card--detail .product-detail-contact-link--vk:active {
    background: rgba(0, 119, 255, 0.16) !important;
    color: #0066DD !important;
    transform: scale(0.97) !important;
    opacity: 1 !important;
}

.product-detail-contact-link--vk {
    background: rgba(0, 119, 255, 0.1);
    color: #0077FF;
    border: 1px solid rgba(0, 119, 255, 0.28);
    box-shadow: none;
}

.product-detail-contact-link--vk:active {
    background: rgba(0, 119, 255, 0.16);
    color: #0066DD;
}

.product-detail-contact-muted {
    font-size: 0.875rem;
    color: var(--text-secondary, #6B7280);
    padding: 8px 0;
}
