/**
 * Argo Shop — search presentation (Job 7 + Job 9 + Job 13.11 + Job 13.10B + Job 16H + Job 16I).
 * - Desktop/native AJAX results dropdown (Job 7 / Job 13.11 polish)
 * - Custom Argo mobile search trigger + overlay SVG sizing + desktop hide (Job 9 migrate)
 * - Sticky-clone search results stacking (Job 13.10B)
 * - Job 16H: mobile trigger chrome polish (tokens) + sticky-clone trigger parity
 * - Job 16I: AJAX “No products found” empty-state polish (no product-row changes)
 *
 * Presentation only. Does not change query / AJAX / snippet #12/#13 search logic.
 * Sticky open bridge lives in assets/js/argo-mobile-search.js.
 * Loaded after argo-header.css. Desktop search field chrome remains in argo-header.css.
 */

/* ------------------------------------------------------------------
   Dropdown shell — connected to the search field
   ------------------------------------------------------------------ */

.wd-search-form .wd-search-results-wrapper,
.whb-general-header .wd-search-results-wrapper {
	position: relative;
	z-index: 450;
}

.wd-search-form .wd-dropdown-results,
.wd-search-form .wd-search-results,
.whb-general-header .wd-dropdown-results,
.whb-general-header .wd-search-results {
	/* Win against WoodMart .wd-dropdown-results overflow:hidden + inset */
	top: calc(100% + 6px);
	right: 0;
	left: 0;
	width: 100%;
	max-width: 100%;
	margin-top: 0;
	/* 16px gutter keeps pink card borders clear of overflow clip edge */
	padding: 16px 16px 0;
	border: 1px solid var(--argo-pink);
	border-radius: var(--argo-radius-lg);
	background: var(--argo-cream-light);
	box-shadow: var(--argo-shadow-md);
	/*
	 * WoodMart sets overflow:hidden on .wd-dropdown-results — that clips
	 * right-column card borders. Keep x clipped (no horizontal scroll) but
	 * rely on the 16px gutter + zeroed suggestion margins below.
	 */
	overflow-x: hidden;
	overflow-y: visible;
	box-sizing: border-box;
	z-index: 450;
	max-height: min(70vh, calc(100vh - 140px));
}

/* Raise header row stacking when results are open (above mega / PDP) */
.whb-general-header:has(.wd-dropdown-results.wd-opened),
.whb-general-header:has(.wd-search-results.wd-opened) {
	position: relative;
	z-index: 460;
}

/* Sticky clone is position:fixed (z-index ~391) — raise whole bar when open */
.whb-clone.whb-sticky-header:has(.wd-dropdown-results.wd-opened),
.whb-clone.whb-sticky-header:has(.wd-search-results.wd-opened) {
	z-index: 460;
}

.wd-search-form .wd-dropdown-results .wd-scroll-content,
.wd-search-form .wd-search-results .wd-scroll-content,
.whb-general-header .wd-dropdown-results .wd-scroll-content,
.whb-general-header .wd-search-results .wd-scroll-content {
	/* Override WoodMart default max-height:450px with viewport-aware scroll */
	max-height: min(62vh, calc(100vh - 190px));
	overflow-x: hidden;
	overflow-y: auto;
	padding: 0 0 16px;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior: contain;
}

/*
 * Neutralize WoodMart / autocomplete clipping:
 * - theme margin-inline-end:-1px pulls the right column into overflow:hidden
 * - autocomplete createNode uses position:absolute + input-width (cleared in
 *   beforeRender via removeAttr('style'); keep static/full-width as safety)
 */
.wd-search-form .wd-dropdown-results .wd-search-suggestions,
.wd-search-form .wd-search-results .wd-search-suggestions,
.whb-general-header .wd-dropdown-results .wd-search-suggestions,
.whb-general-header .wd-search-results .wd-search-suggestions {
	position: static;
	display: block;
	width: 100%;
	max-width: 100%;
	margin-top: 0;
	margin-inline-end: 0;
	margin-inline-start: 0;
	box-sizing: border-box;
}

