/*
 * JustDSL search popup: a search bar that drops over the page, suggested
 * products before typing, live results while typing. It sits in the footer,
 * outside the shop pages, so it carries its own tokens.
 */

.jdsl-sp {
	--jd-black: #111;
	--jd-red: var(--e-global-color-adaf8a2, #d10000);
	--jd-text: #2b2b2b;
	--jd-muted: #737373;
	--jd-line: #e5e5e5;
	--jd-soft: #f5f5f5;
	--jd-radius: 8px;
	--jd-font: "Noto Sans", var(--e-global-typography-primary-font-family, sans-serif), sans-serif;

	position: fixed;
	inset: 0;
	z-index: 100002;
	color: var(--jd-text);
	font-family: var(--jd-font);
	font-size: 15px;
	line-height: 1.45;
}

.jdsl-sp[hidden] {
	display: none;
}

.jdsl-sp *,
.jdsl-sp *::before,
.jdsl-sp *::after {
	box-sizing: border-box;
}

.jdsl-sp a {
	color: inherit;
	text-decoration: none;
}

html.jdsl-sp-open {
	overflow: hidden;
}

.jdsl-sp__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(17, 17, 17, .45);
	opacity: 0;
	transition: opacity .2s ease;
}

.jdsl-sp.is-open .jdsl-sp__backdrop {
	opacity: 1;
}

.jdsl-sp__panel {
	position: relative;
	display: flex;
	flex-direction: column;
	max-height: 100vh;
	max-height: 100dvh;
	background: #fff;
	box-shadow: 0 18px 50px rgba(0, 0, 0, .18);
	transform: translateY(-16px);
	opacity: 0;
	transition: transform .22s ease, opacity .22s ease;
}

.jdsl-sp.is-open .jdsl-sp__panel {
	transform: none;
	opacity: 1;
}

/* Shared buttons: the base theme colours every <button> on hover/focus. */
.jdsl-sp button,
.jdsl-sp button:hover,
.jdsl-sp button:focus {
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	box-shadow: none;
	cursor: pointer;
}

.jdsl-sp button:focus-visible,
.jdsl-sp a:focus-visible,
.jdsl-sp select:focus-visible {
	outline: 2px solid var(--jd-black);
	outline-offset: 2px;
}

.jdsl-sp .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

/* ------------------------------------------------------------------ *
 * The bar
 * ------------------------------------------------------------------ */

.jdsl-sp__bar {
	position: relative;
	display: flex;
	align-items: center;
	gap: 14px;
	width: 100%;
	max-width: 1240px;
	margin: 0 auto;
	padding: 0 24px;
	height: 84px;
	flex: 0 0 auto;
}

.jdsl-sp__bar::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 2px;
	background: linear-gradient(90deg, transparent, var(--jd-black), transparent);
	background-size: 40% 100%;
	background-repeat: no-repeat;
	opacity: 0;
}

.jdsl-sp.is-loading .jdsl-sp__bar::after {
	opacity: 1;
	animation: jdsl-sp-load 1s linear infinite;
}

@keyframes jdsl-sp-load {
	from {
		background-position: -40% 0;
	}
	to {
		background-position: 140% 0;
	}
}

.jdsl-sp__panel::before {
	content: "";
	position: absolute;
	top: 84px;
	left: 0;
	right: 0;
	height: 1px;
	background: var(--jd-line);
}

.jdsl-sp__icon {
	display: grid;
	place-items: center;
	flex: 0 0 auto;
	color: var(--jd-black);
}

.jdsl-sp .jdsl-sp__input,
.jdsl-sp .jdsl-sp__input:focus {
	flex: 1 1 0;
	width: auto;
	min-width: 0;
	height: 52px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	outline: 0;
	background: transparent;
	box-shadow: none;
	color: var(--jd-black);
	font-family: var(--jd-font);
	font-size: 22px;
	font-weight: 500;
	-webkit-appearance: none;
	appearance: none;
}

.jdsl-sp .jdsl-sp__input::placeholder {
	color: #a3a3a3;
	font-weight: 400;
}

.jdsl-sp .jdsl-sp__input::-webkit-search-cancel-button,
.jdsl-sp .jdsl-sp__input::-webkit-search-decoration {
	-webkit-appearance: none;
}

