/*
 * Illuminate product search — styles (PROJECT-TODO T70).
 *
 * One row design everywhere: 48px photo box, name (up to two lines, the typed
 * letters in bold), a grey line with the code and options, "Agotado" on the
 * right. Every text column starts at the same x. Main-site look: Roboto,
 * #1a1a1a, #666, #d4d4d4 lines, 6px corners, red focus ring. Sentence case —
 * nothing here is ever uppercased.
 *
 * Everything is scoped under .ilm-s (our markup) or .ilm-s-divi (Divi's menu
 * search, which the script adopts on desktop).
 */

.ilm-s,
.ilm-s-divi,
.ilm-s-empty,
.ilm-s-notice {
	--ilm-s-ink: #1a1a1a;
	--ilm-s-text: #333;
	--ilm-s-muted: #666;
	--ilm-s-line: #d4d4d4;
	--ilm-s-soft: #f5f5f5;
	--ilm-s-hair: #ececec;
	--ilm-s-red: #c1272d;
	--ilm-s-font: 'Roboto', Helvetica, Arial, Lucida, sans-serif;
}

/*
 * Every .ilm-s-divi rule below also carries a twin prefixed with
 * `.et-db #et-boc .et-l .et_pb_menu `: on Theme Builder pages (results, categories)
 * Divi's own `.et-db #et-boc .et-l .et_pb_menu .et_pb_menu__search-form { flex: 1 1 auto }`
 * and friends would otherwise win, stretching the bar to the full row.
 */

/* ---------- the search field (phone bar, inline bar, adopted Divi bar) ---------- */

.ilm-s-field {
	position: relative;
	flex: 1 1 auto;
	min-width: 0;
}

.ilm-s-field > svg {
	position: absolute;
	top: 50%;
	left: 13px;
	width: 18px;
	height: 18px;
	margin-top: -9px;
	color: var(--ilm-s-muted);
	pointer-events: none;
}

.ilm-s .ilm-s-input,
.ilm-s-divi .et_pb_menu__search-input,
.et-db #et-boc .et-l .et_pb_menu .ilm-s-divi .et_pb_menu__search-input {
	box-sizing: border-box;
	display: block;
	width: 100%;
	height: 44px;
	margin: 0;
	padding: 0 44px 0 40px;
	border: 1px solid var(--ilm-s-line);
	border-radius: 6px;
	background: #fff;
	color: var(--ilm-s-ink);
	font-family: var(--ilm-s-font);
	font-size: 16px; /* 16px or more: iOS does not zoom the page on focus */
	font-weight: 400;
	line-height: 42px;
	letter-spacing: 0;
	text-transform: none;
	box-shadow: none;
	-webkit-appearance: none;
	appearance: none;
	outline: none;
}

.ilm-s .ilm-s-input::placeholder,
.ilm-s-divi .et_pb_menu__search-input::placeholder,
.et-db #et-boc .et-l .et_pb_menu .ilm-s-divi .et_pb_menu__search-input::placeholder {
	color: #8a8a8a;
	opacity: 1;
}

.ilm-s .ilm-s-input:focus,
.ilm-s-divi .et_pb_menu__search-input:focus,
.et-db #et-boc .et-l .et_pb_menu .ilm-s-divi .et_pb_menu__search-input:focus {
	border-color: var(--ilm-s-ink);
}

/* The browser's own clear button would make a second × next to ours. */
.ilm-s .ilm-s-input::-webkit-search-cancel-button,
.ilm-s .ilm-s-input::-webkit-search-decoration,
.ilm-s-divi .et_pb_menu__search-input::-webkit-search-cancel-button,
.ilm-s-divi .et_pb_menu__search-input::-webkit-search-decoration,
.et-db #et-boc .et-l .et_pb_menu .ilm-s-divi .et_pb_menu__search-input::-webkit-search-cancel-button,
.et-db #et-boc .et-l .et_pb_menu .ilm-s-divi .et_pb_menu__search-input::-webkit-search-decoration {
	-webkit-appearance: none;
	appearance: none;
	display: none;
}

.ilm-s-clear {
	position: absolute;
	top: 0;
	right: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0 6px 6px 0;
	background: transparent;
	color: var(--ilm-s-muted);
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

.ilm-s-clear[hidden] {
	display: none;
}

.ilm-s-clear:hover {
	color: var(--ilm-s-ink);
}

/* ---------- phone and tablet: full-screen search ---------- */

.ilm-s-overlay {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 100000; /* above the menu drawer (99999) and the WhatsApp button (99990) */
	flex-direction: column;
	background: #fff;
	font-family: var(--ilm-s-font);
	color: var(--ilm-s-ink);
	text-align: left;
}

html.ilm-s-lock,
html.ilm-s-lock body {
	overflow: hidden;
}

/* The closed menu drawer waits off-screen with a shadow and the highest
   z-index there is; its shadow would paint down our left edge (T73). */
html.ilm-s-lock .ij-drawer:not(.active) {
	visibility: hidden;
}

/* Same for the closed side cart, parked off the right edge: its footer's
   shadow shows as a faint line down our right side. */
html.ilm-s-lock:not(.xoo-wsc-cart-active) body:not(.xoo-wsc-cart-active) .xoo-wsc-container {
	visibility: hidden;
}

.ilm-s-bar {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	gap: 4px;
	margin: 0;
	padding: 8px 12px 8px 4px;
	border-bottom: 1px solid var(--ilm-s-hair);
	background: #fff;
}

.ilm-s-back {
	flex: 0 0 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	color: var(--ilm-s-ink);
	text-decoration: none;
	-webkit-tap-highlight-color: transparent;
}

.ilm-s-panel--phone {
	flex: 1 1 auto;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior: contain;
	padding-bottom: 24px;
}

/* ---------- desktop: Divi's menu search, adopted ---------- */

.ilm-s-divi.et_pb_menu__search,
.et-db #et-boc .et-l .et_pb_menu .ilm-s-divi.et_pb_menu__search {
	justify-content: center;
}

