/**
 * product-card.css — ЄДИНА канон-картка товару (.pc), task #14.
 *
 * Одна ДНК: рамка / радіус / сітка / типографіка / hover. Поля вмикаються
 * per-роль розміткою (template-parts/product-card.php). Unbound scope (працює
 * під будь-яким коренем: архів / головна / стаття / equipment / серія).
 * Читає глобальні --mtsp-* токени (tokens.css @5). Root-клас = .pc.
 *
 * ДНК-дефолти (owner 2026-07-05): radius 8 · image 4/3 contain · gap 20 ·
 * title 15/600 · sku mono 11 · desc 13 clamp-2 · hover accent+(-2px)+тінь ·
 * placeholder «MTS·P».
 *
 * ── ПЕРЕМИКАЧ ТЛА/ПАДІНГУ ФОТО (один рядок) ──
 *   АКТИВНИЙ (owner 2026-07-05): --pc-img-bg: --mtsp-gray-50; --pc-img-pad: 18px
 *                                (сіре тло + рамка-повітря; біле-впритул давало «вліплено»)
 *   РЕЗЕРВ (біле-впритул):       --pc-img-bg: --mtsp-white ; --pc-img-pad: 0
 */
:root {
	--pc-img-bg: var(--mtsp-gray-50);
	--pc-img-pad: 18px;
}

/* ── Сітка ── */
.pc-grid { display: grid; gap: 20px; }
.pc-grid--3 { grid-template-columns: repeat(3, 1fr); }
.pc-grid--4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1024px) {
	.pc-grid--3, .pc-grid--4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
	.pc-grid--3, .pc-grid--4 { grid-template-columns: 1fr; }
}

/* ── Картка ── */
.pc {
	position: relative;
	display: flex; flex-direction: column;
	background: var(--mtsp-white);
	border: 1px solid var(--mtsp-gray-200);
	border-radius: 8px;
	overflow: hidden;
	text-decoration: none; color: inherit;
	transition: border-color .2s, transform .2s, box-shadow .2s;
}
.pc:hover {
	border-color: var(--mtsp-accent);
	transform: translateY(-2px);
	box-shadow: 0 12px 24px -10px rgba(15, 36, 64, 0.16);
}

/* ── Зображення (токен-керований фон/падінг) ── */
/* Фото-зона — absolute-конструкція (2026-07-05): висоту боксу дає ТІЛЬКИ контейнер,
   НЕ img → залізний 4/3 незалежно від natural-пропорції (рамкові 1.231 == чисті 1.454;
   min-content-розпирання зникає, бо img out-of-flow).
   ВИСОТА — через padding-top:75% (4/3), а НЕ aspect-ratio: зв'язка «flex-item +
   aspect-ratio + absolute-only-child» раніше давала overlay-колапс боксу; padding-hack
   дає ЯВНУ висоту, immune до flex-item-квірків (bulletproof, крос-браузерно).
   position:relative — КРИТИЧНО (containing block для absolute-img, інакше overlay на текст).
   img — БЕЗ height:100% (те давало Safari-сквіш): розмір через inset+auto+max+contain. */
.pc-img {
	position: relative;                 /* КРИТИЧНО: без цього absolite-img ляже на текст */
	width: 100%;
	height: 0;
	padding-top: 75%;                   /* 4/3 → залізна висота боксу (не залежить від img) */
	overflow: hidden;
	background: var(--pc-img-bg);
	border-bottom: 1px solid var(--mtsp-gray-100);
}
.pc-img > img {
	position: absolute;
	inset: var(--pc-img-pad);           /* рівний падінг через inset (не padding) */
	width: auto; height: auto;          /* БЕЗ height:100% → Safari не сквішить */
	max-width: calc(100% - 2 * var(--pc-img-pad));
	max-height: calc(100% - 2 * var(--pc-img-pad));
	margin: auto;
	object-fit: contain;
	display: block;
}
.pc-img--ph { background: var(--mtsp-gray-50); }
/* placeholder MTS·P — той самий бокс, absolute-центрований (.pc-img уже не flex) */
.pc-ph-mark {
	position: absolute; inset: 0;
	display: flex; align-items: center; justify-content: center;
	font-family: var(--mtsp-font-display);
	font-size: 19px; font-weight: 700;
	color: var(--mtsp-gray-300);
	letter-spacing: 0.5px;
}
.pc-ph-mark span { color: var(--mtsp-accent); opacity: 0.55; }

