/*
 * Shop archive: category banner, sticky filter bar, sidebar pebbles, product
 * grid, load more, and the mobile filter drawer.
 *
 * Loads on the shop page and every product taxonomy archive.
 */

/* --------------------------------------------------------------- Banner -- */

.lb-banner { padding-block: var(--lb-s5) var(--lb-s6); }

.lb-banner__panel {
	position: relative;
	display: flex;
	align-items: flex-end;
	overflow: hidden;
	border-radius: var(--lb-r-hero);
	background: var(--lb-linen);
	min-height: 240px;
}

.lb-banner__panel.has-image { min-height: clamp(280px, 34vw, 400px); }

.lb-banner__media { position: absolute; inset: 0; }

.lb-banner__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.lb-banner__body {
	position: relative;
	z-index: 1;
	max-width: 720px;
	padding: clamp(var(--lb-s5), 4vw, var(--lb-s7));
}

.lb-banner__panel.has-image .lb-banner__body { color: var(--lb-paper); }
.lb-banner__panel.has-image .lb-banner__title { color: var(--lb-paper); }
.lb-banner__panel.has-image .lb-banner__text { color: rgba(251, 249, 246, .82); }
.lb-banner__panel.has-image .lb-crumbs { color: rgba(251, 249, 246, .72); }
.lb-banner__panel.has-image .lb-crumbs a { color: rgba(251, 249, 246, .9); }

.lb-banner__title { margin-block: var(--lb-s3); }
.lb-banner__text { margin-top: var(--lb-s4); }

.lb-crumbs {
	font-size: var(--lb-fs-control);
	color: var(--lb-mute);
}

.lb-crumbs a { color: var(--lb-ink); }
.lb-banner__crumb-sep { padding-inline: var(--lb-s2); opacity: .5; }

/* ------------------------------------------------------------- Notices --- */

/* The rentopian-sync date form renders here. It keeps the plugin's own markup
   and styling for now - only the spacing around it belongs to the theme. */
.lb-archive__notices:not(:empty) { margin-bottom: var(--lb-s5); }

/* ---------------------------------------------------------- Filter bar --- */

.lb-bar {
	position: sticky;
	top: var(--lb-sticky-bar);
	z-index: var(--lb-z-bar);
	background: rgba(251, 249, 246, .92);
	backdrop-filter: blur(10px);
	box-shadow: var(--lb-sh-rest);
	margin-bottom: var(--lb-s6);
}

.lb-bar__inner {
	display: flex;
	align-items: center;
	gap: var(--lb-s4);
	min-height: 66px;
	padding-block: var(--lb-s3);
}

.lb-bar__cats {
	display: flex;
	align-items: center;
	gap: var(--lb-s2);
	flex: 1 1 auto;
	min-width: 0;
	overflow-x: auto;
	scrollbar-width: none;
	padding-block: 2px;
}

.lb-bar__cats::-webkit-scrollbar { display: none; }

.lb-bar__tools {
	display: flex;
	align-items: center;
	gap: var(--lb-s3);
	flex-shrink: 0;
}

.lb-bar__count .woocommerce-result-count {
	margin: 0;
	font-size: var(--lb-fs-control);
	color: var(--lb-mute);
}

/* WooCommerce's ordering form is a bare select; give it the pill treatment. */
.lb-bar__sort .woocommerce-ordering { margin: 0; }

.lb-scope .lb-bar__sort select {
	min-height: 40px;
	padding: 9px 38px 9px 17px;
	font-size: var(--lb-fs-control);
	font-weight: 500;
	appearance: none;
	background-image: linear-gradient(45deg, transparent 50%, var(--lb-ink) 50%),
	                  linear-gradient(135deg, var(--lb-ink) 50%, transparent 50%);
	background-position: calc(100% - 19px) 52%, calc(100% - 14px) 52%;
	background-size: 5px 5px, 5px 5px;
	background-repeat: no-repeat;
}

.lb-bar__filters { display: none; }

@media (max-width: 899px) {
	.lb-bar__filters { display: inline-flex; }
	.lb-bar__count { display: none; }
}

/* --------------------------------------------------------------- Layout -- */

.lb-archive__layout {
	display: grid;
	grid-template-columns: 262px minmax(0, 1fr);
	gap: var(--lb-s6);
	align-items: start;
	padding-bottom: var(--lb-s8);
}

.lb-archive__aside {
	position: sticky;
	top: var(--lb-sticky-aside);
	max-height: var(--lb-aside-max);
	overflow-y: auto;
	scrollbar-width: thin;
}

.lb-filters {
	display: flex;
	flex-direction: column;
	gap: var(--lb-s4);
	padding-bottom: var(--lb-s5);
}