.jdsl-sp .jdsl-sp__clear {
	display: grid;
	place-items: center;
	flex: 0 0 auto;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	background: var(--jd-soft);
	color: var(--jd-muted);
}

.jdsl-sp .jdsl-sp__clear[hidden] {
	display: none;
}

.jdsl-sp .jdsl-sp__clear:hover {
	background: var(--jd-line);
	color: var(--jd-black);
}

.jdsl-sp__cat {
	position: relative;
	display: flex;
	align-items: center;
	flex: 0 0 auto;
	height: 40px;
	padding-left: 16px;
	border-left: 1px solid var(--jd-line);
}

.jdsl-sp .jdsl-sp__cat-select {
	height: 40px;
	max-width: 210px;
	margin: 0;
	padding: 0 26px 0 0;
	border: 0;
	background: transparent;
	color: var(--jd-black);
	font-family: var(--jd-font);
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}

.jdsl-sp__cat svg {
	position: absolute;
	right: 4px;
	pointer-events: none;
	color: var(--jd-muted);
}

.jdsl-sp .jdsl-sp__close,
.jdsl-sp .jdsl-sp__close:hover,
.jdsl-sp .jdsl-sp__close:focus {
	display: grid;
	place-items: center;
	flex: 0 0 auto;
	width: 44px;
	height: 44px;
	border: 1px solid var(--jd-line);
	border-radius: 50%;
	background: #fff;
	color: var(--jd-black);
	transition: background .15s, color .15s, border-color .15s;
}

.jdsl-sp .jdsl-sp__close:hover {
	border-color: var(--jd-black);
	background: var(--jd-black);
	color: #fff;
}

/* ------------------------------------------------------------------ *
 * Body
 * ------------------------------------------------------------------ */

.jdsl-sp__body {
	width: 100%;
	max-width: 1240px;
	margin: 0 auto;
	padding: 28px 24px 36px;
	overflow-y: auto;
	overscroll-behavior: contain;
}

/* Hidden parts stay hidden, whatever a more specific rule says. */
.jdsl-sp [hidden] {
	display: none !important;
}

.jdsl-sp .jdsl-sp__heading {
	margin: 0 0 14px;
	padding: 0;
	font-family: var(--jd-font);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .08em;
	line-height: 1.3;
	text-transform: uppercase;
	color: var(--jd-muted);
}

.jdsl-sp__popular {
	margin-bottom: 28px;
}

.jdsl-sp__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.jdsl-sp a.jdsl-sp__chip {
	display: inline-flex;
	align-items: center;
	height: 36px;
	padding: 0 16px;
	border: 1px solid var(--jd-line);
	border-radius: 999px;
	font-size: 14px;
	font-weight: 500;
	color: var(--jd-black);
	transition: border-color .15s, background .15s, color .15s;
}

.jdsl-sp a.jdsl-sp__chip:hover {
	border-color: var(--jd-black);
	background: var(--jd-black);
	color: #fff;
}

/* Suggested products */
.jdsl-sp__tiles {
	display: flex;
	gap: 16px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	padding-bottom: 2px;
}

.jdsl-sp__tiles::-webkit-scrollbar {
	display: none;
}

.jdsl-sp__tile {
	display: flex;
	flex-direction: column;
	gap: 6px;
	flex: 0 0 calc((100% - 5 * 16px) / 6);
	min-width: 0;
	scroll-snap-align: start;
}

.jdsl-sp__tile-img {
	position: relative;
	display: block;
	aspect-ratio: 2 / 3;
	overflow: hidden;
	border-radius: var(--jd-radius);
	background: var(--jd-soft);
}

.jdsl-sp__tile-img img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .4s ease;
}

.jdsl-sp a.jdsl-sp__tile:hover .jdsl-sp__tile-img img {
	transform: scale(1.04);
}

.jdsl-sp__tile-name {
	display: -webkit-box;
	margin-top: 4px;
	overflow: hidden;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	font-size: 13.5px;
	font-weight: 500;
	line-height: 1.35;
	color: var(--jd-black);
}

.jdsl-sp__tile.is-skeleton .jdsl-sp__tile-name {
	height: 12px;
	width: 70%;
	border-radius: 4px;
	background: var(--jd-soft);
}

