/* ==========================================================================
   Ads pages — Enhanced M3 Design
   ========================================================================== */

/* --- Ad Card (horizontal: image left, content right) --- */
.listing-card {
  display: flex;
  flex-direction: row;
  overflow: visible;
  background: var(--md-sys-color-surface-container-low);
  border-radius: var(--md-sys-shape-corner-large);
  box-shadow: var(--md-sys-elevation-1);
  transition:
    box-shadow var(--md-sys-motion-duration-medium) var(--md-sys-motion-easing-standard),
    transform var(--md-sys-motion-duration-spring) var(--md-sys-motion-easing-expressive),
    background var(--md-sys-motion-duration-short);
  /* View Transitions — уникальное имя на карту */
  view-transition-name: var(--vt, none);
}

.listing-card:hover {
  transform: translateY(-4px) scale(1.012);
  box-shadow: var(--md-sys-elevation-3);
  background: var(--md-sys-color-surface-container);
}

.listing-card__image {
  position: relative;
  width: 45%;
  aspect-ratio: 4 / 3;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: var(--md-sys-shape-corner-large) 0 0 var(--md-sys-shape-corner-large);
  background: var(--md-sys-color-surface-variant);
}

.listing-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--md-sys-motion-duration-long) var(--md-sys-motion-easing-standard);
}

.listing-card:hover .listing-card__image img {
  transform: scale(1.05);
}

/* Image gradient overlay for readability */
.listing-card__image::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(to top, rgba(0,0,0,0.3), transparent);
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--md-sys-motion-duration-short);
}

.listing-card:hover .listing-card__image::after { opacity: 1; }

