/* ==========================================================================
   V6.1 tire shop layout.

   Adds the catalog sidebar, filter controls and shop grid. Inherits every V6
   token, so nothing about the palette, typography or motif changes here.
   ========================================================================== */

/* ------------------------------------------------------------ shop layout */

.wt-shop {
	display: grid;
	gap: clamp(0.85rem, 1.5vw, 1.15rem);
	grid-template-columns: 1fr;
	align-items: start;
	margin: 0 !important;
}

@media (min-width: 1024px) {
	.wt-shop {
		grid-template-columns: 13.75rem minmax(0, 1fr);
	}
}

.wt-shop__main {
	min-width: 0;
}

.wt-shop-page__intro {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.6rem 1rem;
	width: 100%;
	max-width: none;
	margin: 0 0 0.75rem;
	padding: 0.75rem 0.9rem;
	border: 1px solid var(--wt-border);
	border-radius: var(--wt-radius-lg);
	background: linear-gradient(120deg, var(--wt-white), var(--wt-navy-50));
	box-shadow: var(--wt-shadow-sm);
}

.wt-shop-page {
	padding-block: clamp(0.75rem, 1.5vw, 1.25rem) clamp(1.75rem, 3vw, 2.75rem);
	scroll-margin-top: calc(var(--wt-adminbar-h) + 6rem);
}

.wt-shop-page > .wt-container {
	display: flex;
	flex-direction: column;
	gap: 0;
}

.wt-shop-page__intro > * {
	margin-block: 0 !important;
}

.wt-shop-page__intro > p:first-child {
	flex: 1 1 30rem;
	font-size: var(--wt-text-base);
	line-height: 1.5;
}

.wt-shop-page__intro > p:last-child:not(:first-child) {
	flex-basis: 100%;
	font-size: var(--wt-text-sm);
	color: var(--wt-text-muted);
}

/* ---------------------------------------------------------- filter panel */

.wt-shop-filters {
	display: grid;
	gap: var(--wt-space-2);
	align-content: start;
	padding: 0 var(--wt-space-4) var(--wt-space-4);
	border: 1px solid var(--wt-border);
	border-radius: var(--wt-radius-lg);
	background:
		var(--wt-tread-light),
		linear-gradient(170deg, var(--wt-white), var(--wt-navy-50));
	box-shadow: var(--wt-shadow-sm);
}

@media (min-width: 1024px) {
	.wt-shop-filters {
		position: sticky;
		top: calc(var(--wt-adminbar-h) + 6rem);
		max-height: calc(100vh - var(--wt-adminbar-h) - 7rem);
		overflow-y: auto;
		overscroll-behavior: contain;
		scrollbar-width: thin;
		scrollbar-color: var(--wt-steel-300) transparent;
	}
}

.wt-shop-filters__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--wt-space-3);
	margin: 0 calc(var(--wt-space-4) * -1) var(--wt-space-2);
	padding: 0.9rem var(--wt-space-4);
	border-radius: var(--wt-radius-lg) var(--wt-radius-lg) 0 0;
	background: linear-gradient(115deg, var(--wt-navy-900), var(--wt-navy));
	box-shadow: 0 0.2rem 0.8rem rgba(8, 35, 58, 0.16);
}

.wt-shop-filters__title {
	margin: 0;
	font-size: 1.05rem;
	font-weight: var(--wt-weight-bold);
	color: var(--wt-white);
	letter-spacing: -0.01em;
}

/* The close control only exists in the mobile drawer. */
.wt-shop-filters__close {
	display: none;
	align-items: center;
	justify-content: center;
	width: 2.5rem;
	height: 2.5rem;
	padding: 0;
	border: 0;
	border-radius: var(--wt-radius);
	background: var(--wt-steel-100);
	color: var(--wt-navy);
	cursor: pointer;
}

.wt-shop-filters__empty {
	margin: 0;
	font-size: var(--wt-text-sm);
	color: var(--wt-text-muted);
}

/* ------------------------------------------------------- applied filters */

.wt-shop-filters__active {
	padding: var(--wt-space-4);
	margin-bottom: var(--wt-space-2);
	border: 1px solid var(--wt-orange-100);
	border-radius: var(--wt-radius-lg);
	background: var(--wt-surface-warm);
}

