/*
 * Mobile shell states (see inc/mobile-shell.php). Layout and look live on the Bricks elements; this file
 * only holds what depends on the page or on JS state. 767px = Bricks mobile_landscape breakpoint.
 * Selectors use the Bricks element ids (#brxe-…) because Bricks' own per-element CSS is id-level and
 * would otherwise win. Ids: header template 1000 (mhd…), footer template 130 (mnv…).
 */
@media (max-width: 767px) {
	/* Room for the fixed bottom navigation. */
	body {
		padding-bottom: var(--mnav-h);
	}

	/* Inner pages: the header sits in the page flow (it only floats over the home hero), so the shared
	   breadcrumb section (#frame-8-breadcrumb) doesn't need its desktop top padding to clear it; Figma has
	   the breadcrumb right under the header. */
	body:not(.home) #brx-header {
		position: relative;
	}

	#frame-8-breadcrumb {
		padding-top: 0;
	}

	/* Home vs inner pages (Figma Homepage vs Bedsheets Listing / Categories frames). */
	body:not(.home) #announcement-bar,
	.home #brxe-mhdbck {
		display: none;
	}

	/* Header icons are the same on every page, logged in or not: Wishlist + User (the cart lives in the bottom
	   bar). User: login popup when logged out (#brxe-mhdlog), the account menu when logged in (#brxe-mhdusr,
	   mobile-shell.js / mobile-account.js). */
	body #brxe-mhdcrt {
		display: none;
	}

	/* Pages whose bottom bar has no Cart tab (listing: Sort by / Filters bar; product: action bar): the cart
	   comes back to the header, so it reads Wishlist, Cart, User there. */
	.sng-has-listbar body #brxe-mhdcrt,
	body.single-product #brxe-mhdcrt {
		display: flex;
	}

	/* Homepage: header sits on the hero photo (Figma 2432:45898), so no brown band and no gap under the search bar. */
	.home #brxe-mhdsec {
		background: none;
		border-bottom: 0;
	}

	.home #brxe-mhdsch:not(.is-pinned) {
		padding-bottom: 0;
	}

	body:not(.home) #brxe-mhdfrm {
		border-color: var(--color-brand-deep);
	}

	/* Focus shows on the whole pill, not as a square outline on the field inside it. */
	/* !important only to beat the sitewide "input:focus-visible { border … !important }" rule. */
	#brxe-mhdsel input[type="search"]:focus,
	#brxe-mhdsel input[type="search"]:focus-visible {
		border: 0 !important;
		outline: 0 !important;
		box-shadow: none;
	}

	#brxe-mhdfrm:focus-within {
		border-color: var(--color-brand-deep);
		box-shadow: 0 0 0 var(--hairline) var(--color-brand-deep);
	}

	/* Search bar pinned on scroll (Figma 2432:45884). */
	#brxe-mhdsch.is-pinned {
		position: fixed;
		inset: 0 0 auto;
		z-index: 30;
		padding: var(--space-15) var(--space-20); /* 15px above and below the pill (was 10px, felt cramped). */
		background-color: var(--color-surface-cream-20);
		backdrop-filter: blur(var(--blur-pinned));
		-webkit-backdrop-filter: blur(var(--blur-pinned));
	}

	/* Inner pages (category, shop, product…): the pinned bar keeps the brown patterned header band behind the back
	   button and search pill (Figma); the homepage keeps the light blurred bar over its hero. */
	body:not(.home) #brxe-mhdsch.is-pinned {
		background: var(--color-brand-deep) url("../images/mobile/header-pattern-tile.svg") repeat;
		backdrop-filter: none;
		-webkit-backdrop-filter: none;
	}

	.admin-bar #brxe-mhdsch.is-pinned {
		top: var(--wp-admin--admin-bar--height, 0px);
	}

	/* Up to 600px WordPress' admin bar is not fixed (it scrolls away), so the pinned bar sits at the very top. */
	@media (max-width: 600px) {
		.admin-bar #brxe-mhdsch.is-pinned {
			top: 0;
		}
	}

	/* Bottom navigation, account pages (Figma Dashboard, Orders … Track Order 1416:16270): Dashboard / Orders
	   (#brxe-mnalft) instead of Home / Category; the right side stays Offer / Cart (#brxe-mnvrgt) on every page,
	   so the cart is always in the same place. The account set's Offer / Account (#brxe-mnargt) is not used:
	   the header's User icon opens the account menu. Ids, to beat Bricks' own. */
	body #brxe-mnalft,
	body #brxe-mnargt,
	.woocommerce-account #brxe-mnvlft,
	.page-id-1720 #brxe-mnvlft {
		display: none;
	}

	.woocommerce-account #brxe-mnalft,
	.page-id-1720 #brxe-mnalft {
		display: flex;
	}

	/* Bottom navigation: inactive tabs in ink-soft, the current one in brand colour (Figma Nav/Home). */
	.sng-mnav [data-nav] {
		color: var(--color-ink-soft);
		font-weight: 500;
	}

	.sng-mnav [data-nav].is-active {
		color: var(--color-brand-deep);
		font-weight: 600;
	}

	/* Title bar (Figma "Top": back button + page title), header template #brxe-mhdttl. Hidden by default;
	   the cart / checkout (mobile-cart-checkout.css) and account pages (mobile-account.css) show it.
	   #brxe-mtbt1 "My Cart", #brxe-mtbt2 "Checkout", #brxe-mtbt3 the account page title. */
	#brxe-mtbrow {
		display: flex;
		align-items: center;
		gap: var(--space-10);
	}

	#brxe-mtbbck {
		display: flex;
		align-items: center;
		justify-content: center;
		flex: none;
		width: 40px;
		height: 40px;
		border: var(--hairline) solid var(--color-border-subtle);
		border-radius: var(--radius-pill);
		background: var(--color-on-accent);
		color: var(--color-brand-deep);
	}

	/* The icon shortcode's wrapper is a block that would otherwise pin the arrow to the top-left. */
	#brxe-mtbbki {
		display: flex;
		align-items: center;
		justify-content: center;
	}

	#brxe-mtbbck svg {
		width: 16px;
		height: 16px;
	}

	#brxe-mtbt1,
	#brxe-mtbt2,
	#brxe-mtbt3 {
		margin: 0;
		font-family: var(--font-display);
		font-size: 24px;
		font-weight: 700;
		line-height: 1.15;
		color: var(--color-on-accent);
	}

	.sng-m-cart #brxe-mtbt3,
	.sng-m-checkout #brxe-mtbt3 {
		display: none;
	}

	/* Pages titled by sanganeri_mobile_title() (body.sng-m-titled, inc/mobile-account.php): "← <title>"
	   instead of logo + search, and no breadcrumb. Offers / Sale is a tab, so no back button (Figma). */
	.sng-m-titled #brxe-mhdtop,
	.sng-m-titled #brxe-mhdsrw,
	.sng-m-titled #frame-8-breadcrumb,
	.sng-m-titled #brxe-mtbt1,
	.sng-m-titled #brxe-mtbt2,
	.sng-m-titled #brxe-mtbstp,
	.page-id-1323 #brxe-mtbbck {
		display: none;
	}

	.sng-m-titled #brxe-mhdttl {
		display: flex;
		flex-direction: column;
		width: 100%;
		padding: 25px var(--space-20); /* 25px above and below the back button. */
	}

	/* Product card discount badge: Work Sans in the phone design (the card component asks for IBM Plex Mono,
	   which isn't loaded, so phones showed Courier). */
	body .brxe-6e8d74 .onsale {
		font-family: var(--font-body);
		letter-spacing: 0;
	}

	/* Search by photo (inc/photo-search.php): camera button in the search pill, and its status toast. */
	.sng-mhd-cam.is-busy {
		opacity: 0.5;
		pointer-events: none;
	}

	.sng-photo-search-status {
		position: fixed;
		right: var(--space-20);
		bottom: calc(var(--mnav-h, 76px) + var(--space-15));
		left: var(--space-20);
		z-index: 40;
		margin: 0;
		padding: var(--space-12, 12px) var(--space-15);
		border-radius: var(--radius-card);
		background: var(--color-ink);
		color: var(--color-on-accent);
		font-family: var(--font-body);
		font-size: 13px;
		line-height: 1.4;
		text-align: center;
		opacity: 0;
		visibility: hidden;
		transition: opacity 0.2s;
	}

	.sng-photo-search-status.is-visible {
		opacity: 1;
		visibility: visible;
	}

	.sng-no-speech .sng-mhd-mic {
		display: none;
	}

	.sng-mhd-mic.is-listening {
		color: var(--color-brand-accent);
	}
}

