/* CHXN page: shop/category/tag archive — cream title banner (woocommerce/
   archive-product.php), sticky 230px category sidebar (sidebar.php) +
   fluid product grid, matching the original shop.dc.html spec. */

.chxn-shop-banner {
	background: var(--chxn-cream);
	border-bottom: 1px solid var(--chxn-line);
	padding: 30px 0 26px;
}
.chxn-shop-banner-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	flex-wrap: wrap;
}
.chxn-shop-banner-sort:empty {
	display: none;
}
/* the real ".woocommerce-ordering" form is moved in here by modules/
   shop.js — restyled from its default look (shop.css's own ".woocommerce-
   ordering select" rule further down still applies to it either way). */
.chxn-shop-banner-sort .woocommerce-ordering {
	margin: 0;
}
.chxn-shop-banner .woocommerce-breadcrumb {
	font-size: 13px;
	color: var(--chxn-ink-2);
	margin: 0 0 8px;
}
.chxn-shop-banner .woocommerce-breadcrumb a {
	color: var(--chxn-ink-2);
	text-decoration: none;
}
.chxn-shop-banner .woocommerce-breadcrumb a:hover {
	color: var(--chxn-green-d);
}
.chxn-shop-title {
	font-size: 30px;
	font-weight: 800;
	margin: 0 0 2px;
	color: var(--chxn-ink);
}
.chxn-shop-subtitle {
	color: var(--chxn-ink-2);
	font-size: 14px;
	margin: 0;
}
/* WooCommerce core's own wrapper class for a category/shop page's
   admin-authored description (business-logic.php's "tu_move_wc_archive_
   description" re-anchoring to "woocommerce_after_shop_loop") — sits below
   the product grid (and the "Xem thêm" load-more button) in its own card,
   rather than up in the cream banner pushing the products themselves down
   the page. Can be long-form content (headings, images), so styled at full
   ".chxn-shop-main" column width instead of a capped reading-width line. */
.chxn-shop-main .term-description {
	margin-top: 32px;
	padding: 24px 26px;
	background: var(--chxn-card);
	border: 1px solid var(--chxn-line);
	border-radius: var(--chxn-radius-card);
	font-size: 14px;
	line-height: 1.75;
	color: var(--chxn-ink-2);
}
.chxn-shop-main .term-description img {
	max-width: 100%;
	height: auto;
	border-radius: var(--chxn-radius-img);
	margin-top: 10px;
}
.chxn-shop-main .term-description h1,
.chxn-shop-main .term-description h2,
.chxn-shop-main .term-description h3 {
	color: var(--chxn-ink);
	margin: 18px 0 8px;
}
.chxn-shop-main .term-description h1:first-child,
.chxn-shop-main .term-description h2:first-child,
.chxn-shop-main .term-description h3:first-child {
	margin-top: 0;
}

/* ---- content grid: fixed 230px sidebar + fluid content ---- */
.chxn-shop-layout {
	display: grid;
	grid-template-columns: 230px 1fr;
	gap: 28px;
	align-items: start;
	/* longhand, not the "padding: 24px 0 48px" shorthand it used to be —
	   this element also carries ".chxn-container" (woocommerce/global/
	   wrapper-start.php), and a later same-specificity shorthand
	   declaration overwrites ALL 4 sides of an earlier one, not just the
	   ones it mentions. That silently zeroed out chxn-container's own
	   side padding below the ~1240px width where its max-width stops
	   doing the centering for you — every card sat flush against the
	   screen edge on any phone/tablet instead of picking up that inset. */
	padding-top: 24px;
	padding-bottom: 48px;
}
/* below ~1380px this shared container has no spare margin outside its
   own 20px padding for the fixed floating contact cluster (components/
   fab.css, bottom-right) to sit in — the rightmost product card's price
   ends up flush against the container edge, right where those buttons
   float. Same fix as pages/checkout.css and pages/product-detail.css. */
@media (min-width: 851px) and (max-width: 1380px) {
	.chxn-shop-layout {
		padding-right: 90px;
	}
}
.chxn-shop-main {
	/* the container/max-width job now belongs to the shared ".chxn-shop-
	   layout" grid wrapper (woocommerce/global/wrapper-start.php) — this
	   is just a grid item inside it, not its own centered container. */
	padding: 0;
	/* <main> (wrapper-start.php) prints BEFORE the sidebar in source order
	   — WooCommerce's own hook sequence renders the sidebar via
	   "woocommerce_after_main_content" + "woocommerce_sidebar", both of
	   which fire after </main> already closed — so without this, grid
	   auto-placement puts the product content in column 1 (the 230px
	   sidebar track) and the sidebar itself in column 2 (squeezing the
	   whole product grid down to ~40px-wide slivers). "order" reorders
	   the two visually without needing to fight that hook sequence. */
	order: 2;
}

