/* ==========================================================================
   deintextil – mobile bottom navigation (.dt-bnav) + bottom sheet (.dt-bsheet)
   Only on phones (≤767px). Safe area: iPhone home indicator / Android gesture bar.
   ":not(#dt)" only raises specificity over theme / plugin button rules.
   ========================================================================== */

:root {
	--dt-bnav-h: 62px;
	--dt-safe-b: env(safe-area-inset-bottom, 0px);
	--dt-ease-out: cubic-bezier(.2, .8, .2, 1);
}

.dt-bnav, .dt-bsheet { display: none; }

@media (max-width: 767px) {

	/* room for the bar at the end of every page */
	body.dt-has-bnav { padding-bottom: calc(var(--dt-bnav-h) + var(--dt-safe-b)); }

	/* ---------- Bar ---------- */
	.dt-bnav {
		display: block;
		position: fixed; left: 0; right: 0; bottom: 0;
		z-index: calc(var(--dt-z) - 3);
		padding: 0 max(6px, env(safe-area-inset-right, 0px)) var(--dt-safe-b) max(6px, env(safe-area-inset-left, 0px));
		background: rgba(255, 255, 255, .94);
		-webkit-backdrop-filter: saturate(180%) blur(18px);
		backdrop-filter: saturate(180%) blur(18px);
		border-top: 1px solid rgba(26, 29, 32, .08);
		box-shadow: 0 -6px 24px rgba(15, 24, 32, .06);
		font-family: var(--dt-font);
		transform: translate3d(0, 0, 0);
		transition: transform .28s var(--dt-ease-out), opacity .2s ease;
		-webkit-tap-highlight-color: transparent;
		-webkit-user-select: none; user-select: none;
	}
	@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
		.dt-bnav { background: #fff; }
	}
	/* hidden: keyboard open, a drawer / sheet / menu is open, product buy bar visible */
	.dt-bnav.is-hidden,
	html.dt-lock .dt-bnav,
	html.abr-menu-is-open .dt-bnav,
	html.phoenix-cart-lock .dt-bnav,
	body:has(.dt-pp-bar.is-visible) .dt-bnav {
		transform: translate3d(0, calc(100% + 8px), 0);
		opacity: 0;
		pointer-events: none;
	}

	.dt-bnav .dt-bnav__list:not(#dt) {
		display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
		height: var(--dt-bnav-h);
		margin: 0 auto; padding: 0; max-width: 520px;
		list-style: none;
	}
	.dt-bnav .dt-bnav__cell:not(#dt) { margin: 0; padding: 0; list-style: none; }

	.dt-bnav .dt-bnav__item:not(#dt) {
		-webkit-appearance: none; appearance: none;
		position: relative;
		display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
		width: 100%; height: 100%; min-height: 0;
		margin: 0; padding: 4px 0 0;
		border: 0; border-radius: 0;
		background: none; box-shadow: none;
		color: #5B5F63;
		font: 500 11px/1 var(--dt-font);
		letter-spacing: .01em; text-transform: none; text-decoration: none;
		cursor: pointer;
		touch-action: manipulation;
		transform: none;
		transition: color .15s ease;
	}
	.dt-bnav .dt-bnav__item:not(#dt):is(:hover, :focus, :active) { background: none; color: var(--dt-text); box-shadow: none; transform: none; }
	.dt-bnav .dt-bnav__item:not(#dt):focus:not(:focus-visible) { outline: none; }
	.dt-bnav .dt-bnav__item:not(#dt):focus-visible { outline: none; }
	.dt-bnav .dt-bnav__item:focus-visible .dt-bnav__icon { box-shadow: 0 0 0 2px var(--dt-dark); }

	/* icon pill: lime for the current section (Material-3 style indicator) */
	.dt-bnav__icon {
		position: relative;
		display: flex; align-items: center; justify-content: center;
		width: 56px; height: 30px;
		border-radius: 999px;
		transition: background-color .2s ease, transform .15s var(--dt-ease-out);
	}
	.dt-bnav__icon .dt-icon { width: 23px; height: 23px; stroke-width: 1.8; }
	.dt-bnav__item:active .dt-bnav__icon { transform: scale(.92); }
	.dt-bnav .dt-bnav__item.is-active:not(#dt) { color: var(--dt-text); font-weight: 600; }
	.dt-bnav__item.is-active .dt-bnav__icon { background: var(--dt-accent); }
	.dt-bnav__item.is-active .dt-icon { stroke-width: 2.1; }
	.dt-bnav__label { white-space: nowrap; }

	/* cart count (also updated by the Phoenix cart flyout: .phoenix-cart-count) */
	.dt-bnav .dt-bnav__badge:not(#dt) {
		position: absolute; top: -3px; left: calc(50% + 5px); right: auto;
		min-width: 18px; height: 18px; padding: 0 5px; box-sizing: border-box;
		display: flex; align-items: center; justify-content: center;
		border-radius: 999px; border: 2px solid #fff;
		background: var(--dt-dark); color: #fff;
		font: 600 10px/1 var(--dt-font);
		pointer-events: none;
	}
	.dt-bnav .dt-bnav__badge[hidden]:not(#dt) { display: none !important; }
	.dt-bnav__badge.is-bump { animation: dt-bnav-bump .45s var(--dt-ease-out); }
	@keyframes dt-bnav-bump { 0% { transform: scale(1); } 35% { transform: scale(1.35); } 100% { transform: scale(1); } }

	/* ---------- Bottom sheet (search sheet; the filter sheet uses the same look) ---------- */
	.dt-bsheet { display: block; position: fixed; inset: 0; z-index: calc(var(--dt-z) + 6); font-family: var(--dt-font); color: var(--dt-text); }
	.dt-bsheet[hidden] { display: none; }
	.dt-bsheet__backdrop { position: absolute; inset: 0; background: var(--dt-dim); opacity: 0; transition: opacity .25s ease; }
	.dt-bsheet__panel {
		position: absolute; left: 0; right: 0; bottom: 0;
		display: flex; flex-direction: column;
		max-height: calc(100% - 48px);
		max-height: calc(100dvh - 48px);
		border-radius: 24px 24px 0 0;
		background: #fff;
		box-shadow: 0 -12px 40px rgba(15, 24, 32, .18);
		transform: translate3d(0, 100%, 0);
		transition: transform .32s var(--dt-ease-out);
		will-change: transform;
		overscroll-behavior: contain;
	}
	.dt-bsheet.is-open .dt-bsheet__backdrop { opacity: 1; }
	.dt-bsheet.is-open .dt-bsheet__panel { transform: translate3d(0, var(--dt-drag, 0px), 0); }
	.dt-bsheet.is-dragging .dt-bsheet__panel { transition: none; }

	.dt-bsheet__head {
		position: relative; flex: 0 0 auto;
		display: flex; align-items: center; justify-content: space-between;
		padding: 22px 16px 12px 20px;
		touch-action: none; cursor: grab;
	}
	.dt-bsheet__grip { position: absolute; top: 8px; left: 50%; width: 40px; height: 5px; margin-left: -20px; border-radius: 999px; background: #D5D4CF; }
	.dt-bsheet__title { font-size: 20px; font-weight: 700; line-height: 1.2; }
	.dt-bsheet .dt-bsheet__close:not(#dt) {
		-webkit-appearance: none; appearance: none;
		display: flex; align-items: center; justify-content: center;
		width: 40px; height: 40px; margin: 0; padding: 0;
		border: 0; border-radius: 999px;
		background: var(--dt-soft); color: var(--dt-text); box-shadow: none; cursor: pointer;
	}
	.dt-bsheet__body {
		flex: 1 1 auto; min-height: 0;
		overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
		padding: 4px 20px calc(24px + var(--dt-safe-b));
	}

	/* search sheet */
	.dt-bnav-search__form { position: relative; display: flex; align-items: center; margin: 0; }
	.dt-bnav-search__icon { position: absolute; left: 16px; display: flex; color: var(--dt-muted); pointer-events: none; }
	.dt-bnav-search .dt-bnav-search__input:not(#dt) {
		width: 100%; height: 52px; margin: 0;
		padding: 0 60px 0 46px;
		border: 1.5px solid var(--dt-line-strong); border-radius: 999px;
		background: var(--dt-field); color: var(--dt-text);
		font: 400 16px/1 var(--dt-font); /* 16px: no iOS zoom */
		box-shadow: none; outline: none;
		-webkit-appearance: none; appearance: none;
	}
	.dt-bnav-search .dt-bnav-search__input:not(#dt):focus { border-color: var(--dt-dark); background: #fff; }
	.dt-bnav-search__input::-webkit-search-cancel-button { -webkit-appearance: none; }
	.dt-bnav-search .dt-bnav-search__submit:not(#dt) {
		position: absolute; right: 6px;
		display: flex; align-items: center; justify-content: center;
		width: 40px; height: 40px; margin: 0; padding: 0;
		border: 0; border-radius: 999px;
		background: var(--dt-dark); color: #fff; box-shadow: none; cursor: pointer;
	}
	.dt-bnav-search__label { margin: 22px 0 10px; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--dt-muted); }
	.dt-bnav-search__cats { display: flex; flex-wrap: wrap; gap: 8px; }

	/* shared pill look (search sheet, category bar) */
	.dt-pill:not(#dt) {
		display: inline-flex; align-items: center; gap: 8px;
		height: 38px; padding: 0 16px;
		border: 1px solid var(--dt-line-strong); border-radius: 999px;
		background: #fff; color: var(--dt-text);
		font: 500 14px/1 var(--dt-font); text-decoration: none; white-space: nowrap;
		-webkit-tap-highlight-color: transparent;
	}
	.dt-pill:not(#dt):active { background: var(--dt-soft); }
}

@media (max-width: 767px) and (prefers-reduced-motion: reduce) {
	.dt-bnav, .dt-bsheet__panel, .dt-bsheet__backdrop, .dt-bnav__icon { transition: none !important; }
	.dt-bnav__badge.is-bump { animation: none; }
}