.wt-shop-filters__active-label {
	margin: 0 0 var(--wt-space-3);
	font-size: var(--wt-text-xs);
	font-weight: var(--wt-weight-bold);
	letter-spacing: var(--wt-tracking-wide);
	text-transform: uppercase;
	color: var(--wt-accent-text);
}

.wt-chip-list {
	display: flex;
	flex-wrap: wrap;
	gap: var(--wt-space-2);
	margin: 0 0 var(--wt-space-4);
	padding: 0;
	list-style: none;
}

.wt-chip-list .wt-chip {
	text-decoration: none;
}

.wt-chip-list .wt-chip__remove .wt-icon {
	width: 0.85rem;
	height: 0.85rem;
}

.wt-shop-filters__clear {
	width: 100%;
}

/* --------------------------------------------------------- filter groups */

.wt-filter-group {
	border-top: 1px solid var(--wt-border);
}

.wt-filter-group__heading {
	margin: 0;
	font-size: var(--wt-text-base);
}

.wt-filter-group__trigger {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--wt-space-3);
	width: 100%;
	padding: 0.8rem 0;
	border: 0;
	background: none;
	color: var(--wt-navy);
	font-family: var(--wt-font-display);
	font-size: 0.86rem;
	font-weight: var(--wt-weight-bold);
	letter-spacing: var(--wt-tracking-wide);
	text-transform: uppercase;
	text-align: left;
	cursor: pointer;
}

.wt-filter-group__trigger .wt-icon {
	flex: none;
	transition: transform var(--wt-duration) var(--wt-ease);
}

.wt-filter-group__trigger[aria-expanded="true"] .wt-icon {
	transform: rotate(180deg);
}

.wt-filter-group__panel[hidden] {
	display: none;
}

.wt-filter-group__hint {
	margin: 0 0 var(--wt-space-3);
	font-size: 0.78rem;
	color: var(--wt-text-muted);
}

.wt-filter-list {
	display: grid;
	gap: 0.15rem;
	margin: 0 0 var(--wt-space-4);
	padding: 0;
	list-style: none;
	max-height: none;
	overflow: visible;
}

.wt-filter-option {
	display: flex;
	align-items: center;
	gap: 0.55rem;
	padding: 0.38rem 0.3rem;
	border-radius: var(--wt-radius-sm);
	color: var(--wt-text);
	font-size: 0.82rem;
	text-decoration: none;
	transition: background-color var(--wt-duration-fast) var(--wt-ease);
}

.wt-filter-option:hover {
	background: var(--wt-navy-50);
	color: var(--wt-navy);
}

.wt-filter-option__box {
	display: grid;
	place-items: center;
	flex: none;
	width: 1.2rem;
	height: 1.2rem;
	border: 2px solid var(--wt-border-strong);
	border-radius: 0.28rem;
	background: var(--wt-white);
}

.wt-filter-option__box .wt-icon {
	width: 0.85rem;
	height: 0.85rem;
	color: var(--wt-accent-label);
}

.wt-filter-option.is-active .wt-filter-option__box {
	border-color: var(--wt-orange);
	background: var(--wt-orange);
}

.wt-filter-option.is-active {
	color: var(--wt-navy);
	font-weight: var(--wt-weight-bold);
}

.wt-filter-option__label {
	flex: 1;
	min-width: 0;
}

.wt-filter-option__count {
	flex: none;
	font-size: var(--wt-text-xs);
	font-variant-numeric: tabular-nums;
	color: var(--wt-text-muted);
}

.wt-shop-filters__foot {
	padding-top: var(--wt-space-4);
	border-top: 1px solid var(--wt-border);
}

.wt-shop-filters__switch {
	display: inline-flex;
	align-items: center;
	gap: var(--wt-space-2);
	color: var(--wt-navy);
	font-size: var(--wt-text-sm);
	font-weight: var(--wt-weight-bold);
	text-decoration: none;
}

.wt-shop-filters__switch:hover {
	color: var(--wt-accent-text);
}

