/**
 * Shop archive layout — sidebar + toolbar + 4-column product grid + pagination.
 *
 * Design ref: Figma Product Listing page (1061:2283)
 */

.shop-archive {
	width: 100%;
	padding: 0 0 var(--shop-archive-pad-y);
	background: var(--color-white);
	box-sizing: border-box;
}

.shop-archive__layout {
	width: min(var(--shop-archive-max), calc(100% - (2 * var(--section-inline-pad))));
	max-width: var(--shop-archive-max);
	margin: var(--shop-archive-pad-y) auto 0;
	box-sizing: border-box;
}

/*
 * Sidebar / toolbar / grid — Figma: the toolbar row sits ABOVE the sidebar
 * and product grid, which both start at the same y (508). Sidebar and
 * toolbar are independent grid siblings (not nested) so the sidebar's top
 * aligns with the grid's top, not the toolbar's.
 */
.shop-archive__inner {
	display: grid;
	grid-template-columns: var(--shop-sidebar-width) minmax(0, 1fr);
	grid-template-rows: auto 1fr;
	column-gap: var(--shop-archive-gap);
	row-gap: 0;
	align-items: start;
}

.shop-filters {
	grid-column: 1;
	grid-row: 2;
}

.shop-archive__main {
	grid-column: 2;
	grid-row: 2;
	display: flex;
	flex-direction: column;
	min-width: 0;
}

/* Toolbar */
.shop-toolbar {
	grid-column: 2;
	grid-row: 1;
	margin-bottom: var(--shop-toolbar-gap);
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
}

.shop-toolbar__count {
	margin: 0;
	font-family: var(--font-body);
	font-size: 14px;
	font-weight: 500;
	line-height: 22px;
	color: var(--color-body-80);
}

/* Sort By — Figma 124×40; extracted: padding 10 16, gap 17, Montserrat 400 / 0.1em */
.shop-toolbar__sort {
	position: relative;
	display: flex;
	flex-direction: row;
	align-items: center;
	box-sizing: border-box;
	width: var(--shop-sort-width);
	height: var(--shop-sort-height);
	padding: var(--shop-sort-padding);
	gap: var(--shop-sort-gap);
	background: var(--color-white);
	border: 1px solid var(--color-border-category); /* #FEE7BD */
	border-radius: var(--radius-category-card); /* 6px */
	flex-shrink: 0;
}

.shop-toolbar__sort-label {
	order: 0;
	flex: 0 0 60px;
	width: 60px;
	height: 17px;
	margin: 0;
	font-family: var(--font-lang); /* Montserrat — per Figma export */
	font-weight: 400;
	font-size: 14px;
	line-height: 17px;
	letter-spacing: var(--shop-sort-label-tracking);
	color: #000000;
	white-space: nowrap;
	pointer-events: none;
}

.shop-toolbar__sort-icon {
	order: 1;
	display: flex;
	flex: 0 0 20px;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 20px;
	pointer-events: none;
}

.shop-toolbar__sort-icon img {
	display: block;
	width: 20px;
	height: 20px;
}

.shop-toolbar__select {
	position: absolute;
	inset: 0;
	z-index: 1;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	opacity: 0;
	cursor: pointer;
	appearance: none;
	font-size: 16px; /* avoid iOS zoom on focus */
}

.shop-toolbar__select:disabled {
	cursor: default;
}

.shop-toolbar__sort:has(.shop-toolbar__select:focus-visible) {
	outline: 2px solid var(--color-accent);
	outline-offset: 2px;
}

/* Results grid — Figma: 4 × 238.5px cards, 24px gap, under 1026px main column */
.shop-results__grid {
	display: grid;
	grid-template-columns: repeat(4, var(--shop-card-width));
	justify-content: start;
	gap: var(--shop-grid-gap);
	align-items: start;
	width: 100%;
	list-style: none;
	margin: 0;
	padding: 0;
}

.shop-results.is-loading {
	opacity: 0.55;
	pointer-events: none;
	transition: opacity 0.2s ease;
}

.shop-results__empty {
	padding: 48px 0;
	text-align: center;
	font-family: var(--font-body);
	color: var(--color-body-76);
}

/* Shop product card — Figma fixed 238.5 × (308.05 image + 162.55 info) */
.shop-results .product-card--shop {
	display: flex;
	flex-direction: column;
	width: var(--shop-card-width);
	max-width: 100%;
	height: calc(var(--shop-card-image-height) + var(--shop-card-info-height));
	margin: 0;
	background: none;
	border: none;
	border-radius: var(--radius-product-card);
	overflow: hidden;
	box-sizing: border-box;
}