/* sticky sidebar (sidebar.php's shop-archive branch). */
.chxn-shop-sidebar {
	order: 1;
	position: sticky;
	top: 20px;
	background: var(--chxn-card);
	border: 1px solid var(--chxn-line);
	border-radius: var(--chxn-radius-card);
	padding: 18px;
}
.chxn-shop-sidebar-title {
	font-weight: 700;
	font-size: 15px;
	color: var(--chxn-ink);
	padding: 0 0 12px;
}
.chxn-shop-cat-list {
	list-style: none;
	margin: 0;
	padding: 0;
}
.chxn-shop-cat-list li {
	margin-bottom: 2px;
}
.chxn-shop-cat-list a {
	display: block;
	padding: 10px 12px;
	border-radius: 9px;
	font-size: 13.5px;
	font-weight: 500;
	color: var(--chxn-ink);
	text-decoration: none;
}
.chxn-shop-cat-list a:hover {
	background: var(--chxn-green-l);
	color: var(--chxn-green-d);
}
.chxn-shop-cat-list .count {
	color: var(--chxn-ink-2);
	font-size: 12px;
}
.chxn-shop-cat-list .current-cat > a {
	background: var(--chxn-green-l);
	color: var(--chxn-green-d);
	font-weight: 700;
}

/* ---- "Đang xem X — N sản phẩm" (business-logic.php) + ordering — both
   wrapped in ".chxn-shop-toolbar" (same file) so the sort dropdown sits
   in the corner next to the count instead of stacking below it. ---- */
.chxn-shop-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 10px 16px;
	margin-bottom: 16px;
}
.chxn-shop-viewing {
	font-size: 13.5px;
	color: var(--chxn-ink-2);
}
.chxn-shop-viewing strong {
	color: var(--chxn-ink);
}
/* redundant with ".chxn-shop-viewing" above — the native count text was
   only ever meant to survive on narrow/mobile widths where that custom
   line might get cramped (see the media query at the bottom). */
.woocommerce-result-count {
	display: none;
}
.woocommerce-ordering select {
	border: 1.5px solid var(--chxn-line);
	border-radius: var(--chxn-radius-input);
	padding: 8px 12px;
	font-size: 13.5px;
	background: var(--chxn-card);
	color: var(--chxn-ink);
}

/* ---- product grid: 4 columns inside the fluid content column (not the
   site's full-width container — product-card.css's own 1100px/850px
   breakpoints assume a wider column than this layout's content area
   actually has, so this section sets its own). ---- */
ul.products {
	grid-template-columns: repeat(3, 1fr);
}
@media (min-width: 1200px) {
	ul.products {
		grid-template-columns: repeat(4, 1fr);
	}
}

/* ---- "Xem thêm" load-more button (business-logic.php's chxn_shop_load_
   more_button(), replaces WooCommerce's default numbered pagination) ---- */
.chxn-shop-load-more-wrap {
	display: flex;
	justify-content: center;
	margin-top: 32px;
}
.chxn-shop-load-more {
	border: 1.5px solid var(--chxn-green);
	border-radius: var(--chxn-radius-pill);
	background: var(--chxn-green-l);
	color: var(--chxn-green-d);
	font-size: 14px;
	font-weight: 700;
	padding: 12px 28px;
	cursor: pointer;
	font-family: inherit;
	display: flex;
	align-items: center;
	gap: 8px;
}
.chxn-shop-load-more:hover {
	background: var(--chxn-green);
	color: #fff;
}
.chxn-shop-load-more.is-loading {
	opacity: .6;
	cursor: default;
}
.chxn-shop-load-more-arrow {
	display: inline-block;
	animation: chxn-bounce-down 1.2s ease-in-out infinite;
}
@keyframes chxn-bounce-down {
	0%, 100% { transform: translateY(0); }
	50% { transform: translateY(3px); }
}