.wt-shop-filters__switch .wt-icon {
	color: var(--wt-orange);
}

/* ------------------------------------------------------- toolbar controls */

.wt-shop-page .wt-catalog-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem 1rem;
	position: relative;
	min-height: 3.65rem;
	margin: 0 0 0.8rem;
	padding: 0.55rem 0.65rem 0.55rem 1rem;
	border: 0;
	border-radius: var(--wt-radius-lg);
	background:
		linear-gradient(105deg, var(--wt-navy-900), var(--wt-navy) 66%, #116aa3);
	box-shadow: 0 0.55rem 1.4rem rgba(8, 35, 58, 0.18);
	overflow: hidden;
}

.wt-shop-page .wt-catalog-toolbar::before {
	content: "";
	position: absolute;
	inset-block: 0.65rem;
	inset-inline-start: 0;
	width: 0.28rem;
	border-radius: 0 var(--wt-radius-pill) var(--wt-radius-pill) 0;
	background: var(--wt-orange-bright);
}

.wt-shop-page .woocommerce-result-count {
	position: relative;
	z-index: 1;
	margin: 0;
	color: var(--wt-white);
	font-family: var(--wt-font-display);
	font-size: 0.92rem;
	font-weight: 800;
	letter-spacing: 0.01em;
	text-shadow: 0 1px 1px rgba(0, 0, 0, 0.22);
}

.wt-shop-page .woocommerce .woocommerce-ordering select,
.wt-shop-page .woocommerce-ordering select {
	min-height: 2.65rem;
	border-color: rgba(255, 255, 255, 0.7);
	background-color: var(--wt-white);
	color: var(--wt-navy);
	font-weight: var(--wt-weight-bold);
}

.wt-catalog-toolbar__controls {
	display: flex;
	align-items: center;
	gap: var(--wt-space-3);
}

/* Desktop keeps the sidebar visible, so the toggle is mobile-only. */
.wt-filter-toggle {
	display: none;
	align-items: center;
	gap: var(--wt-space-2);
	min-height: 2.9rem;
	padding: 0.5rem 1rem;
	border: 2px solid var(--wt-navy);
	border-radius: var(--wt-radius-pill);
	background: var(--wt-navy);
	color: var(--wt-white);
	font-weight: var(--wt-weight-bold);
	font-size: var(--wt-text-sm);
	cursor: pointer;
}

.wt-filter-toggle .wt-icon {
	width: 1.05rem;
	height: 1.05rem;
}

/* Call for Price reads as a state, not a missing value. */
.wt-price-call {
	display: inline-block;
	font-family: var(--wt-font-display);
	font-size: var(--wt-text-base);
	font-weight: var(--wt-weight-bold);
	letter-spacing: var(--wt-tracking-wide);
	text-transform: uppercase;
	color: var(--wt-accent-text);
}

.wt-catalog-card__brand {
	margin: 0;
	padding-inline: var(--wt-space-5);
	font-size: var(--wt-text-xs);
	font-weight: var(--wt-weight-bold);
	letter-spacing: var(--wt-tracking-wide);
	text-transform: uppercase;
	color: var(--wt-text-muted);
}

.wt-empty--filtered {
	border-style: solid;
	border-color: var(--wt-border);
}

/* ------------------------------------------------------ compact card grid */

/*
 * The parent catalog deliberately uses generous three-column cards. These
 * inventory pages can contain dozens of size-based listings, so their cards
 * need to scan more like a compact tire catalog. Keep the image frame square,
 * reduce internal whitespace, and add a fourth column only when the results
 * area is genuinely wide enough.
 */
.wt-shop-page .woocommerce ul.products {
	display: grid;
	gap: clamp(0.65rem, 1vw, 0.9rem);
	margin: 0 0 var(--wt-space-7);
	padding: 0;
	list-style: none;
}

.wt-shop-page .woocommerce ul.products::before,
.wt-shop-page .woocommerce ul.products::after {
	display: none;
	content: none;
}

