/**
 * Velotary – WooCommerce shop archive (header, toolbar, filters, product grid).
 * Markup comes from public/public.php. Scoped to body.btelmt-woo (shop and
 * product pages, which share the product cards) so it outranks WooCommerce's
 * default loop styles without !important. Values follow the Lovable design.
 */

body.btelmt-woo {
	--btelmt-accent: #c2001a;
	--btelmt-accent-hover: #ae0017;
	--btelmt-bg: #080808;
	--btelmt-surface: #141414;
	--btelmt-surface-2: #1f1f1f;
	--btelmt-border: #292929;
	--btelmt-text: #f5f5f5;
	--btelmt-muted: #999999;
	--btelmt-font-display: "Anton", "Bebas Neue", Impact, "Arial Narrow", sans-serif;
	--btelmt-font-body: "Manrope", "Inter", system-ui, sans-serif;
	--btelmt-ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Shared button look (Lovable's base button: 12px / 800 / 48px / 12px radius). */
.btelmt-shop-hero .btelmt-shop-filter-trigger,
.btelmt-shop-hero .btelmt-shop-cat,
.btelmt-shop-hero .btelmt-shop-filter-reset,
.btelmt-shop-hero .btelmt-shop-filter-apply,
.btelmt-shop-hero .btelmt-shop-sort-option {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	height: 48px;
	margin: 0;
	padding: 12px 20px;
	font-family: var(--btelmt-font-body);
	font-size: 12px;
	font-weight: 800;
	line-height: 16px;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	text-decoration: none;
	white-space: nowrap;
	border-radius: 12px;
	box-shadow: none;
	cursor: pointer;
	transition:
		color 150ms var(--btelmt-ease),
		background-color 150ms var(--btelmt-ease),
		border-color 150ms var(--btelmt-ease);
}

/* ---------- Hero ---------- */

.btelmt-shop-hero {
	margin: 0 0 64px;
	font-family: var(--btelmt-font-body);
	color: var(--btelmt-text);
}

.btelmt-shop-hero *,
.btelmt-shop-hero *::before,
.btelmt-shop-hero *::after {
	box-sizing: border-box;
}

.btelmt-shop-subtitle {
	display: flex;
	align-items: center;
	gap: 24px;
	margin: 0 0 16px;
	font-size: 10px;
	font-weight: 400;
	line-height: 15px;
	letter-spacing: 0.5em;
	text-transform: uppercase;
	color: var(--btelmt-accent);
}

.btelmt-shop-subtitle::before {
	content: "";
	flex: 0 0 48px;
	height: 1px;
	background-color: var(--btelmt-accent);
}

.btelmt-shop-title {
	margin: 0 0 24px;
	font-family: var(--btelmt-font-display);
	font-size: 72px;
	font-weight: 300;
	line-height: 1;
	letter-spacing: 0;
	text-transform: uppercase;
	color: var(--btelmt-text);
}

.btelmt-shop-description {
	max-width: 448px;
	margin: 0 0 36px;
	font-size: 14px;
	font-weight: 400;
	line-height: 1.8;
	color: var(--btelmt-muted);
}

/* ---------- Toolbar ---------- */

.btelmt-shop-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: 12px;
	margin: 0 0 32px;
}

.btelmt-shop-search {
	position: relative;
	flex: 0 1 448px;
	min-width: 0;
	margin-right: 4px;
}

.btelmt-shop-search::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 16px;
	width: 16px;
	height: 16px;
	transform: translateY(-50%);
	background-color: rgba(153, 153, 153, 0.5);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%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 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E") center / contain no-repeat;
	pointer-events: none;
}

.btelmt-shop-hero .btelmt-shop-search input[type="search"] {
	width: 100%;
	height: 43px;
	margin: 0;
	padding: 12px 16px 12px 48px;
	font-family: var(--btelmt-font-body);
	font-size: 11px;
	letter-spacing: 0.1em;
	color: var(--btelmt-text);
	background-color: transparent;
	border: 1px solid var(--btelmt-border);
	border-radius: 0;
	box-shadow: none;
	outline: none;
	-webkit-appearance: none;
	appearance: none;
	transition: border-color 150ms var(--btelmt-ease);
}

.btelmt-shop-hero .btelmt-shop-search input[type="search"]::placeholder {
	color: rgba(153, 153, 153, 0.5);
	opacity: 1;
}