/*
 * No sticky header, on any screen (requested 2026-11-13): the header scrolls away with the page (on phones only the
 * search bar pins, see mobile-shell.js). The "header sticky smooth" script in Bricks > Settings > Custom code still
 * adds .is-sticky and a body padding-top when scrolling; these undo both, so nothing is fixed and nothing jumps.
 */
#brx-header.is-sticky {
	position: absolute !important;
	top: 0 !important;
	transform: none !important;
	animation: none !important;
}

body:has(#brx-header.is-sticky) {
	padding-top: 0 !important;
}

/* ---------- Login popup on phones (Bricks popup 1653, Figma "Auth Modal / Login" 1416:22966) ----------
   A full-screen page instead of the centred box: brown "← Login" title bar (the close button becomes the
   back circle), no banner photo, the form right under the bar. Desktop keeps the box.
   (.brx-popup + the template class: one class more than Bricks' own inline popup rules, which load later.) */
@media (max-width: 767px) {
	.brx-popup.brxe-popup-1653 {
		align-items: stretch;
		justify-content: stretch;
		padding: 0;
	}

	.brx-popup.brxe-popup-1653 .brx-popup-content {
		width: 100%;
		max-width: none;
		height: 100dvh;
		max-height: none;
		margin: 0;
		overflow-y: auto;
		overscroll-behavior: contain;
		border-radius: 0;
		background-color: var(--color-surface-cream);
	}

	.brx-popup.brxe-popup-1653 #brxe-sngam1 {
		min-height: 100%;
		padding-top: 72px; /* the title bar */
		overflow: visible;
		border-radius: 0;
		background-color: var(--color-surface-cream);
	}

	/* Title bar: brand-deep with the header pattern, like the other phone title bars. */
	.brx-popup.brxe-popup-1653 #brxe-sngam1::before {
		position: absolute;
		top: 0;
		right: 0;
		left: 0;
		height: 72px;
		padding-left: 72px;
		content: "Login";
		display: flex;
		align-items: center;
		box-sizing: border-box;
		font-family: var(--font-display);
		font-size: 24px;
		font-weight: 700;
		line-height: 1.15;
		color: var(--color-on-accent);
		background: var(--color-brand-deep) url("../images/mobile/header-pattern-tile.svg") repeat;
	}

	.brx-popup.brxe-popup-1653 #brxe-sngbn1 {
		display: none;
	}

	/* Close button = back circle at the left of the bar. */
	.brx-popup.brxe-popup-1653 #brxe-sngcl1 {
		top: 16px;
		right: auto;
		left: 20px;
		width: 40px;
		height: 40px;
		border: var(--hairline) solid var(--color-border-subtle);
		background-color: var(--color-on-accent);
	}

	.brx-popup.brxe-popup-1653 #brxe-sngcx1 {
		width: 16px;
		height: 16px;
		font-size: 0;
		line-height: 0;
		background: center / 16px 16px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%2378350F' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M13 8H3M7.5 3.5 3 8l4.5 4.5'/%3E%3C/svg%3E");
	}

	/* The bar says "Login": no second heading in the form (the OTP step keeps its "sent to" line). */
	.brx-popup.brxe-popup-1653 .sng-auth__view > [id$="-login-title"],
	.brx-popup.brxe-popup-1653 .sng-auth__view > [id$="-otp-title"] {
		display: none;
	}

	.brx-popup.brxe-popup-1653 .sng-auth {
		padding: var(--space-20) var(--space-16) var(--space-30);
	}
}

