/* inventory.css — iz cleaned 20260626T235138Z: dead .inventory-* removed + mobile @media (cards/specs/visit 1-col) + View-Details button-overflow fix. Backup: *.bak-cssclean-* */

/*
 * Inventory page styles (post-type-archive-car)
 * Scope: archive-car.php + template-parts/car/card.php only.
 */

.dag-inventory {
	padding: clamp(18px, 2.6vw, 32px) 0;
}

.inventory-hero {
	margin-bottom: 18px;
}

.inventory-title {
	margin: 0;
	font-size: clamp(28px, 3.2vw, 40px);
	letter-spacing: -0.02em;
}

.inventory-lead {
	margin: 10px 0 0;
	color: var(--dag-muted, #667085);
	max-width: 72ch;
	line-height: 1.55;
}

.inventory-layout {
	display: grid;
	grid-template-columns: 360px minmax(0, 1fr);
	gap: 18px;
	align-items: start;
}

@media (max-width: 980px) {
	.inventory-layout {
		grid-template-columns: 1fr;
	}
}

/* Sidebar / filters */

.inventory-filters-collapse {
	border: 1px solid var(--dag-border, #E4E7EC);
	border-radius: 18px;
	background: var(--dag-surface, #fff);
	overflow: hidden;
}

.inventory-filters-collapse__summary {
	cursor: pointer;
	padding: 12px 14px;
	font-weight: 900;
	user-select: none;
	list-style: none;
}

.inventory-filters-collapse__summary::-webkit-details-marker {
	display: none;
}

.inventory-filters-collapse[open] > .inventory-filters-collapse__summary {
	border-bottom: 1px solid var(--dag-border, #E4E7EC);
}

@media (min-width: 981px) {
	.inventory-filters-collapse__summary {
		display: none;
	}

	.inventory-sidebar {
		position: sticky;
		top: calc(var(--wp-admin--admin-bar--height, 0px) + 16px);
		align-self: start;
	}

	.inventory-filters-collapse {
		position: static;
		border-radius: 0;
		border: none;
		background: transparent;
		overflow: visible;
	}

	.inventory-filters {
		max-height: calc(100vh - (var(--wp-admin--admin-bar--height, 0px) + 32px));
		overflow: auto;
	}
}
.inventory-filters {
	border: 1px solid var(--dag-border, #E4E7EC);
	border-radius: 18px;
	background: var(--dag-surface, #fff);
	box-shadow: 0 10px 22px rgba(16, 24, 40, 0.06);
	padding: 14px;
}

@media (max-width: 980px) {
	.inventory-filters {
		border: none;
		border-radius: 0;
		box-shadow: none;
		padding: 14px;
	}
}

.inventory-filters__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin-bottom: 12px;
}

.inventory-filters__title {
	font-weight: 900;
	letter-spacing: -0.01em;
}

.inventory-filters__grid {
	display: grid;
	gap: 12px;
}

.inventory-filters__row--2 {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
}

@media (max-width: 480px) {
	.inventory-filters__row--2 {
		grid-template-columns: 1fr;
	}
}

.inventory-filters .dag-field label {
	display: inline-block;
	margin-bottom: 6px;
	font-weight: 800;
	font-size: 0.92rem;
}

/* Higher-contrast form text (Inventory only) */
.inventory-filters input[type="search"],
.inventory-filters input[type="text"],
.inventory-filters input[type="number"],
.inventory-filters select,
.inventory-topbar select {
	color: var(--dag-text, #101828);
}

.inventory-filters input[type="search"]::placeholder,
.inventory-filters input[type="text"]::placeholder,
.inventory-filters input[type="number"]::placeholder {
	color: rgba(16, 24, 40, 0.60);
	opacity: 1;
}

.inventory-filters input[type="search"],
.inventory-filters input[type="text"],
.inventory-filters input[type="number"],
.inventory-filters select {
	width: 100%;
	border-radius: 12px;
	border: 1px solid var(--dag-border, #E4E7EC);
	background: var(--dag-surface-2, #fff);
	padding: 10px 12px;
	outline: none;
	transition: box-shadow .15s ease, border-color .15s ease;
}

.inventory-filters input[type="search"]:focus,
.inventory-filters input[type="text"]:focus,
.inventory-filters input[type="number"]:focus,
.inventory-filters select:focus {
	border-color: rgba(17, 105, 255, 0.45);
	box-shadow: 0 0 0 4px rgba(17, 105, 255, 0.12);
}

.inventory-filters__hint {
	margin: 8px 0 0;
	font-size: 0.92rem;
	color: var(--dag-muted-2, #475467);
	line-height: 1.45;
}

.inventory-filters__actions {
	margin-top: 4px;
}

/* Help card */

.inventory-help {
	margin-top: 14px;
	border-radius: 18px;
}

.inventory-help__title {
	font-weight: 900;
	margin-bottom: 8px;
}

.inventory-help__row {
	margin-top: 8px;
}

.inventory-help a {
	text-decoration: none;
}

.inventory-help a:hover {
	text-decoration: underline;
}

/* Main bar */

.inventory-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 10px 12px;
	border: 1px solid var(--dag-border, #E4E7EC);
	border-radius: 16px;
	background: var(--dag-surface, #fff);
}

@media (max-width: 680px) {
	.inventory-bar {
		flex-direction: column;
		align-items: stretch;
	}
}

.inventory-found {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}

.inventory-range {
	color: var(--dag-muted, #667085);
	font-weight: 700;
	font-size: 0.95rem;
}

/* Sort / per-page top controls */

.inventory-topbar {
	display: flex;
	justify-content: flex-end;
}

.inventory-topbar__fields {
	display: flex;
	align-items: end;
	justify-content: flex-end;
	gap: 10px;
	flex-wrap: wrap;
}

.inventory-topbar__label {
	display: block;
	font-size: 0.85rem;
	font-weight: 850;
	margin-bottom: 6px;
	color: var(--dag-muted-2, #475467);
}

.inventory-topbar select {
	border-radius: 12px;
	border: 1px solid var(--dag-border, #E4E7EC);
	background: var(--dag-surface-2, #fff);
	padding: 10px 12px;
	outline: none;
	transition: box-shadow .15s ease, border-color .15s ease;
	min-width: 180px;
}

.inventory-topbar select:focus {
	border-color: rgba(17, 105, 255, 0.45);
	box-shadow: 0 0 0 4px rgba(17, 105, 255, 0.12);
}

@media (max-width: 680px) {
	.inventory-topbar__fields {
		align-items: stretch;
	}

	.inventory-topbar__field {
		flex: 1 1 220px;
	}

	.inventory-topbar select {
		min-width: 0;
		width: 100%;
	}
}

/* Applied filters summary */

.inventory-summary {
	margin: 12px 0 0;
	padding: 10px 12px;
	border: 1px solid var(--dag-border, #E4E7EC);
	border-radius: 16px;
	background: var(--dag-surface, #fff);
	display: flex;
	gap: 10px;
	align-items: baseline;
	flex-wrap: wrap;
}

.inventory-summary__label {
	font-weight: 950;
	letter-spacing: -0.01em;
}

.inventory-summary__text {
	color: var(--dag-muted, #667085);
	font-weight: 800;
}

/* Active filter chips */

.inventory-active {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
	margin: 12px 0 14px;
}

.inv-chip {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 7px 10px;
	border-radius:var(--dag-radius-pill);
	border: 1px solid var(--dag-border, #E4E7EC);
	background: var(--dag-surface, #fff);
	color: inherit;
	text-decoration: none;
	transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.inv-chip:hover {
	border-color: rgba(17, 105, 255, 0.35);
	box-shadow: 0 10px 20px rgba(16, 24, 40, 0.08);
	transform: translateY(-1px);
}

.inv-chip:focus-visible {
	outline: none;
	box-shadow: 0 0 0 4px rgba(17, 105, 255, 0.14);
	border-color: rgba(17, 105, 255, 0.55);
}

.inv-chip__label {
	font-weight: 750;
	font-size: 0.95rem;
}

.inv-chip__x {
	opacity: 0.7;
	font-size: 1.05rem;
	line-height: 1;
}

.inv-chip--reset {
	background: var(--dag-surface-2, #F8FAFC);
}

/* Cards grid */

.inventory-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px;
	margin: 14px 0 18px;
}
@media (max-width: 620px) {
	.inventory-grid {
		grid-template-columns: 1fr;
	}
}

.inv-card {
	border: 1px solid var(--dag-border, #E4E7EC);
	border-radius: 18px;
	background: var(--dag-surface, #fff);
	overflow: hidden;
	transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.inv-card:hover {
	transform: translateY(-2px);
	border-color: rgba(17, 105, 255, 0.30);
	box-shadow: 0 18px 35px rgba(16, 24, 40, 0.10);
}

.inv-card.is-sold {
	opacity: 0.92;
}

.inv-card.is-sold:hover {
	transform: none;
	box-shadow: none;
	border-color: var(--dag-border, #E4E7EC);
}

.inv-card.is-sold .inv-card__media::after {
	content: "";
	position: absolute;
	inset: 0;
	background: rgba(16, 24, 40, 0.38);
}

.inv-card.is-sold .inv-card__img {
	filter: grayscale(1) saturate(0.35);
}

.inv-card.is-sold .inv-card__body {
	opacity: 0.85;
}

.inv-card.is-sold .inv-card__cta {
	color: var(--dag-muted, #667085);
}

.inv-card__link {
	display: flex;
	flex-direction: column;
	min-height: 100%;
	color: inherit;
	text-decoration: none;
}

.inv-card__link:focus-visible {
	outline: none;
	box-shadow: 0 0 0 4px rgba(17, 105, 255, 0.14);
}

.inv-card__media {
	position: relative;
	aspect-ratio: 16 / 10;
	background: var(--dag-surface-2, #F2F4F7);
}

.inv-card__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.inv-card__placeholder {
	width: 100%;
	height: 100%;
	display: grid;
	place-items: center;
	color: var(--dag-muted, #667085);
	font-weight: 800;
}

.inv-card__badges {
	position: absolute;
	inset: 10px 10px auto 10px;
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	align-items: center;
	pointer-events: none;
}

.inv-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius:var(--dag-radius-pill);
	padding: 6px 10px;
	font-weight: 900;
	font-size: 0.82rem;
	letter-spacing: 0.02em;
	background: rgb(0, 90, 5);
	border: 1px solid var(--dag-border, #E4E7EC);
}

.inv-badge--sold {
	background: rgba(255, 235, 235, 0.94);
	border-color: rgba(240, 68, 56, 0.25);
	color: #B42318;
}

.inv-badge--discount {
	background: rgba(235, 248, 255, 0.94);
	border-color: rgba(17, 105, 255, 0.22);
	color: #0B4DB8;
}

.inv-badge--count {
	background: var(--dag-surface-2, #F8FAFC);
}

.inv-card__body {
	padding: 14px 14px 12px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	flex: 1;
}

.inv-card__title {
	margin: 0;
	font-size: 1.06rem;
	line-height: 1.2;
	letter-spacing: -0.01em;
}

.inv-card__specs {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	align-items: baseline;
	color: var(--dag-muted, #667085);
	font-weight: 800;
	font-size: 0.95rem;
}

.inv-card__specs-label {
	color: var(--dag-muted, #667085);
	font-weight: 900;
}

.inv-card__specs-value {
	color: var(--dag-muted, #667085);
	font-weight: 800;
}

.inv-card__sub {
	color: var(--dag-muted, #667085);
	font-size: 0.95rem;
}

.inv-card__meta {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
	border-top: 1px solid rgba(var(--ink-rgb), 0.9);
	padding-top: 12px;
	margin-top: auto;
}

.inv-meta__item {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.inv-meta__label {
	color: var(--dag-muted, #667085);
	font-size: 0.85rem;
	font-weight: 800;
}

.inv-meta__value {
	font-weight: 900;
	letter-spacing: -0.01em;
}

.inv-price--old {
	text-decoration: line-through;
	opacity: 0.55;
	margin-right: 8px;
	font-weight: 800;
}

.inv-price--na {
	color: var(--dag-muted, #667085);
	font-weight: 800;
}

.inv-card__cta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin-top: 10px;
	padding-top: 10px;
	border-top: 1px solid rgba(var(--ink-rgb), 0.9);
	color: #0B4DB8;
	font-weight: 900;
}

.inv-card__cta-arrow {
	font-size: 1.05rem;
}

/* Pagination */

.inventory-pagination {
	margin-top: 8px;
}

.inventory-pagination ul {
	list-style: none;
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	margin: 0;
	padding: 0;
}

.inventory-pagination li {
	margin: 0;
}

.inventory-pagination a,
.inventory-pagination span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 42px;
	height: 42px;
	padding: 0 12px;
	border-radius: 12px;
	border: 1px solid var(--dag-border, #E4E7EC);
	background: var(--dag-surface, #fff);
	text-decoration: none;
	color: inherit;
	font-weight: 900;
	transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.inventory-pagination a:hover {
	transform: translateY(-1px);
	box-shadow: 0 12px 24px rgba(16, 24, 40, 0.10);
	border-color: rgba(17, 105, 255, 0.35);
}

.inventory-pagination .current {
	background: rgba(17, 105, 255, 0.10);
	border-color: rgba(17, 105, 255, 0.35);
}

/* Empty state */

.inventory-empty {
	border-radius: 18px;
	padding: 16px;
	margin-top: 14px;
}

.inventory-empty__title {
	font-weight: 950;
	letter-spacing: -0.01em;
	font-size: 1.2rem;
	margin-bottom: 6px;
}

.inventory-empty__lead {
	margin: 0 0 10px;
	color: var(--dag-muted, #667085);
	line-height: 1.55;
}

.inventory-empty__list {
	margin: 0 0 14px;
	padding-left: 18px;
	color: var(--dag-muted, #667085);
}

.inventory-empty__actions {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
}

/* Visit section */

.inventory-visit {
	margin-top: 28px;
}

.inventory-visit__title {
	margin: 0;
	font-size: 1.35rem;
	letter-spacing: -0.01em;
}

.inventory-visit__lead {
	margin: 8px 0 14px;
	color: var(--dag-muted, #667085);
}

.inventory-visit__grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 14px;
}

@media (max-width: 980px) {
	.inventory-visit__grid {
		grid-template-columns: 1fr;
	}
}

.inventory-visit__card {
	border-radius: 18px;
}

.inventory-visit__label {
	font-weight: 900;
	margin-bottom: 6px;
}

.inventory-visit__value a {
	text-decoration: none;
}

.inventory-visit__value a:hover {
	text-decoration: underline;
}
/* iz-css-clean mobile (cards stack + button-overflow fix) */
@media (max-width: 980px){ body.post-type-archive-car .dag-visit__grid{grid-template-columns:repeat(2,minmax(0,1fr));} }
@media (max-width: 768px){
  body.post-type-archive-car .dag-inv-card{grid-template-columns:1fr;}
  body.post-type-archive-car .dag-inv-card__media{min-height:0;}
  body.post-type-archive-car .dag-inv-card__media img{height:auto;min-height:0;aspect-ratio:16/10;}
  body.post-type-archive-car .dag-filter-form{grid-template-columns:1fr;}
  body.post-type-archive-car .dag-actions{flex-wrap:wrap;}
}
@media (max-width: 560px){
  body.post-type-archive-car .dag-spec-mini{grid-template-columns:1fr;}
  body.post-type-archive-car .dag-inv-card__top{flex-wrap:wrap;gap:8px;}
  body.post-type-archive-car .dag-inv-card__top .dag-btn--small{min-width:0;width:auto;max-width:100%;}
  body.post-type-archive-car .dag-inv-card__title{font-size:22px;}
  body.post-type-archive-car .dag-visit__grid{grid-template-columns:1fr;}
}
/* iz-btn-overflow-guard */
body.post-type-archive-car .dag-inv-card .dag-btn{max-width:100%;}

/* ------------------------------------------------------------
   SAIT17 REDESIGN 2026-09-02 — иерархия цены на карточке витрины.

   ПОЧЕМУ ЭТО ЗДЕСЬ. Разметка отдаёт классы inv-price__new и inv-price__old
   (BEM-элементы), а в этом файле описан только .inv-price--old (модификатор).
   Правила для НОВОЙ цены не существовало вовсе, поэтому старая и новая цена
   рендерились одинаково — 16px/900/один цвет, отличие только зачёркиванием, —
   и обе были неотличимы от пробега. На витрине дилера цена решает, поэтому
   иерархия задана явно: новая цена крупнее всего в карточке, старая уходит
   в приглушённый, пробег остаётся вторичным.
------------------------------------------------------------ */
.inv-price__new{
  font-size: 22px;
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--dag-text);
}
.inv-price__old{
  font-size: 14px;
  font-weight: 700;
  color: var(--dag-muted);
  text-decoration: line-through;
  text-decoration-thickness: 1px;
  opacity: .8;
  margin-inline-end: 6px;
}
/* Пробег — вторичное число: тот же размер, но легче цены по насыщенности */
.inv-meta__value{ font-weight: 700; }

/* Бейдж скидки был набран синим (#0B4DB8 на голубом) — единственный остаток
   прежней палитры, который не попал под пересчёт rgba: у него другая тройка.
   Переведён в янтарь, чтобы «скидка» читалась тем же цветом, что и действие. */
.inv-badge--discount,
.inv-badge--deal{
  background: rgba(var(--accent-rgb), .10);
  border-color: rgba(var(--accent-rgb), .30);
  color: #8a3f07;
}

/* Выравнивание строки цены между соседними карточками.
   После того как новая цена стала крупной, у карточек со скидкой она переносится
   на вторую строку, и блок PRICE/MILEAGE уезжает вниз относительно соседа без
   скидки. На витрине карточки сравнивают глазами по горизонтали, поэтому
   мета-блок прижат к низу карточки: строки цены и пробега встают на одну линию
   независимо от длины названия и наличия старой цены. */
.inv-card.car-card{
  display: flex;
  flex-direction: column;
}
.inv-card__body.car-card__body{
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
}
.inv-card__meta.car-card__meta{
  margin-top: auto;
}
/* Цена и старая цена — на одной строке, если помещаются */
.inv-card__meta .inv-meta__item:first-child{
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 6px;
}

/* Поправка к выравниванию: margin-top:auto равняет НИЗ карточки, а сравнивают
   глазами строку цены. У карточки со скидкой цена занимает две строки (старая
   над новой), у карточки без скидки — одну, поэтому строки разъезжались на
   высоту строки. Резервируем место под оба случая: тогда и метки, и значения
   стоят на одной линии во всём ряду. */
.inv-card__meta.car-card__meta{
  margin-top: 0;
  min-height: 84px;
  align-content: start;
}

/* ------------------------------------------------------------
   Витрина: порядок на телефоне и дублирующийся заголовок фильтров.

   1. Дубль. Разметка такая:
        <details class="inventory-filters-collapse" open>
          <summary …>Filters</summary>
          <div class="inventory-filters">
            <div class="inventory-filters__title">Filters</div>   <- то же слово второй раз
      Внутренний заголовок скрыт: он повторяет summary, который к тому же
      интерактивен. Скрыт визуально, из потока для скринридера не выброшен.

   2. Порядок. На телефоне вся форма фильтров идёт ДО списка машин, и на первых
      экранах посетитель не видит ни одного автомобиля — на витрине дилера это
      главный дефект мобильной версии. Список машин поднят выше фильтров.
------------------------------------------------------------ */
/* ПОПРАВКА 2026-09-02: скрывать дубль можно ТОЛЬКО там, где виден <summary>.
   Первая редакция прятала внутренний заголовок безусловно, а на десктопе summary
   скрыт по замыслу темы (inventory.css, @media min-width:981px) — в итоге панель
   фильтров осталась вообще без заголовка. Поймано рендером, не глазами по коду. */
@media (max-width: 980px){
  .inventory-filters-collapse .inventory-filters__title{
    position: absolute;
    width: 1px; height: 1px;
    margin: -1px; padding: 0; border: 0;
    clip: rect(0 0 0 0); clip-path: inset(50%);
    overflow: hidden; white-space: nowrap;
  }
}

@media (max-width: 900px){
  .inventory-layout{
    display: flex;
    flex-direction: column;
  }
  .inventory-main{ order: 1; }
  .inventory-sidebar{ order: 2; }
}

/* SAIT17 REDESIGN 2026-09-02 — признак кликабельности карточки списка.
   Это НЕ ссылка, а <span>: карточка целиком обёрнута в <a class="inv-card__link">,
   и вложенная ссылка была бы невалидной. Оформлен как контурная кнопка — намеренно
   не янтарной, чтобы в сетке из двенадцати карточек не спорить с ценой за внимание. */
.inv-card__more{
  display: block;
  margin-top: 12px;
  padding: 9px 12px;
  border: 1px solid var(--dag-border);
  border-radius: var(--dag-radius-md);
  text-align: center;
  font-weight: 800;
  font-size: 14px;
  color: var(--dag-text);
  background: transparent;
  transition: border-color var(--dag-transition), color var(--dag-transition);
}
.inv-card__link:hover .inv-card__more,
.inv-card__link:focus-visible .inv-card__more{
  border-color: rgba(var(--accent-rgb), .55);
  color: var(--dag-primary);
}

/* Мета-блок стал четырёхпольным (цена, пробег, коробка, привод) — прежний
   min-height 84px рассчитывался на два поля в одну строку и теперь мал.
   Строки цены по-прежнему выравниваются между соседними карточками. */
.inv-card__meta.car-card__meta{
  min-height: 152px;
  row-gap: 10px;
}