.jdsl-sp__tile-price,
.jdsl-sp__row-price {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0 8px;
	font-size: 14px;
	font-weight: 700;
	color: var(--jd-black);
}

.jdsl-sp__tile-price del,
.jdsl-sp__row-price del {
	order: 2;
	font-size: 12.5px;
	font-weight: 400;
	color: var(--jd-muted);
}

.jdsl-sp__tile-price ins,
.jdsl-sp__row-price ins {
	order: 1;
	text-decoration: none;
	color: var(--jd-red);
}

.jdsl-sp .jdsl-badge {
	display: inline-block;
	padding: 3px 7px;
	border-radius: 4px;
	background: var(--jd-red);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: .02em;
}

.jdsl-sp__tile-img .jdsl-badge {
	position: absolute;
	top: 8px;
	left: 8px;
}

/* ------------------------------------------------------------------ *
 * Results
 * ------------------------------------------------------------------ */

.jdsl-sp__cols {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 300px;
	gap: 40px;
	align-items: start;
}

.jdsl-sp__cols:has(> .jdsl-sp__side[hidden]) {
	grid-template-columns: minmax(0, 1fr);
}

.jdsl-sp .jdsl-sp__list,
.jdsl-sp .jdsl-sp__cats {
	margin: 0;
	padding: 0;
	list-style: none;
}

.jdsl-sp__list {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 4px 24px;
}

.jdsl-sp__cols:has(> .jdsl-sp__side:not([hidden])) .jdsl-sp__list {
	grid-template-columns: minmax(0, 1fr);
}

.jdsl-sp__list li {
	margin: 0;
	padding: 0;
}

.jdsl-sp a.jdsl-sp__row {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 8px;
	border-radius: var(--jd-radius);
	transition: background .12s;
}

.jdsl-sp a.jdsl-sp__row:hover,
.jdsl-sp__list li.is-active a.jdsl-sp__row {
	background: var(--jd-soft);
}

.jdsl-sp a.jdsl-sp__row.is-out {
	opacity: .55;
}

.jdsl-sp__row-img {
	flex: 0 0 56px;
	width: 56px;
	height: 72px;
	overflow: hidden;
	border-radius: 6px;
	background: var(--jd-soft);
}

.jdsl-sp__row-img img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.jdsl-sp__row-text {
	display: flex;
	flex-direction: column;
	gap: 4px;
	flex: 1 1 auto;
	min-width: 0;
}

.jdsl-sp__row-name {
	overflow: hidden;
	font-size: 15px;
	font-weight: 500;
	line-height: 1.35;
	color: var(--jd-black);
	text-overflow: ellipsis;
	white-space: nowrap;
}

.jdsl-sp mark {
	padding: 0;
	background: none;
	color: inherit;
	font-weight: 700;
}

.jdsl-sp__row-price .jdsl-badge {
	order: 3;
	align-self: center;
}

.jdsl-sp__row-go {
	flex: 0 0 auto;
	color: #b5b5b5;
	transition: color .12s, transform .12s;
}

.jdsl-sp a.jdsl-sp__row:hover .jdsl-sp__row-go,
.jdsl-sp__list li.is-active .jdsl-sp__row-go {
	color: var(--jd-black);
	transform: translateX(2px);
}

.jdsl-sp__cats li + li {
	border-top: 1px solid var(--jd-line);
}

.jdsl-sp .jdsl-sp__cats a {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 11px 2px;
	font-size: 14.5px;
	color: var(--jd-black);
}

.jdsl-sp .jdsl-sp__cats a:hover {
	color: var(--jd-red);
}

.jdsl-sp__cats small {
	font-size: 12.5px;
	color: var(--jd-muted);
}

.jdsl-sp__cats em {
	flex: 0 0 auto;
	min-width: 28px;
	padding: 2px 8px;
	border-radius: 999px;
	background: var(--jd-soft);
	font-size: 12px;
	font-style: normal;
	text-align: center;
	color: var(--jd-muted);
}

.jdsl-sp__none {
	display: flex;
	flex-direction: column;
	gap: 4px;
	margin: 40px 0 0;
	padding: 16px 18px;
	border-radius: var(--jd-radius);
	background: var(--jd-soft);
	font-size: 14.5px;
}

