/* ========================================================================== 
   Exxenpana v18: native product search and compact WooCommerce archives
   ========================================================================== */

/* Persistent product search directly below the primary header. */
.site-product-search-bar {
	position: relative;
	z-index: 90;
	padding: 0.55rem 0;
	background: #f6f5f2;
	border-bottom: 1px solid var(--color-border);
}

.site-product-search-inner {
	max-width: 760px;
}

.site-product-search-bar .woocommerce-product-search,
.search-modal-content .woocommerce-product-search {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	width: 100%;
	margin: 0;
	background: var(--color-surface);
	border: 1px solid #d6d2ca;
	border-radius: 8px;
	overflow: hidden;
	box-shadow: 0 4px 14px rgba(17, 17, 17, 0.04);
}

.site-product-search-bar .search-field,
.search-modal-content .search-field {
	width: 100%;
	min-width: 0;
	height: 46px;
	margin: 0;
	padding: 0 1rem;
	background: transparent;
	border: 0;
	border-radius: 0;
	color: var(--color-text);
	font: inherit;
	font-size: 0.9rem;
	outline: 0;
}

.site-product-search-bar .search-field::placeholder,
.search-modal-content .search-field::placeholder {
	color: #77736d;
	opacity: 1;
}

.site-product-search-bar .search-submit,
.search-modal-content .search-submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.45rem;
	min-width: 50px;
	height: 46px;
	margin: 0;
	padding: 0 0.95rem !important;
	border: 0 !important;
	border-left: 1px solid #d6d2ca !important;
	border-radius: 0 !important;
	background: #171717 !important;
	color: #fff !important;
	cursor: pointer;
}

.site-product-search-bar .search-submit .icon,
.search-modal-content .search-submit .icon {
	width: 19px;
	height: 19px;
}

.site-product-search-bar .search-submit:hover,
.site-product-search-bar .search-submit:focus-visible,
.search-modal-content .search-submit:hover,
.search-modal-content .search-submit:focus-visible {
	background: #34322f !important;
}

.site-product-search-bar .search-field:focus-visible,
.search-modal-content .search-field:focus-visible {
	box-shadow: inset 0 0 0 2px rgba(23, 23, 23, 0.22);
}

.site-product-search-bar .search-submit-label {
	display: none;
}

/* Archive-only rhythm: no global heading or breadcrumb changes. */
body.post-type-archive-product .woocommerce-container,
body.tax-product_cat .woocommerce-container,
body.search-results.post-type-archive-product .woocommerce-container,
body.search-no-results.post-type-archive-product .woocommerce-container {
	padding-top: clamp(1.1rem, 2.2vw, 1.75rem);
	padding-bottom: clamp(2rem, 4vw, 4rem);
}

body.post-type-archive-product .woocommerce-products-header,
body.tax-product_cat .woocommerce-products-header {
	margin: 0 0 clamp(1.25rem, 2.2vw, 1.8rem);
	text-align: left;
}

body.post-type-archive-product .woocommerce-products-header .woocommerce-breadcrumb,
body.tax-product_cat .woocommerce-products-header .woocommerce-breadcrumb {
	margin: 0 0 0.7rem;
	line-height: 1.55;
}

body.tax-product_cat .woocommerce-products-header.is-category-header .woocommerce-breadcrumb {
	margin-bottom: 0;
}

body.post-type-archive-product .woocommerce-products-header .page-title,
body.tax-product_cat .woocommerce-products-header .page-title {
	margin: 0;
	font-size: clamp(1.55rem, 2.5vw, 2.15rem);
	font-weight: 500;
	line-height: 1.2;
}

body.post-type-archive-product .woocommerce-products-header .term-description,
body.tax-product_cat .woocommerce-products-header .term-description {
	max-width: 760px;
	margin: 0.7rem 0 0;
}

body.post-type-archive-product .shop-layout-wrapper,
body.tax-product_cat .shop-layout-wrapper {
	gap: clamp(1.25rem, 2.25vw, 2rem);
}

body.post-type-archive-product .shop-toolbar,
body.tax-product_cat .shop-toolbar {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	align-items: center;
	gap: 0.8rem 1rem;
	min-width: 0;
	margin: 0 0 clamp(1.25rem, 2vw, 1.75rem);
	padding: 0 0 0.85rem;
}

