/*
 * Mobile shop menu (Figma "Shop" 1098:507), see inc/mobile-menu.php. html.sng-menu-open is set by mobile-menu.js.
 * 767px = Bricks mobile_landscape. Ids: header template 1000 (mhd…, mshp…), footer template 130 (mnv…).
 */
@media (max-width: 767px) {
	.sng-menu-open,
	.sng-menu-open body {
		overflow: hidden;
	}

	/* Header while the menu is open: brown band with the logo and the wishlist / account buttons only. */
	.sng-menu-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: var(--hairline) solid var(--color-border-subtle);
	}

	.sng-menu-open #announcement-bar,
	.sng-menu-open #brxe-mhdsch,
	.sng-menu-open #brxe-mhdsrw,
	.sng-menu-open #brxe-mhdttl,
	.sng-menu-open #brxe-mwabtn,
	.sng-menu-open .sng-mhd-search {
		display: none !important;
	}

	/* Panel: between the header and the tab bar. */
	#brxe-mshpsec {
		display: none;
	}

	.sng-menu-open #brxe-mshpsec {
		position: fixed;
		inset: var(--sng-mp-top, 0) 0 var(--sng-mp-bottom, 76px);
		z-index: 25;
		display: flex;
		flex-direction: column;
		padding: var(--space-20);
		overflow-y: auto;
		overscroll-behavior: contain;
		background: var(--color-surface-cream);
	}

	/* The tab bar (and the centre button that pokes above it) stays on top of the panel. */
	.sng-menu-open #brx-footer {
		z-index: 120; /* the panel lives in the header (z-index 99), so lift the footer above it */
	}

	.sng-menu-open #brxe-mnvsec {
		z-index: 40;
	}

	/* The footer is lifted above the panel for the tab bar; its own content (brown footer section) must not
	   show through the open menu on short pages (e.g. Shop with the Sort by / Filters bar). */
	.sng-menu-open #brxe-ftrsec {
		visibility: hidden;
	}

	/* Top-level items (rows and the expandable Shop group) are separated by hairlines. */
	.sng-menu-panel > .sng-mp-row,
	.sng-menu-panel > .sng-mp-group {
		padding: var(--space-20) 0;
		border-top: var(--hairline) solid var(--color-border-subtle);
	}

	.sng-menu-panel > :first-child {
		padding-top: 0;
		border-top: 0;
	}

	.sng-menu-panel > :last-child {
		padding-bottom: 0;
	}

	.sng-mp-row {
		display: flex;
		align-items: center;
		gap: var(--space-10);
		width: 100%;
		background: none;
		border: 0;
		color: var(--color-ink);
		text-align: left;
		text-decoration: none;
		-webkit-tap-highlight-color: transparent;
	}

	button.sng-mp-row {
		padding: 0;
		cursor: pointer;
	}

	/* Shop row: chevron at the right that turns when the group is open. */
	.sng-mp-row--toggle::after {
		content: "";
		flex: none;
		width: 18px;
		height: 18px;
		margin-left: auto;
		background: currentColor;
		-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M4 6.5 9 11.5 14 6.5' fill='none' stroke='%23000' stroke-width='1.8' 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 18 18'%3E%3Cpath d='M4 6.5 9 11.5 14 6.5' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
		transition: transform 0.2s ease;
	}

	.sng-mp-group.is-open .sng-mp-row--toggle::after {
		transform: rotate(180deg);
	}

	/* Shop sub-menu: orange group titles with link pills (Figma "Shop by …"). */
	.sng-mp-sub {
		display: none;
		flex-direction: column;
		gap: var(--space-15);
		padding-top: var(--space-15);
	}

	.sng-mp-group.is-open .sng-mp-sub {
		display: flex;
	}

	.sng-mp-sub__title {
		margin-bottom: var(--space-10);
		font-family: var(--font-body);
		font-size: 13px;
		font-weight: 600;
		line-height: 15.2px;
		color: #d97706;
	}

	.sng-mp-sub__links {
		display: flex;
		flex-wrap: wrap;
		gap: var(--space-10);
	}

	.sng-mp-sub__link {
		padding: var(--space-8) var(--space-15);
		background: var(--color-surface-sand);
		border: var(--hairline) solid var(--color-border-subtle);
		border-radius: var(--radius-pill);
		font-family: var(--font-body);
		font-size: 14px;
		font-weight: 500;
		line-height: 1.2;
		color: var(--color-ink);
		text-decoration: none;
	}

	.sng-mp-sub__all {
		align-self: flex-start;
		font-family: var(--font-body);
		font-size: 14px;
		font-weight: 600;
		color: var(--color-brand-deep);
		text-decoration: underline;
	}

	.sng-mp-row__img {
		flex: none;
		width: 50px;
		height: 50px;
		border: var(--hairline) solid var(--color-border-subtle);
		border-radius: 50%;
		object-fit: cover;
	}

	.sng-mp-row__label {
		font-family: var(--font-body);
		font-size: 15px;
		font-weight: 600;
		line-height: 18px;
		color: var(--color-ink);
	}

	.sng-mp-row:active .sng-mp-row__label {
		color: var(--color-brand-deep);
	}

	/* The centre button keeps its look when it is a <button>. */
	#brxe-mnvfab.sng-menu-toggle {
		padding: 0;
		border: 0;
		cursor: pointer;
	}
}

/* ---------- Home row, close button (inc/mobile-menu.php) ---------- */
.sng-mp-close {
	display: none;
}

@media (max-width: 767px) {
	.sng-mp-row--home {
		display: flex;
		align-items: center;
		gap: 10px;
		text-decoration: none;
	}

	/* The house icon in the same round frame as the row photos. */
	.sng-mp-row__img--icon {
		display: flex;
		align-items: center;
		justify-content: center;
		background-color: var(--color-surface-sand);
		color: var(--color-brand-deep);
	}

	.sng-mp-row__img--icon .sng-icon,
	.sng-mp-row__img--icon svg {
		display: block;
		width: 22px;
		height: 22px;
	}

	/* Close: top right of the panel, level with the first (Home) row; leaves the flow untouched. */
	.sng-menu-open .sng-mp-close {
		position: absolute;
		top: 27px;
		right: var(--space-20);
		z-index: 1;
		display: flex;
		align-items: center;
		justify-content: center;
		width: 36px;
		height: 36px;
		padding: 0;
		border: var(--hairline) solid var(--color-border-subtle);
		border-radius: 50%;
		background-color: var(--color-on-accent);
		color: var(--color-brand-deep);
		cursor: pointer;
	}

	.sng-mp-close svg {
		width: 16px;
		height: 16px;
	}
}
