/* wp-content/themes/mimgold/assets/css/shop.css
   Shop + product category archives (PLP) — Ascella "shop list with banner" layout.
   Loaded only on WooCommerce archives (inc/enqueue.php). Tokens come from base.css. */

/* ============================== Head + breadcrumb ============================== */
.plp-head { padding-block: 22px 20px; }
.crumbs,
.plp-head .rank-math-breadcrumb {
	font-size: var(--fs-tiny);
	color: var(--muted);
	line-height: 1.8;
}
.crumbs p { margin: 0; }
.crumbs a { transition: color .3s var(--ease); }
.crumbs a:hover { color: var(--ink); }
.crumbs__sep, .crumbs .separator { margin-inline: 6px; opacity: .6; }
.plp-head__title { font-size: var(--fs-h2); margin-block-start: 6px; }

@media (min-width: 1024px) {
	.plp-head { padding-block: 30px 34px; }
}

/* ============================== Banner ============================== */
.plp-banner {
	position: relative;
	isolation: isolate;
	overflow: hidden;
	margin-block-end: 28px;
	background: var(--sand);
	color: #fff;
}
.plp-banner__media { aspect-ratio: 16 / 10; }
.plp-banner__media picture { display: contents; }
.plp-banner__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: 70% 50%;
}
.plp-banner::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 0;
	background: linear-gradient(0deg, rgba(29, 37, 32, .5), rgba(29, 37, 32, .05) 75%);
	pointer-events: none;
}
.plp-banner__content {
	position: absolute;
	inset: 0;
	z-index: 1;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	gap: 12px;
	padding: 20px;
}
/* Same scale as the home hero title (26 / 34 / 42px, bold). */
.plp-banner__title {
	font-size: 26px;
	font-weight: 700;
	line-height: 1.35;
	color: #fff;
	text-wrap: balance;
}
.plp-banner__aside { display: grid; gap: 10px; max-width: 380px; }
.plp-banner__text { font-size: var(--fs-small); line-height: 1.8; }
.plp-banner__link {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 10px;
	justify-self: start;
	padding-block: 4px;
	font-size: var(--fs-small);
	font-weight: 700;
}
.plp-banner__link::before {
	content: "";
	width: 4px;
	height: 4px;
	border-radius: 50%;
	background: currentColor;
}
.plp-banner__link::after {
	content: "";
	position: absolute;
	inset-inline: 14px 0;
	bottom: 0;
	height: 1px;
	background: currentColor;
	transform-origin: right;
	transition: transform .5s var(--ease);
}
.plp-banner__link:hover::after { transform: scaleX(.4); }

@media (min-width: 768px) {
	.plp-banner { margin-block-end: 40px; }
	.plp-banner__media { aspect-ratio: 1300 / 254; min-height: 220px; }
	.plp-banner::after {
		background: linear-gradient(90deg, rgba(29, 37, 32, .28), rgba(29, 37, 32, 0) 45%, rgba(29, 37, 32, 0) 60%, rgba(29, 37, 32, .22));
	}
	.plp-banner__content {
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
		gap: 40px;
		padding-inline: 4%;
	}
	.plp-banner__title { font-size: 34px; }
}
@media (min-width: 1024px) {
	.plp-banner { margin-block-end: 50px; }
	.plp-banner__title { font-size: 42px; }
}