/* ---- pagination ----
   WooCommerce core ships its own ".woocommerce-pagination ul{border:1px
   solid ...;border-right:0}", "ul li{float:left;border-right:1px solid
   ...}" (an old joined-pill-strip look) and, critically, ".woocommerce
   nav.woocommerce-pagination ul li span.current{background:#e9e6ed;
   color:#816f98}" — that last one is 1 element MORE specific than a
   plain ".woocommerce-pagination .page-numbers .current" rule (classes
   tie 3-for-3, WC's has more type selectors), so it silently won over
   this file's own background/color for the current page, leaving that
   washed-out lavender fill instead of solid green. Every selector below
   matches WC's own "nav.woocommerce-pagination ul li ..." shape exactly
   to guarantee it wins regardless. */
.woocommerce-pagination {
	margin-top: 32px;
}
.woocommerce-pagination ul.page-numbers {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	list-style: none;
	margin: 0;
	padding: 0;
	border: 0;
}
.woocommerce-pagination ul.page-numbers li {
	display: flex;
	float: none;
	border: 0;
	padding: 0;
	margin: 0;
	overflow: visible;
}
.woocommerce nav.woocommerce-pagination ul li a,
.woocommerce nav.woocommerce-pagination ul li span {
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 0 6px;
	border: 1.5px solid var(--chxn-line);
	border-radius: var(--chxn-radius-input);
	background: var(--chxn-card);
	color: var(--chxn-ink);
	font-size: 14px;
	font-weight: 700;
	line-height: 1;
	text-decoration: none;
	box-sizing: border-box;
}
.woocommerce nav.woocommerce-pagination ul li span.current,
.woocommerce nav.woocommerce-pagination ul li a:hover,
.woocommerce nav.woocommerce-pagination ul li a:focus {
	background: var(--chxn-green);
	border-color: var(--chxn-green);
	color: #fff;
}
/* prev/next: chevrons instead of WC's default "←"/"→" text glyphs, to
   match the design's plain icon-only look. */
.woocommerce nav.woocommerce-pagination ul li a.next,
.woocommerce nav.woocommerce-pagination ul li a.prev {
	font-size: 0;
}
.woocommerce nav.woocommerce-pagination ul li a.next::before,
.woocommerce nav.woocommerce-pagination ul li a.prev::before {
	font-size: 16px;
	line-height: 1;
}
.woocommerce nav.woocommerce-pagination ul li a.prev::before {
	content: "‹";
}
.woocommerce nav.woocommerce-pagination ul li a.next::before {
	content: "›";
}

@media (max-width: 850px) {
	.chxn-shop-layout {
		/* minmax(0,1fr), not bare 1fr — a 1fr track's default "auto"
		   minimum sizes to its widest child's min-content, and the
		   category pill strip below (a nowrap flex row) doesn't shrink on
		   its own: the track grew to the strip's full unscrolled width,
		   the page overflowed sideways, and the strip itself never got
		   narrow enough to activate its own overflow-x scrolling. */
		grid-template-columns: minmax(0, 1fr);
	}
	.chxn-shop-sidebar {
		min-width: 0;
	}
	/* the sidebar card ate the whole first screen on phones — collapsed
	   into one horizontally-scrollable pill strip instead (the standard
	   mobile-commerce category pattern): products are visible immediately,
	   categories still one flick away. */
	.chxn-shop-sidebar {
		position: static;
		background: none;
		border: 0;
		border-radius: 0;
		padding: 0;
		margin-bottom: 2px;
	}
	.chxn-shop-sidebar-title {
		display: none;
	}
	.chxn-shop-cat-list {
		display: flex;
		gap: 8px;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
		padding: 2px 2px 8px;
	}
	.chxn-shop-cat-list::-webkit-scrollbar {
		display: none;
	}
	.chxn-shop-cat-list li {
		flex: none;
		margin-bottom: 0;
	}
	.chxn-shop-cat-list a {
		display: inline-flex;
		align-items: center;
		white-space: nowrap;
		background: var(--chxn-card);
		border: 1px solid var(--chxn-line);
		border-radius: 99px;
		padding: 8px 14px;
		font-size: 13px;
	}
	.chxn-shop-cat-list .current-cat > a {
		border-color: var(--chxn-green);
	}
	ul.products {
		grid-template-columns: repeat(2, 1fr);
	}
	.woocommerce-result-count {
		display: block;
		font-size: 12.5px;
		color: var(--chxn-ink-2);
		margin-bottom: 10px;
	}
}
