/**
 * Styles for [jakmax_search_results].
 *
 * Hand-written, not built — the results page loads no React, so there is
 * nothing for esbuild to do here and a build step would only be one more
 * thing to forget before a deploy.
 *
 * Only the pagination. The product cards deliberately reuse the theme's
 * markup and classes so Divi's styling applies to them unchanged, and
 * restyling those here would fight the theme rather than match it.
 *
 * The pagination was the exception: the site's own rules for it are scoped
 * to `.search-page-contain.product-filter-row .pagination` in the Custom CSS
 * plugin, so the shortcode only looked right when it happened to be placed
 * inside that wrapper and rendered as unstyled default links anywhere else.
 *
 * Every value below is lifted from those rules rather than invented, so the
 * two cannot disagree about what the pagination looks like. The theme's
 * selectors are more specific and still win where that wrapper exists —
 * which is intended, and harmless, because they set the same values.
 */

.jakmax-pagination {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	column-gap: 8px;
	row-gap: 8px;
	margin-top: 36px;
}

.jakmax-pagination a {
	font-family: "proxima-nova", sans-serif;
	font-weight: 400;
	font-size: 16px;
	line-height: 24px;
	padding: 6px 14px;
	color: #000;
	text-decoration: none;
	border-radius: 6px;
}

/*
 * The current page. A link to itself rather than a span, because the site's
 * own rule targets `.pagination a.active` — styling it as anything else
 * would silently lose the highlight on pages that do sit inside the theme's
 * wrapper.
 */
.jakmax-pagination a.active {
	background: #162112;
	color: #fff;
}

/*
 * Feedback on hover, which the site's rules don't define. Pagination with no
 * hover state reads as static text, and the current page is deliberately
 * excluded — it is already where you are.
 */
.jakmax-pagination a:not(.active):hover,
.jakmax-pagination a:not(.active):focus-visible {
	background: #f2f2f2;
	color: #000;
}

/*
 * The gap between the first pages and the last. Narrower padding than a
 * link, so the ellipsis reads as a break in the sequence rather than
 * another thing to click.
 */
.jakmax-pagination .dots {
	font-family: "proxima-nova", sans-serif;
	font-size: 16px;
	line-height: 24px;
	padding: 6px 2px;
	color: #6b6b6b;
	user-select: none;
}


/*
 * The filter sidebar (includes/search-filters.php).
 *
 * Every option is a plain link with no JS behind it — selecting one is a
 * full page reload to a new ?s=…&filter_x=… URL, the same pattern the
 * pagination above already uses. `.jakmax-filter-box` is a hand-drawn
 * checkbox rather than a real <input>, since a real checkbox has no way to
 * *navigate* on click without JS to intercept it.
 *
 * `.pro-card-div` itself is untouched — it keeps whatever grid the theme's
 * Custom CSS gives it (see this file's top docblock); wrapping it in
 * `.jakmax-search-results` only affects the space beside it, and a
 * descendant selector like `.search-page-contain .pro-card-div` still
 * matches through the extra nesting.
 */
.jakmax-search-layout {
	display: flex;
	align-items: flex-start;
	gap: 32px;
}

.jakmax-search-filters {
	flex: 0 0 240px;
	width: 240px;
}

.jakmax-search-results {
	flex: 1 1 auto;
	min-width: 0;
}

@media (max-width: 900px) {

	.jakmax-search-layout {
		flex-direction: column;
		gap: 16px;
	}

	.jakmax-search-filters {
		width: 100%;
		flex-basis: auto;
	}
}

.jakmax-filters-toggle {
	border: 1px solid #e2e2e2;
	border-radius: 8px;
	padding: 0;
}

/*
 * The filter panel is a native <details>, open by default at every screen
 * size (see jakmax_render_search_filters_sidebar()) — a shopper can
 * collapse it themselves on any device, this just doesn't start that way
 * for them. Below 901px that's also what replaces the second, mobile-only
 * shortcode (with its own popup) product_list_short_code_mobile used to
 * need for this.
 */