/* ============================== Sub-category capsules ============================== */
.caps {
	margin-block-end: 28px;
	margin-inline: calc(var(--container-pad) * -1);
}
.caps__list {
	display: flex;
	gap: 10px;
	overflow-x: auto;
	padding-inline: var(--container-pad);
	padding-block: 2px;
	scroll-snap-type: x proximity;
	scrollbar-width: none;
	overscroll-behavior-x: contain;
}
.caps__list::-webkit-scrollbar { display: none; }
.caps__list > li { flex: none; scroll-snap-align: start; }
.cap {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	height: 54px;
	padding-inline: 5px 18px;
	border: 1px solid var(--line);
	border-radius: 999px;
	font-size: var(--fs-small);
	white-space: nowrap;
	transition: border-color .3s var(--ease), background-color .3s var(--ease), color .3s var(--ease);
}
.cap:hover { border-color: var(--ink); }
.cap.is-current { background: var(--ink); border-color: var(--ink); color: #fff; }
.cap__img {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	overflow: hidden;
	background: var(--canvas);
	flex: none;
}
.cap__img img, .cap__img .ph { width: 100%; height: 100%; object-fit: cover; }
.cap__img .ico { width: 20px; height: 20px; }

@media (min-width: 1024px) {
	.caps { margin-inline: 0; margin-block-end: 48px; }
	.caps__list { flex-wrap: wrap; padding-inline: 0; overflow: visible; }
}

/* ============================== Layout ============================== */
.plp-layout { display: block; }
.plp-main { min-width: 0; }

@media (min-width: 1024px) {
	.plp-layout {
		display: grid;
		grid-template-columns: 250px minmax(0, 1fr);
		gap: 56px;
		align-items: start;
	}
}
@media (min-width: 1280px) {
	.plp-layout { grid-template-columns: 280px minmax(0, 1fr); gap: 80px; }
}

/* ============================== Sidebar / bottom sheet (Ascella style) ============================== */
.plp-side__head { display: none; }
.plp-side__title { font-size: var(--fs-h3); font-weight: 700; }

/* Product search box */
.psearch {
	position: relative;
	display: flex;
	align-items: center;
	margin-block-end: 40px;
	border: 1px solid var(--line-strong);
	transition: border-color .3s var(--ease);
}
.psearch:focus-within { border-color: var(--ink); }
.psearch__input {
	flex: 1;
	min-width: 0;
	height: 50px;
	padding-inline: 16px 4px;
	border: 0;
	background: none;
	font-size: var(--fs-small);
	outline: none;
	-webkit-appearance: none;
	appearance: none;
}
.psearch__input::placeholder { color: var(--muted); }
.psearch__btn {
	display: grid;
	place-items: center;
	width: 48px;
	height: 48px;
	flex: none;
	color: var(--ink);
}

/* Groups: big plain title, no boxes */
.fgroup {
	margin: 0 0 44px;
	padding: 0;
	border: 0;
	min-width: 0;
}
.fgroup__title {
	display: block;
	padding: 0;
	margin-block-end: 16px;
	font-size: 20px;
	font-weight: 400;
	line-height: 1.4;
	color: var(--ink);
}
.fgroup__title small { font-size: var(--fs-tiny); color: var(--muted); }
/* Short black line under each filter title (client request). */
.fgroup__title::after {
	content: "";
	display: block;
	width: 36px;
	height: 2px;
	margin-block-start: 8px;
	border-radius: 2px;
	background: var(--ink);
}

/* Search inside a long group */
.fsearch {
	position: relative;
	margin-block-end: 10px;
	color: var(--muted);
}
.fsearch__input {
	width: 100%;
	height: 38px;
	padding-inline: 0 26px;
	border: 0;
	border-bottom: 1px solid var(--line-strong);
	border-radius: 0;
	background: none;
	font-size: var(--fs-tiny);
	outline: none;
	-webkit-appearance: none;
	appearance: none;
	transition: border-color .3s var(--ease);
}
.fsearch__input:focus { border-color: var(--ink); }
.fsearch__input::-webkit-search-cancel-button { display: none; }
.fsearch .ico { position: absolute; inset-inline-end: 2px; top: 11px; pointer-events: none; }
.fempty { font-size: var(--fs-tiny); color: var(--muted); padding-block: 6px; }

/* Lists: name + tiny superscript count, selected = ink + underline */
.flist { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.js .flist:not(.is-open):not(.is-searching) > li:nth-child(n+6):not(.is-on) { display: none; }
.flist > li[hidden] { display: none !important; }

.plp-cats a, .fopt {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 10px;
	min-height: 30px;
	font-size: var(--fs-small);
	color: var(--ink-2);
	cursor: pointer;
	transition: color .3s var(--ease);
}
.plp-cats a:hover, .fopt:hover { color: var(--ink); }
.plp-cats a.is-current,
.fopt input:checked ~ .fopt__name {
	color: var(--ink);
	text-decoration: underline;
	text-underline-offset: 6px;
	text-decoration-thickness: 1px;
}
.plp-cats sup, .fopt__count {
	font-size: 10px;
	line-height: 1;
	color: var(--muted);
	margin-inline-start: -4px;
	top: -.5em;
}
.plp-cats a sup { margin-inline-start: 6px; }
.plp-cats--sub { padding-inline-start: 14px; margin-block: 2px 6px; border-inline-start: 1px solid var(--line); }

/* The real checkbox stays focusable but invisible (no box, like Ascella) */
.fopt input {
	position: absolute;
	inset-inline-start: 0;
	top: 50%;
	width: 14px;
	height: 14px;
	margin: -7px 0 0;
	opacity: 0;
}
.fopt input:focus-visible ~ .fopt__name { outline: 2px solid var(--gold); outline-offset: 3px; }

.fopt__swatch {
	flex: none;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: var(--sw, var(--sand));
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06);
	transition: box-shadow .25s var(--ease);
}
.fopt input:checked ~ .fopt__swatch { box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--ink); }