.listing-card__no-photo {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.listing-card__no-photo .material-icons { font-size: 40px; color: var(--md-sys-color-outline); }

/* --- Category animal icon placeholder (no-photo) --- */
.listing-card__placeholder,
.gallery__placeholder {
  width: 100%;
  height: 100%;
  min-height: 180px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Category color gradients (top → bottom, как в мобилке) */
.listing-card__placeholder--cattle,
.gallery__placeholder--cattle {
  background: linear-gradient(180deg, rgba(165,214,167,0.4) 0%, #A5D6A7 100%);
}
.listing-card__placeholder--sheep,
.gallery__placeholder--sheep {
  background: linear-gradient(180deg, rgba(209,179,232,0.4) 0%, #D1B3E8 100%);
}
.listing-card__placeholder--horse,
.gallery__placeholder--horse {
  background: linear-gradient(180deg, rgba(255,224,178,0.4) 0%, #FFE0B2 100%);
}
.listing-card__placeholder--goat,
.gallery__placeholder--goat {
  background: linear-gradient(180deg, rgba(187,222,251,0.4) 0%, #BBDEFB 100%);
}
.listing-card__placeholder--camel,
.gallery__placeholder--camel {
  background: linear-gradient(180deg, rgba(255,249,196,0.4) 0%, #FFF9C4 100%);
}
.listing-card__placeholder--pig,
.gallery__placeholder--pig {
  background: linear-gradient(180deg, rgba(255,205,210,0.4) 0%, #FFCDD2 100%);
}

/* Background icon pattern (3x3 grid) */
.listing-card__placeholder-pattern {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  padding: 8px;
  gap: 4px;
}

.listing-card__placeholder-bg-icon {
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0.12;
  filter: brightness(0);
}

/* Central circle with icon */
.listing-card__placeholder-center {
  position: relative;
  z-index: 1;
  width: 96px;
  height: 96px;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.listing-card__placeholder-center img {
  width: 56px;
  height: 56px;
  object-fit: contain;
}

/* Larger center for detail page */
.listing-card__placeholder-center--lg {
  width: 96px;
  height: 96px;
}

.listing-card__placeholder-center--lg img {
  width: 56px;
  height: 56px;
}

/* Gallery placeholder fills the main area — 4x4 grid for larger space */
.gallery__placeholder {
  border-radius: var(--md-sys-shape-corner-large);
}

.gallery__placeholder .listing-card__placeholder-pattern {
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, 1fr);
  padding: 16px;
  gap: 8px;
}

.listing-card__flag {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 20px;
  border-radius: 4px;
  object-fit: cover;
  box-shadow: 0 1px 2px rgba(0,0,0,0.3);
  z-index: 1;
}

/* --- Badge (New / Top) --- */
.listing-card__badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 2px 8px;
  border-radius: var(--md-sys-shape-corner-extra-small);
  font: var(--md-sys-typescale-label-small);
  letter-spacing: 0.5px;
  z-index: 1;
}

.listing-card__badge--new {
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
}

.listing-card__badge--top {
  background: var(--md-sys-color-warning, #F57F17);
  color: #fff;
}

.listing-card__badge--verified {
  background: var(--md-sys-color-success, #2E7D32);
  color: #fff;
}

.listing-card__content {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

@media (min-width: 600px) {
  .listing-card__content { padding: 16px 20px; gap: 6px; }
}

a.listing-card__header {
  display: block;
  text-decoration: none;
  color: inherit;
  margin-bottom: 2px;
}

a.listing-card__header:hover .listing-card__category,
a.listing-card__header:hover .listing-card__breed {
  color: var(--md-sys-color-primary);
}

.listing-card__category {
  font: 500 16px/22px 'Roboto', sans-serif;
  color: var(--md-sys-color-on-surface);
}

.listing-card__breed {
  font: 500 15px/20px 'Roboto', sans-serif;
  color: var(--md-sys-color-on-surface);
}

/* Уникализирующий sub-title: страна · возраст. Различает однотипные карточки. */
.listing-card__sub {
  font: 400 13px/18px 'Roboto', sans-serif;
  color: var(--md-sys-color-on-surface-variant, #6b7280);
  margin-top: 2px;
}

@media (min-width: 600px) {
  .listing-card__category { font-size: 20px; line-height: 26px; }
  .listing-card__breed { font-size: 17px; line-height: 22px; }
  .listing-card__sub { font-size: 14px; line-height: 19px; }
}

.listing-card__help {
  font-size: 20px;
  color: var(--md-sys-color-outline);
  cursor: help;
  flex-shrink: 0;
}

.listing-card__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font: 400 12px/16px 'Roboto', sans-serif;
  color: var(--md-sys-color-on-surface-variant);
}
.listing-card__meta .material-icons { font-size: 14px; }

@media (min-width: 600px) {
  .listing-card__meta { gap: 14px; font-size: 14px; line-height: 20px; }
  .listing-card__meta .material-icons { font-size: 16px; }
}

.listing-card__chars {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  font: 400 12px/16px 'Roboto', sans-serif;
  color: var(--md-sys-color-on-surface-variant);
  margin: 4px 0;
}

@media (min-width: 600px) {
  .listing-card__chars { gap: 10px 18px; font-size: 14px; line-height: 20px; margin: 6px 0; }
}

.listing-card__char {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.listing-card__char .material-icons {
  font-size: 16px;
  color: var(--md-sys-color-primary);
}

.listing-card__footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 8px;
  flex-wrap: wrap;
}

@media (min-width: 600px) {
  .listing-card__footer { gap: 12px; padding-top: 10px; }
}

.listing-card__footer .favorite-btn {
  margin-left: auto;
}

/* Desktop: larger image */
@media (min-width: 840px) {
  .listing-card__image { width: 45%; }
  .listing-card__category { font-size: 18px; }
  .listing-card__breed { font-size: 16px; }
  .listing-card__chars { font-size: 13px; }
}

/* --- Card grid: single column for ad cards --- */
.listings-list .card-grid {
  grid-template-columns: 1fr;
}

/* --- Filter toggle button --- */
.filter-toggle-btn { margin-bottom: 0; }

@media (min-width: 840px) {
  .filter-toggle-btn { display: none; }
}

/* --- Detail page --- */
.listing-detail__gallery { margin-bottom: var(--md-sys-spacing-lg); }

.listing-detail__section-title {
  font: var(--md-sys-typescale-title-large);
  color: var(--md-sys-color-on-surface);
  margin: var(--md-sys-spacing-lg) 0 var(--md-sys-spacing-md);
}

.listing-detail__price-row {
  display: flex;
  align-items: center;
  gap: var(--md-sys-spacing-sm);
  margin-bottom: var(--md-sys-spacing-lg);
}

.listing-detail__chars { margin-bottom: var(--md-sys-spacing-lg); }

.listing-detail__description {
  font: var(--md-sys-typescale-body-large);
  line-height: 1.6;
  text-align: justify;
  margin-bottom: var(--md-sys-spacing-lg);
}

.listing-detail__contact {
  text-align: center;
  margin-top: var(--md-sys-spacing-lg);
}

/* Gallery */
.gallery {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
}

.gallery__main {
  width: 100%;
  aspect-ratio: 4/3;
  border-radius: var(--md-sys-shape-corner-large);
  overflow: hidden;
  background: var(--md-sys-color-surface-variant);
  position: relative;
}

.gallery__main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity var(--md-sys-motion-duration-medium) var(--md-sys-motion-easing-standard);
}

.gallery__main img.is-switching { opacity: 0.5; }

.gallery__thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.gallery__thumbs::-webkit-scrollbar { display: none; }

.gallery__thumb {
  width: 80px;
  height: 80px;
  border-radius: var(--md-sys-shape-corner-large);
  overflow: hidden;
  cursor: pointer;
  flex-shrink: 0;
  border: 2px solid transparent;
  transition: border-color var(--md-sys-motion-duration-short),
              transform var(--md-sys-motion-duration-short);
}

.gallery__thumb:hover { transform: scale(1.05); }

.gallery__thumb--active {
  border-color: var(--md-sys-color-primary);
}

.gallery__thumb img { width: 100%; height: 100%; object-fit: cover; }

/* Detail header / actions */
.detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.detail-header__title {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Price hero — заметный фокус (M3 Expressive headline) */
.detail-price {
  margin-bottom: 24px;
  view-transition-name: price-hero;
}
.detail-price .price--lg {
  font: var(--md-sys-typescale-display-large);
  font-variation-settings: "opsz" 48, "wght" 900, "GRAD" 50;
  letter-spacing: -2px;
  color: var(--md-sys-color-primary);
  font-size: 44px;
  line-height: 1.0;
}

/* --- Characteristics list · M3 Expressive с tonal surface --- */
.char-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px 24px;
  margin: 8px 0 24px;
}
.char-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--md-sys-shape-corner-small);
  background: var(--md-sys-color-surface-container-low);
  transition: background var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-standard);
}
.char-item:hover { background: var(--md-sys-color-surface-container); }
.char-item svg {
  width: 20px; height: 20px;
  color: var(--md-sys-color-primary);
  flex-shrink: 0;
}
.char-item strong { color: var(--brand-ink); font-weight: 600; }
.char-item span { color: var(--md-sys-color-on-surface-variant); font-size: 14px; }

/* --- Glass floating CTA · Call + Favorite (M3 Expressive + Acrylic) --- */
.floating-cta {
  position: sticky;
  bottom: 16px;
  left: 0; right: 0;
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  margin: 24px auto 0;
  max-width: 720px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-rim);
  border-radius: var(--md-sys-shape-corner-full);
  box-shadow: 0 6px 24px rgba(27, 116, 62, 0.15);
  z-index: 50;
}
.floating-cta__primary {
  flex: 1;
  font: var(--md-sys-typescale-label-large);
  font-size: 16px; font-weight: 700;
  padding: 14px 20px;
  border-radius: var(--md-sys-shape-corner-full);
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  border: none; cursor: pointer;
  transition: transform var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-expressive);
}
.floating-cta__primary:hover { transform: scale(1.03); }

.detail-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.contact-section { margin-top: 32px; }

/* --- Filter panel styling --- */
.filter-panel {
  padding: 4px 0;
  /* Bug 6: на mobile фильтры "елозили" — selects/inputs выходили за
     края bottom-sheet. Жёстко прибиваем к 100% ширине контейнера. */
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.filter-panel *,
.filter-panel *::before,
.filter-panel *::after {
  box-sizing: border-box;
}

.filter-panel .input-group {
  margin-bottom: 12px;
  /* min-width:0 — обязательно для flex-children в input-group__range */
  min-width: 0;
}

.filter-panel .input-group__label {
  font: 500 13px/16px 'Roboto', sans-serif;
  color: var(--md-sys-color-on-surface);
  margin-bottom: 6px;
}

.filter-panel .select {
  font-size: 14px;
  padding: 10px 36px 10px 14px;
  min-height: 42px;
  border-radius: var(--md-sys-shape-corner-small);
}

.filter-panel .input {
  font-size: 14px;
  padding: 10px 14px;
  min-height: 42px;
  border-radius: var(--md-sys-shape-corner-small);
}

.filter-panel__range-inputs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
}

.filter-panel__range-inputs > div {
  flex: 1 1 0;
  min-width: 0;
}

.filter-panel__range-inputs .input {
  width: 100%;
  min-width: 0;
}

/* "Ещё фильтры" button */
.filter-panel__more-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  padding: 10px;
  margin-top: 8px;
  border: none;
  background: none;
  cursor: pointer;
  font: 500 14px/20px 'Roboto', sans-serif;
  color: var(--md-sys-color-primary);
  border-radius: var(--md-sys-shape-corner-full);
  transition: background 0.15s;
}

.filter-panel__more-btn:hover { background: rgba(27,116,62,0.06); }

.filter-panel__more-btn .material-icons {
  font-size: 20px;
  transition: transform 0.3s;
}

.filter-panel__more-btn.is-open .material-icons {
  transform: rotate(180deg);
}

/* Extra filters (hidden by default) */
.filter-panel__extra {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.filter-panel__extra.is-open {
  /* Запас на 4 input-group (Страна/Валюта/Возраст/Молоко); раньше 400px
     обрезал нижние поля. overflow:hidden нужен только для transition. */
  max-height: 600px;
}

/* Reset link */
.filter-panel__reset {
  display: block;
  text-align: center;
  margin-top: 12px;
  font: 400 13px/18px 'Roboto', sans-serif;
  color: var(--md-sys-color-on-surface-variant);
}

.filter-panel__reset:hover {
  color: var(--md-sys-color-error);
}

input[type="range"] {
  width: 100%;
  accent-color: var(--md-sys-color-primary);
}

/* --- Featured card highlight --- */
.listing-card.is-featured {
  border: 2px solid var(--md-sys-color-warning, #F57F17);
  box-shadow: 0px 2px 16px rgba(245, 127, 23, 0.15), 0px 4px 24px rgba(0,0,0,0.08);
}

/* --- EPD grid --- */
.epd-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: var(--md-sys-spacing-md);
  /* bag2: предотвращаем горизонтальный overflow viewport'а на mobile.
     Без max-width 100% и min-width 0 у ячеек длинные числовые value
     растягивают column шире чем 1fr → ломают grid → появляется H-scroll. */
  max-width: 100%;
}

@media (min-width: 600px) {
  .epd-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 840px) {
  .epd-grid { grid-template-columns: repeat(4, 1fr); }
}

.epd-item {
  display: flex;
  flex-direction: column;
  padding: 10px 14px;
  background-image: linear-gradient(rgba(164,161,108,0.08), rgba(164,161,108,0.08)),
                     linear-gradient(var(--md-sys-color-surface), var(--md-sys-color-surface));
  border-radius: var(--md-sys-shape-corner-medium);
  border: 1px solid var(--md-sys-color-outline-variant);
  /* bag2: grid item shrink + перенос длинных слов */
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.epd-item__label {
  font: 400 11px/14px 'Roboto', sans-serif;
  color: var(--md-sys-color-on-surface-variant);
  margin-bottom: 4px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.epd-item__value {
  font: 600 18px/24px 'Roboto', sans-serif;
  color: var(--md-sys-color-primary);
  min-width: 0;
  overflow-wrap: anywhere;
}

/* --- Skeleton cards --- */
.listing-card-skeleton {
  display: flex;
  flex-direction: row;
  overflow: hidden;
  border-radius: var(--md-sys-shape-corner-medium);
  background: var(--md-sys-color-surface);
  box-shadow: var(--md-sys-elevation-1);
}

.listing-card-skeleton__image {
  width: 120px;
  min-height: 120px;
  flex-shrink: 0;
}

.listing-card-skeleton__content {
  flex: 1;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

@media (min-width: 840px) {
  .listing-card-skeleton__image { width: 200px; min-height: 160px; }
}

/* ==========================================================================
   Ad Detail — двухколоночный layout (kopeika.shop-style в CattleSales палитре)
   ========================================================================== */

.mkt-detail {
  max-width: 1280px;
  margin: 0 auto;
  padding: 12px 16px 64px;
  /* Safety net: ни один внутренний grid/flex не должен растянуть viewport. */
  overflow-x: clip;
  min-width: 0;
}

/* Универсальный fix для grid/flex items внутри detail —
   без min-width: 0 контент с длинными словами/URL/неразрывными значениями
   расширяет свою ячейку, ломая весь layout. Применяем рекурсивно ко всем
   grid/flex children, чтобы не выискивать каждый случай отдельно. */
.mkt-detail :is(.mkt-detail__layout, .mkt-detail__main, .mkt-detail__aside,
                .mkt-specs, .mkt-specs__row, .mkt-aside__cta-row,
                .epd-grid, .mkt-detail__stats, .card-grid) > * {
  min-width: 0;
  max-width: 100%;
}

/* `.card-grid--related` — embedded grid внутри `.mkt-detail__main` (узкая
   колонка ~720px на iPad landscape из-за sidebar + aside). Default
   .card-grid идёт 3 колонки на 1200+ → карточки получают <240px и
   вылазят за parent. Auto-fit: подстраивается под доступную ширину,
   на узкой main колонке = 1-2 карточки. */
.mkt-detail .card-grid--related {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
@media (min-width: 1200px) {
  .mkt-detail .card-grid--related {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }
}

/* --- Breadcrumbs --- стили переехали в components.css (глобальный app.css),
   чтобы крошки работали на ВСЕХ страницах, не только маркетплейсных. --- */

/* --- Title row --- */
.mkt-detail__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.mkt-detail__title {
  margin: 0;
  font: 700 28px/34px 'Roboto', system-ui, sans-serif;
  color: var(--brand-ink);
  flex: 1;
  min-width: 0;
  word-wrap: break-word;
}
@media (min-width: 768px) {
  .mkt-detail__title { font-size: 32px; line-height: 40px; }
}

/* --- Двухколоночный grid --- */
.mkt-detail__layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 960px) {
  .mkt-detail__layout {
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 32px;
    align-items: start;
  }
}

@media (min-width: 1200px) {
  .mkt-detail__layout {
    grid-template-columns: minmax(0, 1fr) 380px;
  }
}

.mkt-detail__main {
  min-width: 0;
  /* bag2 safety net: блокируем горизонтальный scroll если внутри
     случайно появится over-wide элемент (видео iframe без max-width,
     pre-блок с длинной строкой, и т.п.) */
  overflow-x: hidden;
}

.mkt-detail__aside {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

@media (min-width: 960px) {
  .mkt-detail__aside {
    position: sticky;
    top: 80px;
    align-self: start;
    max-height: calc(100vh - 96px);
    overflow-y: auto;
    scrollbar-width: thin;
    /* Прячем scrollbar — sticky-блок прокручивается при необходимости,
       но визуальный шум минимизируем */
    scrollbar-color: var(--md-sys-color-outline-variant) transparent;
  }
}

/* --- Gallery с overlay-кнопками + ribbons --- */
.gallery__ribbon {
  position: absolute;
  top: 12px;
  z-index: 2;
  padding: 6px 12px;
  font: 600 12px/16px 'Roboto', system-ui, sans-serif;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border-radius: var(--md-sys-shape-corner-small);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.gallery__ribbon--top {
  left: 12px;
  background: linear-gradient(135deg, #F2B43A 0%, #E89A1C 100%);
  color: #fff;
}
.gallery__ribbon--top svg,
.gallery__ribbon--top .material-icons { font-size: 14px; }
.gallery__ribbon--sold {
  right: 12px;
  background: rgba(26, 28, 24, 0.85);
  color: #fff;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* Prev/Next нав-кнопки на главном фото */
.gallery__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.92);
  color: var(--brand-ink);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.18);
  opacity: 0;
  transition: opacity var(--md-sys-motion-duration-short),
              transform var(--md-sys-motion-duration-short),
              background var(--md-sys-motion-duration-short);
  z-index: 2;
}
.gallery:hover .gallery__nav,
.gallery__main:focus-within .gallery__nav { opacity: 1; }
.gallery__nav:hover {
  background: #fff;
  transform: translateY(-50%) scale(1.05);
}
.gallery__nav svg,
.gallery__nav .material-icons { font-size: 24px; }
.gallery__nav--prev { left: 12px; }
.gallery__nav--next { right: 12px; }

@media (hover: none) {
  /* На touch-устройствах кнопки видны всегда (нет :hover) */
  .gallery__nav { opacity: 0.85; }
}

/* Counter «1 / N» справа снизу */
.gallery__counter {
  position: absolute;
  bottom: 12px;
  right: 12px;
  padding: 4px 10px;
  font: 500 12px/16px 'Roboto', system-ui, sans-serif;
  background: rgba(26, 28, 24, 0.72);
  color: #fff;
  border-radius: var(--md-sys-shape-corner-full);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 2;
  pointer-events: none;
}

/* --- Stats row под галереей --- */
.mkt-detail__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 12px 0;
  margin: 8px 0 24px;
  border-top: 1px solid var(--md-sys-color-outline-variant);
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
  font-size: 13px;
  color: var(--md-sys-color-on-surface-variant);
}
.mkt-detail__stats-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.mkt-detail__stats-item svg,
.mkt-detail__stats-item .material-icons {
  color: var(--md-sys-color-outline);
  font-size: 18px;
}
.mkt-detail__stats-item--id {
  margin-left: auto;
  color: var(--md-sys-color-outline);
  font-variant-numeric: tabular-nums;
}

/* --- Sections (Описание / Характеристики / Видео) --- */
.mkt-section {
  margin-bottom: 28px;
}
.mkt-section__title {
  margin: 0 0 14px;
  font: 600 20px/26px 'Roboto', system-ui, sans-serif;
  color: var(--brand-ink);
}
.mkt-section__text {
  font: 400 15px/24px 'Roboto', system-ui, sans-serif;
  color: var(--md-sys-color-on-surface);
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* --- Specs table (две колонки key/value) --- */
.mkt-specs {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  margin: 0;
  background: var(--md-sys-color-surface-container-lowest);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-medium);
  overflow: hidden;
  max-width: 100%;
  min-width: 0;
}
/* 2 колонки key:val — только когда хватает ширины (1200+).
   До этого 1 колонка чтобы values не обрезались (iPad landscape 1024-1200). */
@media (min-width: 1200px) {
  .mkt-specs { grid-template-columns: 1fr 1fr; }
}

.mkt-specs__row {
  display: grid;
  grid-template-columns: minmax(110px, 38%) 1fr;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  align-items: center;
  margin: 0;
}
.mkt-specs__row:last-child,
.mkt-specs__row:nth-last-child(2):nth-child(odd) {
  border-bottom: none;
}
@media (min-width: 600px) {
  /* На 2-колоночной сетке убрать border у предпоследних */
  .mkt-specs__row:nth-last-child(-n+2) { border-bottom: none; }
  .mkt-specs__row:nth-child(odd) { border-right: 1px solid var(--md-sys-color-outline-variant); }
}

.mkt-specs__key {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  min-width: 0;
  font-size: 16px;
  color: var(--md-sys-color-on-surface-variant);
  overflow-wrap: anywhere;
  word-break: break-word;
}
.mkt-specs__key svg,
.mkt-specs__key .material-icons {
  color: var(--brand-green);
  flex-shrink: 0;
}
.mkt-specs__val {
  margin: 0;
  min-width: 0;
  font-size: 17px;
  font-weight: 500;
  color: var(--brand-ink);
  word-wrap: break-word;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* --- Aside cards (правый sticky-блок) --- */
.mkt-aside {
  background: var(--md-sys-color-surface-container-lowest);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-large);
  padding: 18px;
  box-shadow: 0 1px 3px rgba(26, 28, 24, 0.04);
}
.mkt-aside__title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  font: 600 15px/20px 'Roboto', system-ui, sans-serif;
  color: var(--brand-ink);
}
.mkt-aside__title svg,
.mkt-aside__title .material-icons {
  color: var(--brand-green);
}

.mkt-aside__price {
  font: 800 30px/36px 'Roboto', system-ui, sans-serif;
  letter-spacing: -0.5px;
  color: var(--brand-green);
  margin-bottom: 4px;
  word-break: break-word;
}
@media (min-width: 768px) {
  .mkt-aside__price { font-size: 32px; line-height: 38px; }
}
.mkt-aside__price--negotiable {
  font-size: 22px;
  line-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.mkt-aside__price-note {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--md-sys-color-on-surface-variant);
  margin-bottom: 12px;
}

.mkt-aside__status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  margin: 8px 0 12px;
  font-size: 13px;
  border-radius: var(--md-sys-shape-corner-small);
}
.mkt-aside__status--sold {
  background: rgba(26, 28, 24, 0.06);
  color: var(--md-sys-color-on-surface-variant);
}

/* CTA-кнопки в правом блоке */
.mkt-aside__cta-row {
  margin: 14px 0 8px;
}
.mkt-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  padding: 12px 18px;
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--md-sys-shape-corner-medium);
  margin-bottom: 8px;
}
.mkt-cta--primary {
  background: var(--brand-green);
  color: #fff;
}
.mkt-cta--secondary {
  background: transparent;
  color: var(--brand-green);
  border: 1.5px solid var(--brand-green);
}
.mkt-cta--secondary:hover {
  background: rgba(27, 116, 62, 0.06);
}
.mkt-cta--disabled {
  color: var(--md-sys-color-outline);
  border-color: var(--md-sys-color-outline-variant);
  cursor: not-allowed;
}
.mkt-cta--revealed {
  background: rgba(27, 116, 62, 0.08);
  font-variant-numeric: tabular-nums;
}
.mkt-cta--share,
.mkt-cta--voip {
  width: 100%;
  justify-content: center;
  font-size: 14px;
  font-weight: 500;
  min-height: 40px;
  color: var(--md-sys-color-on-surface-variant);
}
.mkt-aside__voip {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}
.mkt-aside__voip .mkt-cta--voip { flex: 1; }

/* --- Seller card --- */
.mkt-seller {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.mkt-seller__avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--brand-olive);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font: 600 20px/1 'Roboto', system-ui, sans-serif;
  flex-shrink: 0;
  overflow: hidden;
}
.mkt-seller__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.mkt-seller__avatar-initial {
  text-transform: uppercase;
}
.mkt-seller__body {
  flex: 1;
  min-width: 0;
}
.mkt-seller__name {
  font: 600 15px/20px 'Roboto', system-ui, sans-serif;
  color: var(--brand-ink);
  word-wrap: break-word;
}
.mkt-seller__farm {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--md-sys-color-on-surface-variant);
  margin-top: 2px;
}
.mkt-seller__joined {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--md-sys-color-outline);
  margin-top: 4px;
}
.mkt-seller__ads-count {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--md-sys-color-on-surface-variant);
  margin-top: 4px;
}
.mkt-seller__badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--brand-green);
  background: rgba(27, 116, 62, 0.08);
  border-radius: var(--md-sys-shape-corner-extra-small);
}
.mkt-seller__info-link {
  width: 100%;
  margin-top: 12px;
}
.mkt-seller__add-form {
  margin-top: 12px;
}
.mkt-seller__add-btn {
  width: 100%;
  justify-content: center;
  font-size: 13px;
  min-height: 36px;
}