.btelmt-shop-hero .btelmt-shop-search input[type="search"]:focus {
	border-color: var(--btelmt-accent);
}

.btelmt-shop-search input[type="search"]::-webkit-search-cancel-button {
	filter: invert(1) brightness(0.6);
}

/* ---------- Filter dropdowns ---------- */

.btelmt-shop-filter {
	position: relative;
}

.btelmt-shop-hero .btelmt-shop-filter-trigger,
.btelmt-shop-hero .btelmt-shop-cat {
	color: var(--btelmt-text);
	background-color: var(--btelmt-surface);
	border: 1px solid var(--btelmt-border);
}

.btelmt-shop-hero .btelmt-shop-filter-trigger::after {
	content: "";
	width: 16px;
	height: 16px;
	background-color: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%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 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
	transition: transform 200ms var(--btelmt-ease);
}

.btelmt-shop-hero .btelmt-shop-filter-trigger[aria-expanded="true"]::after {
	transform: rotate(180deg);
}

.btelmt-shop-hero .btelmt-shop-filter-trigger:hover,
.btelmt-shop-hero .btelmt-shop-filter-trigger:focus-visible,
.btelmt-shop-hero .btelmt-shop-filter-trigger[aria-expanded="true"],
.btelmt-shop-hero .btelmt-shop-cat:hover,
.btelmt-shop-hero .btelmt-shop-cat:focus-visible {
	color: var(--btelmt-text);
	background-color: var(--btelmt-surface-2);
	border-color: var(--btelmt-accent);
}

.btelmt-shop-hero .btelmt-shop-price-filter.is-filtered .btelmt-shop-filter-trigger {
	border-color: var(--btelmt-accent);
}

.btelmt-shop-filter-panel {
	position: absolute;
	top: calc(100% + 4px);
	left: 0;
	z-index: 30;
	min-width: 240px;
	padding: 20px;
	background-color: var(--btelmt-surface);
	border: 1px solid var(--btelmt-border);
}

.btelmt-shop-filter-panel[hidden] {
	display: none;
}

.btelmt-shop-sort-filter .btelmt-shop-filter-panel {
	left: auto;
	right: 0;
	min-width: 180px;
	padding: 0;
}

/* Price slider */

.btelmt-shop-price-values {
	display: flex;
	justify-content: space-between;
	margin-bottom: 12px;
	font-size: 10px;
	line-height: 15px;
	color: var(--btelmt-muted);
}

.btelmt-shop-price-slider-wrap {
	--btelmt-min-pct: 0%;
	--btelmt-max-pct: 100%;
	position: relative;
	height: 24px;
	margin-bottom: 12px;
}

.btelmt-shop-price-slider-wrap::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 0;
	right: 0;
	height: 2px;
	transform: translateY(-50%);
	background: linear-gradient(
		to right,
		var(--btelmt-border) var(--btelmt-min-pct),
		var(--btelmt-accent) var(--btelmt-min-pct),
		var(--btelmt-accent) var(--btelmt-max-pct),
		var(--btelmt-border) var(--btelmt-max-pct)
	);
}

.btelmt-shop-hero .btelmt-shop-price-range {
	position: absolute;
	top: 5px;
	left: 0;
	width: 100%;
	height: 14px;
	margin: 0;
	padding: 0;
	background: transparent;
	border: 0;
	outline: none;
	pointer-events: none;
	-webkit-appearance: none;
	appearance: none;
}

/* Scoped under the hero + wrap so Astra's input[type=range] theme styles (blue round thumb, grey shadowed track) can't win. */
.btelmt-shop-hero .btelmt-shop-price-slider-wrap .btelmt-shop-price-range::-webkit-slider-runnable-track {
	width: 100%;
	height: 14px;
	background: transparent;
	border: 0;
	border-radius: 0;
	box-shadow: none;
}

.btelmt-shop-hero .btelmt-shop-price-slider-wrap .btelmt-shop-price-range::-moz-range-track {
	width: 100%;
	height: 14px;
	background: transparent;
	border: 0;
	border-radius: 0;
	box-shadow: none;
}

.btelmt-shop-hero .btelmt-shop-price-slider-wrap .btelmt-shop-price-range::-webkit-slider-thumb {
	width: 14px;
	height: 14px;
	margin-top: 0;
	background: var(--btelmt-accent);
	border: 0;
	border-radius: 0;
	box-shadow: none;
	cursor: grab;
	pointer-events: auto;
	-webkit-appearance: none;
	appearance: none;
}

