/* ==========================================================================
   1.8.388 — Shop page + product category/tag archives (body.idx-shop-archive).
   Left category sidebar (sticky; slide-in drawer under 1024px), toolbar, card grid, pagination.
   Markup: woocommerce.php + inc/shop-archive.php. Buttons follow the cart page (.idxcart-btn).
   ========================================================================== */
.idx-shop-archive {
	--sx-navy: #0f143a; --sx-navy-2: #1b2560; --sx-yellow: #f3c91a; --sx-red: #8f1c2c;
	--sx-line: #e3e6ef; --sx-bg: #f5f6fa; --sx-muted: #5b6080; --sx-radius: 14px;
}
.idx-shop-archive .idxshop-section { padding-top: 40px; padding-bottom: 4rem; }

/* Layout */
.idxshop-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 2rem; align-items: start; }
.idxshop-main { min-width: 0; }

/* Sidebar */
.idxshop-side { position: sticky; top: calc(var(--header-h, 96px) + 18px); align-self: start; }
.admin-bar .idxshop-side { top: calc(var(--header-h, 96px) + 50px); }
.idxshop-side__inner {
	background: #fff; border: 1px solid var(--sx-line); border-radius: var(--sx-radius);
	box-shadow: 0 10px 28px rgba(15, 20, 58, .07); overflow: hidden;
	max-height: calc(100vh - var(--header-h, 96px) - 40px); overflow-y: auto; overscroll-behavior: contain;
}
.idxshop-side__head {
	display: flex; align-items: center; justify-content: space-between; gap: .75rem;
	padding: .95rem 1.1rem .85rem; background: var(--sx-navy); border-bottom: 3px solid var(--sx-yellow);
}
.idxshop-side__title { margin: 0; color: #fff; font: 600 .8rem/1.2 var(--font-head); letter-spacing: .12em; text-transform: uppercase; }
.idxshop-side__close { display: none; }
.idxshop-side__nav { padding: .5rem; }
.idxshop-cats, .idxshop-cats__sub { list-style: none; margin: 0; padding: 0; }
.idxshop-cats__item { margin: 0; }
.idxshop-cats__row { display: flex; align-items: stretch; gap: .25rem; }
.idxshop-cats__link {
	flex: 1; min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: .6rem;
	padding: .55rem .7rem; border-radius: 9px; color: var(--sx-navy); text-decoration: none;
	font: 600 .93rem/1.25 var(--font-sans); transition: background .15s, color .15s;
}
.idxshop-cats__name { min-width: 0; overflow-wrap: anywhere; }
.idxshop-cats__count {
	flex-shrink: 0; min-width: 1.8rem; padding: .1rem .45rem; border-radius: 999px; background: var(--sx-bg);
	color: var(--sx-muted); font-size: .74rem; font-weight: 700; text-align: center;
}
.idxshop-cats__link:hover { background: var(--sx-bg); color: var(--sx-navy); }
.idxshop-cats__link:focus-visible, .idxshop-cats__toggle:focus-visible, .idxshop-filter-btn:focus-visible,
.idxshop-side__close:focus-visible { outline: 3px solid var(--sx-yellow); outline-offset: 1px; }
.idxshop-cats__item.is-current > .idxshop-cats__row > .idxshop-cats__link { background: var(--sx-navy); color: #fff; font-weight: 800; box-shadow: inset 4px 0 0 var(--sx-yellow); }
.idxshop-cats__item.is-current > .idxshop-cats__row > .idxshop-cats__link .idxshop-cats__count { background: var(--sx-yellow); color: var(--sx-navy); }
.idxshop-cats__item.is-ancestor > .idxshop-cats__row > .idxshop-cats__link { font-weight: 800; }
.idxshop-cats__item--all > .idxshop-cats__row > .idxshop-cats__link { font-weight: 800; }
.idxshop-cats__item--all { margin-bottom: .25rem; padding-bottom: .3rem; border-bottom: 1px solid var(--sx-line); }
.idxshop-cats__toggle {
	flex-shrink: 0; width: 34px; border: 0; border-radius: 9px; background: transparent; color: var(--sx-navy);
	cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: background .15s;
}
.idxshop-cats__toggle:hover { background: var(--sx-bg); }
.idxshop-cats__toggle span {
	width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
	transform: translateY(-2px) rotate(45deg); transition: transform .2s;
}
.idxshop-cats__toggle[aria-expanded="true"] span { transform: translateY(2px) rotate(-135deg); }
.idxshop-cats__sub { margin: .1rem 0 .3rem .7rem; padding-left: .55rem; border-left: 2px solid var(--sx-line); }
.idxshop-cats__sub[hidden] { display: none; }
.idxshop-cats__sub .idxshop-cats__link { font-size: .88rem; padding: .45rem .65rem; }

/* Toolbar */
.idxshop-toolbar {
	display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1rem;
	margin: 0 0 1.25rem; padding: .7rem .8rem .7rem 1.1rem; background: #fff;
	border: 1px solid var(--sx-line); border-radius: var(--sx-radius);
}
.idx-shop-archive .idxshop-toolbar .woocommerce-result-count { float: none; margin: 0; color: var(--sx-muted); font-size: .9rem; font-weight: 600; }
.idx-shop-archive .idxshop-toolbar .woocommerce-ordering { float: none; margin: 0 0 0 auto; }
.idx-shop-archive .idxshop-toolbar select.orderby {
	-webkit-appearance: none; appearance: none; min-width: 230px; height: 42px; margin: 0;
	padding: 0 2.6rem 0 1rem; border: 1.5px solid var(--sx-line); border-radius: 999px; background-color: #fff;
	background-image: 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 1.5l5 5 5-5' fill='none' stroke='%230f143a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat; background-position: right 1rem center; background-size: 12px 8px;
	color: var(--sx-navy); font: 700 .88rem/1 var(--font-sans); cursor: pointer; transition: border-color .15s, box-shadow .15s;
}
.idx-shop-archive .idxshop-toolbar select.orderby:hover { border-color: var(--sx-navy); }
.idx-shop-archive .idxshop-toolbar select.orderby:focus { outline: none; border-color: var(--sx-navy); box-shadow: 0 0 0 3px rgba(243, 201, 26, .75); }
.idxshop-filter-btn {
	display: none; align-items: center; gap: .5rem; min-height: 42px; padding: .5rem 1.05rem; border: 0; border-radius: 999px;
	background: var(--sx-navy); color: #fff; font: 600 .8rem/1 var(--font-head); letter-spacing: .06em; text-transform: uppercase; cursor: pointer;
}
.idxshop-filter-btn:hover { background: var(--sx-navy-2); }
.idxshop-filter-btn svg { color: var(--sx-yellow); }
.idxshop-toolbar--empty { justify-content: flex-start; }

/* Product grid + cards (DTF category keeps its own 1.8.158 grid) */
.idx-shop-archive:not(.term-dtf-gang-sheets) .idxshop-main ul.products {
	display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.4rem; margin: 0 0 2rem; padding: 0;
}
.idx-shop-archive .idxshop-main ul.products::before, .idx-shop-archive .idxshop-main ul.products::after { display: none; content: none; }
.idx-shop-archive:not(.term-dtf-gang-sheets) .idxshop-main ul.products li.product {
	float: none; width: auto !important; margin: 0 !important; clear: none !important;
	display: flex; flex-direction: column; padding: 0; background: #fff; border: 1px solid var(--sx-line);
	border-radius: var(--sx-radius); overflow: hidden; box-shadow: 0 6px 18px rgba(15, 20, 58, .06);
	transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.idx-shop-archive:not(.term-dtf-gang-sheets) .idxshop-main ul.products li.product:hover {
	transform: translateY(-4px); border-color: rgba(15, 20, 58, .18); box-shadow: 0 16px 34px rgba(15, 20, 58, .14);
}
.idx-shop-archive .idxshop-main ul.products li.product a.woocommerce-loop-product__link {
	display: flex; flex-direction: column; flex: 1; color: inherit; text-decoration: none;
}
.idx-shop-archive:not(.term-dtf-gang-sheets) .idxshop-main ul.products li.product a img {
	display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; margin: 0;
	background: var(--sx-bg); border-bottom: 1px solid var(--sx-line); transition: transform .35s ease;
}
.idx-shop-archive .idxshop-main ul.products li.product .woocommerce-loop-product__title {
	margin: 0; padding: .95rem 1.05rem .3rem; color: var(--sx-navy);
	font: 600 1rem/1.3 var(--font-head); letter-spacing: -.005em;
}
.idx-shop-archive .idxshop-main ul.products li.product .price {
	display: block; margin: auto 0 0; padding: .1rem 1.05rem .95rem; color: var(--sx-navy); font-weight: 800; font-size: 1.02rem;
}
.idx-shop-archive .idxshop-main ul.products li.product .price .idxsb-from { color: var(--sx-muted); font-size: .82rem; font-weight: 700; }
.idx-shop-archive .idxshop-main ul.products li.product .price .idxsb-from .amount { color: var(--sx-navy); font-size: 1.02rem; font-weight: 800; }
.idx-shop-archive .idxshop-main ul.products li.product .price del { color: var(--sx-muted); font-weight: 600; opacity: .8; }
.idx-shop-archive .idxshop-main ul.products li.product .price ins { color: var(--sx-red); text-decoration: none; }
.idx-shop-archive .idxshop-main ul.products li.product .onsale {
	top: .75rem; left: .75rem; right: auto; margin: 0; min-width: 0; min-height: 0; padding: .3rem .65rem; line-height: 1.2;
	border-radius: 999px; background: var(--sx-red) !important; color: #fff !important; font-size: .72rem; font-weight: 800; text-transform: uppercase;
}
/* Card button — cart page button style (.idxcart-btn): 8px radius, uppercase, navy → yellow */
.idx-shop-archive .idxshop-main ul.products li.product a.button,
.idx-shop-archive .idxshop-main ul.products li.product .button {
	display: flex; align-items: center; justify-content: center; gap: .4rem; min-height: 40px; margin: 0 1.05rem 1.05rem !important;
	padding: .55rem 1rem; border: 0; border-radius: 8px !important; background: var(--sx-navy) !important; color: #fff !important;
	font: 600 .8rem/1.1 var(--font-head) !important; letter-spacing: .05em; text-transform: uppercase; text-align: center; text-decoration: none;
	transition: background .15s, color .15s, transform .15s, box-shadow .15s;
}
.idx-shop-archive .idxshop-main ul.products li.product a.button:hover,
.idx-shop-archive .idxshop-main ul.products li.product a.button:focus-visible {
	background: var(--sx-yellow) !important; color: var(--sx-navy) !important; transform: translateY(-1px); box-shadow: 0 8px 18px rgba(15, 20, 58, .18);
}
.idx-shop-archive .idxshop-main ul.products li.product a.button:focus-visible { outline: 3px solid var(--sx-navy); outline-offset: 2px; }
.idx-shop-archive .idxshop-main ul.products li.product a.added_to_cart { display: block; margin: -.5rem 1.05rem 1rem; color: var(--sx-navy); font-weight: 700; font-size: .85rem; text-align: center; }

/* Pagination */
.idx-shop-archive .idxshop-main nav.woocommerce-pagination { margin: .5rem 0 0; text-align: center; }
.idx-shop-archive .idxshop-main nav.woocommerce-pagination ul { display: inline-flex; flex-wrap: wrap; justify-content: center; gap: .4rem; margin: 0; padding: 0; border: 0; white-space: normal; }
.idx-shop-archive .idxshop-main nav.woocommerce-pagination ul li { float: none; margin: 0; border: 0; overflow: visible; }
.idx-shop-archive .idxshop-main nav.woocommerce-pagination ul li .page-numbers {
	display: inline-flex; align-items: center; justify-content: center; min-width: 42px; height: 42px; padding: 0 .8rem;
	border: 1.5px solid var(--sx-line); border-radius: 999px; background: #fff; color: var(--sx-navy);
	font: 800 .9rem/1 var(--font-sans); text-decoration: none; transition: background .15s, color .15s, border-color .15s;
}
.idx-shop-archive .idxshop-main nav.woocommerce-pagination ul li a.page-numbers:hover,
.idx-shop-archive .idxshop-main nav.woocommerce-pagination ul li a.page-numbers:focus-visible { background: var(--sx-yellow); border-color: var(--sx-yellow); color: var(--sx-navy); }
.idx-shop-archive .idxshop-main nav.woocommerce-pagination ul li span.current { background: var(--sx-navy); border-color: var(--sx-navy); color: var(--sx-yellow); }

/* Tablet / phone: sidebar becomes a slide-in drawer */
@media (max-width: 1023.98px) {
	.idxshop-layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
	.idxshop-filter-btn { display: inline-flex; }
	.idxshop-side {
		position: fixed; top: 0; bottom: 0; left: 0; z-index: 1400; width: min(340px, 88vw);
		transform: translateX(-105%); visibility: hidden; transition: transform .28s ease, visibility 0s linear .28s;
	}
	.admin-bar .idxshop-side { top: 0; }
	.idxshop-side.is-open { transform: none; visibility: visible; transition: transform .28s ease; }
	.idxshop-side__inner { height: 100%; max-height: none; border: 0; border-radius: 0 16px 16px 0; box-shadow: 0 0 40px rgba(0, 0, 0, .3); }
	.idxshop-side__head { position: sticky; top: 0; z-index: 1; padding: 1rem 1rem 1rem 1.2rem; }
	.idxshop-side__close {
		display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border: 0; border-radius: 50%;
		background: rgba(255, 255, 255, .12); color: #fff; font-size: 1.6rem; line-height: 1; cursor: pointer;
	}
	.idxshop-side__close:hover { background: var(--sx-yellow); color: var(--sx-navy); }
	.idxshop-cats__link { padding: .7rem .75rem; font-size: 1rem; }
	.idxshop-cats__toggle { width: 44px; }
	.idxshop-overlay { position: fixed; inset: 0; z-index: 1390; background: rgba(15, 20, 58, .55); opacity: 0; transition: opacity .25s; }
	.idxshop-overlay.is-open { opacity: 1; }
	.idxshop-overlay[hidden] { display: none; }
	html.idxshop-drawer-open, html.idxshop-drawer-open body { overflow: hidden; }
	.idx-shop-archive .idxshop-toolbar .woocommerce-result-count { order: 3; flex-basis: 100%; }
	.idx-shop-archive:not(.term-dtf-gang-sheets) .idxshop-main ul.products { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem; }
}
@media (min-width: 1024px) {
	.idxshop-overlay { display: none !important; }
}
@media (max-width: 600px) {
	.idx-shop-archive .idxshop-section { padding-top: 24px; }
	.idxshop-toolbar { padding: .6rem; gap: .6rem; }
	.idx-shop-archive .idxshop-toolbar .woocommerce-ordering { flex: 1; min-width: 0; }
	.idx-shop-archive .idxshop-toolbar select.orderby { width: 100%; min-width: 0; padding-left: .85rem; font-size: .82rem; }
	.idx-shop-archive .idxshop-toolbar .woocommerce-result-count { padding-left: .3rem; font-size: .82rem; }
	.idx-shop-archive:not(.term-dtf-gang-sheets) .idxshop-main ul.products { gap: .75rem; }
	.idx-shop-archive .idxshop-main ul.products li.product .woocommerce-loop-product__title { padding: .7rem .7rem .25rem; font-size: .88rem; }
	.idx-shop-archive .idxshop-main ul.products li.product .price { padding: 0 .7rem .7rem; font-size: .92rem; }
	.idx-shop-archive .idxshop-main ul.products li.product a.button { margin: 0 .7rem .7rem !important; padding: .5rem .5rem; font-size: .7rem !important; letter-spacing: .03em; }
}
@media (max-width: 359.98px) {
	.idx-shop-archive:not(.term-dtf-gang-sheets) .idxshop-main ul.products { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
	.idxshop-side, .idxshop-overlay, .idx-shop-archive .idxshop-main ul.products li.product, .idxshop-cats__toggle span,
	.idx-shop-archive .idxshop-main ul.products li.product a.button { transition: none !important; }
	.idx-shop-archive .idxshop-main ul.products li.product:hover, .idx-shop-archive .idxshop-main ul.products li.product a.button:hover { transform: none !important; }
}

/* 1.8.389 — full category tree, all expanded: empty categories dimmed; sidebar scrolls inside itself when taller than the screen. */
.idxshop-cats__count.is-zero { background: transparent; color: #9aa0b8; box-shadow: inset 0 0 0 1px var(--sx-line); }
.idxshop-cats__sub .idxshop-cats__sub { margin-left: .45rem; }
.idxshop-side__inner { scrollbar-width: thin; scrollbar-color: rgba(15, 20, 58, .25) transparent; }
.admin-bar .idxshop-side__inner { max-height: calc(100vh - var(--header-h, 96px) - 72px); }
@media (max-width: 1023.98px) {
	.admin-bar .idxshop-side__inner { max-height: none; }
	/* A fixed box with align-self:start sizes to its content; stretch it to the screen so the tree scrolls inside the drawer. */
	.idxshop-side { align-self: stretch; height: 100vh; height: 100dvh; }
	.idxshop-side__inner { overflow-y: auto; -webkit-overflow-scrolling: touch; }
}

/* 1.8.389 — Branded background for the shop/archive area (shop + product category/tag archives only).
   Light base with a soft navy fade under the banner, a faint yellow glow, and the theme's diamond lattice
   (footer-diamond.png, as on Laser Blanks "Start here") recoloured navy via mask at low opacity, fading out
   down the page. Static: no parallax or animation. Cards stay white. */
.idx-shop-archive .idxshop-section {
	position: relative; /* no isolation / z-index / overflow here: a stacking context would trap the mobile drawer under the header, and overflow would break the sticky sidebar */
	background:
		linear-gradient(180deg, rgba(15, 20, 58, .10) 0, rgba(15, 20, 58, .035) 180px, rgba(15, 20, 58, 0) 420px),
		radial-gradient(ellipse 55% 320px at 88% 0, rgba(243, 201, 26, .13), rgba(243, 201, 26, 0) 70%),
		linear-gradient(180deg, #eef0f7 0, #f5f6fa 520px, #f7f8fb 100%);
}
.idx-shop-archive .idxshop-section::before {
	content: ""; position: absolute; inset: 0; pointer-events: none;
	background: #0f143a; opacity: .1;
	-webkit-mask-image: url("../images/backgrounds/footer-diamond.png"), linear-gradient(180deg, #000 0, rgba(0, 0, 0, .55) 520px, rgba(0, 0, 0, .18) 100%);
	-webkit-mask-size: 280px auto, 100% 100%; -webkit-mask-repeat: repeat, no-repeat;
	-webkit-mask-composite: source-in;
	mask-image: url("../images/backgrounds/footer-diamond.png"), linear-gradient(180deg, #000 0, rgba(0, 0, 0, .55) 520px, rgba(0, 0, 0, .18) 100%);
	mask-size: 280px auto, 100% 100%; mask-repeat: repeat, no-repeat; mask-composite: intersect;
}
.idx-shop-archive .idxshop-section::after {
	content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; pointer-events: none;
	background: linear-gradient(90deg, rgba(243, 201, 26, 0), rgba(243, 201, 26, .5) 50%, rgba(243, 201, 26, 0));
}
.idx-shop-archive .idxshop-section > .container { position: relative; } /* painted above the ::before texture (later in tree), no stacking context */
.idx-shop-archive .idxshop-toolbar { box-shadow: 0 6px 18px rgba(15, 20, 58, .05); }
@media (max-width: 600px) {
	.idx-shop-archive .idxshop-section::before { -webkit-mask-size: 200px auto, 100% 100%; mask-size: 200px auto, 100% 100%; }
}
/* Logged-in only: keep the drawer header clear of the WP admin bar. */
@media (max-width: 1023.98px) {
	.admin-bar .idxshop-side { top: 32px; height: calc(100vh - 32px); height: calc(100dvh - 32px); }
}
@media (max-width: 782px) {
	.admin-bar .idxshop-side { top: 46px; height: calc(100vh - 46px); height: calc(100dvh - 46px); }
}

/* 1.8.389 — Full-width archive layout: the section (and the banner copy, so they line up) break out of the
   centred container with 40px sides on desktop, 24px tablet, 14px phone. Grid: 4 cols ≥1280, 3 cols 1024–1279,
   2 cols under 1024 (sidebar = drawer), 1 col under 360. Toolbar + pagination span the grid column. */
.idx-shop-archive .idxshop-section > .container,
.idx-shop-archive .idxshop-hero > .container { width: auto; max-width: none; margin-inline: 40px; }
.idx-shop-archive .idxshop-layout { gap: 2.25rem; }
@media (min-width: 1280px) {
	.idx-shop-archive:not(.term-dtf-gang-sheets) .idxshop-main ul.products { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.4rem; }
}
@media (min-width: 1680px) {
	.idx-shop-archive .idxshop-layout { grid-template-columns: 280px minmax(0, 1fr); }
}
@media (max-width: 1023.98px) {
	.idx-shop-archive .idxshop-section > .container,
	.idx-shop-archive .idxshop-hero > .container { margin-inline: 24px; }
}
@media (max-width: 600px) {
	.idx-shop-archive .idxshop-section > .container,
	.idx-shop-archive .idxshop-hero > .container { margin-inline: 14px; }
}