/* --- Location card --- */
.mkt-location {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  color: var(--brand-ink);
}
.mkt-location__row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.mkt-location__row svg,
.mkt-location__row .material-icons {
  color: var(--md-sys-color-outline);
  flex-shrink: 0;
}
.mkt-location__flag {
  width: 22px;
  height: 16px;
  border-radius: 2px;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
  flex-shrink: 0;
}

/* Маленький инлайн-флаг в строке характеристик (страна-производитель). */
.mkt-flag-inline {
  width: 18px;
  height: 13px;
  border-radius: 2px;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
  vertical-align: middle;
  margin-right: 4px;
}

/* --- Safety tips card --- */
.mkt-aside--safety {
  background: var(--brand-cream);
  border-color: rgba(194, 191, 108, 0.5);
}
.mkt-safety {
  margin: 0;
  padding: 0 0 0 18px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--md-sys-color-on-surface-variant);
}
.mkt-safety li { margin-bottom: 6px; }
.mkt-safety li:last-child { margin-bottom: 0; }

/* --- Share-toast --- */
.mkt-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 18px;
  background: rgba(26, 28, 24, 0.92);
  color: #fff;
  font-size: 14px;
  border-radius: var(--md-sys-shape-corner-full);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  z-index: 9999;
  animation: mkt-toast-in 0.2s ease-out;
}
@keyframes mkt-toast-in {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* ============================================================================
   Mobile + Tablet-portrait reorder: aside ПОСЛЕ Описания (UX-bag1)
   ============================================================================
   До 960px aside рендерился в самом конце страницы — пользователь сначала
   видел галерею → описание → характеристики → EPD → ... → потом цену+CTA.
   Это плохо: цена и кнопки «Позвонить»/«Написать» должны быть в верхней
   четверти прокрутки.

   Решение — `display: contents` на `.mkt-detail__main` распаковывает его
   children в `.mkt-detail__layout` (flex-контейнер на мобиле). Тогда
   sections + `.mkt-detail__aside` становятся flex-сиблингами и можно
   управлять их `order`.

   Каскад:
   - gallery       (div.gallery)         → order 1
   - stats         (.mkt-detail__stats)  → order 2
   - 1-я section   (Описание, либо если её нет — Характеристики) → order 3
   - aside         (.mkt-detail__aside)  → order 4
   - остальные sections (n+2)            → order 5

   Sticky НЕ работает у элемента с `display: contents` parent'ом, но на mobile
   она и не нужна (одна колонка). На desktop (>=960px) ниже всё откатывается
   обратно на grid + `display: block` — sticky восстанавливается. */
@media (max-width: 959px) {
  .mkt-detail__layout {
    display: flex;
    flex-direction: column;
    gap: 24px;
    overflow-x: hidden; /* bag2 safety net на flex-контейнере */
  }
  /* Распаковываем main: его прямые children становятся flex-сиблингами
     `.mkt-detail__aside` в `.mkt-detail__layout`. */
  .mkt-detail__main {
    display: contents;
  }
  /* Default order — DOM-селекторы (display:contents НЕ меняет селекторное
     дерево, только box-tree, поэтому используем фактических DOM-родителей). */
  .mkt-detail__main > * { order: 10; }
  .mkt-detail__layout > .mkt-detail__aside { order: 4; }

  /* Gallery — самой первой. */
  .mkt-detail__main > .gallery { order: 1; }
  /* Stats — сразу после галереи. */
  .mkt-detail__main > .mkt-detail__stats { order: 2; }
  /* Первый .mkt-section (Описание, если есть; иначе Характеристики). */
  .mkt-detail__main > .mkt-section:nth-of-type(1) { order: 3; }
  /* Все остальные sections — после aside. nth-of-type считает среди
     `<section>` сиблингов в DOM-родителе (`.mkt-detail__main`). */
  .mkt-detail__main > .mkt-section:nth-of-type(n+2) { order: 5; }

  /* На mobile/tablet aside не sticky — это просто блок в потоке. */
  .mkt-detail__aside {
    position: static;
    max-height: none;
    overflow: visible;
  }
}

/* --- Tablet portrait (768-959px): центрирование контента, mid-size шрифты
   Между mobile-фолбэком и desktop 2-column layout. iPad portrait
   (768×1024) и аналоги. Контент не должен растягиваться на всю ширину
   планшета — иначе строки слишком длинные (читабельность). */
@media (min-width: 768px) and (max-width: 959px) {
  .mkt-detail { padding: 16px 24px 56px; }
  .mkt-detail__layout {
    max-width: 760px;
    margin: 0 auto;
  }
  /* Цена увеличена относительно mobile, но меньше desktop (32). */
  .mkt-aside__price { font-size: 36px; line-height: 42px; }
  /* Галерея main не должна превышать ширину контейнера. */
  .gallery__main { max-width: 720px; margin-left: auto; margin-right: auto; }
}

/* --- Mobile (< 768px): компактные паддинги, мелкие нав-кнопки галереи --- */
@media (max-width: 767px) {
  .mkt-detail { padding: 8px 12px 48px; }
  .mkt-detail__header { margin-bottom: 12px; }
  .mkt-aside { padding: 14px; }
  .mkt-aside__price { font-size: 26px; line-height: 32px; }
  .gallery__nav { width: 38px; height: 38px; }
  .gallery__nav svg, .gallery__nav .material-icons { font-size: 20px; }
}

/* --- Desktop (>=960px) explicit reset: возвращаем grid + block-main + sticky
   На случай если каскад от mobile-блока выше «протёк» через специфичность,
   явно сбрасываем display и order. */
@media (min-width: 960px) {
  .mkt-detail__main { display: block; }
  .mkt-detail__main > *,
  .mkt-detail__layout > .mkt-detail__aside { order: initial; }
}

/* Edit ad/product/service форма — резиновая, тон M3 (без чужих синих) */
.ad-edit {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px;
  background: var(--md-sys-color-surface-container-low);
  border-radius: var(--md-sys-shape-corner-large);
  border: 1px solid var(--md-sys-color-outline-variant);
}
.ad-edit .page-title {
  font-size: 22px;
  margin-bottom: 16px;
  color: var(--brand-ink);
}
.ad-edit__form { display: grid; gap: 16px; }
.ad-edit__field { display: block; }
.ad-edit__field > span {
  display: block;
  font-size: 13px;
  color: var(--md-sys-color-on-surface-variant);
  margin-bottom: 6px;
  font-weight: 500;
}
.ad-edit__field input[type=text],
.ad-edit__field input[type=number],
.ad-edit__field input[type=url],
.ad-edit__field select,
.ad-edit__field textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-small);
  box-sizing: border-box;
  font: var(--md-sys-typescale-body-large);
  color: var(--md-sys-color-on-surface);
  background: var(--md-sys-color-surface);
  outline: none;
  transition: border-color 0.15s;
}
.ad-edit__field input:focus,
.ad-edit__field select:focus,
.ad-edit__field textarea:focus {
  /* CattleSales green вместо нативного синего outline. */
  border-color: var(--md-sys-color-primary);
  border-width: 2px;
  padding: 11px 13px;
}
.ad-edit__field input:disabled {
  background: var(--md-sys-color-surface-container);
  color: var(--md-sys-color-on-surface-variant);
  cursor: not-allowed;
  opacity: 0.7;
}
.ad-edit__field textarea {
  min-height: 110px;
  resize: vertical;
  font-family: inherit;
}
.ad-edit__checkbox {
  display: flex;
  gap: 10px;
  align-items: center;
  cursor: pointer;
  padding: 6px 0;
  font-size: 14px;
  color: var(--md-sys-color-on-surface);
}
.ad-edit__checkbox input[type=checkbox] {
  width: 20px;
  height: 20px;
  accent-color: var(--md-sys-color-primary);
  cursor: pointer;
}
.ad-edit__actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.ad-edit__actions .btn { flex: 1 1 auto; min-width: 120px; }
.ad-edit__divider { margin: 24px 0; border: 0; border-top: 1px solid var(--md-sys-color-outline-variant); }
.ad-edit__delete-form button.btn--danger { width: 100%; }