/* "• show more" — dot + underline link */
.fmore {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-block-start: 12px;
	padding-block: 4px;
	font-size: var(--fs-tiny);
	font-weight: 700;
	color: var(--ink);
}
.fmore::before {
	content: "";
	width: 4px;
	height: 4px;
	border-radius: 50%;
	background: currentColor;
}
.fmore::after {
	content: "";
	position: absolute;
	inset-inline: 12px 0;
	bottom: 0;
	height: 1px;
	background: currentColor;
	transform-origin: right;
	transition: transform .5s var(--ease);
}
.fmore:hover::after { transform: scaleX(.4); }

/* Dual range slider: thin ink line with small solid dots */
.range { position: relative; height: 20px; margin-block: 6px 6px; }
.range__track {
	position: absolute;
	inset-inline: 0;
	top: 50%;
	height: 1px;
	transform: translateY(-50%);
	background: var(--line-strong);
}
.range__fill {
	position: absolute;
	inset-block: 0;
	inset-inline: 0;
	background: var(--ink);
}
.range__input {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 20px;
	margin: 0;
	background: none;
	pointer-events: none;
	-webkit-appearance: none;
	appearance: none;
}
.range__input::-webkit-slider-runnable-track { background: none; height: 20px; }
.range__input::-moz-range-track { background: none; }
.range__input::-webkit-slider-thumb {
	-webkit-appearance: none;
	width: 11px;
	height: 11px;
	margin-top: 4.5px;
	border-radius: 50%;
	background: var(--ink);
	border: 0;
	cursor: grab;
	pointer-events: auto;
	transition: transform .2s var(--ease);
}
.range__input::-moz-range-thumb {
	width: 11px;
	height: 11px;
	border-radius: 50%;
	background: var(--ink);
	border: 0;
	cursor: grab;
	pointer-events: auto;
}
.range__input:active::-webkit-slider-thumb { transform: scale(1.3); cursor: grabbing; }
.range__input:focus-visible { outline: none; }
.range__input:focus-visible::-webkit-slider-thumb { outline: 2px solid var(--gold); outline-offset: 2px; }
.range__values {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	font-size: var(--fs-tiny);
	color: var(--ink);
}

.plp-side__foot { display: flex; gap: 10px; flex-wrap: wrap; }
.plp-side__foot .btn { flex: 1; }


/* Mobile/tablet: bottom sheet */
@media (max-width: 1023px) {
	.plp-side {
		position: fixed;
		inset-inline: 0;
		bottom: 0;
		z-index: 80;
		display: flex;
		flex-direction: column;
		max-height: 86vh;
		max-height: 86dvh;
		background: #fff;
		border-radius: var(--r-lg) var(--r-lg) 0 0;
		box-shadow: 0 -20px 50px -20px rgba(29, 37, 32, .3);
		transform: translateY(105%);
		visibility: hidden;
		transition: transform .5s var(--ease-soft), visibility .5s;
	}
	.is-filters-open .plp-side { transform: none; visibility: visible; }
	.plp-side__head {
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding-block: 14px 8px;
		padding-inline: 20px 8px;
		border-bottom: 1px solid var(--line);
	}
	.plp-side__head::before {
		content: "";
		position: absolute;
		top: 6px;
		left: 50%;
		width: 40px;
		height: 4px;
		margin-left: -20px;
		border-radius: 4px;
		background: var(--line-strong);
	}
	.plp-side__body {
		flex: 1;
		overflow-y: auto;
		overscroll-behavior: contain;
		scrollbar-width: none;
		padding: 20px 20px 0;
	}
	.plp-side__foot {
		position: sticky;
		bottom: 0;
		margin-inline: -20px;
		padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
		background: #fff;
		border-top: 1px solid var(--line);
	}
	.plp-side__body::-webkit-scrollbar { display: none; }
	.fgroup { margin-block-end: 30px; }
	.fopt, .plp-cats a { min-height: 40px; }
	.psearch { margin-block-end: 28px; }

	.plp-scrim {
		position: fixed;
		inset: 0;
		z-index: 79;
		background: rgba(29, 37, 32, .35);
		animation: mimg-fade .4s var(--ease);
	}
}

/* Desktop: filters apply instantly with JS, so the submit button is only a no-JS fallback */
@media (min-width: 1024px) {
	/* Sidebar scrolls with the page (no own scrollbar), like Ascella; long lists collapse with "show more". */
	.js .plp-apply { display: none; }
	.plp-scrim { display: none !important; }
}