.shop-results .product-card--shop .featured-products__image {
	position: relative;
	flex-shrink: 0;
	width: 100%;
	height: var(--shop-card-image-height); /* 308.05px — identical every card */
	background: var(--color-bg-product-image); /* #FAF6F3 — Figma image-frame fill */
}

.shop-results .product-card--shop .featured-products__image-link {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
}

.shop-results .product-card--shop .featured-products__image-link img,
.shop-results .product-card--shop .featured-products__img {
	display: block;
	max-width: 100%;
	max-height: 100%;
}

/* NEW badge — Figtree 700 ~13.2 / uppercase / #B17915 — top-left, identical every card */
.shop-results .product-card--shop .featured-products__badge {
	top: 14px;
	left: 14px;
	font-family: var(--font-body);
	font-size: var(--shop-card-badge-size);
	font-weight: 700;
	line-height: var(--shop-card-badge-lh);
	letter-spacing: -0.01em;
	text-transform: uppercase;
	color: var(--color-accent);
}

/*
 * Wishlist PLP — mdi-light:heart via YITH, fill #918268.
 * Size 26.404×26.404 (Figma) — larger than Home’s 24px by design.
 */
.shop-results .product-card--shop .featured-products__image .yith-wcwl-add-to-wishlist {
	top: 8.8px; /* Figma: mdi-light:heart top:8.8 */
	right: 21.77px; /* Figma: card 238.5 − icon left:190.33 − icon width:26.4 */
}

.shop-results .product-card--shop .featured-products__image .yith-wcwl-add-to-wishlist a,
.shop-results .product-card--shop .featured-products__image .yith-wcwl-add-to-wishlist a:link,
.shop-results .product-card--shop .featured-products__image .yith-wcwl-add-to-wishlist a:visited {
	width: var(--shop-card-wishlist-size);
	height: var(--shop-card-wishlist-size);
}

.shop-results .product-card--shop .featured-products__image .yith-wcwl-add-to-wishlist a.add_to_wishlist > img,
.shop-results .product-card--shop .featured-products__image .yith-wcwl-add-to-wishlist a.delete_item > img,
.shop-results .product-card--shop .featured-products__image .yith-wcwl-add-to-wishlist a.move_to_another_wishlist > img,
.shop-results .product-card--shop .featured-products__image .yith-wcwl-add-to-wishlist .yith-wcwl-icon,
.shop-results .product-card--shop .featured-products__image .yith-wcwl-add-to-wishlist .yith-wcwl-icon-svg,
.shop-results .product-card--shop .featured-products__image .yith-wcwl-add-to-wishlist svg,
.shop-results .product-card--shop .featured-products__image .yith-wcwl-add-to-wishlist img {
	width: var(--shop-card-wishlist-size);
	height: var(--shop-card-wishlist-size);
	max-width: var(--shop-card-wishlist-size);
}

.shop-results .product-card--shop .featured-products__content {
	display: flex;
	flex-direction: column;
	flex: 0 0 var(--shop-card-info-height);
	width: 100%;
	height: var(--shop-card-info-height); /* identical every card */
	gap: var(--shop-card-info-gap); /* 17.6px between every row incl. rating → ATC */
	padding: var(--shop-card-info-pad); /* 15.4px */
	box-sizing: border-box;
	overflow: hidden;
}

.shop-results .product-card--shop .featured-products__name,
.shop-results .product-card--shop .featured-products__name:link,
.shop-results .product-card--shop .featured-products__name:visited {
	display: -webkit-box;
	-webkit-line-clamp: 1;
	-webkit-box-orient: vertical;
	overflow: hidden;
	margin: 0;
	font-family: var(--font-body);
	font-size: var(--shop-card-name-size); /* 15.4px */
	font-weight: 600;
	line-height: 1.2;
	color: var(--color-product-name); /* #212121 */
	opacity: 0.98;
	text-decoration: none;
}

.shop-results .product-card--shop .featured-products__price {
	margin: 0;
	font-family: var(--font-body);
	font-size: var(--shop-card-name-size);
	font-weight: 700;
	line-height: 1.2;
	color: var(--color-product-price); /* #171717 */
}

.shop-results .product-card--shop .featured-products__rating {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 0;
}

.shop-results .product-card--shop .featured-products__stars {
	display: flex;
	align-items: center;
	gap: var(--shop-card-star-gap); /* 2.2px */
	color: var(--color-star); /* #C08817 */
}

.shop-results .product-card--shop .featured-products__star {
	width: var(--shop-card-star-w); /* 14.67px */
	height: var(--shop-card-star-h); /* 13.94px */
}

.shop-results .product-card--shop .featured-products__reviews {
	font-family: var(--font-body);
	font-size: var(--shop-card-review-size); /* 13.2px */
	font-weight: 500;
	line-height: 1.2;
	letter-spacing: 0.03em;
	color: var(--color-product-name); /* #212121 */
}

