/*
 * Baraka chrome on phones and tablets — Figma 01_Global-Chrome_Mobile:
 * Screen 01 header, Screens 02–03 the full-screen menu sheet, Screen 04 the
 * folding footer. Desktop (≥ 1081 px) is untouched.
 */

/* The sheet only exists below desktop width. */
.bh-sheet { display: none; }
.bh-fold { all: unset; }
.bh-fold__sign { display: none; }

@media (max-width: 1080px) {
	/* ---- Screen 01 · header: burger · logo (centred) · search · cart · language. */
	.bh .bh-nav__links { display: none !important; }
	.bh-nav__rule, .bh-signin, .bh-account { display: none !important; }
	.bh-nav__bar { display: grid; grid-template-columns: 1fr auto 1fr; gap: 0; }
	.bh .bh-nav__toggle { order: 0; grid-column: 1; grid-row: 1; justify-self: start; }
	.bh-nav__logo { grid-column: 2; grid-row: 1; justify-self: center; margin: 0; }
	.bh-nav__actions { grid-column: 3; grid-row: 1; justify-self: end; }

	/* ---- Screens 02–03 · full-screen sheet. */
	.bh-sheet:not([hidden]) {
		position: fixed;
		inset: 0;
		top: var(--wp-admin--admin-bar--height, 0px);
		z-index: 1100;
		display: block;
		background: #fff;
		color: var(--bh-walnut);
		pointer-events: auto;
		animation: bh-sheet-in .2s ease-out;
	}
	@keyframes bh-sheet-in { from { opacity: 0; transform: translateY(8px); } }
	.bh-sheet__view { position: absolute; inset: 0; display: flex; flex-direction: column; }
	.bh-sheet__view[hidden] { display: none !important; }
	.bh-sheet__head {
		display: flex; align-items: center; justify-content: space-between;
		flex: none; height: 72px; padding-inline: 20px; border-bottom: 1px solid var(--bh-line);
	}
	.bh-sheet__logo { display: block; width: 64px; height: 32px; color: var(--bh-walnut); }
	.bh-sheet__logo svg { width: 100%; height: 100%; }
	.bh .bh-sheet__close, .bh .bh-sheet__back { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; font-size: 15px; color: var(--bh-walnut); }
	.bh .bh-sheet__close { justify-content: center; width: 40px; font-size: 20px; margin-inline-end: -8px; }
	.bh-sheet__scroll { flex: 1 1 auto; overflow-y: auto; padding: 8px 20px 24px; overscroll-behavior: contain; }
	.bh-sheet__kicker { margin: 20px 0 4px !important; font-size: 11px; font-weight: 500 !important; letter-spacing: 1.98px; text-transform: uppercase; color: var(--bh-kicker); }
	.bh-sheet__list > li { border-bottom: 1px solid var(--bh-line); }
	.bh .bh-sheet__row {
		display: flex; align-items: center; justify-content: space-between; gap: 12px;
		width: 100%; min-height: 58px; padding: 0; font-size: 17px; font-weight: 400 !important; color: var(--bh-walnut); text-align: start;
	}
	.bh-sheet__row.is-accent { color: var(--bh-sale) !important; }
	.bh-sheet__row.is-soon { color: #b9a69a !important; }
	.bh-sheet__chev { font-size: 20px; color: var(--bh-muted); }
	[dir="rtl"] .bh-sheet__chev, [dir="rtl"] .bh-sheet__back span { transform: scaleX(-1); display: inline-block; }
	.bh-sheet__foot { flex: none; display: flex; flex-direction: column; gap: 14px; padding: 16px 20px 20px; border-top: 1px solid var(--bh-line); }
	.bh .bh-sheet__signin { display: flex; justify-content: center; width: 100%; height: 48px; padding: 0; font-size: 13px; letter-spacing: 1.6px; text-transform: uppercase; }
	.bh-sheet__lang { display: flex; align-items: center; justify-content: space-between; font-size: 13px; color: var(--bh-muted); }
	.bh-seg { display: inline-flex; padding: 4px; border-radius: 999px; background: var(--bh-pill); }
	.bh-seg > * { display: inline-flex; align-items: center; height: 34px; padding-inline: 18px; border-radius: 999px; font-size: 14px; color: var(--bh-walnut); }
	.bh-seg > .is-on { background: var(--bh-coffee); color: #fff; }
	html.bh-lock, html.bh-lock body { overflow: hidden; }
}

@media (max-width: 780px) {
	.bh-nav__bar { height: 64px; padding-inline: 12px 10px; }
	.bh .bh-cart { width: 40px; height: 40px; }

	/* ---- Screen 04 · footer: brand, social 2 × 2, payments 3 × 2, folding link groups. */
	.bh-footer { padding-top: 40px; }
	.bh-footer__top { gap: 22px; padding-bottom: 20px; border-bottom: 0; }
	.bh-footer__brand svg { width: 76px; height: 38px; }
	.bh-footer__brand p { margin-top: 18px; font-size: 15px; line-height: 1.5; }
	.bh-footer__social { display: grid; grid-template-columns: 1fr 1fr; width: 100%; gap: 8px; }
	.bh-footer__social a { justify-content: center; width: 100%; }
	.bh-footer__cols { display: flex; flex-direction: column; gap: 0; padding-top: 0; }
	.bh-footer__pay { order: -1; padding-bottom: 20px; }
	.bh .bh-pay { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
	.bh-footer__cols > div:not(.bh-footer__pay) { padding-block: 18px; border-top: 1px solid rgba(255, 255, 255, .14); }
	.bh-fold { display: flex; align-items: center; justify-content: space-between; width: 100%; cursor: pointer; }
	.bh-fold:focus-visible { outline: 2px solid var(--bh-pill); outline-offset: 3px; }
	.bh-fold__sign { display: block; width: 10px; height: 1px; background: currentColor; position: relative; }
	.bh-fold[aria-expanded="false"] .bh-fold__sign::after { content: ""; position: absolute; inset: 0; background: currentColor; transform: rotate(90deg); }
	.bh-fold[aria-expanded="false"] ~ *, .bh-footer__h:has(.bh-fold[aria-expanded="false"]) + ul { display: none !important; }
	.bh-footer__bottom { margin-top: 0; }
}

/* ------------------------------------------------------------------------
 * Audit fixes against Figma 01_Global-Chrome_Mobile (8:3270).
 * --------------------------------------------------------------------- */

/* Search field: no browser focus box or native clear button (Figma 1:1341 / 8:4063). */
.bh .bh-search__bar input[type="search"]:focus { outline: 0; border: 0; box-shadow: none; }
.bh .bh-search__bar input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }

@media (max-width: 1080px) {
	/* Signed in (MobileHeader 8:3724): a 34px avatar replaces the language pill. */
	.bh .bh-nav.is-signed-in .bh-account { display: inline-flex !important; width: 34px; height: 34px; padding: 0; border: 0; }
	.bh .bh-nav.is-signed-in .bh-account__avatar { width: 34px; height: 34px; font-size: 13.5px; font-weight: 500 !important; }
	.bh .bh-nav.is-signed-in .bh-account__name, .bh .bh-nav.is-signed-in .bh-lang { display: none; }

	/* Search opens as a full-width sheet under the header (8:4063). */
	.bh .bh-search { inset-inline: 0; width: auto; max-width: none; margin: 0; border-radius: 0; box-shadow: 0 20px 30px -20px rgba(74, 58, 50, .3); }
	.bh .bh-search__bar input[type="search"] { font-size: 16px; font-weight: 300 !important; }

	/* Level views slide in from the reading side (Figma: "slides in from the right"). */
	.bh-sheet__view:not([hidden]):not([data-bh-view="root"]) { animation: bh-view-in .22s ease-out; }
	[dir="rtl"] .bh-sheet__view:not([hidden]):not([data-bh-view="root"]) { animation-name: bh-view-in-rtl; }
	@keyframes bh-view-in { from { transform: translateX(28px); opacity: .4; } }
	@keyframes bh-view-in-rtl { from { transform: translateX(-28px); opacity: .4; } }

	/* Deeper levels (8:3436): 16px rows ~52px, small kickers, coffee chevrons. */
	.bh .bh-sheet__view:not([data-bh-view="root"]) .bh-sheet__row { min-height: 52px; font-size: 16px; }
	.bh .bh-sheet__kicker { margin: 0 !important; padding: 22px 0 6px; font-size: 10.5px; font-weight: 400 !important; letter-spacing: 1.68px; }
	.bh .bh-sheet__view:not([data-bh-view="root"]) .bh-sheet__chev { font-size: 17px; color: var(--bh-coffee); }
	.bh .bh-sheet__close { width: 44px; height: 44px; }

	/* Sheet footer (8:3402–8:3408). */
	.bh .bh-sheet__signin { font-size: 12.5px; letter-spacing: 1px; }
	.bh-seg > * { height: 36px; font-size: 13.5px; }
	/* Signed in (8:3898): account card instead of the Sign in button. */
	.bh .bh-sheet__acct { display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 16px; border: 1px solid var(--bh-line); border-radius: 14px; background: #fff; color: var(--bh-ink); }
	.bh .bh-sheet__acct .bh-account__avatar { flex: none; width: 34px; height: 34px; font-size: 13.5px; font-weight: 500 !important; }
	.bh-sheet__acct-text { display: flex; flex: 1; flex-direction: column; min-width: 0; }
	.bh .bh-sheet__acct-text strong { font-size: 15px; font-weight: 400 !important; color: var(--bh-ink); }
	.bh .bh-sheet__acct-text span { font-size: 12px; font-weight: 300 !important; color: var(--bh-kicker); }
	.bh .bh-sheet__acct .bh-sheet__chev { font-size: 17px; color: var(--bh-coffee); }
}

@media (max-width: 780px) {
	/* MobileHeader (8:3295): 58px bar, 6/8 padding, two-bar burger. */
	.bh-nav__bar { height: 58px; padding-inline: 8px; box-shadow: 0 16px 34px -14px rgba(74, 58, 50, .34); }
	.bh-burger { background: transparent !important; }
	.bh-burger::before { top: -3.3px; }
	.bh-burger::after { top: 3.3px; }
	.bh-nav__toggle[aria-expanded="true"] .bh-burger::before { transform: translateY(3.3px) rotate(45deg); }
	.bh-nav__toggle[aria-expanded="true"] .bh-burger::after { transform: translateY(-3.3px) rotate(-45deg); }

	/* Mobile footer (8:3525): 20px sides, 96 × 48 logo, 17px light tagline; links row above the © line. */
	.bh .bh-footer { padding-inline: 20px; }
	.bh-footer__brand svg { width: 96px; height: 48px; }
	.bh .bh-footer__brand p { font-size: 17px; font-weight: 300 !important; }
	.bh-footer__bottom p { order: 2; flex-basis: 100%; }
}