@media (max-width: 899px) {
	.lb-archive__layout { grid-template-columns: minmax(0, 1fr); }

	/* The sidebar markup moves into the drawer at this width. */
	.lb-archive__aside { display: none; }
}

/* -------------------------------------------------------- Filter groups -- */

.lb-filters__active {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--lb-s2);
}

.lb-filters__clear {
	font-size: var(--lb-fs-control);
	font-weight: 500;
	color: var(--lb-violet-ink);
	text-decoration: underline;
	padding: var(--lb-s2);
}

.lb-filter-group__title {
	margin: 0 0 var(--lb-s4);
	font-family: var(--lb-font-sans);
	font-size: var(--lb-fs-control);
	font-weight: 600;
	letter-spacing: .04em;
	color: var(--lb-ink);
}

.lb-filter-group__list {
	display: flex;
	flex-wrap: wrap;
	gap: var(--lb-s2);
	margin: 0;
	padding: 0;
	list-style: none;
}

.lb-filter-group--color .lb-filter-group__list { gap: var(--lb-s3); }

/* Colour dots. A term with no stored swatch still shows the warm well so the
   row never collapses into an invisible gap. */
.lb-swatch {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: var(--lb-r-pill);
	border: 2px solid transparent;
	transition: border-color var(--lb-dur) var(--lb-ease);
}

.lb-swatch__dot {
	width: 30px;
	height: 30px;
	border-radius: var(--lb-r-pill);
	background: var(--lb-well);
	box-shadow: inset 0 0 0 1px rgba(26, 22, 32, .12);
}

.lb-swatch:hover { border-color: var(--lb-line); }
.lb-swatch.is-active { border-color: var(--lb-ink); }

.lb-price-filter__row {
	display: flex;
	align-items: center;
	gap: var(--lb-s2);
	margin-bottom: var(--lb-s4);
}

.lb-scope .lb-price-filter input {
	width: 100%;
	min-width: 0;
	padding-inline: var(--lb-s3);
	text-align: center;
	font-variant-numeric: tabular-nums;
}

.lb-price-filter__sep { color: var(--lb-mute); }

/* ----------------------------------------------------------------- Grid -- */

.lb-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(212px, 1fr));
	gap: 26px 22px;
}

/* ------------------------------------------------------------ Load more -- */

.lb-loadmore {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--lb-s4);
	margin-top: var(--lb-s7);
}

.lb-archive__empty { padding-block: var(--lb-s7); }

/* --------------------------------------------------------------- Drawer -- */

.lb-drawer {
	position: fixed;
	inset: 0;
	z-index: var(--lb-z-drawer);
}

.lb-drawer__overlay {
	position: absolute;
	inset: 0;
	z-index: var(--lb-z-overlay);
	background: rgba(26, 22, 32, .48);
	opacity: 0;
	transition: opacity var(--lb-dur) var(--lb-ease);
}

.lb-drawer.is-open .lb-drawer__overlay { opacity: 1; }

.lb-drawer__panel {
	position: absolute;
	inset-block: 0;
	right: 0;
	z-index: calc(var(--lb-z-drawer) + 1);
	display: flex;
	flex-direction: column;
	width: min(420px, 92vw);
	background: var(--lb-paper);
	border-radius: var(--lb-r-hero) 0 0 var(--lb-r-hero);
	box-shadow: var(--lb-sh-panel);
	transform: translateX(100%);
	transition: transform var(--lb-dur) var(--lb-ease);
}

.lb-drawer.is-open .lb-drawer__panel { transform: none; }

.lb-drawer__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--lb-s4);
	padding: var(--lb-s5);
	border-bottom: 1px solid var(--lb-line);
}

.lb-drawer__title { margin: 0; font-size: 24px; }

.lb-drawer__body {
	display: flex;
	flex-direction: column;
	gap: var(--lb-s4);
	padding: var(--lb-s5);
	overflow-y: auto;
}

body.lb-drawer-open { overflow: hidden; }

@media (min-width: 900px) {
	/* Above the breakpoint the sidebar is the filter surface. */
	.lb-drawer { display: none; }
}

/* ---------------------------------------------------------- Breakpoints -- */

/*
 * The grid's auto-fill track already lands on the intended counts at the wide
 * end: 4 up above 1280, 3 up between 900 and 1279 once the 262px sidebar is
 * subtracted. Only the narrow end needs help, where a 212px minimum would drop
 * to a single column on a phone.
 */
@media (max-width: 599px) {
	.lb-grid {
		grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
		gap: 22px 14px;
	}

}

@media (max-width: 899px) {
	.lb-banner__panel.has-image { min-height: 240px; }
}