.btn--danger {
  background: var(--md-sys-color-error);
  color: var(--md-sys-color-on-error);
  border: none;
}
.btn--danger:hover { filter: brightness(1.08); }

@media (min-width: 600px) {
  .ad-edit { padding: 24px 28px; }
  .ad-edit .page-title { font-size: 24px; margin-bottom: 20px; }
  .ad-edit__form { gap: 18px; }
}
@media (min-width: 840px) {
  .ad-edit { padding: 32px 36px; }
  .ad-edit .page-title { font-size: 28px; }
  .ad-edit__form {
    /* На планшете двухколоночный layout — компактнее по вертикали. */
    grid-template-columns: 1fr 1fr;
    gap: 18px 24px;
  }
  /* Полноразмерные поля занимают обе колонки. */
  .ad-edit__form > .ad-edit__field:has(textarea),
  .ad-edit__form > .ad-edit__actions,
  .ad-edit__form > .ad-edit__field:nth-last-of-type(-n+2):has(input[type=url]) {
    grid-column: 1 / -1;
  }
}

/* ==========================================================================
   Bug 15/16: tablet/related-cards — горизонтальная карта на узких колонках
   ad-detail (main + aside = ~720px на 840px → карточки получают <240px) ломает
   текст. На планшете и в related-блоках разворачиваем карточку в column —
   image сверху, content снизу. Также fluid между 840-1042 без ступенек.
   ========================================================================== */

