/* Phone-only app navigation. The existing header remains the sole navigation
   system above ELORA's established 37.49rem phone breakpoint. */
.elora-mobile-nav,
.elora-mobile-sheet { display: none; }

@media (max-width: 37.49rem) {
	:root {
		--elora-mobile-nav-height: 4.5rem;
		--elora-mobile-nav-total-height: calc(var(--elora-mobile-nav-height) + env(safe-area-inset-bottom));
	}

	body { padding-bottom: calc(var(--elora-mobile-nav-total-height) + .25rem); }
	body.elora-mobile-sheet-open { overflow: hidden; }

	.elora-mobile-nav {
		position: fixed;
		z-index: 920;
		inset: auto 0 0;
		display: grid;
		grid-template-columns: repeat(5, minmax(0, 1fr));
		min-height: var(--elora-mobile-nav-height);
		padding: .35rem .25rem calc(.3rem + env(safe-area-inset-bottom));
		border-top: 1px solid rgb(140 106 61 / .28);
		background: #F7F5F1;
		box-shadow: 0 -8px 24px rgb(10 18 37 / .08);
		color: var(--elora-navy);
		font-family: var(--elora-font-body);
	}

	.elora-mobile-nav__item {
		position: relative;
		display: flex;
		min-width: 0;
		min-height: 3.8rem;
		margin: 0;
		padding: .35rem .1rem .25rem;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		gap: .2rem;
		border: 0;
		border-radius: 0;
		background: transparent;
		color: var(--elora-navy);
		font: 500 .625rem/1.15 var(--elora-font-body);
		letter-spacing: .075em;
		text-align: center;
		text-decoration: none;
		text-transform: uppercase;
		cursor: pointer;
	}

	.elora-mobile-nav__item::before {
		content: "";
		position: absolute;
		inset: -.35rem 26% auto;
		height: 1px;
		background: transparent;
	}

	.elora-mobile-nav__item:is(:hover, :focus-visible, .is-active),
	.elora-mobile-nav__more[aria-expanded="true"] { color: var(--elora-gold-dark); }
	.elora-mobile-nav__item:is(.is-active, [aria-expanded="true"])::before { background: var(--elora-gold); }

	.elora-mobile-nav__icon {
		position: relative;
		display: grid;
		width: 1.4rem;
		height: 1.4rem;
		place-items: center;
	}
	.elora-mobile-nav__icon > svg { display: block; width: 100%; height: 100%; }
	.elora-mobile-nav__item--gift .elora-mobile-nav__icon { color: var(--elora-gold-dark); }

	.elora-mobile-cart-count {
		position: absolute;
		top: -.38rem;
		right: -.55rem;
		display: grid;
		min-width: 1.05rem;
		height: 1.05rem;
		padding-inline: .22rem;
		place-items: center;
		border-radius: 999px;
		background: var(--elora-navy);
		color: #F7F5F1;
		font: 600 .575rem/1 var(--elora-font-body);
		letter-spacing: 0;
	}
	.elora-mobile-cart-count[hidden] { display: none; }

	.elora-mobile-sheet {
		position: fixed;
		z-index: 900;
		inset: 0 0 var(--elora-mobile-nav-total-height);
		display: block;
		visibility: hidden;
		pointer-events: none;
		transition: visibility 0s linear 320ms;
	}
	.elora-mobile-sheet.is-open {
		visibility: visible;
		pointer-events: auto;
		transition-delay: 0s;
	}

	.elora-mobile-sheet__backdrop {
		position: absolute;
		inset: 0;
		width: 100%;
		height: 100%;
		margin: 0;
		padding: 0;
		border: 0;
		background: rgb(10 18 37 / .52);
		opacity: 0;
		transition: opacity 260ms var(--elora-ease);
	}
	.elora-mobile-sheet.is-open .elora-mobile-sheet__backdrop { opacity: 1; }

	.elora-mobile-sheet__panel {
		position: absolute;
		inset: auto 0 0;
		max-height: min(77vh, 38rem);
		padding: .65rem var(--elora-gutter) 1.5rem;
		overflow-y: auto;
		overscroll-behavior: contain;
		border-top: 1px solid rgb(140 106 61 / .32);
		background: #F7F5F1;
		color: var(--elora-navy);
		box-shadow: 0 -18px 42px rgb(10 18 37 / .16);
		transform: translateY(102%);
		transition: transform 300ms var(--elora-ease);
	}
	.elora-mobile-sheet.is-open .elora-mobile-sheet__panel { transform: translateY(0); }

	.elora-mobile-sheet__handle {
		width: 2.5rem;
		height: 2px;
		margin: 0 auto 1rem;
		background: rgb(22 32 59 / .25);
	}
	.elora-mobile-sheet__header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
	.elora-mobile-sheet__header .elora-label { margin: 0 0 .25rem; color: var(--elora-gold-dark); }
	.elora-mobile-sheet__header h2 { margin: 0; color: var(--elora-navy); font-size: 2rem; }
	.elora-mobile-sheet__close {
		display: grid;
		width: 2.75rem;
		height: 2.75rem;
		padding: .7rem;
		place-items: center;
		border: 1px solid rgb(140 106 61 / .32);
		border-radius: 50%;
		background: transparent;
		color: var(--elora-navy);
		cursor: pointer;
	}
	.elora-mobile-sheet__close svg { width: 100%; height: 100%; }

	.elora-mobile-sheet__links {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 0 1.25rem;
		margin-top: 1.25rem;
		border-top: var(--elora-border);
	}
	.elora-mobile-sheet__links a {
		display: flex;
		min-height: 3.35rem;
		align-items: center;
		justify-content: space-between;
		gap: .75rem;
		border-bottom: var(--elora-border);
		color: var(--elora-navy);
		font: 400 .8rem/1.3 var(--elora-font-body);
		letter-spacing: .12em;
		text-decoration: none;
		text-transform: uppercase;
	}
	.elora-mobile-sheet__links a:is(:hover, :focus-visible, .is-active) { color: var(--elora-gold-dark); }
	.elora-mobile-sheet__links svg { width: 1rem; height: 1rem; flex: 0 0 auto; }

	.elora-mobile-sheet__search { margin-top: 1.25rem; }
	.elora-mobile-sheet__search > label {
		display: block;
		margin-bottom: .5rem;
		color: var(--elora-gold-dark);
		font: 500 .65rem/1.4 var(--elora-font-body);
		letter-spacing: .16em;
		text-transform: uppercase;
	}
	.elora-mobile-sheet__search > div { display: flex; border-bottom: 1px solid var(--elora-navy); }
	.elora-mobile-sheet__search input {
		width: 100%;
		min-width: 0;
		min-height: 2.75rem;
		padding: .5rem 0;
		border: 0;
		border-radius: 0;
		background: transparent;
		color: var(--elora-navy);
		font: 300 1rem/1.5 var(--elora-font-body);
	}
	.elora-mobile-sheet__search input:focus { outline: 0; }
	.elora-mobile-sheet__search button {
		display: grid;
		width: 2.75rem;
		height: 2.75rem;
		padding: .65rem;
		place-items: center;
		border: 0;
		background: transparent;
		color: var(--elora-navy);
		cursor: pointer;
	}
	.elora-mobile-sheet__search button svg { width: 100%; height: 100%; }
}

@media (max-width: 37.49rem) and (prefers-reduced-motion: reduce) {
	.elora-mobile-sheet,
	.elora-mobile-sheet__backdrop,
	.elora-mobile-sheet__panel { transition-duration: 0s; }
}