/* ── Бейдж (catalog) ── */
.pc-badge {
	position: absolute; top: 12px; left: 12px; z-index: 2;
	font-family: var(--mtsp-font-mono);
	font-size: 10px; font-weight: 700;
	letter-spacing: 0.4px; text-transform: uppercase;
	color: var(--mtsp-accent);
	background: var(--mtsp-white);
	padding: 4px 10px;
	border-radius: 100px;
	box-shadow: 0 1px 3px rgba(15, 36, 64, 0.18);
}

/* ── Тіло ── */
.pc-body { padding: 16px 18px 18px; display: flex; flex-direction: column; flex: 1; }
.pc-sku {
	font-family: var(--mtsp-font-mono);
	font-size: 11px; color: var(--mtsp-gray-400);
	margin-bottom: 6px;
	min-height: 13px; /* тримає sku-слот навіть коли порожньо → foot не стрибає */
}
/* Серія-хаб у related: замість articul — помаранчева пігулка «СЕРІЯ» у sku-слоті. */
.pc-sku-badge {
	display: inline-block;
	font-family: var(--mtsp-font-mono);
	font-size: 10px; font-weight: 700;
	letter-spacing: 0.4px; text-transform: uppercase;
	color: #fff; background: var(--mtsp-accent);
	padding: 2px 8px; border-radius: 100px;
	line-height: 1.2;
}
.pc-title {
	font-size: 15px; font-weight: 600;
	color: var(--mtsp-navy); line-height: 1.35;
	margin: 0 0 12px;
}
.pc:hover .pc-title { color: var(--mtsp-accent); }
.pc-desc {
	font-size: 13px; line-height: 1.55; color: var(--mtsp-gray-600);
	margin: 0 0 14px;
	display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* ── Спека (row-стиль; label опційний) ── */
.pc-spec {
	display: flex; justify-content: space-between; gap: 12px;
	font-size: 12.5px; padding: 6px 0;
	margin-bottom: 14px;
	border-top: 1px dashed var(--mtsp-gray-100);
	border-bottom: 1px dashed var(--mtsp-gray-100);
}
.pc-spec .l { color: var(--mtsp-gray-500); }
.pc-spec .v { color: var(--mtsp-gray-800); font-weight: 700; white-space: nowrap; font-family: var(--mtsp-font-mono); }
.pc-spec .v.range { color: var(--mtsp-navy); }

/* ── Адаптивний suffix (role=related): kW / опис / tagline / порожній-резерв ──
   ФІКСОВАНА min-height = 1 рядок → sku/title/foot на одній лінії незалежно від
   вмісту (kW-картка == порожня-картка). Clamp-1 + ellipsis. БЕЗ dashed-розділювачів. */
.pc-suffix {
	min-height: 1.4em;              /* тримає висоту навіть коли порожньо */
	margin-bottom: 14px;
	font-size: 12.5px;
	line-height: 1.4;
	color: var(--mtsp-gray-600);
	font-family: var(--mtsp-font-body);
	display: -webkit-box;
	-webkit-line-clamp: 1;
	-webkit-box-orient: vertical;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* ── Футер ── */
.pc-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--mtsp-gray-100); }
.pc-price-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.pc-foot:last-child .pc-price-row:last-child { margin-bottom: 0; }
.pc-stock { display: inline-flex; align-items: center; gap: 6px; color: var(--mtsp-green); font-size: 12px; font-weight: 600; white-space: nowrap; }
.pc-stock::before { content: ''; width: 7px; height: 7px; background: var(--mtsp-green); border-radius: 50%; box-shadow: 0 0 0 2.5px rgba(22,163,74,0.16); }
.pc-stock--order { color: var(--mtsp-gray-500); }
.pc-stock--order::before { background: var(--mtsp-gray-400); box-shadow: 0 0 0 2.5px rgba(138,147,163,0.16); }
.pc-vars { font-size: 12px; font-weight: 600; color: var(--mtsp-gray-600); white-space: nowrap; }
.pc-more { font-size: 12.5px; font-weight: 700; color: var(--mtsp-accent); white-space: nowrap; }
.pc-cta {
	display: flex; align-items: center; justify-content: center; gap: 8px;
	width: 100%; padding: 11px;
	background: var(--mtsp-navy); color: var(--mtsp-white);
	border-radius: 6px;
	font-size: 12.5px; font-weight: 700;
	transition: background .2s;
}
.pc:hover .pc-cta { background: var(--mtsp-navy-light); }

/* ── Ціна з mtsp_render_price() всередині .pc ── */
.pc .mtsp-card-price { margin: 0; font-family: var(--mtsp-font-body); font-size: 13px; font-weight: 700; color: var(--mtsp-navy); }
.pc .mtsp-card-price--ask { font-size: 13px; font-weight: 700; font-style: normal; color: var(--mtsp-gray-600); }
