/* Shirtvana Commerce — product archive styles. Tokens match the Elementor kit (doc 14). */
:root {
	--sv-ink: #1B1A18;
	--sv-muted: #5F5A53;
	--sv-sand: #F5F2ED;
	--sv-sand-deep: #EBE5DB;
	--sv-hair: #E2DDD4;
	--sv-red: #C50000;
	--sv-red-hover: #A10000;
}

/* ---------- Elements shared by every product archive (shop, categories, search) ---------- */

.woocommerce ul.products li.product { position: relative; }

.sv-badge {
	position: absolute; top: 10px; left: 10px; z-index: 2;
	background: var(--sv-ink); color: #fff;
	font: 700 10px/1 Inter, sans-serif; letter-spacing: .14em; text-transform: uppercase;
	padding: 6px 8px;
	pointer-events: none;
}

.woocommerce ul.products li.product .sv-card-meta {
	margin: 0 0 4px; font-size: 13px; line-height: 1.4; color: var(--sv-muted);
}

.woocommerce ul.products li.product .price .sv-from {
	font-weight: 400; color: var(--sv-muted); margin-right: 2px;
}

/* ---------- /products/ and product search: layout ---------- */

body.post-type-archive-product .site-main { max-width: 1280px; }

body.post-type-archive-product .page-header .entry-title,
body.post-type-archive-product .woocommerce-products-header__title {
	font-size: clamp(28px, 3.2vw, 40px); line-height: 1.1; letter-spacing: -.01em; margin: 8px 0 12px;
}

.sv-shop-intro { margin: 0 0 28px; }
.sv-shop-lede { margin: 0 0 18px; max-width: 60ch; font-size: 16px; line-height: 1.55; color: var(--sv-muted); }