/* ------------------------------------------------------------------
   Product results grid
   ------------------------------------------------------------------ */

.wd-search-form .wd-suggestions-group.wd-type-product,
.whb-general-header .wd-suggestions-group.wd-type-product {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
	margin: 0;
}

.wd-search-form .wd-dropdown-results .wd-suggestion,
.wd-search-form .wd-search-results .wd-suggestion,
.whb-general-header .wd-dropdown-results .wd-suggestion,
.whb-general-header .wd-search-results .wd-suggestion {
	position: relative;
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 0;
	padding: 12px;
	min-width: 0;
	border: 1px solid var(--argo-pink);
	border-radius: var(--argo-radius-md);
	background: var(--argo-white);
	box-sizing: border-box;
	transition: background-color 0.18s ease, border-color 0.18s ease;
}

.wd-search-form .wd-dropdown-results .wd-suggestion:hover,
.wd-search-form .wd-dropdown-results .wd-suggestion.wd-active,
.wd-search-form .wd-search-results .wd-suggestion:hover,
.wd-search-form .wd-search-results .wd-suggestion.wd-active,
.whb-general-header .wd-dropdown-results .wd-suggestion:hover,
.whb-general-header .wd-dropdown-results .wd-suggestion.wd-active {
	background: var(--argo-cream);
	border-color: var(--argo-pink);
}

.wd-search-form .wd-dropdown-results .wd-suggestion:focus-within,
.whb-general-header .wd-dropdown-results .wd-suggestion:focus-within {
	outline: 2px solid var(--argo-pink);
	outline-offset: 1px;
}

/* Thumbnail — keep placeholder images visible (content issue, not CSS) */
.wd-search-form .wd-suggestion-thumb,
.whb-general-header .wd-suggestion-thumb {
	flex: 0 0 62px;
	width: 62px;
	max-width: 62px;
	height: 62px;
	margin: 0;
	border-radius: var(--argo-radius-sm);
	background: var(--argo-cream-light);
	overflow: hidden;
}

.wd-search-form .wd-suggestion-thumb img,
.whb-general-header .wd-suggestion-thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
	border-radius: var(--argo-radius-sm);
}

.wd-search-form .wd-suggestion-content,
.whb-general-header .wd-suggestion-content {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 4px;
	--wd-mb: 0;
}

.wd-search-form .wd-suggestion-content .wd-entities-title,
.whb-general-header .wd-suggestion-content .wd-entities-title {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	overflow: hidden;
	color: var(--argo-plum);
	font-family: "Poppins", sans-serif;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.3;
	text-decoration: none;
}

.wd-search-form .wd-suggestion-content .wd-entities-title strong,
.whb-general-header .wd-suggestion-content .wd-entities-title strong {
	color: inherit;
	font-weight: 700;
	text-decoration: none;
}

.wd-search-form .wd-suggestion-content .price,
.whb-general-header .wd-suggestion-content .price {
	margin: 0;
	color: var(--argo-text-muted);
	font-family: "Poppins", sans-serif;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.3;
}

.wd-search-form .wd-suggestion-content .price ins,
.whb-general-header .wd-suggestion-content .price ins {
	color: var(--argo-plum);
	font-weight: 600;
	text-decoration: none;
}

.wd-search-form .wd-suggestion-content .price del,
.whb-general-header .wd-suggestion-content .price del {
	color: var(--argo-text-muted);
	font-weight: 400;
	opacity: 0.85;
}

/* VIEW ALL RESULTS — footer bar, not a third card */
.wd-search-form .wd-all-results,
.whb-general-header .wd-all-results {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	margin: 12px -16px 0;
	padding: 12px 16px;
	border: 0;
	border-top: 1px solid var(--argo-border);
	border-radius: 0 0 var(--argo-radius-lg) var(--argo-radius-lg);
	background: var(--argo-cream);
	color: var(--argo-plum);
	font-family: "Poppins", sans-serif;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.04em;
	line-height: 1.2;
	text-transform: uppercase;
	text-decoration: none;
	transition: background-color 0.18s ease, color 0.18s ease;
}

