/* Module: Product Listing. */
.product-listing { padding-top: var(--gap-l); padding-bottom: var(--gap-l); }
.product-listing__heading { margin-bottom: 40px; }

.product-listing__layout { display: block; }
.product-listing--has-filter .product-listing__layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 48px; align-items: start; }
/* Desktop: the filter sticks below the fixed header while the products scroll; scrolls itself if taller than the screen. */
@media (min-width: 992px) {
	.product-listing__aside {
		--pl-sticky-top: 134px; /* Fixed header (~110px) + breathing room. */
		position: sticky;
		top: var(--pl-sticky-top);
		max-height: calc(100vh - var(--pl-sticky-top) - 24px);
		overflow-y: auto;
		scrollbar-width: thin;
	}
	body.admin-bar .product-listing__aside { --pl-sticky-top: 166px; }
}

/* Toolbar: result count + sort, right-aligned above the grid. */
.product-listing__toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 12px 24px; margin-bottom: 24px; }
.product-listing__count { margin: 0; font-size: 15px; color: var(--skin-dark); }
.pl-sort { display: flex; align-items: center; gap: 10px; margin: 0; }
.pl-sort__label { font-size: 15px; color: var(--skin-dark-60); white-space: nowrap; }
.pl-sort__select {
	height: 40px; padding: 0 36px 0 14px;
	border: 1px solid var(--skin-grey-20); border-radius: 10px;
	background: var(--skin-white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2301A99D' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 14px center;
	font: inherit; font-size: 15px; color: var(--skin-dark-60);
	appearance: none; -webkit-appearance: none; cursor: pointer;
}
.pl-sort__select:focus { outline: none; border-color: var(--skin-teal); }
.pl-sort.is-auto .pl-sort__apply { display: none; }

.product-listing__grid { display: grid; gap: 24px; }
.product-listing__grid--cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.product-listing__grid--cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.product-listing__grid--cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* Filter sidebar. */
.pl-filter__title {
	list-style: none;
	cursor: default;
	margin-bottom: 24px;
	font-family: var(--font-heading);
	font-weight: 500;
	font-size: 18px;
	color: var(--skin-dark-60);
}
.pl-filter__title::-webkit-details-marker { display: none; }
.pl-filter__group { border: none; margin: 0 0 28px; padding: 0; min-width: 0; }
.pl-filter__legend { padding: 0; margin-bottom: 16px; font-weight: 500; font-size: 15px; color: var(--skin-dark-60); }
.pl-filter__option { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: 15px; line-height: 1.2; color: var(--skin-dark); cursor: pointer; }
.pl-filter__option--depth-1 { padding-left: 20px; }
.pl-filter__option--depth-2 { padding-left: 40px; }
.pl-filter__option--depth-3 { padding-left: 60px; }
.pl-filter__option input { width: 18px; height: 18px; margin: 0; flex-shrink: 0; accent-color: var(--skin-teal); cursor: pointer; }
/* Search box: top of the filter column */
.pl-search { position: relative; margin: 0 0 28px; }
.pl-search .screen-reader-text { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.pl-search__icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-size: 14px; color: var(--skin-teal); pointer-events: none; }
.pl-search__input { width: 100%; height: 44px; padding: 0 40px 0 38px; border: 1px solid var(--skin-grey-20); border-radius: 10px; background: var(--skin-white); font: inherit; font-size: 15px; color: var(--skin-dark-60); }
.pl-search__input::placeholder { color: var(--skin-dark); opacity: .7; }
.pl-search__input:focus { outline: none; border-color: var(--skin-teal); }
.pl-search__input::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
.pl-search__clear { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--skin-dark); font-size: 14px; cursor: pointer; }
.pl-search__clear[hidden] { display: none; }
.pl-search__clear:hover, .pl-search__clear:focus-visible { color: var(--skin-teal); outline: none; }
/* Search + Clear CTAs */
.pl-filter__actions { display: flex; align-items: center; gap: 12px; }
.pl-filter__details { margin-bottom: 24px; }
.pl-filter__details .pl-filter__group { margin-bottom: 0; }