.jakmax-filters-summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 16px;
	font-family: "proxima-nova", sans-serif;
	font-weight: 600;
	font-size: 16px;
	line-height: 24px;
	color: #000;
	cursor: pointer;
	list-style: none;
}

.jakmax-filters-summary::-webkit-details-marker {
	display: none;
}

/*
 * The chevron that tells a shopper this bar is collapsible — a real <svg>
 * in the markup (jakmax_render_search_filters_sidebar()), not a
 * CSS-generated icon, rotated here based on the <details>'s open/closed
 * state. Points down when collapsed ("tap to expand"), flips to point up
 * when open ("tap to collapse").
 */
.jakmax-filters-chevron {
	margin-left: auto;
	flex-shrink: 0;
	color: #6b6b6b;
	transition: transform 0.15s ease;
}

.jakmax-filters-toggle[open] > .jakmax-filters-summary .jakmax-filters-chevron {
	transform: rotate(180deg);
}

.jakmax-filters-body {
	padding: 0 16px 16px;
	border-top: 1px solid #e2e2e2;
}

.jakmax-clear-filters {
	font-family: "proxima-nova", sans-serif;
	font-weight: 400;
	font-size: 13px;
	color: #6b6b6b;
	text-decoration: underline;
	white-space: nowrap;
}

.jakmax-clear-filters:hover,
.jakmax-clear-filters:focus-visible {
	color: #162112;
}

.jakmax-filter-section {
	padding-top: 16px;
}

.jakmax-filter-section + .jakmax-filter-section {
	margin-top: 4px;
	border-top: 1px solid #f0f0f0;
}

.jakmax-filter-title {
	margin: 0 0 8px;
	font-family: "proxima-nova", sans-serif;
	font-weight: 600;
	font-size: 14px;
	line-height: 20px;
	color: #000;
	text-transform: uppercase;
	letter-spacing: 0.02em;
}

.jakmax-filter-options {
	list-style: none;
	margin: 0;
	padding: 0;
	max-height: 220px;
	overflow-y: auto;
}

.jakmax-filter-option {
	margin: 0;
}

.jakmax-filter-link {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 6px 4px;
	font-family: "proxima-nova", sans-serif;
	font-weight: 400;
	font-size: 14px;
	line-height: 20px;
	color: #000;
	text-decoration: none;
	border-radius: 4px;
}

.jakmax-filter-link:hover,
.jakmax-filter-link:focus-visible {
	background: #f2f2f2;
}

.jakmax-filter-box {
	flex: 0 0 16px;
	width: 16px;
	height: 16px;
	border: 1px solid #6b6b6b;
	border-radius: 3px;
	background: #fff;
}