body.post-type-archive-product .shop-toolbar-count,
body.tax-product_cat .shop-toolbar-count {
	grid-column: 1;
	min-width: 0;
}

body.post-type-archive-product .shop-toolbar-sorting,
body.tax-product_cat .shop-toolbar-sorting {
	grid-column: 3;
	justify-self: end;
	min-width: 0;
}

body.post-type-archive-product .shop-toolbar-sorting select,
body.tax-product_cat .shop-toolbar-sorting select {
	max-width: 100%;
	height: 42px;
	margin: 0;
}

body.post-type-archive-product .shop-toolbar .woocommerce-ordering,
body.tax-product_cat .shop-toolbar .woocommerce-ordering {
	float: none !important;
	width: auto;
	margin: 0;
}

body.post-type-archive-product .woocommerce-result-count,
body.tax-product_cat .woocommerce-result-count {
	margin: 0;
	line-height: 1.5;
}

/* Sidebar hierarchy, counts and reliable native links. */
.exxenpana-shop-categories,
.exxenpana-shop-categories ul {
	min-width: 0;
}

.exxenpana-shop-categories ul {
	padding-left: 0.7rem;
	border-left: 1px solid var(--color-border);
}

.exxenpana-shop-categories a {
	position: relative;
	z-index: 1;
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	min-width: 0;
	cursor: pointer;
	pointer-events: auto;
}

.exxenpana-shop-categories a span {
	min-width: 0;
	overflow-wrap: anywhere;
}

.exxenpana-shop-categories a em {
	min-width: 2ch;
	text-align: right;
	white-space: nowrap;
}

.exxenpana-shop-categories li.is-current-ancestor > a {
	border-color: #d8d3cb;
	font-weight: 600;
}

.exxenpana-shop-categories li.is-active > a {
	border-color: #aaa49a;
	box-shadow: inset 3px 0 0 #171717;
	font-weight: 700;
}

.exx-product-search-empty {
	margin: 0 !important;
}

@media (max-width: 1024px) {
	body.post-type-archive-product .shop-toolbar,
	body.tax-product_cat .shop-toolbar {
		grid-template-columns: auto minmax(0, 1fr) auto;
	}

	body.post-type-archive-product .mobile-filter-btn,
	body.tax-product_cat .mobile-filter-btn {
		grid-column: 1;
	}

	body.post-type-archive-product .shop-toolbar-count,
	body.tax-product_cat .shop-toolbar-count {
		grid-column: 2;
		width: auto;
	}

	body.post-type-archive-product .shop-toolbar-sorting,
	body.tax-product_cat .shop-toolbar-sorting {
		grid-column: 3;
		width: auto;
	}
}

@media (max-width: 768px) {
	.site-product-search-bar {
		padding: 0.5rem 0;
	}

	.site-product-search-inner {
		max-width: none;
	}

	.site-product-search-bar .search-field {
		height: 44px;
		padding-inline: 0.8rem;
		font-size: 0.86rem;
	}

	.site-product-search-bar .search-submit {
		width: 46px;
		min-width: 46px;
		height: 44px;
		padding: 0 !important;
	}

	body.post-type-archive-product .woocommerce-container,
	body.tax-product_cat .woocommerce-container {
		padding-top: 1rem;
	}

	body.post-type-archive-product .shop-toolbar,
	body.tax-product_cat .shop-toolbar {
		grid-template-columns: minmax(0, 1fr);
		align-items: stretch !important;
		gap: 0.7rem;
	}

	body.post-type-archive-product .mobile-filter-btn,
	body.tax-product_cat .mobile-filter-btn,
	body.post-type-archive-product .shop-toolbar-count,
	body.tax-product_cat .shop-toolbar-count,
	body.post-type-archive-product .shop-toolbar-sorting,
	body.tax-product_cat .shop-toolbar-sorting {
		grid-column: 1;
		width: 100%;
		justify-self: stretch;
	}

	body.post-type-archive-product .shop-toolbar-sorting select,
	body.tax-product_cat .shop-toolbar-sorting select {
		width: 100%;
	}

	body.post-type-archive-product .woocommerce-products-header .page-title,
	body.tax-product_cat .woocommerce-products-header .page-title {
		font-size: clamp(1.4rem, 7vw, 1.8rem);
	}
}

@media (max-width: 360px) {
	.site-product-search-bar .search-field {
		font-size: 0.8rem;
	}
}