.ilm-s-divi .et_pb_menu__search-form,
.et-db #et-boc .et-l .et_pb_menu .ilm-s-divi .et_pb_menu__search-form {
	position: relative;
	flex: 0 1 720px;
	width: 720px;
	max-width: calc(100% - 56px);
	margin: 0;
}

.ilm-s-divi .ilm-s-field > svg,
.et-db #et-boc .et-l .et_pb_menu .ilm-s-divi .ilm-s-field > svg {
	z-index: 1;
}

/* Divi colours these from the module setting; on the clone that is white on white. */
.et_pb_menu .et_pb_menu__search-button:after,
.ilm-s-divi .et_pb_menu__close-search-button:after {
	color: var(--ilm-s-ink, #1a1a1a) !important;
}

/* Divi gives menu icons margin: 0 11px; the right one would push the centred bar 5.5px left. */
.ilm-s-divi .et_pb_menu__close-search-button,
.et-db #et-boc .et-l .et_pb_menu .ilm-s-divi .et_pb_menu__close-search-button {
	flex: 0 0 44px;
	width: 44px;
	height: 44px;
	margin: 0 0 0 8px;
	justify-content: center;
}

/* The dropdown under a desktop bar: same left edge and width as the bar. */
.ilm-s-drop {
	position: absolute;
	top: calc(100% + 8px);
	left: 0;
	right: 0;
	z-index: 1000;
	max-height: min(70vh, 640px);
	overflow-y: auto;
	overscroll-behavior: contain;
	border: 1px solid var(--ilm-s-line);
	border-radius: 6px;
	background: #fff;
	box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
	font-family: var(--ilm-s-font);
	text-align: left;
}

.ilm-s-drop[hidden] {
	display: none;
}

.ilm-s-inline {
	position: relative;
	display: flex;
	margin: 0;
}

/* ---------- panel content (shared) ---------- */

.ilm-s-label {
	margin: 0;
	padding: 14px 16px 6px;
	color: var(--ilm-s-muted);
	font-family: var(--ilm-s-font);
	font-size: 13px;
	font-weight: 400;
	line-height: 18px;
	letter-spacing: 0;
	text-transform: none;
}

.ilm-s-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.ilm-s-row {
	box-sizing: border-box;
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 68px;
	margin: 0;
	padding: 10px 16px;
	color: var(--ilm-s-ink);
	font-family: var(--ilm-s-font);
	text-decoration: none;
	-webkit-tap-highlight-color: transparent;
}

.ilm-s-row:hover,
.ilm-s-row.is-active {
	background: var(--ilm-s-soft);
	color: var(--ilm-s-ink);
}

.ilm-s-row:focus-visible {
	outline: 2px solid var(--ilm-s-red);
	outline-offset: -2px;
}

.ilm-s-img {
	box-sizing: border-box;
	flex: 0 0 48px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	overflow: hidden;
	border: 1px solid var(--ilm-s-hair);
	border-radius: 4px;
	background: #fff;
	color: var(--ilm-s-muted);
}

.ilm-s-img img {
	display: block;
	width: 100%;
	height: 100%;
	margin: 0;
	object-fit: contain;
}

.ilm-s-img--icon {
	background: var(--ilm-s-soft);
	border-color: var(--ilm-s-soft);
}

.ilm-s-img--icon svg {
	width: 20px;
	height: 20px;
}