/* ============================== Toolbar ============================== */
.plp-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px 16px;
	margin-block-end: 20px;
}
.plp-bar__count {
	order: 3;
	width: 100%;
	font-size: var(--fs-tiny);
	color: var(--muted);
}
.plp-bar__filter {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	height: 44px;
	padding-inline: 14px 18px;
	border: 1px solid var(--line-strong);
	border-radius: var(--r-sm);
	font-size: var(--fs-small);
}
.plp-bar__badge {
	display: grid;
	place-items: center;
	min-width: 20px;
	height: 20px;
	padding-inline: 5px;
	border-radius: 999px;
	background: var(--green);
	color: #fff;
	font-size: 11px;
}
.plp-sort { position: relative; display: flex; align-items: center; }
.plp-sort__select {
	height: 44px;
	min-width: 170px;
	padding-inline: 2px 28px;
	border: 0;
	border-bottom: 1px solid var(--ink);
	border-radius: 0;
	background: transparent;
	font-size: var(--fs-small);
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}
.plp-sort .ico {
	position: absolute;
	inset-inline-end: 2px;
	pointer-events: none;
}

@media (min-width: 1024px) {
	.plp-bar { flex-wrap: nowrap; margin-block-end: 22px; }
	.plp-bar__filter { display: none; }
	.plp-bar__count { order: 0; width: auto; font-size: var(--fs-small); color: var(--ink-2); }
	.plp-sort__select { min-width: 200px; }
}

/* Active filter chips */
ul.fchips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0 0 22px; padding: 0; }
.fchip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 34px;
	padding-inline: 14px 10px;
	border-radius: 999px;
	background: var(--canvas);
	font-size: var(--fs-tiny);
	transition: background-color .3s var(--ease);
}
.fchip:hover { background: var(--sand); }

/* ============================== Grid ============================== */
.plp-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 28px 12px;
}
.plp-grid .pcard.is-new { animation: mimg-rise-in .6s var(--ease) both; }

@media (min-width: 768px) {
	.plp-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px 20px; }
}
@media (min-width: 1024px) {
	.plp-grid { gap: 48px 30px; }
}

/* Load more + pagination */
.plp-more-wrap {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 26px;
	margin-block-start: 48px;
}
.plp-more { min-width: 240px; }
.plp-more.is-loading { pointer-events: none; opacity: .6; }
.plp-pages { display: flex; align-items: center; gap: 4px; font-size: var(--fs-small); }
.plp-pages .page-numbers {
	display: grid;
	place-items: center;
	min-width: 36px;
	height: 40px;
	padding-inline: 6px;
	color: var(--muted);
	transition: color .3s var(--ease);
}
.plp-pages a.page-numbers:hover { color: var(--ink); }
.plp-pages .current {
	color: var(--ink);
	text-decoration: underline;
	text-underline-offset: 6px;
}
.plp-pages .prev, .plp-pages .next { color: var(--ink); }

@media (min-width: 1024px) {
	.plp-more-wrap { margin-block-start: 50px; }
}

/* Empty state */
.plp-empty {
	display: grid;
	justify-items: center;
	gap: 12px;
	padding: 60px 20px;
	text-align: center;
	background: var(--canvas);
	color: var(--ink-2);
}
.plp-empty .ico { color: var(--taupe); }
.plp-empty__title { font-size: var(--fs-h3); color: var(--ink); }

/* ============================== Below the grid ============================== */
.plp-related { padding-block-end: var(--section-space-sm); }
.plp-related__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 28px 12px;
}
@media (min-width: 1024px) {
	.plp-related__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 30px; }
}

.plp > .seo-box { margin-block-start: var(--section-space-sm); }

.plp-links__title { font-size: var(--fs-h3); font-weight: 700; margin-block-end: 16px; }
.plp-links__list { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
/* .chip lives in base.css (shared). */

/* WooCommerce notices (WooCommerce CSS is not loaded on archives) */
.woocommerce-notices-wrapper:empty { display: none; }
.woocommerce-message, .woocommerce-info, .woocommerce-error {
	list-style: none;
	margin: 0 0 20px;
	padding: 14px 18px;
	border-radius: var(--r);
	background: var(--canvas);
	font-size: var(--fs-small);
}
.woocommerce-error { background: var(--danger-soft); color: var(--danger); }
.woocommerce-message .button, .woocommerce-info .button { float: inline-end; text-decoration: underline; text-underline-offset: 4px; }