.btelmt-shop-hero .btelmt-shop-price-slider-wrap .btelmt-shop-price-range::-moz-range-thumb {
	width: 14px;
	height: 14px;
	background: var(--btelmt-accent);
	border: 0;
	border-radius: 0;
	box-shadow: none;
	cursor: grab;
	pointer-events: auto;
}

.btelmt-shop-hero .btelmt-shop-price-slider-wrap .btelmt-shop-price-range-max::-webkit-slider-thumb,
.btelmt-shop-hero .btelmt-shop-price-slider-wrap .btelmt-shop-price-range.btelmt-shop-price-range-max::-webkit-slider-thumb {
	background: var(--btelmt-text);
}

.btelmt-shop-hero .btelmt-shop-price-slider-wrap .btelmt-shop-price-range.btelmt-shop-price-range-max::-moz-range-thumb {
	background: var(--btelmt-text);
}

.btelmt-shop-hero .btelmt-shop-price-slider-wrap .btelmt-shop-price-range:focus::-webkit-slider-runnable-track {
	background: transparent;
}

.btelmt-shop-hero .btelmt-shop-price-slider-wrap .btelmt-shop-price-range:active::-webkit-slider-thumb {
	cursor: grabbing;
}

.btelmt-shop-hero .btelmt-shop-price-slider-wrap .btelmt-shop-price-range:focus-visible::-webkit-slider-thumb {
	outline: 2px solid var(--btelmt-accent);
	outline-offset: 2px;
}

.btelmt-shop-filter-actions {
	display: flex;
	gap: 8px;
}

.btelmt-shop-hero .btelmt-shop-filter-reset,
.btelmt-shop-hero .btelmt-shop-filter-apply {
	color: var(--btelmt-muted);
	background: transparent;
	border: 0;
}

.btelmt-shop-hero .btelmt-shop-filter-reset:hover,
.btelmt-shop-hero .btelmt-shop-filter-reset:focus-visible,
.btelmt-shop-hero .btelmt-shop-filter-apply:hover,
.btelmt-shop-hero .btelmt-shop-filter-apply:focus-visible {
	color: var(--btelmt-text);
	background-color: var(--btelmt-surface-2);
}

/* The price filter applies itself when a handle is released; Apply stays for no-JS/keyboard fallbacks. */
.btelmt-shop-js .btelmt-shop-hero .btelmt-shop-filter-apply {
	display: none;
}

/* Sort options */

.btelmt-shop-hero .btelmt-shop-sort-option {
	justify-content: flex-start;
	width: 100%;
	text-align: left;
	color: var(--btelmt-muted);
	background: transparent;
	border: 0;
}

.btelmt-shop-hero .btelmt-shop-sort-option:hover,
.btelmt-shop-hero .btelmt-shop-sort-option:focus-visible {
	color: var(--btelmt-text);
	background-color: var(--btelmt-surface-2);
}

.btelmt-shop-hero .btelmt-shop-sort-option.is-active {
	color: var(--btelmt-accent);
	background-color: var(--btelmt-surface-2);
}

/* ---------- Categories ---------- */