/* Related-grid (similar ads + other-from-seller на detail-странице) — всегда
   vertical layout, никаких side-image на planshet/desktop. */
.mkt-detail .card-grid--related .listing-card,
.mkt-detail .card-grid .listing-card {
  flex-direction: column;
}
.mkt-detail .card-grid--related .listing-card__image,
.mkt-detail .card-grid .listing-card__image {
  width: 100%;
  border-radius: var(--md-sys-shape-corner-large) var(--md-sys-shape-corner-large) 0 0;
}
.mkt-detail .card-grid--related .listing-card__content,
.mkt-detail .card-grid .listing-card__content {
  flex: 1 1 auto;
}

/* Планшет 840-1199 — карточки на /market/ тоже vertical (image сверху).
   На 840-1042 без этого правила: image слева 45% + content справа узкий
   → текст вылазит, неадаптивно. */
@media (min-width: 840px) and (max-width: 1199px) {
  .listings-list .card-grid {
    /* Минимум 280px на карточку — auto-fit подстраивается. */
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }
  .listings-list .listing-card { flex-direction: column; }
  .listings-list .listing-card__image {
    width: 100%;
    border-radius: var(--md-sys-shape-corner-large) var(--md-sys-shape-corner-large) 0 0;
  }
  /* Detail layout: на planshet aside становится узким (320px) чтобы main
     не сжимался ниже 480px. */
  .mkt-detail__layout {
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 20px;
  }
}

