/**
 * Marketplace product cards (.erm-pn-vendor-cards) + browse archive header.
 * Loaded on global /shop/ / tax archives and store-scoped ?store_id= shop.
 */

/* ── Archive shell ── */
.erm-browse-products-wrap {
	max-width: 100%;
}

.erm-marketplace-browse .erm-browse-products-wrap {
	margin-top: 0.5rem;
}

/* ── Loop header (replaces generic Kadence archive title) ── */
.erm-browse-products-header {
	margin: 0 0 1rem;
	padding: 0;
	border: 0;
}

.erm-browse-products-header .woocommerce-products-header__title {
	margin: 0 0 0.35rem;
	font-size: clamp(1.5rem, 3vw, 1.875rem);
	font-weight: 700;
	line-height: 1.2;
	color: #101828;
	letter-spacing: -0.02em;
}

.erm-browse-products-header .erm-browse-products-header__subtitle {
	margin: 0 0 0.75rem;
	font-size: 0.9375rem;
	line-height: 1.45;
	color: #6b7280;
	max-width: 42rem;
}

.erm-browse-products-header .term-description,
.erm-browse-products-header .page-description {
	margin-top: 0.5rem;
	font-size: 0.875rem;
	color: #4b5563;
}

/* ── Product grid ── */
.erm-pn-vendor-cards ul.products {
	display: grid !important;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1rem 0.85rem;
	list-style: none;
	margin: 0;
	padding: 0;
	width: 100%;
	align-items: stretch;
}