/* ---------- "About & Support" under the login form (inc/mobile-login.php, Figma "Auth Modal / Login") ----------
   Phones only; hidden from 768px up so desktop is unchanged. Login fields filled sand as in Figma. */
@media (min-width: 768px) {
	.sng-about-support {
		display: none;
	}
}

@media (max-width: 767px) {
	.sng-auth .sng-auth__input,
	.sng-auth .sng-auth__cc {
		background-color: var(--color-surface-sand);
	}

	.sng-about-support {
		margin-top: var(--space-10);
		font-family: var(--font-body);
	}

	.sng-about-support__title {
		margin: 0;
		padding: var(--space-15) var(--space-16);
		font-family: var(--font-display);
		font-size: 18px;
		font-weight: 600;
		line-height: 1.3;
		color: var(--color-brand-deep);
		background: var(--color-surface-sand);
	}

	.sng-about-support__group {
		border-bottom: var(--hairline) solid var(--color-border-subtle);
	}

	.sng-about-support__summary {
		display: flex;
		align-items: center;
		gap: 12px;
		padding: var(--space-15) var(--space-16);
		font-size: 15px;
		font-weight: 500;
		line-height: 1.4;
		color: var(--color-ink);
		cursor: pointer;
		list-style: none;
	}

	.sng-about-support__summary::-webkit-details-marker {
		display: none;
	}

	.sng-about-support__icon,
	.sng-about-support__icon svg {
		display: block;
		flex: none;
		width: 20px;
		height: 20px;
		color: var(--color-ink);
	}

	.sng-about-support__label {
		flex: 1;
	}

	.sng-about-support__chevron {
		flex: none;
		width: 16px;
		height: 16px;
		color: var(--color-ink-muted);
		transition: transform 0.2s ease;
	}

	.sng-about-support__group[open] .sng-about-support__chevron {
		transform: rotate(180deg);
	}

	.sng-about-support__links {
		display: flex;
		flex-direction: column;
		gap: 12px;
		margin: 0;
		padding: 0 var(--space-16) var(--space-16) 48px;
		list-style: none;
	}

	.sng-about-support__links li {
		position: relative;
		margin: 0;
	}

	.sng-about-support__links li::before {
		position: absolute;
		top: 0.75em;
		left: -12px;
		width: 3px;
		height: 3px;
		content: "";
		border-radius: 50%;
		background: var(--color-ink-muted);
	}

	.sng-about-support__links a {
		font-size: 13px;
		font-weight: 500;
		line-height: 1.4;
		color: var(--color-ink-muted);
		text-decoration: none;
	}

	/* In the login popup the block runs edge to edge (the form keeps its side padding). */
	.brx-popup.brxe-popup-1653 .sng-about-support {
		margin-top: 0;
	}
}

