/**
 * Wareoff Distribution Theme: storefront (0.3.0).
 *
 * The theme's copies of the plugin's storefront templates (wareoff/
 * storefront/): product lists, filters, the product page, and the plugin's
 * own Add to cart box, whose markup stays the plugin's. The theme declares
 * storefront support, so the plugin's storefront.css is not loaded and
 * these rules replace it. Loaded on storefront pages and on pages with the
 * [wds_catalogue] or [wds_product] shortcodes.
 */

.wot-store {
	padding-bottom: var(--wot-space-8);
}

.wot-store .wot-breadcrumbs {
	padding-top: var(--wot-space-4);
}

/* Anchors land below the sticky header. */
.wot-store [id] {
	scroll-margin-top: calc(var(--wot-header-height) + var(--wot-space-4));
}

/* List header ------------------------------------------------------------- */
.wot-store-header {
	display: flex;
	gap: var(--wot-space-4);
	align-items: center;
	padding-block: var(--wot-space-4) var(--wot-space-5);
}

.wot-store-header__logo {
	flex: none;
	width: 4rem;
	height: 4rem;
	padding: var(--wot-space-2);
	border: 1px solid var(--wot-line);
	border-radius: var(--wot-radius-card);
	background: var(--wot-surface);
	object-fit: contain;
}

.wot-store-header__title {
	margin: 0;
	font-size: var(--wot-text-3xl);
}

.wot-store-header__intro {
	max-width: 46rem;
	margin: var(--wot-space-2) 0 0;
	color: var(--wot-ink-muted);
}

/* Layout: rail and list --------------------------------------------------- */
.wot-store-layout {
	display: grid;
	gap: var(--wot-space-5);
	align-items: start;
}

.wot-store-main {
	min-width: 0;
}

@media (min-width: 1024px) {
	.wot-store-layout {
		grid-template-columns: 16rem minmax(0, 1fr);
		gap: var(--wot-space-6);
	}

	.wot-store-filter-button {
		display: none !important;
	}

	.wot-store-filters {
		position: sticky;
		top: calc(var(--wot-header-height) + var(--wot-space-4));
		max-height: calc(100vh - var(--wot-header-height) - var(--wot-space-6));
		overflow-y: auto;
	}

	.wot-store-filters__head {
		display: none;
	}
}

/* Categories and brands --------------------------------------------------- */
.wot-store-filters {
	padding: var(--wot-space-4);
	border: 1px solid var(--wot-line);
	border-radius: var(--wot-radius-card);
	background: var(--wot-surface);
}

.wot-filter-group + .wot-filter-group {
	margin-top: var(--wot-space-5);
	padding-top: var(--wot-space-4);
	border-top: 1px solid var(--wot-line);
}