.btelmt-shop-categories {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

.btelmt-shop-hero .btelmt-shop-cat.is-active,
.btelmt-shop-hero .btelmt-shop-cat.is-active:hover {
	color: var(--btelmt-text);
	background-color: var(--btelmt-accent);
	border-color: var(--btelmt-accent);
}

/* ---------- Count ---------- */

.btelmt-shop-loop-meta {
	margin: 0 0 32px;
	font-family: var(--btelmt-font-body);
	line-height: 15px;
}

.btelmt-shop-product-count {
	display: block;
	font-size: 10px;
	line-height: 15px;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: rgba(153, 153, 153, 0.6);
}

/* ---------- Product grid & cards ---------- */

body.btelmt-woo ul.products {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 24px;
	margin: 0 0 60px;
	padding: 0;
	list-style: none;
	transition: opacity 400ms ease, transform 400ms ease;
}

body.btelmt-woo ul.products::before,
body.btelmt-woo ul.products::after {
	content: none;
	display: none;
}

/* Filter transition (shop.js), as in Lovable: the grid leaves up, the next one enters from below
   and its cards rise in one after another. */
body.btelmt-woo ul.products.is-leaving {
	opacity: 0;
	transform: translateY(-10px);
	pointer-events: none;
}

body.btelmt-woo ul.products.is-entering {
	opacity: 0;
	transform: translateY(10px);
	transition: none;
}

@keyframes btelmt-card-in {
	from {
		opacity: 0;
		transform: translateY(20px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

body.btelmt-woo ul.products.is-entered > li.product {
	animation: btelmt-card-in 500ms ease both;
	animation-delay: calc(var(--btelmt-card-index, 0) * 80ms);
}

/* Until shop.js runs, keep cards hidden so they don't flash before animating in.
   The delayed reveal is a safety net in case the script never runs. */
@keyframes btelmt-card-reveal {
	to {
		opacity: 1;
	}
}

.btelmt-shop-anim body.btelmt-woo ul.products:not(.is-entered):not(.is-leaving) > li.product {
	opacity: 0;
	animation: btelmt-card-reveal 0s 2.5s forwards;
}

body.btelmt-woo ul.products li.product {
	position: relative;
	float: none;
	width: auto;
	margin: 0;
	padding: 0;
	text-align: left;
	font-family: var(--btelmt-font-body);
}

body.btelmt-woo ul.products li.product a.woocommerce-LoopProduct-link {
	position: relative;
	display: block;
	color: inherit;
	text-decoration: none;
}

/* Image frame (opened/closed around the sale flash, thumbnail and VIEW overlay in public.php). */
.btelmt-product-media {
	position: relative;
	overflow: hidden;
	aspect-ratio: 3 / 4;
	margin: 0 0 16px;
	background-color: var(--btelmt-surface);
}

body.btelmt-woo ul.products li.product .btelmt-product-media img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	object-fit: cover;
	border-radius: 0;
	box-shadow: none;
	transition: transform 700ms var(--btelmt-ease);
}

body.btelmt-woo ul.products li.product:hover .btelmt-product-media img {
	transform: scale(1.05);
}

/* Fallback when a theme removes the frame hooks: plain 3:4 image. */
body.btelmt-woo ul.products li.product a > img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 3 / 4;
	margin: 0 0 16px;
	object-fit: cover;
	background-color: var(--btelmt-surface);
}

.btelmt-product-view-anchor {
	position: absolute;
	inset: 0;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	font-size: 10px;
	font-weight: 400;
	line-height: 15px;
	letter-spacing: 0.3em;
	text-transform: uppercase;
	color: var(--btelmt-text);
	background-color: rgba(8, 8, 8, 0.6);
	opacity: 0;
	pointer-events: none;
	transition: opacity 500ms var(--btelmt-ease);
}

.btelmt-product-view-arrow {
	display: inline-flex;
}

.btelmt-product-view-arrow svg {
	width: 14px;
	height: 14px;
}

body.btelmt-woo ul.products li.product:hover .btelmt-product-view-anchor,
body.btelmt-woo ul.products li.product a:focus-visible .btelmt-product-view-anchor {
	opacity: 1;
}

/* Badges (WooCommerce sale flash, or any .btelmt-product-badge). */
body.btelmt-woo ul.products li.product .onsale,
body.btelmt-woo ul.products li.product .btelmt-product-badge {
	position: absolute;
	top: 16px;
	left: 16px;
	right: auto;
	z-index: 3;
	min-width: 0;
	min-height: 0;
	margin: 0;
	padding: 6px 12px;
	font-family: var(--btelmt-font-body);
	font-size: 8px;
	font-weight: 400;
	line-height: 12px;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--btelmt-text);
	background-color: var(--btelmt-accent);
	border-radius: 0;
}

body.btelmt-woo ul.products li.product .woocommerce-loop-product__title {
	margin: 0 0 4px;
	padding: 0;
	font-family: var(--btelmt-font-display);
	font-size: 14px;
	font-weight: 400;
	line-height: 1.375;
	letter-spacing: 0;
	text-transform: uppercase;
	color: var(--btelmt-text);
	transition: color 500ms var(--btelmt-ease);
}

body.btelmt-woo ul.products li.product:hover .woocommerce-loop-product__title {
	color: var(--btelmt-accent);
}

body.btelmt-woo ul.products li.product .price {
	display: block;
	margin: 0;
	font-size: 11px;
	font-weight: 400;
	line-height: 16.5px;
	letter-spacing: 0.05em;
	color: var(--btelmt-muted);
}

body.btelmt-woo ul.products li.product .price del {
	margin-right: 6px;
	color: rgba(153, 153, 153, 0.6);
	opacity: 1;
}

body.btelmt-woo ul.products li.product .price ins {
	text-decoration: none;
	color: var(--btelmt-text);
}

body.btelmt-woo ul.products li.product .star-rating {
	display: none;
}

body.btelmt-woo ul.products li.btelmt-no-products {
	grid-column: 1 / -1;
	padding: 128px 0;
	text-align: center;
}

.btelmt-no-products-text {
	margin: 0;
	font-family: var(--btelmt-font-body);
	font-size: 14px;
	line-height: 20px;
	color: var(--btelmt-muted);
}

body.btelmt-woo .btelmt-shop-clear-filters {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 48px;
	margin-top: 16px;
	padding: 12px 20px;
	font-family: var(--btelmt-font-body);
	font-size: 12px;
	font-weight: 800;
	line-height: 16px;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	text-decoration: none;
	color: var(--btelmt-text);
	background-color: var(--btelmt-accent);
	border-radius: 12px;
	transition: background-color 150ms var(--btelmt-ease);
}

body.btelmt-woo .btelmt-shop-clear-filters:hover,
body.btelmt-woo .btelmt-shop-clear-filters:focus-visible {
	color: var(--btelmt-text);
	background-color: rgba(194, 0, 26, 0.9);
}

/* ---------- Pagination ---------- */

body.btelmt-woo .woocommerce-pagination {
	margin: 0 0 80px;
	text-align: left;
}

body.btelmt-woo .woocommerce-pagination ul.page-numbers {
	display: inline-flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
	padding: 0;
	border: 0;
}

body.btelmt-woo .woocommerce-pagination ul.page-numbers li {
	float: none;
	border: 0;
	overflow: visible;
}

body.btelmt-woo .woocommerce-pagination ul.page-numbers li .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 48px;
	height: 48px;
	padding: 0 12px;
	font-family: var(--btelmt-font-body);
	font-size: 12px;
	font-weight: 800;
	color: var(--btelmt-text);
	background-color: var(--btelmt-surface);
	border: 1px solid var(--btelmt-border);
	border-radius: 12px;
	transition: background-color 150ms var(--btelmt-ease), border-color 150ms var(--btelmt-ease);
}