/* Bug 3: на мобиле кнопка «Фильтры» должна полностью помещаться. Контейнер
   .listings-list имеет padding=16, но flex-row title+btn могут переполнить.
   Добавляем flex-wrap + ограничение размеров кнопки. */
.filter-toggle-btn {
  margin-bottom: 0;
  flex-shrink: 0;
  max-width: 100%;
  white-space: nowrap;
}
.listings-list > div:first-child {
  /* Wrap для строки с title + кнопкой Фильтры на узких экранах. */
  flex-wrap: wrap;
  gap: 8px;
}

/* Bottom-sheet (mobile filters) — гарантируем что не вылазит за viewport. */
.bottom-sheet { max-width: 100vw; box-sizing: border-box; }
.bottom-sheet__body {
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* --- Каталог товаров / ветеринарии (listings-list--catalog) --------------
   Лента животных — горизонтальные карточки в одну колонку (богатый контент).
   Товары/ветеринария — компактный grid вертикальных карточек на ВСЕХ ширинах.
   Иначе на десктопе ≥1200 `.listings-list .card-grid` падает в `1fr`
   (одна колонка) → карточки растягиваются во всю ширину и выглядят огромными.
   Правила идут после базовых/медиа-правил .listings-list → при равной
   специфичности побеждают по порядку источника на любой ширине. */
.listings-list--catalog .card-grid {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--md-sys-spacing-md);
}
.listings-list--catalog .listing-card {
  flex-direction: column;
}
.listings-list--catalog .listing-card__image {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--md-sys-shape-corner-large) var(--md-sys-shape-corner-large) 0 0;
}
@media (min-width: 600px) {
  .listings-list--catalog .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }
}