/* Card. */
.pl-card { display: flex; flex-direction: column; background: var(--skin-white); border: 1px solid var(--skin-grey-20); border-radius: 20px; overflow: hidden; transition: border-color 0.2s; }
.pl-card:hover { border-color: var(--skin-teal); }
/* Image sits inside a light grey frame. */
.pl-card__media-wrap { position: relative; padding: 16px 16px 0; background: var(--skin-white); }
.pl-card__media { display: flex; align-items: center; justify-content: center; aspect-ratio: 4 / 2.9; overflow: hidden; background: var(--skin-white); }
.pl-card__media img { width: 100%; height: 100%; object-fit: cover; }
.pl-card__placeholder { font-size: 13px; font-style: italic; color: var(--skin-dark); }
.pl-card__body { display: flex; flex-direction: column; flex: 1; padding: 24px 20px 20px; }
.pl-card__title { margin: 0; font-size: 22px; line-height: 30px; }
.pl-card__title a { color: var(--skin-dark-60); text-decoration: none; }
.pl-card__title a:hover { color: var(--skin-teal); }
/* Category tag sits over the image, top-left. */
.pl-card__category {
	position: absolute; top: 24px; left: 24px; right: 24px; 
	width: fit-content; margin: 0;
	padding: 6px 18px; 
	pointer-events: none; min-width: 80px; text-align: center;
	background: var(--skin-white);
	color: var(--skin-teal);
	font-family: var(--font-heading);
	font-weight: 500;
	font-size: 13px;
	border-radius: 25px;
	box-shadow: inset 0 -2px 15px rgba(0,0,0,0.2), inset 0 2px 15px rgba(1,169,157,0.25);
}
.pl-card__summary { margin: 16px 0 0; font-size: 14px; line-height: 21px; color: var(--skin-dark); }
/* colour dots: round swatches; hover/focus = ring */
.pl-card__colours { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; padding: 0; list-style: none; }
.pl-card__colour { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; overflow: hidden; box-shadow: 0 0 0 1px var(--skin-grey-20); transition: box-shadow 0.2s; }
.pl-card__colour img { width: 100%; height: 100%; object-fit: cover; display: block; transform: scale(1.45); } /* zoom past the swatch photo's own rounded corners so the dot is a true circle */
.pl-card__colour:hover, .pl-card__colour:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--skin-white), 0 0 0 4px var(--skin-dark-60); }
.pl-card__colour--more { font-size: 12px; font-weight: 500; color: var(--skin-dark-60); text-decoration: none; background: var(--skin-grey-20); }
.pl-card__footer { display: flex; align-items: center; gap: 20px; margin-top: auto; padding-top: 18px; border-top: 1px solid var(--skin-grey-20); }
.pl-card__text { margin-bottom: 20px; }
.pl-card__doc { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 400; color: var(--skin-dark-60); text-decoration: none; }
.pl-card__doc:hover { color: var(--skin-teal); }
.pl-card__doc i { font-size: 16px; }
.pl-card__more { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; font-size: 15px; font-weight: 500; color: var(--skin-dark-60); text-decoration: none; white-space: nowrap; }
.pl-card__more i { font-size: 12px; transition: transform 0.2s; }
.pl-card__more:hover { color: var(--skin-teal); }
.pl-card__more:hover i { transform: translateX(3px); }

/* Responsive. */
@media (max-width: 1280px) {
	.product-listing__grid--cols-4 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1024px) {
	.product-listing__grid--cols-3,
	.product-listing__grid--cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 991.98px) {
	.product-listing--has-filter .product-listing__layout { grid-template-columns: 1fr; gap: 24px; }
	.pl-filter__details { border: 1px solid var(--skin-grey-20); border-radius: 12px; padding: 16px; margin-bottom: 20px; }
	.pl-search { margin-bottom: 16px; }
	.pl-filter__title { cursor: pointer; margin-bottom: 0; display: flex; justify-content: space-between; }
	.pl-filter__title::after { content: "+"; font-size: 20px; line-height: 1; }
	.pl-filter__details[open] .pl-filter__title { margin-bottom: 20px; }
	.pl-filter__details[open] .pl-filter__title::after { content: "\2212"; }
	.product-listing__toolbar { justify-content: space-between; }
}
@media (max-width: 767.98px) {
	.product-listing__grid--cols-2,
	.product-listing__grid--cols-3,
	.product-listing__grid--cols-4 { grid-template-columns: 1fr; }
}

/* Product Group archive (taxonomy-product_group.php): header sits directly above the listing. */
.product-group-archive__intro { padding-bottom: 0; }
.product-group-archive__intro + .product-listing { padding-top: 40px; }