.ilm-s-text {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.ilm-s-name {
	display: -webkit-box;
	overflow: hidden;
	color: var(--ilm-s-ink);
	font-size: 15px;
	font-weight: 400;
	line-height: 20px;
	overflow-wrap: anywhere;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.ilm-s-name b {
	font-weight: 700;
}

.ilm-s-meta {
	overflow: hidden;
	color: var(--ilm-s-muted);
	font-size: 13px;
	line-height: 18px;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.ilm-s-meta b {
	color: var(--ilm-s-ink);
	font-weight: 700;
}

.ilm-s-tag {
	flex: 0 0 auto;
	padding: 0 8px;
	border-radius: 4px;
	background: #f0f0f0;
	color: var(--ilm-s-muted);
	font-size: 12px;
	line-height: 22px;
	white-space: nowrap;
}

.ilm-s-note {
	margin: 0;
	padding: 12px 16px;
	border-bottom: 1px solid var(--ilm-s-hair);
	color: var(--ilm-s-text);
	font-family: var(--ilm-s-font);
	font-size: 14px;
	line-height: 20px;
}

/* "Ver los 46 resultados" — a row at the foot of the dropdown, a button on phones. */
.ilm-s-all {
	box-sizing: border-box;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	margin: 0;
	padding: 0 16px;
	border-top: 1px solid var(--ilm-s-hair);
	color: var(--ilm-s-ink);
	font-family: var(--ilm-s-font);
	font-size: 15px;
	font-weight: 500;
	line-height: 20px;
	text-decoration: none;
}

.ilm-s-all:hover,
.ilm-s-all.is-active {
	background: var(--ilm-s-soft);
	color: var(--ilm-s-ink);
}

.ilm-s-panel--phone .ilm-s-all {
	margin: 12px 16px 0;
	border: 0;
	border-radius: 6px;
	background: var(--ilm-s-ink);
	color: #fff;
}

.ilm-s-panel--phone .ilm-s-all:hover,
.ilm-s-panel--phone .ilm-s-all.is-active {
	background: #000;
	color: #fff;
}

/* Recent searches: the search itself, and a × to forget it. */
.ilm-s-recent {
	display: flex;
	align-items: center;
}

.ilm-s-recent .ilm-s-row {
	flex: 1 1 auto;
	min-width: 0;
	min-height: 48px;
	padding-top: 6px;
	padding-bottom: 6px;
}

.ilm-s-recent .ilm-s-img {
	border-color: transparent;
	background: transparent;
}

.ilm-s-recent .ilm-s-name {
	-webkit-line-clamp: 1;
}

.ilm-s-remove {
	flex: 0 0 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	margin: 0 6px 0 0;
	padding: 0;
	border: 0;
	border-radius: 6px;
	background: transparent;
	color: var(--ilm-s-muted);
	cursor: pointer;
}

.ilm-s-remove:hover {
	background: var(--ilm-s-soft);
	color: var(--ilm-s-ink);
}

/* Category chips, the same chip as the Para row (inc/shop-para.php). */
.ilm-s-chips,
.ilm-s-empty__cats {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding: 4px 16px 16px;
}

.ilm-s-chip {
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	height: 38px;
	padding: 0 14px;
	border: 1px solid var(--ilm-s-line);
	border-radius: 6px;
	background: #fff;
	color: #333;
	font-family: var(--ilm-s-font);
	font-size: 15px;
	font-weight: 500;
	line-height: 1;
	white-space: nowrap;
	text-decoration: none;
}

.ilm-s-chip:hover,
.ilm-s-chip.is-active {
	border-color: #999;
	color: #333;
}

.ilm-s-none {
	padding: 20px 16px 8px;
	font-family: var(--ilm-s-font);
}

.ilm-s-none__title {
	margin: 0 0 6px;
	padding: 0;
	color: var(--ilm-s-ink);
	font-size: 16px;
	font-weight: 500;
	line-height: 22px;
	overflow-wrap: anywhere;
}

.ilm-s-none__hint {
	margin: 0 0 14px;
	padding: 0;
	color: var(--ilm-s-muted);
	font-size: 14px;
	line-height: 20px;
}

.ilm-s-none__wa,
.ilm-s-empty__wa a {
	color: var(--ilm-s-red);
	font-size: 15px;
	line-height: 20px;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.ilm-s-loading {
	margin: 0;
	padding: 16px;
	color: var(--ilm-s-muted);
	font-family: var(--ilm-s-font);
	font-size: 14px;
}

.ilm-s-sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

.ilm-s-icon:focus-visible,
.ilm-s-back:focus-visible,
.ilm-s-clear:focus-visible,
.ilm-s-remove:focus-visible,
.ilm-s-chip:focus-visible,
.ilm-s-all:focus-visible {
	outline: 2px solid var(--ilm-s-red);
	outline-offset: 2px;
}

/* ---------- the results page (after Enter) ---------- */

.ilm-s-notice {
	margin: 0 0 16px;
	padding: 12px 14px;
	border-left: 3px solid var(--ilm-s-ink);
	background: #f7f7f7;
	color: #333;
	font-family: 'Roboto', Helvetica, Arial, Lucida, sans-serif;
	font-size: 15px;
	line-height: 22px;
}

.ilm-s-empty {
	margin: 8px 0 32px;
	font-family: 'Roboto', Helvetica, Arial, Lucida, sans-serif;
}

.ilm-s-empty__title {
	margin: 0 0 6px;
	padding: 0;
	color: #1a1a1a;
	font-size: 18px;
	font-weight: 500;
	line-height: 24px;
	overflow-wrap: anywhere;
}

.ilm-s-empty__hint {
	margin: 0 0 14px;
	padding: 0;
	color: #666;
	font-size: 15px;
	line-height: 22px;
}

.ilm-s-empty__wa {
	margin: 0 0 18px;
	padding: 0;
}

.ilm-s-empty .ilm-s-empty__cats {
	padding: 0;
}
