/**
 * HD Product Cards — 01 Mil-Spec
 * Scoped to .hd-ms. Tokens resolved by the plugin (defaults → hd_card_theme
 * filter → shortcode attrs) and printed as an inline .hd-ms{} block.
 * Values below are fallbacks matching the style defaults.
 */

.hd-ms {
	--hd-ms-accent: #e8a33d;
	--hd-ms-bg: #121316;
	--hd-ms-line: #2c2e33;
	--hd-ms-line-hover: #4a4d55;
	--hd-ms-ink: #eceef1;
	--hd-ms-ink-dim: #9fa2aa;
	--hd-ms-ink-faint: #6f7178;
	--hd-ms-font-display: 'Chakra Petch', sans-serif;
	--hd-ms-font-mono: 'JetBrains Mono', monospace;

	position: relative;
	background: var(--hd-ms-bg);
	border: 1px solid var(--hd-ms-line);
	font-family: var(--hd-ms-font-display);
	overflow: hidden;
	transition: border-color .3s ease, transform .3s ease;
	height: 100%;
	display: flex;
	flex-direction: column;
}
.hd-ms:hover {
	border-color: var(--hd-ms-line-hover);
	transform: translateY(-4px);
}

/* ---- Corner brackets ------------------------------------------------ */
.hd-ms::before, .hd-ms::after,
.hd-ms__corner::before, .hd-ms__corner::after {
	content: "";
	position: absolute;
	width: 14px; height: 14px;
	border-color: var(--hd-ms-accent);
	border-style: solid;
	border-width: 0;
	transition: width .25s ease, height .25s ease;
	z-index: 3;
	pointer-events: none;
}
.hd-ms::before        { top: -1px;    left: -1px;  border-top-width: 2px;    border-left-width: 2px; }
.hd-ms::after         { top: -1px;    right: -1px; border-top-width: 2px;    border-right-width: 2px; }
.hd-ms__corner::before{ bottom: -1px; left: -1px;  border-bottom-width: 2px; border-left-width: 2px; }
.hd-ms__corner::after { bottom: -1px; right: -1px; border-bottom-width: 2px; border-right-width: 2px; }
.hd-ms:hover::before, .hd-ms:hover::after,
.hd-ms:hover .hd-ms__corner::before, .hd-ms:hover .hd-ms__corner::after {
	width: 26px; height: 26px;
}

/* ---- Topline: SKU + stock ------------------------------------------- */
.hd-ms__topline {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 10px;
	padding: 10px 14px;
	border-bottom: 1px solid var(--hd-ms-line);
	font-family: var(--hd-ms-font-mono);
	font-size: 10px;
	letter-spacing: .14em;
	color: var(--hd-ms-ink-faint);
	text-transform: uppercase;
	white-space: nowrap;
}
.hd-ms__sku { overflow: hidden; text-overflow: ellipsis; }
.hd-ms__stock { display: inline-flex; align-items: center; flex-shrink: 0; }
.hd-ms__dot {
	width: 6px; height: 6px;
	border-radius: 50%;
	margin-right: 6px;
	background: #3fbf6f;
	box-shadow: 0 0 6px rgba(63,191,111,.7);
}
.hd-ms__stock.is-backorder .hd-ms__dot { background: #d9a13b; box-shadow: 0 0 6px rgba(217,161,59,.7); }
.hd-ms__stock.is-oos       .hd-ms__dot { background: #c24a3f; box-shadow: 0 0 6px rgba(194,74,63,.7); }

/* ---- Image ------------------------------------------------------------ */
.hd-ms__img {
	position: relative;
	display: block;
	aspect-ratio: 4 / 3;
	background: radial-gradient(ellipse at 50% 42%, #1c1e22 0%, #101114 70%);
	border-bottom: 1px solid var(--hd-ms-line);
	overflow: hidden;
}
.hd-ms__img img {
	transition: transform .4s ease;
}
.hd-ms:hover .hd-ms__img img { transform: scale(1.05); }

.hd-ms__badge {
	position: absolute;
	top: 12px; left: 12px;
	z-index: 2;
	font-family: var(--hd-ms-font-mono);
	font-size: 10px;
	letter-spacing: .12em;
	color: #0b0c0e;
	background: var(--hd-ms-accent);
	padding: 4px 8px;
}

/* ---- Body -------------------------------------------------------------- */
.hd-ms__body {
	padding: 18px 16px 16px;
	display: flex;
	flex-direction: column;
	flex-grow: 1;
}
.hd-ms__cat {
	font-family: var(--hd-ms-font-mono);
	font-size: 10px;
	letter-spacing: .18em;
	color: var(--hd-ms-ink-faint);
	text-transform: uppercase;
	margin-bottom: 6px;
}
.hd-ms__title {
	font-size: 17px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: .03em;
	line-height: 1.3;
	margin: 0 0 14px;
	/* Deterministic height: always reserve exactly 2 lines */
	min-height: 2.6em;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.hd-ms__title a {
	color: var(--hd-ms-ink);
	text-decoration: none;
	transition: color .2s ease;
}
.hd-ms__title a:hover { color: var(--hd-ms-accent); }

.hd-ms__specs {
	display: flex;
	flex-wrap: wrap;
	align-content: flex-start;
	gap: 6px;
	margin-bottom: 16px;
	/* Deterministic height: exactly 2 chip rows (2×20px + 6px gap),
	   whether a product has 0, 1, or 5 attributes */
	height: 46px;
	overflow: hidden;
}
.hd-ms__specs span {
	font-family: var(--hd-ms-font-mono);
	font-size: 10px;
	line-height: 1.2;
	letter-spacing: .06em;
	color: var(--hd-ms-ink-dim);
	border: 1px solid var(--hd-ms-line);
	padding: 3px 8px;
	text-transform: uppercase;
	height: 20px;
	box-sizing: border-box;
	white-space: nowrap;
}

/* ---- Footer: price + CTA ------------------------------------------------ */
.hd-ms__footer {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	border-top: 1px solid var(--hd-ms-line);
	padding-top: 14px;
	margin-top: auto;
}
.hd-ms__price {
	font-family: var(--hd-ms-font-mono);
	font-size: 18px;
	font-weight: 700;
	color: var(--hd-ms-accent);
	line-height: 1.2;
}
.hd-ms__price del {
	font-size: 12px;
	font-weight: 400;
	color: #5c5e65;
	margin-right: 8px;
}
.hd-ms__price del .amount { color: inherit; }
.hd-ms__price ins { text-decoration: none; }

.hd-ms .hd-ms__btn,
.hd-ms .hd-ms__btn.button {
	font-family: var(--hd-ms-font-display);
	font-size: 11px;
	font-weight: 600;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--hd-ms-ink);
	background: transparent;
	border: 1px solid var(--hd-ms-line-hover);
	border-radius: 0;
	padding: 9px 16px;
	line-height: 1;
	cursor: pointer;
	text-decoration: none;
	transition: all .25s ease;
	white-space: nowrap;
}
.hd-ms .hd-ms__btn:hover {
	background: var(--hd-ms-accent);
	border-color: var(--hd-ms-accent);
	color: #0b0c0e;
}
.hd-ms .hd-ms__btn--ghost { opacity: .55; }


/* ---- A11y / motion ----------------------------------------------------- */
.hd-ms a:focus-visible,
.hd-ms .hd-ms__btn:focus-visible {
	outline: 2px solid var(--hd-ms-accent);
	outline-offset: 2px;
}