/* ---------- Count badges (inc/mobile-counts.php): wishlist on the header heart, cart on the Cart tab ----------
   Orange dot with the number, top right of the icon, as the desktop header's cart count. Phones only. */
.sng-count {
	display: none;
}

/* Desktop header heart (#brxe-hdrwsh): same badge as the desktop cart count (.cart-count). */
@media (min-width: 768px) {
	a:has(> #brxe-hdrwsh) {
		position: relative;
	}

	a:has(> #brxe-hdrwsh) > .sng-count:not([hidden]) {
		position: absolute;
		top: -8px;
		right: -5px;
		display: flex;
		align-items: center;
		justify-content: center;
		min-width: 18px;
		height: 18px;
		padding: 0 4px;
		border-radius: 50%;
		background-color: #FF9800;
		font-size: 10px;
		font-weight: 700;
		line-height: 10px;
		color: #FFFFFF;
		pointer-events: none;
	}
}

@media (max-width: 767px) {
	#brxe-mhdfav,
	#brxe-mdhfav,
	#brxe-mhdcrt,
	#brxe-mnvcr .brxe-shortcode {
		position: relative;
	}

	.sng-count:not([hidden]) {
		position: absolute;
		top: -4px;
		right: -6px;
		display: flex;
		align-items: center;
		justify-content: center;
		min-width: 18px;
		height: 18px;
		padding: 0 5px;
		border: 1.5px solid var(--color-on-accent);
		border-radius: var(--radius-pill);
		background-color: var(--color-brand-accent);
		font-family: "Work Sans", sans-serif;
		font-size: 10px;
		font-weight: 700;
		line-height: 1;
		color: var(--color-on-accent);
		pointer-events: none;
	}

	.sng-count--cart:not([hidden]) {
		top: -6px;
		right: -10px;
	}
}

