/**
 * Shop composition presets, hero, chips, toolbar, filters, view modes.
 */

/* ---- Hero ---- */
.tekton-shop-hero {
	margin: 0 0 1.25rem;
	padding: clamp(1.75rem, 4vw, 3rem) clamp(1.25rem, 3vw, 2rem);
	border-radius: 20px;
	background:
		linear-gradient(135deg, color-mix(in srgb, var(--primary-color, #0274be) 10%, #fff) 0%, #f8fafc 55%, #fff 100%);
	border: 1px solid color-mix(in srgb, currentColor 8%, transparent);
}

.tekton-shop-hero__title {
	margin: 0 0 0.35em;
	font-size: clamp(1.75rem, 3.2vw, 2.6rem);
	line-height: 1.15;
	letter-spacing: -0.02em;
}

.tekton-shop-hero__subtitle {
	margin: 0;
	max-width: 42rem;
	font-size: 1.05rem;
	line-height: 1.55;
	opacity: 0.78;
}

/* ---- Category chips ---- */
.tekton-shop-chips {
	margin: 0 0 1.25rem;
}

.tekton-shop-chips__track {
	display: flex;
	flex-wrap: nowrap;
	gap: 0.5rem;
	overflow-x: auto;
	padding-bottom: 0.35rem;
	scrollbar-width: thin;
}

.tekton-shop-chip {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	flex: 0 0 auto;
	padding: 0.45rem 0.95rem;
	border-radius: 999px;
	border: 1px solid color-mix(in srgb, currentColor 14%, transparent);
	background: #fff;
	color: inherit;
	text-decoration: none;
	font-size: 0.9rem;
	font-weight: 500;
	white-space: nowrap;
	transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.tekton-shop-chip:hover,
.tekton-shop-chip.is-active {
	border-color: var(--primary-color, #0274be);
	background: color-mix(in srgb, var(--primary-color, #0274be) 12%, #fff);
	color: var(--primary-color, #0274be);
}

.tekton-shop-chip__count {
	font-size: 0.75rem;
	opacity: 0.65;
}

/* ---- Toolbar ---- */
.tekton-shop-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem 1rem;
	margin: 0 0 1.25rem;
	padding: 0.65rem 0;
	border-bottom: 1px solid color-mix(in srgb, currentColor 10%, transparent);
}

.tekton-shop-toolbar__start,
.tekton-shop-toolbar__end {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.65rem 0.85rem;
}

.tekton-shop-toolbar .woocommerce-result-count {
	margin: 0;
}

.tekton-shop-toolbar .woocommerce-ordering {
	margin: 0;
}

.tekton-shop-filters-toggle,
.tekton-shop-view-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.4rem;
	min-height: 40px;
	padding: 0.4rem 0.85rem;
	border-radius: 10px;
	border: 1px solid color-mix(in srgb, currentColor 16%, transparent);
	background: #fff;
	color: inherit;
	cursor: pointer;
	font-size: 0.875rem;
	font-weight: 600;
}

.tekton-shop-view-switcher {
	display: inline-flex;
	border: 1px solid color-mix(in srgb, currentColor 16%, transparent);
	border-radius: 10px;
	overflow: hidden;
}

.tekton-shop-view-switcher .tekton-shop-view-btn {
	border: none;
	border-radius: 0;
	min-width: 42px;
	background: transparent;
}

.tekton-shop-view-btn.is-active {
	background: color-mix(in srgb, var(--primary-color, #0274be) 14%, #fff);
	color: var(--primary-color, #0274be);
}

.tekton-shop-filters-toggle__icon {
	width: 14px;
	height: 14px;
	border: 2px solid currentColor;
	border-radius: 2px;
	position: relative;
}

.tekton-shop-filters-toggle__icon::after {
	content: "";
	position: absolute;
	inset: 3px;
	border-top: 2px solid currentColor;
}

/* ---- Layout shell + filters ---- */
.tekton-shop-layout {
	display: grid;
	gap: 1.5rem;
	align-items: start;
}

.tekton-shop-layout--start {
	grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
}

.tekton-shop-layout--drawer {
	grid-template-columns: 1fr;
}

.tekton-shop-filters {
	position: relative;
}

.tekton-shop-filters[hidden] {
	display: none !important;
}

@media (min-width: 960px) {
	.tekton-shop-layout--start .tekton-shop-filters,
	.tekton-shop-layout--start .tekton-shop-filters[hidden] {
		display: block !important;
		position: sticky;
		top: calc(var(--tekton-sticky-header-offset, 80px) + 12px);
	}
}

.tekton-shop-layout--start .tekton-shop-filters__backdrop,
.tekton-shop-layout--start .tekton-shop-filters__close {
	display: none;
}

.tekton-shop-filters__panel {
	background: #fff;
	border: 1px solid color-mix(in srgb, currentColor 10%, transparent);
	border-radius: 16px;
	padding: 1rem 1.1rem 1.25rem;
	box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
}

.tekton-shop-filters__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	margin-bottom: 0.85rem;
}

.tekton-shop-filters__title {
	margin: 0;
	font-size: 1.05rem;
}

.tekton-shop-filters__close {
	border: none;
	background: transparent;
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
	color: inherit;
}

.tekton-shop-filter-widget {
	margin: 0 0 1.1rem;
	padding: 0 0 1rem;
	border-bottom: 1px solid color-mix(in srgb, currentColor 8%, transparent);
}

.tekton-shop-filter-widget:last-child {
	border-bottom: none;
	margin-bottom: 0;
	padding-bottom: 0;
}

.tekton-shop-filter-widget .widget-title {
	margin: 0 0 0.65rem;
	font-size: 0.92rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

/* Drawer mode */
body.tekton-shop-filters-open {
	overflow: hidden;
}

.tekton-shop-layout--drawer .tekton-shop-filters:not([hidden]) {
	display: block !important;
	position: fixed;
	inset: 0;
	z-index: 100050;
}

.tekton-shop-layout--drawer .tekton-shop-filters__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, 0.45);
}

.tekton-shop-layout--drawer .tekton-shop-filters__panel {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	width: min(360px, 92vw);
	border-radius: 0;
	overflow: auto;
	transform: translateX(0);
	box-shadow: 20px 0 48px rgba(15, 23, 42, 0.18);
}

html[dir="rtl"] .tekton-shop-layout--drawer .tekton-shop-filters__panel {
	left: auto;
	right: 0;
	box-shadow: -20px 0 48px rgba(15, 23, 42, 0.18);
}

@media (max-width: 959px) {
	.tekton-shop-layout--start {
		grid-template-columns: 1fr;
	}

	.tekton-shop-layout--start .tekton-shop-filters {
		position: fixed;
		inset: 0;
		z-index: 100050;
		display: none !important;
	}

	.tekton-shop-layout--start .tekton-shop-filters:not([hidden]) {
		display: block !important;
	}

	.tekton-shop-layout--start .tekton-shop-filters__backdrop,
	.tekton-shop-layout--start .tekton-shop-filters__close {
		display: block;
	}

	.tekton-shop-layout--start .tekton-shop-filters__panel {
		position: absolute;
		top: 0;
		bottom: 0;
		left: 0;
		width: min(360px, 92vw);
		border-radius: 0;
		overflow: auto;
	}
}

/* ---- Client view override (list) ---- */
body.tekton-view-list.tekton-woo-catalog .woocommerce ul.products {
	grid-template-columns: 1fr !important;
}

body.tekton-view-list.tekton-woo-catalog .woocommerce ul.products li.product {
	flex-direction: row;
	align-items: stretch;
}

body.tekton-view-list.tekton-woo-catalog .woocommerce ul.products li.product .woocommerce-LoopProduct-link {
	display: grid;
	grid-template-columns: minmax(140px, 220px) 1fr;
	gap: 1.25rem;
	align-items: center;
	width: 100%;
}

body.tekton-view-grid.tekton-woo-catalog-layout-list .woocommerce ul.products {
	grid-template-columns: repeat(var(--tekton-shop-columns, 4), minmax(0, 1fr)) !important;
}

body.tekton-view-grid.tekton-woo-catalog-layout-list .woocommerce ul.products li.product {
	flex-direction: column;
}

body.tekton-view-grid.tekton-woo-catalog-layout-list .woocommerce ul.products li.product .woocommerce-LoopProduct-link {
	display: block;
	grid-template-columns: none;
}

/* ---- Composition presets ---- */
body.tekton-shop-layout-boutique .tekton-shop-hero {
	background: linear-gradient(160deg, #111827 0%, #1f2937 50%, #111827 100%);
	color: #f8fafc;
	border: none;
}

body.tekton-shop-layout-boutique .tekton-shop-hero__subtitle {
	opacity: 0.72;
}

body.tekton-shop-layout-boutique.tekton-woo-catalog .woocommerce ul.products {
	--tekton-catalog-grid-gap: 32px;
}

body.tekton-shop-layout-boutique.tekton-woo-catalog .woocommerce ul.products li.product {
	box-shadow: none;
	border: none;
	background: transparent;
}

body.tekton-shop-layout-boutique .tekton-shop-chip {
	background: transparent;
}

body.tekton-shop-layout-fashion .tekton-shop-hero {
	border-radius: 0;
	background: #0f172a;
	color: #fff;
}

body.tekton-shop-layout-fashion .tekton-shop-chips__track {
	gap: 0.35rem;
}

body.tekton-shop-layout-fashion .tekton-shop-chip {
	border-radius: 6px;
	text-transform: uppercase;
	font-size: 0.78rem;
	letter-spacing: 0.04em;
}

body.tekton-shop-layout-fashion.tekton-woo-catalog .woocommerce ul.products {
	--tekton-catalog-grid-gap: 16px;
}

body.tekton-shop-layout-modern .tekton-shop-hero {
	background:
		radial-gradient(1200px 280px at 10% 0%, color-mix(in srgb, var(--primary-color, #0274be) 18%, transparent), transparent 60%),
		#f8fafc;
}