.jdsl-sp__none strong {
	color: var(--jd-black);
}

.jdsl-sp__none span {
	color: var(--jd-muted);
}

.jdsl-sp a.jdsl-sp__all {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: max-content;
	max-width: 100%;
	height: 50px;
	margin: 26px auto 0;
	padding: 0 32px;
	border-radius: var(--jd-radius);
	background: var(--jd-black);
	color: #fff;
	font-size: 15px;
	font-weight: 600;
	transition: background .15s;
}

.jdsl-sp a.jdsl-sp__all:hover {
	background: #333;
}

/* ------------------------------------------------------------------ *
 * Widget: the icon that opens it
 * ------------------------------------------------------------------ */

.jdsl-search-icon {
	display: flex;
}

.jdsl-search-icon .jdsl-search-open,
.jdsl-search-icon .jdsl-search-open:hover,
.jdsl-search-icon .jdsl-search-open:focus {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	box-shadow: none;
	color: var(--jdsl-si-color, currentColor);
	font: inherit;
	line-height: 1;
	cursor: pointer;
	transition: color .15s;
}

.jdsl-search-icon .jdsl-search-open:hover {
	color: var(--jdsl-si-hover, var(--jdsl-si-color, currentColor));
}

.jdsl-search-icon .jdsl-search-open i,
.jdsl-search-icon .jdsl-search-open svg {
	width: var(--jdsl-si-size, 22px);
	height: var(--jdsl-si-size, 22px);
	font-size: var(--jdsl-si-size, 22px);
	fill: currentColor;
}

.jdsl-search-icon .jdsl-search-open svg.jdsl-si-default {
	fill: none;
	stroke: currentColor;
}

/* ------------------------------------------------------------------ *
 * Tablet / phone
 * ------------------------------------------------------------------ */

@media (max-width: 1024px) {
	.jdsl-sp__tile {
		flex-basis: calc((100% - 3 * 16px) / 4);
	}

	.jdsl-sp__cols {
		grid-template-columns: minmax(0, 1fr) 240px;
		gap: 28px;
	}

	.jdsl-sp__list {
		grid-template-columns: minmax(0, 1fr);
	}
}

@media (max-width: 767px) {
	.jdsl-sp__panel {
		height: 100vh;
		height: 100dvh;
	}

	.jdsl-sp__bar {
		flex-wrap: wrap;
		gap: 10px;
		height: auto;
		padding: 10px 14px;
	}

	.jdsl-sp__panel::before {
		display: none;
	}

	.jdsl-sp__bar {
		border-bottom: 1px solid var(--jd-line);
	}

	.jdsl-sp .jdsl-sp__input,
	.jdsl-sp .jdsl-sp__input:focus {
		height: 44px;
		font-size: 17px;
	}

	.jdsl-sp .jdsl-sp__close,
	.jdsl-sp .jdsl-sp__close:hover,
	.jdsl-sp .jdsl-sp__close:focus {
		width: 40px;
		height: 40px;
	}

	/* Category picker: its own row under the field. */
	.jdsl-sp__cat {
		order: 10;
		flex: 1 0 100%;
		height: 38px;
		padding: 0 12px;
		border: 1px solid var(--jd-line);
		border-radius: var(--jd-radius);
	}

	.jdsl-sp .jdsl-sp__cat-select {
		width: 100%;
		max-width: none;
		height: 36px;
	}

	.jdsl-sp__cat svg {
		right: 12px;
	}

	.jdsl-sp__body {
		flex: 1 1 auto;
		padding: 20px 14px 32px;
	}

	.jdsl-sp__tile {
		flex-basis: calc((100% - 16px) / 2.35);
	}

	.jdsl-sp__cols {
		grid-template-columns: minmax(0, 1fr);
		gap: 24px;
	}

	.jdsl-sp__row-name {
		white-space: normal;
		display: -webkit-box;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 2;
		font-size: 14.5px;
	}

	.jdsl-sp a.jdsl-sp__all {
		width: 100%;
	}

	.jdsl-sp__none {
		margin-top: 28px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.jdsl-sp__panel,
	.jdsl-sp__backdrop {
		transition: none;
	}

	.jdsl-sp.is-loading .jdsl-sp__bar::after {
		animation: none;
	}
}