/* ---------- Account menu on every page (inc/mobile-account.php, mobile-shell.js) ----------
   Same rows as the account pages' menu (mobile-account.css "Account menu"), opened by the header User icon. */
.sng-gacct {
	display: none;
}

@media (max-width: 767px) {
	.sng-gacct-open,
	.sng-gacct-open body {
		overflow: hidden;
	}

	/* Menu open: the header is just logo + icons (as the shop menu), no search bar or WhatsApp bubble. */
	.sng-gacct-open #brxe-mhdsch,
	.sng-gacct-open #brxe-mhdsrw,
	.sng-gacct-open #brxe-mwabtn {
		display: none !important;
	}

	.sng-gacct-open .sng-gacct {
		position: fixed;
		inset: var(--sng-gacct-top, 90px) 0 var(--mnav-h, 76px);
		z-index: 35;
		display: block;
		overflow-y: auto;
		overscroll-behavior: contain;
		background: var(--color-surface-cream);
	}

	.sng-gacct #brxe-r6ws8j,
	.sng-gacct #brxe-1og4o8 {
		display: flex;
		flex-direction: column;
	}

	.sng-gacct #brxe-kwfo74 {
		display: flex;
		flex-direction: row;
		flex-wrap: nowrap;
		align-items: center;
		gap: 12px;
		padding: var(--space-15) var(--space-20);
		border-bottom: var(--hairline) solid var(--color-border-subtle);
		background: var(--color-surface-sand);
	}

	.sng-gacct #brxe-fmm4ke {
		display: flex;
		flex: none;
		align-items: center;
		justify-content: center;
		width: 42px;
		height: 42px;
		overflow: hidden;
		border-radius: 999px;
		background: var(--color-brand-deep);
	}

	.sng-gacct #brxe-fmm4ke img {
		display: block;
		width: 100%;
		height: 100%;
		border-radius: 999px;
		object-fit: cover;
	}

	.sng-gacct #brxe-a9ojhk {
		flex: 1 1 auto;
		min-width: 0;
		width: auto;
		display: flex;
		flex-direction: column;
		gap: 2px;
	}

	.sng-gacct #brxe-i4n6a5 {
		font-family: "Work Sans", sans-serif;
		font-size: 16px;
		font-weight: 500;
		line-height: 18.8px;
		color: #6B5D4D;
	}

	.sng-gacct #brxe-d5gw2l {
		font-family: "Work Sans", sans-serif;
		font-size: 18px;
		font-weight: 500;
		line-height: 21px;
		color: var(--color-ink);
	}

	.sng-gacct #brxe-1og4o8 > a {
		display: flex;
		flex-direction: row;
		align-items: center;
		gap: 15px;
		padding: var(--space-20);
		border-bottom: var(--hairline) solid var(--color-border-subtle);
		background: var(--color-surface-cream); /* QA #32: Figma rows #FAF7F2 */
		font-family: "Work Sans", sans-serif;
		font-size: 16px;
		font-weight: 500;
		line-height: 20.8px;
		color: var(--color-ink);
		text-decoration: none;
	}

	.sng-gacct #brxe-1og4o8 > a svg {
		flex: none;
		width: 22px;
		height: 22px;
		color: var(--color-ink);
		fill: currentColor;
	}

	.sng-gacct #brxe-1og4o8 > #brxe-ixcoth {
		margin-top: var(--space-10); /* QA #34 */
		padding: 20px 30px 25px;
		border-bottom: 0;
		background: rgba(216, 0, 4, 0.05);
	}

	.sng-gacct #brxe-1og4o8 > #brxe-ixcoth,
	.sng-gacct #brxe-1og4o8 > #brxe-ixcoth svg {
		color: rgb(144, 0, 16);
		fill: currentColor;
	}

	/* Know Us / Customer Care block: same as in the account pages' menu (mobile-account.css). */
	.sng-gacct .sng-about-support--menu {
		width: 100%;
		margin: var(--space-10) 0 0;
		padding: 0;
		background-color: var(--color-surface-cream);
	}

	.sng-gacct .sng-about-support--menu .sng-about-support__title {
		display: block;
		padding: 15px 20px;
		font-size: 20px;
		line-height: 25px;
	}

	.sng-gacct #brxe-1og4o8 > #brxe-gp6ejl {
		border-bottom: 0;
	}

	.sng-gacct .sng-about-support--menu .sng-about-support__group:last-of-type {
		border-bottom: 0;
	}

	.sng-gacct .sng-about-support--menu .sng-about-support__summary {
		gap: 15px;
		padding: 20px;
		font-size: 16px;
		font-weight: 500;
		line-height: 20.8px;
	}

	.sng-gacct .sng-about-support--menu :is(.sng-about-support__icon, .sng-about-support__icon svg) {
		width: 22px;
		height: 22px;
	}

	.sng-gacct .sng-about-support--menu .sng-about-support__links {
		padding: 0 20px 16px 55px;
	}
}