.wot-filter-group__title {
	margin: 0 0 var(--wot-space-2);
	color: var(--wot-ink-muted);
	font-size: var(--wot-text-xs);
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.wot-filter-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.wot-filter-list--nested {
	margin-left: var(--wot-space-3);
	padding-left: var(--wot-space-2);
	border-left: 1px solid var(--wot-line);
}

.wot-filter-list__link {
	display: flex;
	gap: var(--wot-space-2);
	align-items: center;
	justify-content: space-between;
	min-height: 2.5rem;
	padding: var(--wot-space-1) var(--wot-space-2);
	border-radius: var(--wot-radius-control);
	color: var(--wot-ink);
	text-decoration: none;
}

.wot-filter-list__link:hover {
	background: var(--wot-green-50);
	color: var(--wot-ink);
	text-decoration: none;
}

.wot-filter-list__link.is-current {
	background: var(--wot-green-100);
	color: var(--wot-green-950);
	font-weight: 600;
}

.wot-filter-list__count {
	color: var(--wot-ink-muted);
	font-size: var(--wot-text-sm);
	font-variant-numeric: tabular-nums;
}

/* The button needs the script; until it runs (or without it) it stays hidden. */
.wot-store-filter-button[hidden] {
	display: none;
}

/* Phones and tablets: a panel opened by the "Categories and brands" button.
   Without JavaScript the rail stays in the page, above the products. */
.wot-store-filters__head {
	display: none;
}

@media (max-width: 1023px) {
	.wot-store-filter-button {
		justify-self: start;
	}

	.wot-filters-ready .wot-store-filters {
		position: fixed;
		inset: 0 auto 0 0;
		z-index: 200;
		width: min(22rem, 88vw);
		border-width: 0 1px 0 0;
		border-radius: 0;
		overflow-y: auto;
		box-shadow: var(--wot-shadow-menu);
		transform: translateX(-105%);
		visibility: hidden;
	}

	.wot-filters-ready .wot-store-filters.is-open {
		transform: none;
		visibility: visible;
	}

	/* Transitions start once the panel is in place (storefront.js, 0.8.0). */
	.wot-filters-animate .wot-store-filters {
		transition: transform var(--wot-duration) var(--wot-ease), visibility 0s linear var(--wot-duration);
	}

	.wot-filters-animate .wot-store-filters.is-open {
		transition: transform var(--wot-duration) var(--wot-ease);
	}

	.wot-filters-ready .wot-store-filters__head {
		display: flex;
		align-items: center;
		justify-content: space-between;
		margin: calc(-1 * var(--wot-space-4)) calc(-1 * var(--wot-space-4)) var(--wot-space-4);
		padding: var(--wot-space-2) var(--wot-space-2) var(--wot-space-2) var(--wot-space-4);
		border-bottom: 1px solid var(--wot-line);
	}

	.wot-store-filters__title {
		margin: 0;
		font-weight: 600;
	}

	body.wot-filters-open::after {
		content: "";
		position: fixed;
		inset: 0;
		z-index: 199;
		background: rgb(23 43 36 / 0.45);
	}
}

/* Active filters as chips ------------------------------------------------- */
.wot-chips {
	display: flex;
	flex-wrap: wrap;
	gap: var(--wot-space-2);
	margin: 0 0 var(--wot-space-4);
	padding: 0;
	list-style: none;
}

.wot-chip {
	display: inline-flex;
	gap: var(--wot-space-1);
	align-items: center;
	min-height: 2.25rem;
	padding: 0 var(--wot-space-1) 0 var(--wot-space-3);
	border: 1px solid var(--wot-green-100);
	border-radius: var(--wot-radius-pill);
	background: var(--wot-green-50);
	font-size: var(--wot-text-sm);
}

.wot-chip__label {
	color: var(--wot-ink-muted);
}

.wot-chip__clear {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.25rem;
	height: 2.25rem;
	border-radius: var(--wot-radius-pill);
	color: var(--wot-ink);
}

.wot-chip__clear:hover {
	background: var(--wot-green-100);
	color: var(--wot-green-950);
}

/* Search and sort --------------------------------------------------------- */
.wot-store-toolbar {
	display: flex;
	flex-wrap: wrap;
	gap: var(--wot-space-3);
	align-items: flex-end;
	margin-bottom: var(--wot-space-4);
}

.wot-store-toolbar__search {
	position: relative;
	flex: 1 1 16rem;
}

.wot-store-toolbar__search .wot-input {
	width: 100%;
	padding-left: 2.5rem;
}

.wot-store-toolbar__icon {
	position: absolute;
	top: 50%;
	left: var(--wot-space-3);
	color: var(--wot-ink-muted);
	transform: translateY(-50%);
	pointer-events: none;
}

.wot-store-toolbar__sort {
	display: flex;
	gap: var(--wot-space-2);
	align-items: center;
}

.wot-store-toolbar__sort label {
	color: var(--wot-ink-muted);
	font-size: var(--wot-text-sm);
}

@media (max-width: 479px) {
	.wot-store-toolbar__sort {
		flex: 1 1 100%;
	}

	.wot-store-toolbar__sort .wot-input {
		flex: 1;
	}

	.wot-store-toolbar .wot-button {
		width: 100%;
	}
}

.wot-store-count {
	margin: 0 0 var(--wot-space-3);
	color: var(--wot-ink-muted);
	font-size: var(--wot-text-sm);
}

.wot-store .wot-notice {
	margin-bottom: var(--wot-space-4);
}

.wot-store .wot-pager {
	margin-top: var(--wot-space-6);
}

/* Product page ------------------------------------------------------------ */
.wot-product__top {
	display: grid;
	gap: var(--wot-space-6);
	align-items: start;
	padding-top: var(--wot-space-4);
}

@media (min-width: 1024px) {
	.wot-product__top {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
		gap: var(--wot-space-8);
	}

	.wot-product__gallery {
		position: sticky;
		top: calc(var(--wot-header-height) + var(--wot-space-4));
	}
}

.wot-product__main,
.wot-product__placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 1;
	overflow: hidden;
	border: 1px solid var(--wot-line);
	border-radius: var(--wot-radius-card);
	background: var(--wot-surface);
}

.wot-product__main-img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.wot-product__placeholder {
	color: var(--wot-line-strong);
}

.wot-product__placeholder .wot-icon {
	width: 4rem;
	height: 4rem;
}

.wot-product__thumbs {
	display: flex;
	flex-wrap: wrap;
	gap: var(--wot-space-2);
	margin: var(--wot-space-3) 0 0;
	padding: 0;
	list-style: none;
}

.wot-product__thumb {
	display: block;
	width: 4.5rem;
	height: 4.5rem;
	overflow: hidden;
	border: 2px solid var(--wot-line);
	border-radius: var(--wot-radius-control);
	background: var(--wot-surface);
}

.wot-product__thumb img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.wot-product__thumb.is-current,
.wot-product__thumb:hover {
	border-color: var(--wot-green-900);
}

