/*
 * Product listing on phones (Figma "Bedsheets Listing" 1300:26635, "Sort By" 1300:44715), see
 * inc/mobile-listing.php. Template "Bedsheets Listing" (783); .archive.woocommerce = shop and product
 * category/tag archives. The Figma circle strip (Best Seller / New Arrivals / …) is deliberately NOT styled or added.
 * html.sng-has-listbar / .sng-sheet-open come from mobile-listing.js. Phones only: 767px = mobile_landscape.
 */
@media (max-width: 767px) {
	/* ---------- Product area on sand: chips, 1-column grid ---------- */
	/* The wrapper around the product area adds 20px of cream padding: no band between the header and the chips. */
	.archive.woocommerce #brxe-nlwkcu {
		padding: 0;
	}

	.archive.woocommerce #bl-shop-layout {
		padding: var(--space-20) var(--space-20) var(--space-40);
		background: var(--color-surface-sand);
	}

	.archive.woocommerce #brxe-17b7h3 {
		gap: var(--space-20);
		width: 100%;
	}

	/* The toolbar keeps only the active-filter tags; Filters / Sort move to the bottom bar. */
	.archive.woocommerce #brxe-xulix4 {
		gap: 0;
	}

	.archive.woocommerce #brxe-x3x08s,
	.archive.woocommerce #brxe-9i0ui4 {
		display: none;
	}

	.archive.woocommerce #brxe-xulix4:not(:has(.brxe-filter-active-filters li)) {
		display: none;
	}

	.sng-list-chips {
		display: flex;
		align-self: stretch;
		gap: var(--space-15);
		width: calc(100% + 2 * var(--space-20)); /* Full bleed; scrolls instead of widening the page. */
		min-width: 0;
		max-width: none;
		margin: 0 calc(var(--space-20) * -1);
		padding: 0 var(--space-20);
		overflow-x: auto;
		scrollbar-width: none;
	}

	.sng-list-chips::-webkit-scrollbar {
		display: none;
	}

	.sng-list-chip {
		display: inline-flex;
		flex: none;
		align-items: center;
		gap: var(--space-5);
		height: 44px;
		padding: var(--space-10) var(--space-15);
		border: var(--hairline-md) solid var(--color-border-subtle);
		border-radius: var(--radius-card);
		background: var(--color-surface-cream);
		font-family: var(--font-body);
		font-size: 14px;
		font-weight: 500;
		line-height: 1.5;
		color: var(--color-ink-muted);
		text-decoration: none;
		cursor: pointer;
	}

	.sng-list-chip:not(.sng-list-chip--luxury)::after {
		content: "";
		width: 18px;
		height: 18px;
		background: currentColor;
		-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M5 7l4 4 4-4' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
		mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M5 7l4 4 4-4' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
	}

	.sng-list-chip--luxury {
		color: var(--color-badge-luxury);
	}

	.sng-list-chip--luxury svg {
		width: 18px;
		height: 18px;
	}

	.sng-list-chip--luxury.is-active {
		border-color: var(--color-badge-luxury);
		background: var(--color-badge-luxury);
		color: var(--color-on-accent);
	}

	.archive.woocommerce #bl-product-grid {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr)); /* two cards per row on phones (Figma 1300:26635, requested 2026-11-13) */
		gap: var(--space-20) 10px;
		width: 100%;
	}

	/* The promo banner inside the grid keeps the full width. */
	.archive.woocommerce #bl-product-grid > #brxe-nqorc8 {
		grid-column: 1 / -1;
	}

	.archive.woocommerce #bl-product-grid > .brxe-iluywy {
		width: auto;
		min-width: 0;
	}

	/* ---------- Compact product cards (same look as the homepage "New This Month" cards; Figma 174px cards) ---------- */
	/* the card: no panel, photo first, text underneath */
	.archive.woocommerce #bl-product-grid .sng-card {
		position: relative;
		display: flex;
		flex-direction: column;
		gap: 10px;
		height: auto;
		padding: 0;
		background: none;
		border: 0;
		border-radius: 0;
		box-shadow: none;
		transform: none;
	}

	.archive.woocommerce #bl-product-grid .sng-card:hover {
		box-shadow: none;
		transform: none;
	}

	.archive.woocommerce #bl-product-grid .sng-card__thumb {
		position: relative;
		flex: none;
		height: 196px;
		border-radius: 10px;
		overflow: hidden;
	}

	.archive.woocommerce #bl-product-grid .sng-card__thumb a.brxe-image,
	.archive.woocommerce #bl-product-grid .sng-card__thumb img {
		display: block;
		width: 100%;
		height: 100%;
	}

	.archive.woocommerce #bl-product-grid .sng-card__thumb img {
		object-fit: cover;
		transform: none;
		scale: none;
		transition: none;
	}

	/* badges: pills, top left; "New" is green */
	.archive.woocommerce #bl-product-grid .sng-card .brxe-6c58ba {
		top: 8px;
		left: 8px;
	}

	/* All of the product's badges, as on desktop (each is a Bricks condition in the card component: New, Bestseller,
	   Luxe, Best Value, Sale, Out of Stock, product tag); they wrap and stop short of the wishlist heart. */
	.archive.woocommerce #bl-product-grid .sng-card .brxe-6c58ba {
		display: flex;
		flex-wrap: wrap;
		gap: 4px;
		max-width: calc(100% - 52px);
	}

	.archive.woocommerce #bl-product-grid .sng-card .brxe-6c58ba > .brxe-text-basic {
		padding: 5px 10px;
		border-radius: 999px;
		font-family: "Work Sans", sans-serif;
		font-size: 11px;
		font-weight: 600;
		line-height: 12.9px;
	}

	/* wishlist heart: white circle, top right */
	.archive.woocommerce #bl-product-grid .sng-card .brxe-202d3c {
		top: 8px;
		right: 8px;
		display: flex;
		align-items: center;
		justify-content: center;
		width: 32px;
		height: 32px;
		background: #fff;
		border-radius: 50%;
	}

	.archive.woocommerce #bl-product-grid .sng-card .brxe-sngchv {
		display: none;
	}

	/* text: name, rating, price */
	.archive.woocommerce #bl-product-grid .sng-card .brxe-266273 {
		display: flex;
		flex-direction: column;
		gap: 5px;
		padding: 0;
		background: none;
	}

	.archive.woocommerce #bl-product-grid .sng-card .brxe-jscwab {
		display: flex;
		flex-direction: column;
		gap: 5px;
		padding: 0;
		border: 0;
	}

	.archive.woocommerce #bl-product-grid .sng-card h3.brxe-683ea5,
	.archive.woocommerce #bl-product-grid .sng-card h3.brxe-683ea5 a {
		margin: 0;
		font-family: "Work Sans", sans-serif;
		font-size: 14px;
		font-weight: 500;
		line-height: 21px;
		color: var(--color-ink);
	}

	.archive.woocommerce #bl-product-grid .sng-card h3.brxe-683ea5 {
		display: -webkit-box;
		-webkit-line-clamp: 2;
		-webkit-box-orient: vertical;
		overflow: hidden;
	}

	.archive.woocommerce #bl-product-grid .sng-card .sng-card-rating {
		display: flex;
		align-items: center;
		gap: 5px;
	}

	/* one star, then the rating */
	.archive.woocommerce #bl-product-grid .sng-card .sng-card-rating__stars {
		position: relative;
		flex: none;
		width: 12px;
		height: 12px;
		overflow: hidden;
	}

	.archive.woocommerce #bl-product-grid .sng-card .sng-card-rating__fill {
		display: none;
	}

	.archive.woocommerce #bl-product-grid .sng-card .sng-card-rating__base svg:not(:first-child) {
		display: none;
	}

	/* The one star is drawn at the 12px box size (the base star is 15px, so the box used to clip it). */
	.archive.woocommerce #bl-product-grid .sng-card .sng-card-rating__base svg {
		width: 12px;
		height: 12px;
		min-width: 0; /* Bricks gives svg:not([width]) a 1em (15px) minimum. */
		min-height: 0;
	}

	.archive.woocommerce #bl-product-grid .sng-card .sng-card-rating__base svg {
		width: 12px;
		height: 12px;
		min-width: 0; /* Bricks gives svg:not([width]) a 1em (15px) minimum. */
		min-height: 0;
	}

	.archive.woocommerce #bl-product-grid .sng-card .sng-card-rating__base svg,
	.archive.woocommerce #bl-product-grid .sng-card .sng-card-rating__base svg path {
		color: #d97706;
		fill: #d97706;
	}

	.archive.woocommerce #bl-product-grid .sng-card .sng-card-rating__text {
		font-family: "Work Sans", sans-serif;
		font-size: 12px;
		font-weight: 600;
		line-height: 16.8px;
		color: #9c8f7c;
	}

	.archive.woocommerce #bl-product-grid .sng-card .brxe-389d65,
	.archive.woocommerce #bl-product-grid .sng-card .brxe-homnvw {
		display: flex;
		flex-direction: row;
		align-items: baseline;
		flex-wrap: wrap;
		gap: 5px;
		margin: 0;
		padding: 0;
		border: 0;
	}

	.archive.woocommerce #bl-product-grid .sng-card .brxe-9aa3ce p.price {
		display: flex;
		align-items: baseline;
		gap: 5px;
		margin: 0;
		font-family: "Work Sans", sans-serif;
		font-size: 16px;
		font-weight: 600;
		line-height: 18.8px;
		color: var(--color-ink);
	}

	.archive.woocommerce #bl-product-grid .sng-card .brxe-9aa3ce p.price ins {
		order: 1;
		text-decoration: none;
		background: none;
	}

	.archive.woocommerce #bl-product-grid .sng-card .brxe-9aa3ce p.price del {
		order: 2;
		font-size: 12px;
		font-weight: 400;
		line-height: 14.1px;
		color: #9c8f7c;
	}

	.archive.woocommerce #bl-product-grid .sng-card .brxe-6e8d74 {
		padding: 0;
		background: none;
		border-radius: 0;
		font-family: "Work Sans", sans-serif;
		font-size: 12px;
		font-weight: 600;
		line-height: 16.8px;
		color: #4f5c3f;
	}

	/* No quick-add "+" button on the photo (removed on request); Add to cart / Buy now are hidden on phones here. */
	.archive.woocommerce #bl-product-grid .sng-card .brxe-e3bed8 {
		display: none;
	}

	/* ---------- Shop cards as in Figma "Bedsheets Listing" 1300:26635: panel card, Newsreader name, price + red
	   discount pill, full-width "Add to cart" and "Buy now" (no colour dots: PRD already has one card per colour) ---------- */
	.archive.woocommerce #bl-product-grid .sng-card {
		background: var(--color-surface-cream);
		border: var(--hairline) solid var(--color-border-subtle);
		border-radius: 10px;
		box-shadow: 0 2px 8px rgba(43, 32, 22, 0.08);
		overflow: hidden;
		gap: 0;
	}

	.archive.woocommerce #bl-product-grid .sng-card:hover {
		box-shadow: 0 2px 8px rgba(43, 32, 22, 0.08);
	}

	.archive.woocommerce #bl-product-grid .sng-card__thumb {
		border-radius: 0;
	}

	.archive.woocommerce #bl-product-grid .sng-card .brxe-266273 {
		padding: 10px;
		gap: 5px;
	}

	.archive.woocommerce #bl-product-grid .sng-card h3.brxe-683ea5,
	.archive.woocommerce #bl-product-grid .sng-card h3.brxe-683ea5 a {
		font-family: var(--font-display);
		font-size: 17px;
		font-weight: 600;
		line-height: 20px;
	}

	.archive.woocommerce #bl-product-grid .sng-card .brxe-6e8d74 {
		padding: 4px 9px;
		background: #900010;
		border-radius: 999px;
		font-size: 11px;
		font-weight: 600;
		line-height: 15.4px;
		color: #fff;
	}

	.archive.woocommerce #bl-product-grid .sng-card .brxe-6e8d74:empty {
		display: none;
	}

	.archive.woocommerce #bl-product-grid .sng-card .brxe-e3bed8 {
		position: static;
		display: block;
		width: 100%;
		height: auto;
		margin: 5px 0 0;
		padding: 0;
	}

	.archive.woocommerce #bl-product-grid .sng-card .sng-card-actions {
		display: flex;
		flex-direction: column;
		gap: 6px;
		width: 100%;
	}

	.archive.woocommerce #bl-product-grid .sng-card .sng-card-actions > .button {
		display: flex;
		align-items: center;
		justify-content: center;
		box-sizing: border-box;
		width: 100%;
		height: 36px;
		min-height: 36px;
		margin: 0;
		padding: 0 var(--space-10);
		font-size: 13px;
		font-weight: 600;
		line-height: 15.6px;
		white-space: nowrap;
		border-radius: 999px;
	}

	.archive.woocommerce #bl-product-grid .sng-card .sng-card-actions > a.button::before {
		content: none;
	}

	.archive.woocommerce #bl-product-grid .sng-card .sng-card-actions > a.button > span {
		display: inline;
	}

	/* Promo banner across both columns, after the first two rows (Figma "Festive Homes" 362×234). */
	.archive.woocommerce #bl-product-grid > .brxe-iluywy {
		order: 2;
	}

	.archive.woocommerce #bl-product-grid > .brxe-iluywy:nth-child(-n+4) {
		order: 0;
	}

	.archive.woocommerce #brxe-nqorc8 {
		order: 1;
		z-index: 0; /* Keep the banner's layered copy (z-index 2) under the fixed bottom bar. */
		grid-column: 1 / -1;
		min-height: 234px;
		height: auto;
		border-radius: var(--radius-card);
	}

	/* The banner's text block sets the banner height (it was clipped at a fixed 234px); photo and wash stay behind it. */
	.archive.woocommerce #brxe-nqorc8 {
		display: flex;
		align-items: stretch;
	}

	.archive.woocommerce #brxe-4q2ete {
		position: relative;
		inset: auto;
		z-index: 2;
		height: auto;
	}

	.archive.woocommerce #brxe-fck2f0 {
		width: 82%;
	}

	.archive.woocommerce #brxe-4q2ete {
		gap: var(--space-20);