/* ---------- "About & Support" under the login form: Figma "Auth Modal / Login" 1416:22966 ----------
   Title band 15/20 padding, Newsreader 20/600; rows 20px padding, 22px icon, 15px gap, Work Sans 16/500;
   open list: 15px under the row, 3px muted dot at 48px, link text at 61px, 10px apart, 14/500 muted
   (Figma expanded Know Us, user screenshot 2026-11-18). The open list (not the rows) is the same in the account menu variant (--menu: dashboard and
   the account menu on other pages). */
@media (max-width: 767px) {
	.sng-about-support:not(.sng-about-support--menu) .sng-about-support__title {
		padding: 15px 20px;
		font-size: 20px;
		font-weight: 600;
		line-height: 25px;
		color: var(--color-brand-deep);
		background: var(--color-surface-sand);
	}

	.sng-about-support:not(.sng-about-support--menu) .sng-about-support__summary {
		gap: 15px;
		padding: 20px;
		font-size: 16px;
		font-weight: 500;
		line-height: 20.8px;
		color: var(--color-ink);
	}

	.sng-about-support:not(.sng-about-support--menu) .sng-about-support__group[open] .sng-about-support__summary,
	.sng-about-support.sng-about-support--menu .sng-about-support__group[open] .sng-about-support__summary {
		padding-bottom: 15px;
	}

	.sng-about-support:not(.sng-about-support--menu) :is(.sng-about-support__icon, .sng-about-support__icon svg) {
		width: 22px;
		height: 22px;
	}

	.sng-about-support:not(.sng-about-support--menu) .sng-about-support__chevron {
		width: 18px;
		height: 18px;
		color: var(--color-ink-soft);
	}

	.sng-about-support:not(.sng-about-support--menu) .sng-about-support__links,
	.sng-about-support.sng-about-support--menu .sng-about-support__links {
		gap: 10px;
		padding: 0 20px 20px 61px;
		list-style: none;
	}

	.sng-about-support:not(.sng-about-support--menu) .sng-about-support__links li,
	.sng-about-support.sng-about-support--menu .sng-about-support__links li {
		position: relative;
		list-style: none;
	}

	/* 3px dot in the link colour, centred on the line, 10px before the text (Figma: dot at 48-51px, text at 61px). */
	.sng-about-support:not(.sng-about-support--menu) .sng-about-support__links li::before,
	.sng-about-support.sng-about-support--menu .sng-about-support__links li::before {
		display: block;
		position: absolute;
		top: 9px;
		left: -13px;
		width: 3px;
		height: 3px;
		content: "";
		border-radius: 50%;
		background: var(--color-ink-muted);
	}

	.sng-about-support:not(.sng-about-support--menu) .sng-about-support__links a,
	.sng-about-support.sng-about-support--menu .sng-about-support__links a {
		display: block;
		font-size: 14px;
		font-weight: 500;
		line-height: 21px;
		color: var(--color-ink-muted);
	}
}

/* ---------- iPhone / iPad: no zoom when a field is tapped ----------
   iOS Safari zooms the page in when a text field under 16px gets focus, and leaves it zoomed (the header
   search is 15px, login / contact / track-order fields 14px). 16px on iOS only (-webkit-touch-callout is
   iOS-only), so Android and desktop keep the Figma sizes. !important: Bricks sets field sizes by element ID. */
@supports (-webkit-touch-callout: none) {
	input:is([type="text"], [type="search"], [type="email"], [type="tel"], [type="number"], [type="password"], [type="url"], [type="date"], :not([type])),
	select,
	textarea {
		font-size: 16px !important;
	}
}