.wd-search-form .wd-all-results:hover,
.wd-search-form .wd-all-results:focus-visible,
.whb-general-header .wd-all-results:hover,
.whb-general-header .wd-all-results:focus-visible {
	background: rgba(232, 168, 188, 0.28);
	color: var(--argo-plum-soft);
}

.wd-search-form .wd-all-results:focus-visible,
.whb-general-header .wd-all-results:focus-visible {
	outline: 2px solid var(--argo-pink);
	outline-offset: -2px;
}

/* ------------------------------------------------------------------
   Job 16I — No-results empty state only
   Markup: .wd-suggestion.wd-not-found > .wd-not-found-msg
   Product rows (.wd-suggestion:not(.wd-not-found)) stay unchanged.
   ------------------------------------------------------------------ */

/* Flatten the inner suggestion card so only the outer dropdown reads as one shell */
.wd-search-form .wd-dropdown-results .wd-suggestion.wd-not-found,
.wd-search-form .wd-search-results .wd-suggestion.wd-not-found,
.whb-general-header .wd-dropdown-results .wd-suggestion.wd-not-found,
.whb-general-header .wd-search-results .wd-suggestion.wd-not-found {
	display: flex;
	align-items: center;
	justify-content: flex-start;
	gap: 10px;
	margin: 0;
	padding: 0;
	min-height: 0;
	border: 0 !important;
	border-radius: 0;
	/* Beat WoodMart `.wd-dropdown-results .wd-not-found { background !important }` */
	background: transparent !important;
	box-shadow: none;
	outline: none;
	transition: none;
}

.wd-search-form .wd-dropdown-results .wd-suggestion.wd-not-found:hover,
.wd-search-form .wd-dropdown-results .wd-suggestion.wd-not-found.wd-active,
.wd-search-form .wd-search-results .wd-suggestion.wd-not-found:hover,
.wd-search-form .wd-search-results .wd-suggestion.wd-not-found.wd-active,
.whb-general-header .wd-dropdown-results .wd-suggestion.wd-not-found:hover,
.whb-general-header .wd-dropdown-results .wd-suggestion.wd-not-found.wd-active {
	background: transparent !important;
	border-color: transparent;
}

/* Compact the outer shell when it only holds the empty message */
.wd-search-form .wd-dropdown-results:has(.wd-suggestion.wd-not-found),
.wd-search-form .wd-search-results:has(.wd-suggestion.wd-not-found),
.whb-general-header .wd-dropdown-results:has(.wd-suggestion.wd-not-found),
.whb-general-header .wd-search-results:has(.wd-suggestion.wd-not-found) {
	padding: 22px 22px;
	background: var(--argo-white);
	border: 1px solid var(--argo-pink);
	border-radius: 18px;
	box-shadow: var(--argo-shadow-sm);
	max-height: none;
}

.wd-search-form .wd-dropdown-results:has(.wd-suggestion.wd-not-found) .wd-scroll-content,
.wd-search-form .wd-search-results:has(.wd-suggestion.wd-not-found) .wd-scroll-content,
.whb-general-header .wd-dropdown-results:has(.wd-suggestion.wd-not-found) .wd-scroll-content,
.whb-general-header .wd-search-results:has(.wd-suggestion.wd-not-found) .wd-scroll-content {
	max-height: none;
	padding: 0;
	overflow: visible;
}

.wd-search-form .wd-dropdown-results:has(.wd-suggestion.wd-not-found) .wd-suggestions-group.wd-type-product,
.wd-search-form .wd-search-results:has(.wd-suggestion.wd-not-found) .wd-suggestions-group.wd-type-product,
.whb-general-header .wd-dropdown-results:has(.wd-suggestion.wd-not-found) .wd-suggestions-group.wd-type-product,
.whb-general-header .wd-search-results:has(.wd-suggestion.wd-not-found) .wd-suggestions-group.wd-type-product {
	display: block;
	gap: 0;
}

