/*
 * Mobile search screen (Figma "Search" 1098:1601), see inc/mobile-search.php. html.sng-search-open is set by
 * mobile-search.js. 767px = Bricks mobile_landscape. Ids: header template 1000 (mhd…, msp…).
 */
@media (max-width: 767px) {
	/* ---- Header while searching: brown band, logo, back button + search field; nothing else ---- */
	.sng-search-open,
	.sng-search-open body {
		overflow: hidden;
	}

	.sng-search-open #brxe-mhdsec {
		background-color: var(--color-brand-deep);
		background-image: url("../images/mobile/header-pattern-tile.svg");
		background-size: var(--pattern-tile);
		border-bottom: 0;
	}

	.sng-search-open #brxe-mhdact,
	.sng-search-open #announcement-bar,
	.sng-search-open #brxe-mnvsec,
	.sng-search-open #brxe-mwabtn {
		display: none;
	}

	html.sng-search-open body #brxe-mhdbck {
		display: flex;
	}

	html.sng-search-open #brxe-mhdsch {
		padding-bottom: var(--space-20);
	}

	/* ---- Panel ---- */
	.sng-search-open #brxe-mspsec {
		position: fixed;
		inset: var(--sng-sp-top, 0) 0 0;
		z-index: 35;
		display: flex;
		flex-direction: column;
		gap: var(--space-15);
		padding: var(--space-20) var(--space-20) var(--space-40);
		overflow-y: auto;
		overscroll-behavior: contain;
		background: var(--color-surface-cream);
	}

	.sng-sp-title {
		margin: 0;
		font-family: var(--font-display);
		font-size: 20px;
		font-weight: 600;
		line-height: 1.25;
		color: var(--color-ink);
	}

	/* Most searched: wrapping pills with the "use this search" arrow. */
	.sng-sp-chips {
		display: flex;
		flex-wrap: wrap;
		gap: var(--space-12) var(--space-10);
		margin-bottom: var(--space-10);
	}

	.sng-sp-chip {
		display: inline-flex;
		align-items: center;
		gap: var(--space-10);
		padding: var(--space-8) var(--space-15);
		border: var(--hairline) solid var(--color-border-subtle);
		border-radius: var(--radius-pill);
		background: var(--color-surface-sand);
		font-family: var(--font-body);
		font-size: 14px;
		font-weight: 500;
		line-height: 1.2;
		color: var(--color-ink);
		text-decoration: none;
	}

	.sng-sp-chip::after {
		content: "";
		width: 12px;
		height: 12px;
		background: currentColor;
		opacity: 0.6;
		-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M10.5 1.5 2 10M2 4v6h6' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
		mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M10.5 1.5 2 10M2 4v6h6' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
	}

	/* Recent searches: clock, term, ×; the block is hidden while the list is empty. */
	.sng-sp-recent {
		display: flex;
		flex-direction: column;
		gap: var(--space-5);
		margin-bottom: var(--space-10);
	}

	.sng-sp-recent.is-empty {
		display: none;
	}

	.sng-sp-head {
		display: flex;
		align-items: center;
		justify-content: space-between;
		margin-bottom: var(--space-5);
	}

	.sng-sp-clear {
		padding: 0;
		border: 0;
		background: none;
		font-family: var(--font-body);
		font-size: 14px;
		font-weight: 600;
		color: var(--color-brand-deep);
		cursor: pointer;
	}

	.sng-sp-recent__list {
		margin: 0;
		padding: 0;
		list-style: none;
	}

	.sng-sp-recent__item {
		display: flex;
		align-items: center;
		gap: var(--space-10);
		min-height: 38px;
	}

	.sng-sp-recent__item::before {
		content: "";
		flex: none;
		width: 16px;
		height: 16px;
		background: var(--color-ink-soft);
		-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='6.5' fill='none' stroke='%23000' stroke-width='1.4'/%3E%3Cpath d='M8 4.5V8l2.5 1.5' fill='none' stroke='%23000' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
		mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='6.5' fill='none' stroke='%23000' stroke-width='1.4'/%3E%3Cpath d='M8 4.5V8l2.5 1.5' fill='none' stroke='%23000' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
	}

	.sng-sp-recent__link {
		flex: 1;
		min-width: 0;
		overflow: hidden;
		font-family: var(--font-body);
		font-size: 14px;
		color: var(--color-ink-muted);
		text-decoration: none;
		text-overflow: ellipsis;
		white-space: nowrap;
	}

	.sng-sp-recent__remove {
		flex: none;
		width: 28px;
		height: 28px;
		padding: 0;
		border: 0;
		background: none;
		font-size: 22px;
		line-height: 1;
		color: var(--color-ink-soft);
		cursor: pointer;
	}

	/* Explore best category: 3 × 2 circles. */
	.sng-sp-cats {
		display: grid;
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: var(--space-15) var(--space-10);
	}

	.sng-sp-cat {
		display: flex;
		flex-direction: column;
		align-items: center;
		gap: var(--space-8);
		text-decoration: none;
	}

	.sng-sp-cat__img {
		width: 83px;
		height: 83px;
		border: var(--hairline) solid var(--color-border-subtle);
		border-radius: var(--radius-pill);
		object-fit: cover;
		box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
	}

	.sng-sp-cat__label {
		font-family: var(--font-body);
		font-size: 14px;
		font-weight: 500;
		color: var(--color-ink);
		text-align: center;
	}
}