.jakmax-filter-link.is-selected .jakmax-filter-box {
	background: #162112;
	border-color: #162112;
	background-image: linear-gradient(45deg, transparent 40%, #fff 40%, #fff 55%, transparent 55%),
		linear-gradient(-45deg, transparent 55%, #fff 55%, #fff 70%, transparent 70%);
}

.jakmax-filter-label {
	flex: 1 1 auto;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.jakmax-filter-count {
	flex: 0 0 auto;
	color: #6b6b6b;
	font-size: 13px;
}

.jakmax-filter-price .jakmax-price-inputs {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	flex-wrap: wrap;
}

.jakmax-filter-price label {
	display: flex;
	flex-direction: column;
	gap: 4px;
	font-family: "proxima-nova", sans-serif;
	font-size: 12px;
	color: #6b6b6b;
}

.jakmax-filter-price input[type="number"] {
	width: 84px;
	padding: 6px 8px;
	border: 1px solid #ccc;
	border-radius: 4px;
	font-family: "proxima-nova", sans-serif;
	font-size: 14px;
}

.jakmax-price-sep {
	padding-bottom: 8px;
	color: #6b6b6b;
}

.jakmax-price-apply {
	padding: 7px 14px;
	border: none;
	border-radius: 6px;
	background: #162112;
	color: #fff;
	font-family: "proxima-nova", sans-serif;
	font-weight: 400;
	font-size: 14px;
	cursor: pointer;
}

.jakmax-price-apply:hover,
.jakmax-price-apply:focus-visible {
	background: #0d1409;
}

/*
 * The active-filter chip row above the result grid — a quick way to see
 * and remove what's currently narrowing the search without opening the
 * sidebar.
 */
.jakmax-active-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 20px;
}

.jakmax-filter-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 10px;
	border-radius: 999px;
	background: #f2f2f2;
	color: #000;
	font-family: "proxima-nova", sans-serif;
	font-size: 13px;
	text-decoration: none;
}

.jakmax-filter-chip:hover,
.jakmax-filter-chip:focus-visible {
	background: #e2e2e2;
}

.jakmax-filter-chip span {
	color: #6b6b6b;
	font-weight: 600;
}

.jakmax-no-results .jakmax-clear-filters {
	color: #162112;
	text-decoration: underline;
}

/*
 * The sort control at the top-right of the result grid — shared by
 * [jakmax_search_results] and [jakmax_category_results]
 * (jakmax_render_search_sort_control() in includes/search-filters.php).
 *
 * A native <details>/<summary> disclosure of real links, styled to match
 * the dark dropdown-menu look already used elsewhere on the site. This
 * replaces an earlier version built as a real <select> — a <select>'s open
 * option list is the browser's own native popup, essentially unstyleable
 * (the "black background, grey text" Yash saw was the closed state's own
 * colours leaking through with no reliable way to fix the text colour, and
 * :hover on an <option> isn't supported in most browsers at all). Plain
 * links in a <details> panel are just page HTML, so every colour below,
 * including the green hover, is a normal CSS rule rather than a browser
 * default this page has no control over.
 */
/*
 * `<details>` is block-level by default; `width: fit-content` shrinks it to
 * its content instead of the full row, which is what lets `margin-left:
 * auto` push it to the right edge — the "top-right of the product grid"
 * placement — regardless of what wraps it. (Not every render path wraps
 * this in the same container: a search/category page with no facets to
 * show skips the `.jakmax-search-results` div entirely, so this can't rely
 * on that specific ancestor being a flex container.)
 */
.jakmax-sort-dropdown {
	position: relative;
	display: block;
	width: fit-content;
	margin-left: auto;
	margin-bottom: 16px;
}

.jakmax-sort-current {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	min-width: 220px;
	padding: 13px 18px;
	background: #162112;
	color: #fff;
	font-family: "proxima-nova", sans-serif;
	font-weight: 700;
	font-size: 14px;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	border-radius: 6px;
	cursor: pointer;
	list-style: none;
}

.jakmax-sort-current::-webkit-details-marker {
	display: none;
}

.jakmax-sort-current:hover,
.jakmax-sort-current:focus-visible {
	background: #0d1409;
}

.jakmax-sort-chevron {
	flex-shrink: 0;
	transition: transform 0.15s ease;
}

.jakmax-sort-dropdown[open] .jakmax-sort-chevron {
	transform: rotate(180deg);
}

.jakmax-sort-options {
	position: absolute;
	top: calc(100% + 6px);
	right: 0;
	z-index: 20;
	min-width: 220px;
	margin: 0;
	padding: 8px 0;
	list-style: none;
	background: #000;
	border-radius: 6px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
}

.jakmax-sort-option a {
	display: block;
	padding: 10px 18px;
	color: #fff;
	font-family: "proxima-nova", sans-serif;
	font-weight: 700;
	font-size: 13px;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	text-decoration: none;
}

.jakmax-sort-option a:hover,
.jakmax-sort-option a:focus-visible {
	color: #7ac142;
}

/*
 * The currently active sort stays marked green even when the dropdown is
 * reopened later, not only while the pointer happens to be over it.
 */
.jakmax-sort-option.is-selected a {
	color: #7ac142;
}