/* 		width: 230px;
		max-width: 66%; */
		padding: var(--space-20);
	}

	.archive.woocommerce #brxe-idd16k {
		gap: var(--space-10);
		width: 100%;
	}

	.archive.woocommerce #brxe-lizgly {
		font-size: 24px;
		line-height: 1.3;
	}

	.archive.woocommerce #brxe-m2ccw7 {
		font-size: 14px;
		line-height: 1.5;
	}

	.archive.woocommerce #brxe-kgfkor {
		width: auto;
		min-height: 0;
		padding: var(--space-15) var(--space-20);
		font-size: 13px;
		line-height: 1.17;
	}

	/* Pagination: Bricks' AJAX pagination only (the WooCommerce one and the "Page x of y" lines repeat it;
	   none of them is in the phone design). */
	.archive.woocommerce #brxe-icrjjg,
	.archive.woocommerce #brxe-eadsem,
	.archive.woocommerce #brxe-2n8crx {
		display: none;
	}

	.archive.woocommerce #brxe-wurzfa {
		align-items: center;
		gap: var(--space-10);
		padding-top: var(--space-20); /* the buttons sat directly on the divider line; match the 20px above it */
		padding-bottom: var(--space-10);
	}

	/* ---------- Bottom bar: Sort by | Shop | Filters (Figma), instead of the tabs ---------- */
	.sng-has-listbar #brxe-mnvlft,
	.sng-has-listbar #brxe-mnvrgt,
	.sng-has-listbar body #brxe-mnalft,
	.sng-has-listbar body #brxe-mnargt {
		display: none;
	}

	/* One row on every phone width: Sort by | Shop | Filters. The tab bar normally wraps, which on 360px and 320px
	   screens pushed Filters under Sort by. */
	.sng-has-listbar #brxe-mnvsec {
		flex-wrap: nowrap;
		align-items: center;
		justify-content: space-between;
		gap: var(--space-10);
		padding-right: var(--space-15);
		padding-left: var(--space-15);
	}

	.sng-listbar-btn {
		display: inline-flex;
		flex: 0 1 auto;
		align-items: center;
		gap: var(--space-5);
		height: 44px;
		margin: 0;
		padding: var(--space-10) var(--space-15);
		white-space: nowrap;
		border: var(--hairline-md) solid var(--color-border-subtle);
		border-radius: var(--radius-card);
		background: var(--color-on-accent);
		font-family: var(--font-body);
		font-size: 14px;
		font-weight: 500;
		color: var(--color-ink);
		cursor: pointer;
	}

	.sng-listbar-btn svg {
		width: 18px;
		height: 18px;
	}

	.sng-listbar-btn--filters {
		color: var(--color-brand-deep);
	}

	/* ---------- Filters popup on short phone screens (browser bars leave ~650px). Every flex column inside the popup
	   (the popup body, the tab list, the options pane) is flex-wrap: wrap, so when its content is taller than the
	   space it gets, the overflow wraps into a SECOND column to the right instead of scrolling: the footer (Clear All /
	   Apply), the last tabs and long option lists went off-screen and the popup scrolled sideways. Keep one column
	   everywhere and scroll vertically. !important so the page's own inline block styles can't win. ---------- */
	.brx-popup.brxe-popup-1926 .brx-popup-content {
		overflow-x: hidden !important;
	}

	#brxe-sngfp0 {
		flex-wrap: nowrap !important;
	}

	#brxe-sngft0 {
		flex: 1 1 0 !important;
		min-height: 0 !important;
		overflow: hidden !important;
	}

	#brxe-sngfm0,
	#brxe-sngfc0 {
		flex-wrap: nowrap !important;
		min-height: 0 !important;
		overflow-x: hidden !important;
		overflow-y: auto !important;
		-webkit-overflow-scrolling: touch;
		overscroll-behavior: contain;
	}

	#brxe-sngfm0 > *,
	#brxe-sngfc0 > * {
		flex-shrink: 0 !important;
	}

	#brxe-sngff0 {
		flex: none !important;
	}

	/* Tab column 40% of the popup (118–185px) so small phones (320px) keep room for option names and counts;
	   no scrollbars on the two lists (they still scroll by swiping, as in Figma). */
	#brxe-sngfm0 {
		flex: none !important;
		width: clamp(118px, 40%, 185px) !important;
	}

	#brxe-sngfc0 {
		flex: 1 1 0 !important;
		min-width: 0 !important;
	}

	#brxe-sngfm0,
	#brxe-sngfc0 {
		scrollbar-width: none;
	}

	#brxe-sngfm0::-webkit-scrollbar,
	#brxe-sngfc0::-webkit-scrollbar {
		display: none;
	}

	/* ---------- Sort by sheet (Figma 1300:44715) ---------- */
	.sng-sheet-open,
	.sng-sheet-open body {
		overflow: hidden;
	}

	.sng-sort-sheet {
		position: fixed;
		inset: 0;
		z-index: 1000;
	}

	.sng-sort-sheet[hidden] {
		display: none;
	}

	.sng-sort-sheet__backdrop {
		position: absolute;
		inset: 0;
		background: rgba(43, 32, 22, 0.45);
	}

	.sng-sort-sheet__panel {
		position: absolute;
		inset: auto 0 0;
		overflow: hidden;
		border-radius: var(--radius-lg) var(--radius-lg) 0 0;
		background: var(--color-surface-cream);
	}

	.sng-sort-sheet__head {
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: var(--space-15) var(--space-20);
		background: var(--color-on-accent);
	}

	.sng-sort-sheet__title {
		display: inline-flex;
		align-items: center;
		gap: var(--space-10);
		font-family: var(--font-body);
		font-size: 16px;
		font-weight: 500;
		color: var(--color-ink);
	}

	.sng-sort-sheet__title svg {
		width: 20px;
		height: 20px;
	}

	.sng-sort-sheet__close {
		padding: 0;
		border: 0;
		background: none;
		font-size: 28px;
		line-height: 1;
		color: var(--color-brand-deep);
		cursor: pointer;
	}

	.sng-sort-sheet__list {
		display: flex;
		flex-direction: column;
		gap: var(--space-15);
		margin: 0;
		padding: var(--space-15) var(--space-20) var(--space-40);
		border: 0;
	}

	.sng-sort-sheet__option {
		display: flex;
		align-items: center;
		gap: var(--space-10);
		font-family: var(--font-body);
		font-size: 14px;
		font-weight: 500;
		color: var(--color-ink);
		cursor: pointer;
	}

	.sng-sort-sheet__option input {
		width: 18px;
		height: 18px;
		margin: 0;
		accent-color: var(--color-brand-deep);
	}

	/* "Notify Me" (out of stock, inc/back-in-stock.php) the same size as Add to cart / Buy now. */
	.archive.woocommerce #bl-product-grid .sng-card .sng-card-notify {
		display: flex;
		align-items: center;
		justify-content: center;
		box-sizing: border-box;
		width: 100%;
		height: 36px;
		min-height: 36px;
		margin: 0;
		padding: 0 var(--space-10);
		border-radius: 999px;
		font-size: 13px;
		font-weight: 600;
		line-height: 15.6px;
		white-space: nowrap;
	}
}
