/*
 * Shop page — search header, filter pills, restyled WC ordering bar.
 *
 * Loaded on /shop/, product category, tag, and iow_* taxonomy archives.
 */

/* === Header (search + filters) === */
.iow-shop-header {
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
	margin: 0 0 2rem;
	padding: 1.5rem;
	background: var(--wp--preset--color--card);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 16px;
}
@media (min-width: 768px) {
	.iow-shop-header {
		padding: 2rem;
	}
}

/* Search input */
.iow-shop-search {
	position: relative;
	display: flex;
	align-items: center;
	gap: 0.5rem;
}
.iow-shop-search-icon {
	position: absolute;
	left: 1.1rem;
	top: 50%;
	transform: translateY(-50%);
	color: var(--wp--preset--color--muted-foreground);
	pointer-events: none;
}
.iow-shop-search input[type="search"] {
	flex: 1;
	width: 100%;
	height: 56px;
	padding: 0 1rem 0 3rem;
	font-size: 1.05rem;
	font-family: var(--wp--preset--font-family--sans);
	background: var(--wp--preset--color--background);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 9999px;
	color: var(--wp--preset--color--foreground);
	outline: none;
	transition: border-color 200ms ease-out, box-shadow 200ms ease-out;
}
.iow-shop-search input[type="search"]:focus {
	border-color: var(--wp--preset--color--ring);
	box-shadow: 0 0 0 4px hsl(207 90% 40% / 0.10);
}
.dark .iow-shop-search input[type="search"]:focus {
	box-shadow: 0 0 0 4px hsl(0 0% 100% / 0.10);
}
.iow-shop-search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.iow-shop-search-btn {
	height: 56px;
	padding: 0 1.5rem;
	background: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--primary-foreground);
	border: 0;
	border-radius: 9999px;
	font-size: 0.95rem;
	font-weight: 600;
	cursor: pointer;
	white-space: nowrap;
	transition: opacity 200ms ease-out;
}
.iow-shop-search-btn:hover { opacity: 0.88; }

/* Filter pill rows */
.iow-shop-filters {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.iow-filter-group {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	align-items: center;
}

/* Subject row scrolls horizontally on narrow viewports so it doesn't
 * push the rest of the layout out of shape. */
.iow-filter-group-scroll {
	flex-wrap: nowrap;
	overflow-x: auto;
	scrollbar-width: thin;
	padding-bottom: 0.25rem;
	-webkit-overflow-scrolling: touch;
}
@media (min-width: 768px) {
	.iow-filter-group-scroll { flex-wrap: wrap; overflow: visible; padding-bottom: 0; }
}

/* Pills */
.iow-pill {
	display: inline-flex;
	align-items: center;
	height: 38px;
	padding: 0 1rem;
	background: var(--wp--preset--color--secondary);
	color: var(--wp--preset--color--foreground);
	text-decoration: none;
	border-radius: 9999px;
	font-size: 0.875rem;
	font-weight: 500;
	border: 1px solid transparent;
	transition: background 180ms ease-out, color 180ms ease-out, border-color 180ms ease-out;
	white-space: nowrap;
}
.iow-pill:hover {
	background: var(--wp--preset--color--muted);
	border-color: var(--wp--preset--color--border);
}
.iow-pill.is-active {
	background: var(--wp--preset--color--foreground);
	color: var(--wp--preset--color--background);
	border-color: var(--wp--preset--color--foreground);
}
.iow-pill-small {
	height: 34px;
	padding: 0 0.85rem;
	font-size: 0.825rem;
}

.iow-filter-clear {
	color: var(--wp--preset--color--muted-foreground);
	font-size: 0.825rem;
	text-decoration: underline;
	align-self: flex-start;
}
.iow-filter-clear:hover {
	color: var(--wp--preset--color--warm);
}

/* === WC ordering bar — bigger, pill-shaped === */
.woocommerce-notices-wrapper:empty { display: none; }

.woocommerce .woocommerce-result-count {
	font-size: 0.95rem;
	color: var(--wp--preset--color--muted-foreground);
	margin: 1rem 0 1.5rem;
}

.woocommerce-ordering {
	margin: 0 0 1.5rem !important;
}
.woocommerce-ordering select {
	height: 46px;
	padding: 0 2.75rem 0 1.25rem;
	font-size: 0.95rem;
	font-family: var(--wp--preset--font-family--sans);
	background: var(--wp--preset--color--card);
	color: var(--wp--preset--color--foreground);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 9999px;
	min-width: 220px;
	appearance: none;
	-webkit-appearance: none;
	background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'><path d='M6 9l6 6 6-6'/></svg>");
	background-repeat: no-repeat;
	background-position: right 1rem center;
	background-size: 16px;
	cursor: pointer;
	outline: none;
	transition: border-color 200ms ease-out;
}
.woocommerce-ordering select:hover,
.woocommerce-ordering select:focus {
	border-color: var(--wp--preset--color--foreground);
}
.dark .woocommerce-ordering select {
	background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23bbb' stroke-width='2'><path d='M6 9l6 6 6-6'/></svg>");
}

/* Top-bar layout: result count left, ordering right */
.woocommerce-notices-wrapper + .woocommerce-result-count,
.woocommerce-products-header + .woocommerce-result-count {
	float: none;
}
.woocommerce .woocommerce-ordering {
	float: none !important;
}
@media (min-width: 768px) {
	.iow-shop-toolbar,
	.woocommerce-ordering {
		display: inline-flex;
		align-items: center;
	}
}

/* Product card spacing */
.woocommerce ul.products li.product {
	margin-bottom: 2rem !important;
}
.woocommerce ul.products li.product .woocommerce-loop-product__title {
	font-size: 1rem !important;
	font-weight: 600 !important;
	color: var(--wp--preset--color--foreground);
	padding-top: 0.75rem !important;
}
.woocommerce ul.products li.product .price {
	color: var(--wp--preset--color--muted-foreground) !important;
	font-size: 0.95rem !important;
}