/* PLP Add to Cart — outline gold (Figma). Not a WooCommerce `.button`. */
.woocommerce .shop-results a.product-card__add-to-cart,
.woocommerce-page .shop-results a.product-card__add-to-cart,
.shop-results a.product-card__add-to-cart,
.shop-results a.product-card__add-to-cart:link,
.shop-results a.product-card__add-to-cart:visited,
a.product-card__add-to-cart,
a.product-card__add-to-cart:link,
a.product-card__add-to-cart:visited {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	box-sizing: border-box;
	width: 100%;
	max-width: var(--shop-card-atc-width); /* 208px — fills ~238.5 − 2×15.4 pad */
	height: var(--shop-card-atc-height); /* 43px */
	min-height: var(--shop-card-atc-height);
	margin-top: 0; /* spacing now comes from .featured-products__content's gap */
	padding: 10px;
	border: 1px solid var(--color-accent); /* #B17915 */
	border-radius: var(--radius-category-card); /* 6px */
	background: transparent;
	background-image: none;
	box-shadow: none;
	text-shadow: none;
	font-family: var(--font-body);
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	text-decoration: none;
	color: var(--color-accent);
	opacity: 1;
	filter: none;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.woocommerce .shop-results a.product-card__add-to-cart:hover,
.woocommerce .shop-results a.product-card__add-to-cart:focus,
.woocommerce-page .shop-results a.product-card__add-to-cart:hover,
.woocommerce-page .shop-results a.product-card__add-to-cart:focus,
.shop-results a.product-card__add-to-cart:hover,
.shop-results a.product-card__add-to-cart:focus,
a.product-card__add-to-cart:hover,
a.product-card__add-to-cart:focus {
	background: var(--color-accent);
	background-image: none;
	border-color: var(--color-accent);
	box-shadow: none;
	color: var(--color-white);
	outline: none;
}

.product-card__cart-icon {
	display: block;
	flex-shrink: 0;
	width: 24px;
	height: 24px;
	color: inherit;
	fill: none;
	stroke: currentColor;
}

/* Pagination — Figma gold active square */
.shop-results .woocommerce-pagination {
	margin-top: 40px;
	text-align: center;
}

.shop-results .woocommerce-pagination ul {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	margin: 0;
	padding: 0;
	list-style: none;
	border: 0;
}

.shop-results .woocommerce-pagination ul li {
	margin: 0;
	border: 0;
	overflow: visible;
}

.shop-results .woocommerce-pagination ul li a,
.shop-results .woocommerce-pagination ul li span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 37px;
	height: 31px;
	padding: 0 10px;
	border: 0 !important;
	border-radius: var(--radius-button);
	background: transparent;
	font-family: var(--font-body);
	font-size: 14px;
	font-weight: 500;
	line-height: 1;
	color: var(--color-heading) !important;
	text-decoration: none;
}

.shop-results .woocommerce-pagination ul li span.current {
	background: var(--color-accent) !important;
	color: var(--color-white) !important;
}

.shop-results .woocommerce-pagination ul li a:hover,
.shop-results .woocommerce-pagination ul li a:focus {
	background: var(--color-bg-cream-2);
	color: var(--color-accent) !important;
	outline: none;
}

.shop-results .woocommerce-pagination .shop-pagination-arrow {
	display: block;
	width: 20px;
	height: 20px;
}

.shop-results .woocommerce-pagination .shop-pagination-arrow--next {
	transform: rotate(180deg);
}

@media (max-width: 1199px) {
	.shop-results__grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		justify-content: stretch;
	}

	.shop-results .product-card--shop {
		width: 100%;
		height: auto;
	}

	.shop-results .product-card--shop .featured-products__content {
		flex: 1 1 auto;
		height: auto;
		min-height: var(--shop-card-info-height);
	}
}

@media (max-width: 991px) {
	.shop-archive__inner {
		grid-template-columns: 1fr;
		grid-template-rows: auto auto;
		gap: 28px;
	}

	.shop-filters,
	.shop-toolbar,
	.shop-archive__main {
		grid-column: 1;
	}

	.shop-toolbar {
		grid-row: 1;
		margin-bottom: 0;
	}

	.shop-archive__main {
		grid-row: 2;
	}

	.shop-results__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.shop-results .product-card--shop .featured-products__image {
		height: 240px;
	}
}

@media (max-width: 575px) {
	.shop-archive__layout {
		width: min(var(--shop-archive-max), calc(100% - 32px));
		margin-top: 24px;
	}

	.shop-results__grid {
		grid-template-columns: 1fr;
		gap: 16px;
	}

	.product-card__add-to-cart {
		max-width: none;
	}
}