.wt-shop-page .woocommerce ul.products li.product {
	position: relative;
	display: flex;
	flex-direction: column;
	width: auto !important;
	margin: 0 !important;
	float: none !important;
	padding: 0;
	min-width: 0;
	border-radius: 0.65rem;
	overflow: hidden;
	box-shadow: 0 0.35rem 0.9rem rgba(8, 35, 58, 0.1);
}

.wt-shop-page .woocommerce ul.products li.product a.woocommerce-LoopProduct-link {
	gap: 0.3rem;
	margin-inline: -0.75rem;
	padding: 0 0.75rem 0.35rem;
}

.wt-shop-page .woocommerce ul.products li.product img {
	display: block;
	width: 100%;
	aspect-ratio: 1 / 1;
	height: auto;
	margin: 0 0 0.5rem;
	object-fit: cover;
	background: var(--wt-steel-100);
}

.wt-shop-page .woocommerce ul.products li.product img.wt-catalog-card__placeholder {
	object-fit: contain;
	padding: clamp(0.4rem, 1vw, 0.75rem);
	background:
		radial-gradient(circle at 50% 44%, var(--wt-white), var(--wt-navy-50) 68%, var(--wt-steel-100));
}

.wt-shop-page .woocommerce ul.products li.product .woocommerce-loop-product__title {
	display: -webkit-box;
	min-height: 2.25em;
	padding-inline: 0.75rem;
	font-size: clamp(0.78rem, 0.8vw, 0.88rem);
	line-height: 1.15;
	overflow-wrap: anywhere;
	overflow: hidden;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

.wt-shop-page .wt-catalog-card__brand,
.wt-shop-page .wt-catalog-card__size,
.wt-shop-page .woocommerce ul.products li.product .price {
	padding-inline: 0.75rem;
}

.wt-shop-page .wt-catalog-card__brand {
	font-size: 0.64rem;
}

.wt-shop-page .wt-catalog-card__size {
	font-size: 0.76rem;
}

.wt-shop-page .woocommerce ul.products li.product .price,
.wt-shop-page .wt-price-call {
	font-size: 0.82rem;
}

.wt-shop-page .wt-catalog-card__action {
	margin: auto 0.75rem 0.75rem;
}

.wt-shop-page .wt-catalog-card__action .wt-btn {
	width: 100%;
	min-height: 2.4rem;
	padding: 0.45rem 0.65rem;
	border-color: var(--wt-navy);
	background: linear-gradient(110deg, var(--wt-navy-900), var(--wt-navy));
	box-shadow: 0 0.35rem 0.8rem rgba(8, 35, 58, 0.18);
	color: var(--wt-white);
	font-size: 0.76rem;
}

.wt-shop-page .wt-catalog-card__action .wt-btn:hover,
.wt-shop-page .wt-catalog-card__action .wt-btn:focus-visible {
	border-color: var(--wt-blue-bright);
	background: linear-gradient(110deg, var(--wt-navy), var(--wt-blue));
	color: var(--wt-white);
}

@media (min-width: 1180px) {
	.wt-shop-page .woocommerce ul.products {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

/* ------------------------------------------------------- shop hero motion */

.wt-shop-hero-motion {
	position: absolute;
	inset: 0;
	z-index: 0;
	pointer-events: none;
	overflow: hidden;
}

.wt-shop-hero-motion__track {
	position: absolute;
	display: block;
	aspect-ratio: 1;
	opacity: 0.55;
	filter: drop-shadow(0 1rem 1.5rem rgba(0, 0, 0, 0.28));
}

.wt-shop-hero-motion__track--one {
	width: clamp(8rem, 15vw, 14rem);
	inset-inline-end: 10%;
	inset-block-start: 12%;
	animation: wt-shop-tire-float-one 7s ease-in-out infinite alternate;
}

.wt-shop-hero-motion__track--two {
	width: clamp(5rem, 9vw, 8rem);
	inset-inline-end: 2.5%;
	inset-block-end: 5%;
	opacity: 0.32;
	animation: wt-shop-tire-float-two 8.5s ease-in-out infinite alternate;
}

.wt-shop-hero-motion__track--three {
	width: clamp(3.5rem, 6vw, 5.5rem);
	inset-inline-end: 27%;
	inset-block-end: 9%;
	opacity: 0.2;
	animation: wt-shop-tire-float-three 6s ease-in-out infinite alternate;
}

.wt-shop-hero-motion__tire {
	position: absolute;
	inset: 0;
	display: block;
	border: clamp(0.72rem, 1.6vw, 1.35rem) solid rgba(5, 17, 28, 0.86);
	border-radius: 50%;
	background:
		radial-gradient(circle, rgba(235, 244, 250, 0.92) 0 10%, #71869a 11% 18%, #13283a 19% 24%, rgba(225, 238, 247, 0.9) 25% 31%, transparent 32%),
		repeating-conic-gradient(from 5deg, rgba(255, 255, 255, 0.28) 0 5deg, rgba(11, 41, 65, 0.7) 5deg 13deg);
	box-shadow:
		inset 0 0 0 0.22rem rgba(255, 255, 255, 0.16),
		0 0 0 0.12rem rgba(255, 255, 255, 0.22);
	animation: wt-shop-tire-spin 15s linear infinite;
}

.wt-shop-hero-motion__tire::after {
	content: "";
	position: absolute;
	inset-inline-start: 50%;
	inset-block-start: -0.72rem;
	width: 0.32rem;
	height: 1rem;
	border-radius: var(--wt-radius-pill);
	background: var(--wt-orange-bright);
	box-shadow: 0 0 0.8rem var(--wt-orange);
	transform: translateX(-50%);
}

@keyframes wt-shop-tire-spin {
	to { transform: rotate(360deg); }
}

@keyframes wt-shop-tire-float-one {
	from { transform: translate3d(0, -0.4rem, 0) rotate(-3deg); }
	to { transform: translate3d(-1.2rem, 0.9rem, 0) rotate(3deg); }
}

@keyframes wt-shop-tire-float-two {
	from { transform: translate3d(0.3rem, 0.5rem, 0); }
	to { transform: translate3d(-0.8rem, -0.7rem, 0); }
}

@keyframes wt-shop-tire-float-three {
	from { transform: translate3d(-0.2rem, 0, 0); }
	to { transform: translate3d(0.6rem, -0.8rem, 0); }
}

/* The drawer backdrop is injected by script and only exists for the mobile
   sheet. It is hidden by default so that, even if it were ever inserted inside
   a layout container, it can never occupy a grid cell or affect flow. */
.wt-shop-backdrop {
	display: none;
}

/* ==========================================================================
   Mobile: filters become a bottom drawer.

   A permanent sidebar would eat the screen, so below 1024px the panel is
   hidden and opens as a sheet that covers at most 85% of the viewport, with
   the page behind it locked from scrolling.
   ========================================================================== */

@media (max-width: 1023px) {
	.wt-filter-toggle {
		display: inline-flex;
	}

	.wt-shop-filters {
		position: fixed;
		inset-inline: 0;
		inset-block-end: 0;
		z-index: var(--wt-z-drawer);
		max-height: 85vh;
		max-height: 85dvh;
		overflow-y: auto;
		overscroll-behavior: contain;
		border: 0;
		border-top: 1px solid var(--wt-border);
		border-radius: var(--wt-radius-2xl) var(--wt-radius-2xl) 0 0;
		box-shadow: var(--wt-shadow-lg);
		transform: translateY(101%);
		visibility: hidden;
		transition: transform var(--wt-duration) var(--wt-ease),
		            visibility var(--wt-duration) var(--wt-ease);
		padding-bottom: calc(var(--wt-space-6) + env(safe-area-inset-bottom, 0px));
	}

	.wt-shop-filters.is-open {
		transform: translateY(0);
		visibility: visible;
	}

	.wt-shop-filters__close {
		display: inline-flex;
	}

	/* Grab handle so the sheet reads as draggable-looking and intentional. */
	.wt-shop-filters::before {
		content: "";
		display: block;
		width: 2.75rem;
		height: 0.28rem;
		margin: 0 auto var(--wt-space-3);
		border-radius: var(--wt-radius-pill);
		background: var(--wt-steel-300);
	}

	.wt-shop-backdrop {
		display: block;
		position: fixed;
		inset: 0;
		z-index: calc(var(--wt-z-drawer) - 1);
		border: 0;
		width: 100%;
		background: var(--wt-scrim-drawer);
		opacity: 0;
		visibility: hidden;
		transition: opacity var(--wt-duration) var(--wt-ease),
		            visibility var(--wt-duration) var(--wt-ease);
		cursor: pointer;
	}

	.wt-shop-backdrop.is-open {
		opacity: 1;
		visibility: visible;
	}

	.wt-filter-list {
		max-height: none;
	}
}

@media (max-width: 767px) {
	.wt-shop-page {
		overflow-x: clip;
	}

	.wt-shop-page .wt-container,
	.wt-shop,
	.wt-shop__main,
	.wt-shop-page .woocommerce ul.products,
	.wt-shop-page .woocommerce ul.products li.product {
		min-width: 0;
		max-width: 100%;
	}

	.wt-catalog-toolbar__controls {
		width: 100%;
		min-width: 0;
	}

	.wt-filter-toggle {
		flex: 1;
		justify-content: center;
		min-width: 0;
	}

	.wt-catalog-toolbar .woocommerce-ordering {
		flex: 1;
		min-width: 0;
	}

	.wt-catalog-toolbar .woocommerce-ordering select {
		width: 100%;
		min-width: 0;
	}

	.wt-shop-page__intro {
		margin-bottom: 0.8rem;
		padding: 0.75rem 0.85rem;
	}

	.wt-shop-filters {
		width: 100%;
		max-width: 100vw;
		max-width: 100dvw;
	}

	.wt-shop-page .wt-catalog-toolbar {
		gap: 0.65rem;
		padding: 0.75rem;
	}

	.wt-shop-page .woocommerce-result-count {
		width: 100%;
		font-size: 0.85rem;
	}

	.wt-shop-hero-motion__track--one {
		inset-inline-end: -8%;
		inset-block-start: 18%;
		width: 8rem;
		opacity: 0.24;
	}

	.wt-shop-hero-motion__track--two,
	.wt-shop-hero-motion__track--three {
		display: none;
	}
}

@media (max-width: 619px) {
	/*
	 * Two compact cards fit comfortably at common phone widths (320-430px).
	 * This keeps the catalog fast to scan without horizontal scrolling.
	 */
	.wt-shop-page .woocommerce ul.products {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 0.7rem;
	}

	.wt-shop-page .woocommerce ul.products li.product a.woocommerce-LoopProduct-link {
		margin-inline: -0.55rem;
		padding-inline: 0.55rem;
	}

	.wt-shop-page .woocommerce ul.products li.product img {
		margin-bottom: 0.5rem;
	}

	.wt-shop-page .woocommerce ul.products li.product .woocommerce-loop-product__title {
		min-height: 2.2em;
		padding-inline: 0.55rem;
		font-size: 0.78rem;
		line-height: 1.1;
	}

	.wt-shop-page .wt-catalog-card__brand,
	.wt-shop-page .wt-catalog-card__size,
	.wt-shop-page .woocommerce ul.products li.product .price {
		padding-inline: 0.55rem;
	}

	.wt-shop-page .wt-catalog-card__brand {
		font-size: 0.58rem;
	}

	.wt-shop-page .wt-catalog-card__size {
		font-size: 0.7rem;
	}

	.wt-shop-page .woocommerce ul.products li.product .price,
	.wt-shop-page .wt-price-call {
		font-size: 0.74rem;
	}

	.wt-shop-page .wt-catalog-card__badges {
		inset-inline-start: 0.6rem;
		inset-block-start: 0.6rem;
	}

	.wt-shop-page .wt-catalog-card__action {
		margin: auto 0.55rem 0.55rem;
	}

	.wt-shop-page .wt-catalog-card__action .wt-btn {
		min-height: 2.25rem;
		padding: 0.4rem 0.35rem;
		font-size: 0.68rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.wt-shop-filters,
	.wt-shop-backdrop,
	.wt-filter-option,
	.wt-filter-group__trigger .wt-icon {
		transition: none !important;
	}

	.wt-shop-hero-motion__track,
	.wt-shop-hero-motion__tire {
		animation: none !important;
	}
}