.wot-product__brand {
	margin: 0 0 var(--wot-space-1);
	font-size: var(--wot-text-sm);
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.wot-product__name {
	margin: 0;
	font-size: var(--wot-text-3xl);
	line-height: 1.15;
}

.wot-product__sku {
	margin: var(--wot-space-2) 0 0;
	color: var(--wot-ink-muted);
	font-family: var(--wot-font-mono);
	font-size: var(--wot-text-sm);
}

.wot-product__lead {
	margin: var(--wot-space-3) 0 0;
	color: var(--wot-ink-muted);
	font-size: var(--wot-text-lg);
}

.wot-product__buy {
	margin: var(--wot-space-5) 0;
	padding: var(--wot-space-5);
	border: 1px solid var(--wot-line);
	border-radius: var(--wot-radius-card);
	background: var(--wot-surface);
}

.wot-product__buy > .wot-notice {
	margin: 0;
}

.wot-product__price-row {
	display: flex;
	flex-wrap: wrap;
	gap: var(--wot-space-3);
	align-items: center;
	justify-content: space-between;
}

.wot-product__price-row .wot-price__amount {
	font-size: var(--wot-text-3xl);
}

.wot-product__units caption {
	padding-bottom: var(--wot-space-2);
	font-weight: 600;
	text-align: left;
}

.wot-product__breaks {
	margin: 0;
	padding: 0;
	list-style: none;
	white-space: nowrap;
}

.wot-product__section {
	max-width: 50rem;
	margin-top: var(--wot-space-7);
}

.wot-product__section-title {
	margin: 0 0 var(--wot-space-3);
	font-size: var(--wot-text-2xl);
}

.wot-specs {
	margin: 0;
	border-top: 1px solid var(--wot-line);
}

.wot-specs__row {
	display: grid;
	gap: var(--wot-space-1) var(--wot-space-4);
	padding: var(--wot-space-3) 0;
	border-bottom: 1px solid var(--wot-line);
	grid-template-columns: minmax(8rem, 14rem) 1fr;
}

.wot-specs dt {
	color: var(--wot-ink-muted);
}

.wot-specs dd {
	margin: 0;
}

.wot-product__categories {
	margin-top: var(--wot-space-6);
	color: var(--wot-ink-muted);
}

.wot-product__back a {
	display: inline-flex;
	gap: var(--wot-space-1);
	align-items: center;
	min-height: var(--wot-touch);
	font-weight: 600;
}

@media (max-width: 767px) {
	.wot-product__name {
		font-size: var(--wot-text-2xl);
	}

	.wot-specs__row {
		grid-template-columns: 1fr;
	}
}

/* The plugin's Add to cart box (its markup, theme styles) ----------------- */
.wds-buy {
	margin-top: var(--wot-space-4);
	padding-top: var(--wot-space-4);
	border-top: 1px solid var(--wot-line);
}

.wds-buy__fields {
	display: flex;
	flex-wrap: wrap;
	gap: var(--wot-space-3);
}

.wds-buy__field {
	display: grid;
	flex: 1 1 9rem;
	gap: var(--wot-space-1);
}

.wds-buy__field label {
	font-size: var(--wot-text-sm);
	font-weight: 600;
}

.wds-buy select,
.wds-buy input[type="number"] {
	width: 100%;
	min-height: var(--wot-touch);
	padding: var(--wot-space-2) var(--wot-space-3);
	border: 1px solid var(--wot-line-strong);
	border-radius: var(--wot-radius-control);
	background: var(--wot-surface);
	color: var(--wot-ink);
	font: inherit;
}

.wds-buy select:focus-visible,
.wds-buy input:focus-visible,
.wds-store__button:focus-visible {
	outline: 2px solid var(--wot-color-focus);
	outline-offset: 2px;
}

.wds-buy__actions {
	display: flex;
	flex-wrap: wrap;
	gap: var(--wot-space-3);
	margin-top: var(--wot-space-4);
}

.wds-store__button {
	display: inline-flex;
	flex: 1 1 auto;
	align-items: center;
	justify-content: center;
	min-height: var(--wot-touch);
	padding: var(--wot-space-2) var(--wot-space-5);
	border: 1px solid var(--wot-color-primary);
	border-radius: var(--wot-radius-control);
	background: var(--wot-color-primary);
	color: var(--wot-ink-inverse);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	transition: background var(--wot-duration) var(--wot-ease);
}

.wds-store__button:hover {
	border-color: var(--wot-color-primary-hover);
	background: var(--wot-color-primary-hover);
}

.wds-store__button--secondary {
	background: var(--wot-surface);
	color: var(--wot-color-primary);
}

.wds-store__button--secondary:hover {
	background: var(--wot-green-50);
	color: var(--wot-green-950);
}

.wds-buy__note {
	margin: var(--wot-space-3) 0 0;
	font-size: var(--wot-text-sm);
}

.wds-store__flash {
	margin: var(--wot-space-4) 0 0;
	padding: var(--wot-space-3) var(--wot-space-4);
	border-radius: var(--wot-radius-control);
	background: var(--wot-info-soft);
	color: var(--wot-info);
}

.wds-store__flash--success {
	background: var(--wot-success-soft);
	color: var(--wot-success);
}

.wds-store__flash--error {
	background: var(--wot-danger-soft);
	color: var(--wot-danger);
}

/* Shortcodes on ordinary pages ([wds_catalogue], [wds_product]). */
.wds-store--embedded {
	margin-block: var(--wot-space-5);
}

.wds-store--embedded .wot-product__top {
	padding-top: 0;
}