.sv-chips ul { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
/* Selectors carry .sv-chips ul a to outrank the Elementor kit's global link colour (.elementor-kit-13 a). */
.sv-chips ul a.sv-chip {
	display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px;
	border: 1px solid var(--sv-hair); background: #fff; color: var(--sv-ink);
	font: 700 11px/1 Inter, sans-serif; letter-spacing: .12em; text-transform: uppercase;
	text-decoration: none; white-space: nowrap;
	transition: border-color .15s, background-color .15s, color .15s;
}
.sv-chips ul a.sv-chip:hover, .sv-chips ul a.sv-chip:focus-visible { border-color: var(--sv-ink); background: var(--sv-ink); color: #fff; }

/* Toolbar: count left, sort right, one hairline row */
body.post-type-archive-product .woocommerce-result-count,
body.post-type-archive-product .woocommerce-ordering { margin: 0 0 24px; }
body.post-type-archive-product .sv-count {
	font-size: 13px; line-height: 40px; color: var(--sv-muted); letter-spacing: .02em;
}
body.post-type-archive-product .woocommerce-ordering select {
	min-height: 40px; padding: 0 36px 0 12px;
	border: 1px solid var(--sv-hair); border-radius: 0; background-color: #fff;
	font: 500 14px Inter, sans-serif; color: var(--sv-ink); cursor: pointer;
}
body.post-type-archive-product .woocommerce-ordering select:focus-visible { outline: 2px solid var(--sv-ink); outline-offset: 2px; }

/* Grid (replaces WooCommerce's float layout) */
body.post-type-archive-product .woocommerce ul.products,
body.post-type-archive-product ul.products {
	display: grid !important;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 40px 24px;
	margin: 0 0 40px; padding: 0; clear: both;
}
body.post-type-archive-product ul.products::before,
body.post-type-archive-product ul.products::after { content: none !important; display: none !important; }
body.post-type-archive-product ul.products li.product {
	width: auto !important; margin: 0 !important; float: none !important; padding: 0 !important;
	display: flex; flex-direction: column;
}

/* Card */
body.post-type-archive-product ul.products li.product a.woocommerce-loop-product__link {
	display: block; color: inherit; text-decoration: none;
}
body.post-type-archive-product ul.products li.product a img {
	display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover;
	background: var(--sv-sand); margin: 0 0 14px !important; box-shadow: none;
	transition: filter .2s ease;
}
body.post-type-archive-product ul.products li.product .woocommerce-loop-product__title {
	padding: 0 !important; margin: 0 0 4px;
	font-size: 15px !important; font-weight: 600; line-height: 1.35; color: var(--sv-ink);
	display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
body.post-type-archive-product ul.products li.product .price {
	display: block; margin: 2px 0 0 !important;
	font-size: 15px !important; font-weight: 600; color: var(--sv-ink) !important;
}
body.post-type-archive-product ul.products li.product .price del { color: var(--sv-muted); font-weight: 400; }
body.post-type-archive-product ul.products li.product .price ins { text-decoration: none; color: var(--sv-red); }

@media (hover: hover) {
	body.post-type-archive-product ul.products li.product a:hover img { filter: brightness(.95); }
	body.post-type-archive-product ul.products li.product a:hover .woocommerce-loop-product__title { text-decoration: underline; text-underline-offset: 3px; }
}
body.post-type-archive-product ul.products li.product a:focus-visible { outline: 2px solid var(--sv-ink); outline-offset: 4px; }

/* WooCommerce sale flash, aligned with our badge */
body.post-type-archive-product ul.products li.product .onsale {
	top: 10px !important; left: 10px !important; right: auto !important; margin: 0 !important;
	min-width: 0; min-height: 0; padding: 6px 8px; border-radius: 0;
	background: var(--sv-red); font: 700 10px/1 Inter, sans-serif; letter-spacing: .14em; text-transform: uppercase;
}

/* Load more */
.sv-loadmore { display: flex; flex-direction: column; align-items: center; gap: 12px; margin: 8px auto 56px; max-width: 320px; text-align: center; }
.sv-loadmore__count { margin: 0; font-size: 13px; color: var(--sv-muted); }
.sv-loadmore__bar { width: 100%; height: 2px; background: var(--sv-hair); }
.sv-loadmore__bar span { display: block; height: 100%; background: var(--sv-ink); transition: width .3s ease; }
.sv-loadmore__btn {
	min-height: 48px; padding: 0 32px; border: 1px solid var(--sv-ink); border-radius: 0;
	background: var(--sv-ink); color: #fff; cursor: pointer;
	font: 700 12px/1 Inter, sans-serif; letter-spacing: .14em; text-transform: uppercase;
}
.sv-loadmore__btn:hover { background: #fff; color: var(--sv-ink); }
.sv-loadmore__btn:focus-visible { outline: 2px solid var(--sv-ink); outline-offset: 3px; }
.sv-loadmore__btn[disabled] { opacity: .6; cursor: progress; }
.sv-js-paginated .woocommerce-pagination { display: none; }

/* Tablet */
@media (max-width: 1024px) {
	body.post-type-archive-product ul.products { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px 20px; }
}

/* Mobile */
@media (max-width: 767px) {
	body.post-type-archive-product ul.products { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 12px; }
	body.post-type-archive-product ul.products li.product .woocommerce-loop-product__title { font-size: 14px !important; }
	body.post-type-archive-product ul.products li.product a img { margin-bottom: 10px !important; }
	.sv-shop-lede { font-size: 15px; }
	/* Chips become one swipeable row */
	.sv-chips { margin: 0 -16px; }
	.sv-chips ul { flex-wrap: nowrap; overflow-x: auto; padding: 0 16px 4px; scroll-snap-type: x proximity; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
	.sv-chips ul::-webkit-scrollbar { display: none; }
	.sv-chips li { scroll-snap-align: start; }
	body.post-type-archive-product .woocommerce-result-count,
	body.post-type-archive-product .woocommerce-ordering { margin-bottom: 16px; }
	body.post-type-archive-product .woocommerce-ordering select { max-width: 190px; }
}

@media (prefers-reduced-motion: reduce) {
	.sv-chip, .sv-loadmore__bar span, body.post-type-archive-product ul.products li.product a img { transition: none; }
}