body.btelmt-woo .woocommerce-pagination ul.page-numbers li a.page-numbers:hover,
body.btelmt-woo .woocommerce-pagination ul.page-numbers li a.page-numbers:focus-visible {
	color: var(--btelmt-text);
	background-color: var(--btelmt-surface-2);
	border-color: var(--btelmt-accent);
}

body.btelmt-woo .woocommerce-pagination ul.page-numbers li span.current {
	color: var(--btelmt-text);
	background-color: var(--btelmt-accent);
	border-color: var(--btelmt-accent);
}

/* ---------- Responsive ---------- */

@media (max-width: 1023px) {
	body.btelmt-woo ul.products {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (max-width: 767px) {
	.btelmt-shop-hero {
		margin-bottom: 40px;
	}

	.btelmt-shop-title {
		font-size: 48px;
	}

	.btelmt-shop-toolbar {
		gap: 12px;
		margin-bottom: 24px;
	}

	.btelmt-shop-search {
		flex: 1 1 100%;
		margin-right: 0;
	}

	/* Price and sort share one row; long labels wrap inside the button instead of pushing it down. */
	.btelmt-shop-filter {
		flex: 1 1 0;
		min-width: 0;
	}

	.btelmt-shop-hero .btelmt-shop-filter-trigger {
		width: 100%;
		padding: 0 14px;
		white-space: normal;
		text-align: center;
	}

	.btelmt-shop-filter-panel {
		min-width: 0;
		width: max(100%, 240px);
	}

	/* Categories scroll sideways instead of stacking into several rows. */
	.btelmt-shop-categories {
		flex-wrap: nowrap;
		padding-bottom: 4px;
		overflow-x: auto;
		scrollbar-width: none;
	}

	.btelmt-shop-categories::-webkit-scrollbar {
		display: none;
	}

	.btelmt-shop-hero .btelmt-shop-cat {
		flex: 0 0 auto;
	}

	.btelmt-shop-loop-meta {
		margin-bottom: 24px;
	}

	body.btelmt-woo ul.products {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 16px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.btelmt-shop-hero *,
	body.btelmt-woo ul.products,
	body.btelmt-woo ul.products * {
		transition: none !important;
		animation: none !important;
	}
}