/* Decorative search glyph only — real copy stays in .wd-not-found-msg */
.wd-search-form .wd-suggestion.wd-not-found::before,
.whb-general-header .wd-suggestion.wd-not-found::before {
	content: "\f130";
	font-family: "woodmart-font";
	font-size: 18px;
	font-weight: 400;
	line-height: 1;
	color: var(--argo-pink);
	speak: never;
	-webkit-font-smoothing: antialiased;
}

.wd-search-form .wd-not-found-msg,
.whb-general-header .wd-not-found-msg {
	color: var(--argo-plum);
	font-family: "Poppins", sans-serif;
	font-size: 14.5px;
	font-weight: 600;
	line-height: 1.35;
}

/* ------------------------------------------------------------------
   Narrow desktop / tablet — one column when cards would cramp
   ------------------------------------------------------------------ */

@media (max-width: 1199px) {
	.wd-search-form .wd-suggestions-group.wd-type-product,
	.whb-general-header .wd-suggestions-group.wd-type-product {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* ------------------------------------------------------------------
   Mobile — safe full-width, one column, touch targets
   Native header form is desktop-only (whb-visible-lg); these rules
   cover drawer / residual WoodMart search forms without touching
   Argo mobile overlay snippets #12/#13.
   ------------------------------------------------------------------ */

@media (max-width: 1024px) {
	.wd-search-form .wd-dropdown-results,
	.wd-search-form .wd-search-results {
		left: 0;
		right: 0;
		width: 100%;
		max-width: min(100vw - 24px, 100%);
		padding: 8px 8px 0;
		border-radius: var(--argo-radius-md);
		max-height: min(65vh, calc(100vh - 120px));
	}

	.wd-search-form .wd-dropdown-results .wd-scroll-content,
	.wd-search-form .wd-search-results .wd-scroll-content {
		max-height: min(55vh, calc(100vh - 170px));
		padding-bottom: 8px;
	}

	.wd-search-form .wd-suggestions-group.wd-type-product {
		grid-template-columns: minmax(0, 1fr);
		gap: 6px;
	}

	.wd-search-form .wd-dropdown-results .wd-suggestion,
	.wd-search-form .wd-search-results .wd-suggestion {
		min-height: 44px;
		padding: 10px;
		gap: 10px;
	}

	.wd-search-form .wd-suggestion-thumb {
		flex-basis: 48px;
		width: 48px;
		max-width: 48px;
		height: 48px;
	}

	.wd-search-form .wd-all-results {
		min-height: 44px;
		margin: 6px -8px 0;
	}
}

/* ------------------------------------------------------------------
   Job 9 + Job 16H — Custom Argo mobile search trigger + overlay icons
   Snippet #12 owns overlay HTML/JS/AJAX; child CSS owns chrome polish.
   Higher specificity beats snippet footer <style> (.argo-mobile-search-trigger).
   ------------------------------------------------------------------ */

@media (max-width: 1024px) {

	/*
	 * Job 16H — header / sticky-clone search pill
	 * Soft dusty-rose border, cream-white fill, weight-400 placeholder.
	 * Entire pill is the hit target (role=button on the trigger).
	 */
	.whb-general-header .argo-mobile-search-trigger,
	.whb-clone.whb-sticky-header .argo-mobile-search-trigger {
		box-sizing: border-box;
		display: inline-flex;
		align-items: center;
		justify-content: flex-start;
		gap: 10px;
		width: 100%;
		max-width: 100%;
		min-width: 0;
		height: 48px;
		min-height: 48px;
		padding: 0 14px 0 18px;
		border: 1px solid var(--argo-pink);
		border-radius: var(--argo-radius-pill);
		background: var(--argo-white);
		color: var(--argo-plum);
		font-family: "Poppins", sans-serif;
		font-size: 14px;
		font-weight: 400;
		line-height: 1.2;
		cursor: pointer;
		box-shadow: var(--argo-shadow-sm);
		transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
		-webkit-tap-highlight-color: transparent;
	}

	.whb-general-header .argo-mobile-search-trigger:hover,
	.whb-general-header .argo-mobile-search-trigger:focus-visible,
	.whb-clone.whb-sticky-header .argo-mobile-search-trigger:hover,
	.whb-clone.whb-sticky-header .argo-mobile-search-trigger:focus-visible {
		border-color: var(--argo-pink);
		background: var(--argo-cream-light);
		box-shadow: var(--argo-shadow-sm);
		outline: none;
	}

	.whb-general-header .argo-mobile-search-trigger:focus-visible,
	.whb-clone.whb-sticky-header .argo-mobile-search-trigger:focus-visible {
		outline: 2px solid var(--argo-pink);
		outline-offset: 2px;
	}

	.whb-general-header .argo-search-trigger-text,
	.whb-clone.whb-sticky-header .argo-search-trigger-text {
		flex: 1 1 auto;
		min-width: 0;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
		color: var(--argo-text-muted);
		font-family: "Poppins", sans-serif;
		font-size: 14px;
		font-weight: 400;
		line-height: 1.2;
		text-align: left;
	}

	/* Flat search icon inside mobile fake search bar */
	.whb-general-header .argo-search-trigger-icon,
	.whb-clone.whb-sticky-header .argo-search-trigger-icon,
	.argo-search-trigger-icon {
		display: flex;
		align-items: center;
		justify-content: center;
		flex: 0 0 auto;
		margin-left: auto;
		color: var(--argo-plum);
		line-height: 1;
	}

	.whb-general-header .argo-search-trigger-icon svg,
	.whb-clone.whb-sticky-header .argo-search-trigger-icon svg,
	.argo-search-trigger-icon svg {
		display: block;
		width: 21px;
		height: 21px;
	}

	/* Overlay form chrome — match header pill (snippet #12 layout unchanged) */
	#argo-mobile-search-clean .argo-clean-search-form {
		height: 48px;
		border: 1px solid var(--argo-pink);
		border-radius: var(--argo-radius-pill);
		background: var(--argo-white);
		padding: 0 8px 0 18px;
		box-shadow: var(--argo-shadow-sm);
	}

	#argo-mobile-search-clean .argo-clean-search-input {
		height: 46px;
		color: var(--argo-plum);
		font-family: "Poppins", sans-serif;
		font-size: 14px;
		font-weight: 400;
	}

	#argo-mobile-search-clean .argo-clean-search-input::placeholder {
		color: var(--argo-text-muted);
		font-weight: 400;
		opacity: 1;
	}

	#argo-mobile-search-clean .argo-clean-search-back {
		width: 44px;
		height: 44px;
		min-width: 44px;
		border-radius: var(--argo-radius-pill);
		background: var(--argo-cream);
		color: var(--argo-plum);
		border: 1px solid var(--argo-border);
	}

	/* Migrated — flat icons inside Argo mobile full-screen search */
	.argo-clean-search-back svg {
		width: 28px;
		height: 28px;
		color: var(--argo-plum);
	}

	.argo-clean-search-submit svg {
		width: 21px;
		height: 21px;
		color: var(--argo-plum);
	}

	.argo-clean-empty-icon svg {
		width: 42px;
		height: 42px;
		color: var(--argo-text-muted);
	}

	.argo-clean-search-back,
	.argo-clean-search-submit,
	.argo-clean-empty-icon {
		display: flex;
		align-items: center;
		justify-content: center;
	}
}

/* Migrated — hide Argo mobile search overlay chrome on desktop */
@media (min-width: 1025px) {
	#argo-mobile-search-clean,
	#argo-mobile-search-final,
	#argo-mobile-search-overlay,
	.argo-mobile-search-overlay,
	.argo-clean-search-top,
	.argo-clean-empty,
	.argo-clean-results,
	.argo-final-search-top,
	.argo-final-empty,
	.argo-final-results {
		display: none;
		visibility: hidden;
		opacity: 0;
		height: 0;
		overflow: hidden;
	}
}