/* ===========================================================================
   Карточки лент — компактные ГОРИЗОНТАЛЬНЫЕ строки, как в mobile app (Flutter):
   небольшое фото слева + контент справа. Единый вид для животных / товаров /
   мяса / молока / ветеринарии. Одна колонка на мобиле/планшете, 2 колонки на
   широком десктопе (чтобы строки не растягивались). Блок в КОНЦЕ файла →
   перекрывает прежние правила (+ !important на grid и flex-direction).
   =========================================================================== */
.listings-list .card-grid,
.listings-list--catalog .card-grid {
  grid-template-columns: 1fr !important;
  gap: var(--md-sys-spacing-sm);
}
.listings-list .listing-card,
.listings-list--catalog .listing-card {
  flex-direction: row !important;
  align-items: stretch;
}
.listings-list .listing-card__image,
.listings-list--catalog .listing-card__image {
  width: 120px !important;
  min-width: 120px;
  aspect-ratio: 1 / 1 !important;
  border-radius: var(--md-sys-shape-corner-large) 0 0 var(--md-sys-shape-corner-large) !important;
}
.listings-list .listing-card__content,
.listings-list--catalog .listing-card__content {
  padding: 10px 12px;
  gap: 4px;
}
.listings-list .listing-card__breed { font-size: 15px; }
.listings-list .listing-card__category { font-size: 12px; }

/* Широкий десктоп — 2 колонки горизонтальных карточек (не растягивать). */
@media (min-width: 1000px) {
  .listings-list .card-grid,
  .listings-list--catalog .card-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* Совсем узкие экраны — фото чуть меньше. */
@media (max-width: 380px) {
  .listings-list .listing-card__image,
  .listings-list--catalog .listing-card__image {
    width: 96px !important;
    min-width: 96px;
  }
}

/* Силуэт животного в плейсхолдере карточки (нет фото) — паритет с Flutter
   AnimalSilhouette. meat: m.category|meat_icon; milk: species_root|category_icon. */
.listing-card__placeholder-silhouette {
  width: 56px;
  height: 56px;
  object-fit: contain;
  opacity: 0.85;
}

/* Чипы под заголовком деталки (Халяль / Регулярная поставка) — meat/milk */
.mkt-detail__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 8px;
}
/* Единица цены рядом с ценой в сайдбаре (за кг/л/...) — meat/milk */
.mkt-aside__price-unit {
  font-size: 14px;
  font-weight: 400;
  color: var(--md-sys-color-on-surface-variant, #666);
}