@media (min-width: 600px) {
	.erm-pn-vendor-cards ul.products {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (min-width: 960px) {
	.erm-pn-vendor-cards ul.products {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

.erm-pn-vendor-cards ul.products.products-list-view {
	grid-template-columns: 1fr !important;
}

.erm-pn-vendor-cards ul.products li.product {
	margin: 0 !important;
	width: 100% !important;
	max-width: none !important;
	float: none !important;
	padding: 0;
	list-style: none;
	display: flex;
	flex-direction: column;
}

/* Store-filtered /shop/?store_id= must use the same responsive grid as the main catalogue
 * (2 cols <600px, 3 cols <960px, 4 cols ≥960px). A previous rule here forced 4 columns at all
 * breakpoints with higher specificity than store-shop-archive media queries, causing ultra-narrow cards. */

.erm-store-shop-view .erm-store-shop-grid.is-list {
	grid-template-columns: 1fr !important;
}

/* ═══════════════════════════════════════════════════════════
   Product card
   ═══════════════════════════════════════════════════════════ */

.erm-pn-vendor-cards .pn-vendor-item-card {
	display: flex;
	flex-direction: column;
	min-width: 0;
	height: 100%;
	background: #fff;
	border: 1px solid #e8ecf0;
	border-radius: 14px;
	padding: 10px;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.erm-pn-vendor-cards .pn-vendor-item-card:hover {
	border-color: #dce2e9;
	box-shadow: 0 8px 22px rgba(15, 23, 42, 0.07);
}

/* ── Media ── */
.erm-pn-vendor-cards .pn-vendor-item-card__media {
	position: relative;
	aspect-ratio: 4 / 3;
	width: 100%;
	flex-shrink: 0;
	border-radius: 10px;
	overflow: hidden;
	background: linear-gradient(160deg, #eef1f5 0%, #e2e7ee 100%);
	border: 1px solid rgba(255, 255, 255, 0.85);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.erm-pn-vendor-cards .pn-vendor-item-card__media .pn-vendor-item-card__cover {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

.erm-pn-vendor-cards .pn-vendor-item-card__category-pill {
	position: absolute;
	top: 0.5rem;
	right: 0.5rem;
	z-index: 3;
	max-width: calc(100% - 1rem);
	padding: 0.28rem 0.55rem;
	font-size: 0.625rem;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	text-decoration: none;
	color: #0f172a;
	background: rgba(255, 255, 255, 0.92);
	border: 1px solid rgba(15, 23, 42, 0.08);
	border-radius: 999px;
	box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.erm-pn-vendor-cards .pn-vendor-item-card__category-pill:hover {
	background: #fff;
	border-color: rgba(15, 23, 42, 0.12);
	color: #0f172a;
}

.erm-pn-vendor-cards .pn-vendor-item-card__cover img,
.erm-pn-vendor-cards .pn-vendor-item-card__cover .pn-vendor-item-card__img {
	display: block;
	height: 100%;
	width: 100%;
	object-fit: cover;
}

.erm-pn-vendor-cards .pn-vendor-item-card__placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	min-height: 0;
	background:
		radial-gradient(ellipse 70% 55% at 50% 38%, rgba(255, 255, 255, 0.55) 0%, transparent 50%),
		linear-gradient(168deg, #f6f7fa 0%, #eceff4 45%, #e3e8ef 100%);
}

.erm-pn-vendor-cards .pn-vendor-item-card__placeholder-inner {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.35rem;
	padding: 0.65rem 0.75rem;
	text-align: center;
	max-width: 11rem;
}

.erm-pn-vendor-cards .pn-vendor-item-card__placeholder-frame {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 3.25rem;
	height: 3.25rem;
	margin-bottom: 0.15rem;
	border-radius: 12px;
	border: 1px dashed rgba(100, 116, 139, 0.35);
	background: rgba(255, 255, 255, 0.45);
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.erm-pn-vendor-cards .pn-vendor-item-card__placeholder-icon {
	color: #7c8aa0;
	opacity: 0.88;
	flex-shrink: 0;
}

.erm-pn-vendor-cards .pn-vendor-item-card__placeholder-kicker {
	font-size: 0.625rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #64748b;
	line-height: 1.2;
}

.erm-pn-vendor-cards .pn-vendor-item-card__placeholder-label {
	font-size: 0.75rem;
	font-weight: 500;
	letter-spacing: 0.01em;
	color: #475569;
	line-height: 1.35;
}

.erm-pn-vendor-cards .pn-vendor-item-card__media .pn-vendor-item-card__cover .onsale {
	position: absolute;
	top: 0.5rem;
	left: 0.5rem;
	z-index: 2;
	margin: 0;
	min-height: auto;
	line-height: 1.2;
	font-size: 0.625rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	padding: 0.3rem 0.5rem;
	border-radius: 6px;
	background: #dc2626;
	color: #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

/* ── Body: identity + meta panel ── */
.erm-pn-vendor-cards .pn-vendor-item-card__body {
	display: flex;
	flex-direction: column;
	gap: 0.45rem;
	padding: 0.55rem 2px 0;
	flex: 1 1 auto;
	min-height: 0;
	min-width: 0;
}

.erm-pn-vendor-cards .pn-vendor-item-card__identity {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	padding-bottom: 0;
}

.erm-pn-vendor-cards .pn-vendor-item-card__title-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-start;
	gap: 0.5rem 0.75rem;
	column-gap: 0.75rem;
	row-gap: 0.45rem;
}

.erm-pn-vendor-cards .pn-vendor-item-card__title {
	flex: 1 1 10rem;
	min-width: 0;
	font-size: 0.9375rem;
	font-weight: 600;
	line-height: 1.38;
	margin: 0;
	letter-spacing: -0.015em;
	overflow-wrap: break-word;
	color: #0f172a;
}

.erm-pn-vendor-cards .pn-vendor-item-card__title a {
	color: inherit;
	text-decoration: none;
}

.erm-pn-vendor-cards .pn-vendor-item-card__title a:hover {
	color: #1e40af;
}

.erm-pn-vendor-cards .pn-vendor-item-card__store {
	margin: 0;
	font-size: 0.75rem;
	line-height: 1.35;
	font-weight: 500;
	color: #64748b;
}

.erm-pn-vendor-cards .pn-vendor-item-card__store a {
	color: #4f46e5;
	text-decoration: none;
}

.erm-pn-vendor-cards .pn-vendor-item-card__store a:hover {
	text-decoration: underline;
}

.erm-pn-vendor-cards .pn-vendor-item-card .pn-vendor-item-card__rating {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.28rem;
	margin: 0;
	color: #334155;
	font-size: 0.75rem;
	line-height: 1.3;
}

.erm-pn-vendor-cards .pn-vendor-item-card .pn-product-card-rating__star {
	width: 0.75rem;
	height: 0.75rem;
	color: #f59e0b;
	flex-shrink: 0;
}

.erm-pn-vendor-cards .pn-vendor-item-card .pn-product-card-rating__star svg {
	width: 100%;
	height: 100%;
	display: block;
	fill: currentColor;
}

.erm-pn-vendor-cards .pn-vendor-item-card .pn-product-card-rating__value {
	font-weight: 700;
	color: #1e293b;
}

.erm-pn-vendor-cards .pn-vendor-item-card .pn-product-card-rating__count {
	color: #94a3b8;
	font-weight: 500;
	font-size: 0.6875rem;
}

/* Stock pill: sits beside title in .pn-vendor-item-card__title-row */
.erm-pn-vendor-cards .pn-vendor-item-card__title-row .pn-vendor-item-card__availability {
	display: inline-flex;
	align-items: center;
	flex-shrink: 0;
	margin: 0;
	padding: 0.12rem 0.38rem;
	border-radius: 999px;
	font-size: 0.5625rem;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	color: #64748b;
	background: rgba(248, 250, 252, 0.95);
	border: 1px solid rgba(226, 232, 240, 0.9);
	white-space: nowrap;
}

.erm-pn-vendor-cards .pn-vendor-item-card__title-row .pn-vendor-item-card__availability--in {
	color: #166534;
	background: rgba(220, 252, 231, 0.5);
	border-color: rgba(167, 243, 208, 0.55);
	box-shadow: none;
	font-weight: 600;
}

.erm-pn-vendor-cards .pn-vendor-item-card__availability--out {
	color: #9a3412;
	background: rgba(255, 237, 213, 0.65);
	border-color: rgba(251, 146, 60, 0.4);
}

/* Fulfilment: icon + text rows (no pills) */
.erm-pn-vendor-cards .pn-vendor-item-card__meta--fulfill {
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	box-shadow: none;
}

.erm-pn-vendor-cards .pn-vendor-item-card__fulfill-lines {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
	width: 100%;
}

.erm-pn-vendor-cards .pn-vendor-item-card__fulfill-line {
	display: flex;
	align-items: flex-start;
	gap: 0.4rem;
	margin: 0;
	padding: 0;
	line-height: 1.4;
}

.erm-pn-vendor-cards .pn-vendor-item-card__fulfill-icon {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 1rem;
	height: 1.15rem;
	margin-top: 0.08rem;
	color: #60a5fa;
	opacity: 0.92;
}

.erm-pn-vendor-cards .pn-vendor-item-card__fulfill-icon svg {
	display: block;
	width: 16px;
	height: 16px;
}

.erm-pn-vendor-cards .pn-vendor-item-card__fulfill-text {
	flex: 1 1 auto;
	min-width: 0;
	font-size: 0.8125rem;
	font-weight: 500;
	color: #475569;
	letter-spacing: 0.01em;
	overflow-wrap: break-word;
}

/* ── Purchase block: price + CTA (visually separated from info) ── */
.erm-pn-vendor-cards .pn-vendor-item-card__commerce {
	flex-shrink: 0;
	margin-top: auto;
	padding-top: 0.55rem;
	margin-left: -2px;
	margin-right: -2px;
	padding-left: 2px;
	padding-right: 2px;
	border-top: 1px solid #f1f4f8;
	display: flex;
	flex-direction: column;
	gap: 0.45rem;
	overflow: visible;
}

.erm-pn-vendor-cards .pn-vendor-item-card__price-wrap {
	padding: 0.2rem 0 0.35rem;
	margin-bottom: 0.05rem;
	border-bottom: 1px solid rgba(15, 23, 42, 0.07);
}

.erm-pn-vendor-cards .pn-vendor-item-card__price {
	font-size: 0.6875rem;
	font-weight: 700;
	color: #94a3b8;
	line-height: 1.2;
	margin: 0;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.erm-pn-vendor-cards .pn-vendor-item-card__price:not(:has(del)) .woocommerce-Price-amount,
.erm-pn-vendor-cards .pn-vendor-item-card__price:not(:has(del)) .amount {
	font-size: 1.25rem;
	font-weight: 800;
	color: #0f172a;
	letter-spacing: -0.03em;
	text-transform: none;
	line-height: 1.12;
}

.erm-pn-vendor-cards .pn-vendor-item-card__price del {
	font-size: 0.8125rem;
	font-weight: 500;
	color: #64748b;
	text-transform: none;
	letter-spacing: 0;
	text-decoration-thickness: 1px;
}

.erm-pn-vendor-cards .pn-vendor-item-card__price ins {
	text-decoration: none;
}

.erm-pn-vendor-cards .pn-vendor-item-card__price ins .woocommerce-Price-amount,
.erm-pn-vendor-cards .pn-vendor-item-card__price ins .amount {
	font-size: 1.25rem;
	font-weight: 800;
	color: #dc2626;
	letter-spacing: -0.03em;
	text-transform: none;
	line-height: 1.12;
}

/* Theme filter appends sale % next to price (functions.php erm-price-pct). */
.erm-pn-vendor-cards .pn-vendor-item-card__price .erm-price-pct {
	display: inline-block;
	margin-left: 0.35rem;
	font-size: 0.625rem;
	font-weight: 600;
	letter-spacing: 0.02em;
	color: #94a3b8;
	line-height: 1.2;
	vertical-align: 0.15em;
	white-space: nowrap;
}

.erm-pn-vendor-cards .pn-vendor-item-card__footer.pn-vendor-item-card__cta,
.erm-pn-vendor-cards .pn-vendor-item-card__cta {
	padding: 0;
	margin: 0;
	width: 100%;
}

/* CTA: solid commerce button (override theme/Woo link appearance) */
.erm-pn-vendor-cards .pn-vendor-item-card__commerce a.button,
.erm-pn-vendor-cards .pn-vendor-item-card__commerce a.wp-element-button,
.erm-pn-vendor-cards .pn-vendor-item-card__commerce button.button,
.erm-pn-vendor-cards .pn-vendor-item-card__commerce button.wp-element-button,
.erm-pn-vendor-cards .pn-vendor-item-card__commerce .button {
	box-sizing: border-box !important;
	align-items: center !important;
	appearance: none !important;
	-webkit-appearance: none !important;
	background-color: #111827 !important;
	background-image: none !important;
	border: none !important;
	border-radius: 10px !important;
	color: #fff !important;
	cursor: pointer !important;
	display: inline-flex !important;
	flex-direction: row !important;
	font-size: 0.8125rem !important;
	font-weight: 700 !important;
	gap: 0.45rem !important;
	justify-content: center !important;
	line-height: 1.25 !important;
	min-height: 42px !important;
	padding: 0.65rem 1rem !important;
	text-align: center !important;
	text-decoration: none !important;
	text-transform: none !important;
	width: 100% !important;
	max-width: 100% !important;
	white-space: nowrap !important;
	overflow: visible !important;
	box-shadow: 0 4px 14px rgba(17, 24, 39, 0.16), 0 1px 2px rgba(17, 24, 39, 0.08) !important;
	transition: background-color 0.15s ease, box-shadow 0.15s ease, transform 0.08s ease !important;
}

/* Kadence adds arrow-right-alt after the label; keep spinner/check for AJAX states. */
.erm-pn-vendor-cards .pn-vendor-item-card__commerce a.button .kadence-arrow-right-alt-svg,
.erm-pn-vendor-cards .pn-vendor-item-card__commerce a.wp-element-button .kadence-arrow-right-alt-svg,
.erm-pn-vendor-cards .pn-vendor-item-card__commerce button.button .kadence-arrow-right-alt-svg,
.erm-pn-vendor-cards .pn-vendor-item-card__commerce button.wp-element-button .kadence-arrow-right-alt-svg,
.erm-pn-vendor-cards .pn-vendor-item-card__commerce .button .kadence-arrow-right-alt-svg {
	display: none !important;
}

.erm-pn-vendor-cards .pn-vendor-item-card__commerce a.button::before,
.erm-pn-vendor-cards .pn-vendor-item-card__commerce a.wp-element-button::before,
.erm-pn-vendor-cards .pn-vendor-item-card__commerce button.button::before,
.erm-pn-vendor-cards .pn-vendor-item-card__commerce button.wp-element-button::before,
.erm-pn-vendor-cards .pn-vendor-item-card__commerce .button::before {
	content: "";
	display: block;
	width: 18px;
	height: 18px;
	min-width: 18px;
	min-height: 18px;
	flex-shrink: 0;
	background-repeat: no-repeat;
	background-position: center;
	/* Slightly inset so stroke-based cart art is not clipped on narrow mobile cards */
	background-size: 15px 15px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M6.5 6h15l-2 9H8L6.5 6Z' stroke='white' stroke-width='2' stroke-linejoin='round'/%3E%3Cpath d='M8 6 7.3 3H3' stroke='white' stroke-width='2' stroke-linecap='round'/%3E%3Cpath d='M9.5 21a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z' fill='white'/%3E%3Cpath d='M18 21a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z' fill='white'/%3E%3C/svg%3E");
	opacity: 0.95;
}

@media (max-width: 599px) {
	.erm-pn-vendor-cards .pn-vendor-item-card__commerce a.button,
	.erm-pn-vendor-cards .pn-vendor-item-card__commerce a.wp-element-button,
	.erm-pn-vendor-cards .pn-vendor-item-card__commerce button.button,
	.erm-pn-vendor-cards .pn-vendor-item-card__commerce button.wp-element-button,
	.erm-pn-vendor-cards .pn-vendor-item-card__commerce .button {
		white-space: normal !important;
		text-align: center !important;
		padding-left: 0.55rem !important;
		padding-right: 0.55rem !important;
	}
}

.erm-pn-vendor-cards .pn-vendor-item-card__commerce a.button:hover,
.erm-pn-vendor-cards .pn-vendor-item-card__commerce a.wp-element-button:hover,
.erm-pn-vendor-cards .pn-vendor-item-card__commerce button.button:hover,
.erm-pn-vendor-cards .pn-vendor-item-card__commerce button.wp-element-button:hover,
.erm-pn-vendor-cards .pn-vendor-item-card__commerce .button:hover {
	background-color: #030712 !important;
	color: #fff !important;
	box-shadow: 0 4px 14px rgba(17, 24, 39, 0.28) !important;
}

.erm-pn-vendor-cards .pn-vendor-item-card__commerce a.button:active,
.erm-pn-vendor-cards .pn-vendor-item-card__commerce button.button:active,
.erm-pn-vendor-cards .pn-vendor-item-card__commerce .button:active {
	transform: translateY(1px);
	box-shadow: 0 1px 4px rgba(17, 24, 39, 0.2) !important;
}

.erm-pn-vendor-cards .pn-vendor-item-card__commerce a.button:focus,
.erm-pn-vendor-cards .pn-vendor-item-card__commerce button.button:focus,
.erm-pn-vendor-cards .pn-vendor-item-card__commerce .button:focus {
	outline: 2px solid rgba(99, 102, 241, 0.45) !important;
	outline-offset: 2px !important;
}

.erm-pn-vendor-cards .pn-vendor-item-card__commerce .button.added::after,
.erm-pn-vendor-cards .pn-vendor-item-card__commerce a.button.added::after {
	display: none !important;
}

.erm-pn-vendor-cards .pn-vendor-item-card__commerce .add_to_cart_button.added {
	display: none !important;
}

.erm-pn-vendor-cards .pn-vendor-item-card__commerce .added_to_cart {
	box-sizing: border-box !important;
	align-items: center !important;
	background-color: #111827 !important;
	background-image: none !important;
	border: none !important;
	border-radius: 10px !important;
	color: #fff !important;
	display: inline-flex !important;
	font-size: 0.8125rem !important;
	font-weight: 700 !important;
	gap: 0.45rem !important;
	justify-content: center !important;
	line-height: 1.25 !important;
	min-height: 42px !important;
	padding: 0.65rem 1rem !important;
	text-decoration: none !important;
	width: 100% !important;
	box-shadow: 0 2px 8px rgba(17, 24, 39, 0.22) !important;
}

.erm-pn-vendor-cards .pn-vendor-item-card__commerce .added_to_cart:hover {
	background-color: #030712 !important;
	color: #fff !important;
}

.erm-pn-vendor-cards li.product.outofstock .pn-vendor-item-card__commerce a.button,
.erm-pn-vendor-cards li.product.outofstock .pn-vendor-item-card__commerce a.wp-element-button,
.erm-pn-vendor-cards li.product.outofstock .pn-vendor-item-card__commerce button.button,
.erm-pn-vendor-cards li.product.outofstock .pn-vendor-item-card__commerce .button {
	background-color: #f1f5f9 !important;
	color: #64748b !important;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06) !important;
	border: 1px solid #e2e8f0 !important;
}

.erm-pn-vendor-cards li.product.outofstock .pn-vendor-item-card__commerce a.button::before,
.erm-pn-vendor-cards li.product.outofstock .pn-vendor-item-card__commerce button.button::before,
.erm-pn-vendor-cards li.product.outofstock .pn-vendor-item-card__commerce .button::before {
	opacity: 0.55;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='21' r='1'%3E%3C/circle%3E%3Ccircle cx='20' cy='21' r='1'%3E%3C/circle%3E%3Cpath d='M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6'%3E%3C/path%3E%3C/svg%3E");
}

/* Kadence reimplements WC result count + ordering + grid/list in .kadence-shop-top-row; hide if PHP remove_action misses. */
body.erm-marketplace-browse:not(.erm-store-shop-view) .kadence-shop-top-row {
	display: none !important;
}
