/* =========================================================
   Allprint: phone "app" layer: tab bar, menu sheet, search overlay,
   press feedback, page transitions, scroll reveal.
   Loaded last; everything except tokens is limited to < 1024px.
   ========================================================= */
:root { --tabbar-h: 64px; --spring: cubic-bezier(.32, .72, 0, 1); --pop: cubic-bezier(.3, 1.6, .5, 1); }

@media (min-width: 1024px) {
	.tabbar, .mm, .header-call, .search__cancel, .search__quick { display: none !important; }
}

@media (max-width: 1023px) {
	html { -webkit-tap-highlight-color: transparent; }
	body { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }

	/* ---------- Header: logo + call, the rest lives in the tab bar ---------- */
	.burger, .search-toggle, .header-actions__cta { display: none !important; }
	.header-main__inner { min-height: 60px; gap: 12px; }
	.header-call { display: inline-flex; width: 42px; height: 42px; border-radius: 50%; background: var(--stone); color: var(--ink); margin-right: -4px; }
	.header-call:active { background: var(--stone-2); }
	.site-header { transition: transform .38s var(--spring), box-shadow .3s; }

	/* ---------- Tab bar ---------- */
	.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 180; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); background: rgba(255, 255, 255, .86); -webkit-backdrop-filter: saturate(1.8) blur(18px); backdrop-filter: saturate(1.8) blur(18px); border-top: 1px solid rgba(17, 17, 17, .07); box-shadow: 0 -10px 30px -20px rgba(17, 24, 39, .35); view-transition-name: tabbar; }
	.tabbar__item { position: relative; isolation: isolate; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; height: 52px; border-radius: 14px; font-size: 10.5px; font-weight: 700; letter-spacing: .01em; color: #8b8a83; transition: color .2s, transform .15s var(--ease); }
	.tabbar__item .icon { transition: transform .4s var(--pop); }
	.tabbar__item:active { transform: scale(.9); }
	.tabbar__item.is-active { color: var(--accent); }
	.tabbar__item.is-active::before { content: ""; position: absolute; top: 3px; left: 50%; width: 52px; height: 30px; margin-left: -26px; border-radius: 999px; background: var(--accent-soft); z-index: -1; animation: ap-tab-pill .45s var(--pop) both; }
	.tabbar__item.is-active .icon { transform: translateY(-1px); }
	.tabbar__item[aria-expanded="true"] { color: var(--accent); }
	.tabbar__ico { position: relative; display: inline-flex; }
	.tabbar__badge { position: absolute; top: -6px; right: -10px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #e0452b; color: #fff; font-size: 10.5px; font-weight: 800; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px #fff; transform: scale(0); transition: transform .35s var(--pop); }
	.tabbar__badge.is-visible { transform: scale(1); }
	.tabbar__badge.is-bump { animation: ap-bump .55s var(--pop); }

	/* ---------- Menu sheet ---------- */
	.mm { position: fixed; inset: 0; z-index: 260; visibility: hidden; transition: visibility 0s .5s; }
	.mm.is-open { visibility: visible; transition: none; }
	.mm__backdrop { position: absolute; inset: 0; width: 100%; background: rgba(9, 14, 28, .42); opacity: 0; transition: opacity .4s; }
	.mm.is-open .mm__backdrop { opacity: 1; }
	.mm__sheet { position: absolute; left: 0; right: 0; bottom: 0; height: calc(100% - 40px - env(safe-area-inset-top)); display: flex; flex-direction: column; background: #fff; border-radius: 22px 22px 0 0; box-shadow: 0 -24px 60px -24px rgba(0, 0, 0, .4); transform: translateY(100%); transition: transform .5s var(--spring); overflow: hidden; will-change: transform; }
	.mm.is-open .mm__sheet { transform: none; }
	.mm__sheet.is-dragging { transition: none; }
	.mm__head { position: relative; flex: none; display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; gap: 8px; padding: 16px 14px 10px; touch-action: none; }
	.mm__grab { position: absolute; top: 7px; left: 50%; width: 38px; height: 5px; margin-left: -19px; border-radius: 99px; background: #dcdad3; }
	.mm__title { text-align: center; font-family: var(--font-head); font-size: 17px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
	.mm__back, .mm__close { width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--stone); color: var(--ink); transition: opacity .3s, transform .3s var(--spring), background .15s; }
	.mm__back:active, .mm__close:active { background: var(--stone-2); transform: scale(.92); }
	.mm__back { opacity: 0; transform: translateX(10px); pointer-events: none; }
	.mm.is-deep .mm__back { opacity: 1; transform: none; pointer-events: auto; }
	.mm__viewport { position: relative; flex: 1; overflow: hidden; }
	.mm__panel { position: absolute; inset: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 6px 16px calc(28px + env(safe-area-inset-bottom)); transform: translateX(100%); visibility: hidden; transition: transform .46s var(--spring), opacity .46s, visibility 0s .46s; }
	.mm__panel.is-active { transform: none; opacity: 1; visibility: visible; transition: transform .46s var(--spring), opacity .46s; }
	.mm__panel.is-behind { transform: translateX(-26%); opacity: 0; }

	.mm__search { display: flex; align-items: center; gap: 10px; width: 100%; height: 48px; padding: 0 16px; border-radius: 14px; background: var(--stone); color: var(--muted); font-size: 14.5px; font-weight: 600; text-align: left; transition: transform .15s var(--ease), background .15s; }
	.mm__search:active { transform: scale(.98); background: var(--stone-2); }
	.mm__label { margin: 20px 2px 10px; font-size: 11.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
	.mm__cats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
	.mm__cat { display: flex; flex-direction: column; align-items: center; gap: 8px; min-height: 100px; padding: 14px 6px 12px; border-radius: 16px; background: var(--stone); color: var(--ink); text-align: center; font-size: 12.5px; font-weight: 700; line-height: 1.2; transition: transform .15s var(--ease), background .15s; }
	.mm__cat:active { transform: scale(.94); background: var(--stone-2); }
	.mm__cat-ico { flex: none; width: 46px; height: 46px; border-radius: 14px; background: #fff; display: inline-flex; align-items: center; justify-content: center; color: var(--accent); box-shadow: 0 6px 14px -10px rgba(17, 24, 39, .45); }
	.mm__cat-ico svg { width: 28px; height: 28px; }
	.mm__cat-name { overflow-wrap: anywhere; }
	.mm__cat--all { background: var(--accent); color: #fff; }
	.mm__cat--all:active { background: var(--accent-dark); }
	.mm__cat--all .mm__cat-ico, .mm__all .mm__cat-ico { background: rgba(255, 255, 255, .14); color: #fff; box-shadow: none; }
	.mm__list { list-style: none; margin: 0; padding: 0; border-radius: 16px; background: var(--stone); overflow: hidden; }
	.mm__list li + li { border-top: 1px solid rgba(17, 17, 17, .06); }
	.mm__list a { display: flex; align-items: center; gap: 12px; min-height: 54px; padding: 10px 14px; font-weight: 700; transition: background .15s; }
	.mm__list a:active { background: var(--stone-2); }
	.mm__list a > .icon:last-child { flex: none; margin-left: auto; transform: rotate(-90deg); color: #a3a29b; }
	.mm__list--plain { margin-top: 12px; }
	.mm__li-ico { flex: none; width: 38px; height: 38px; border-radius: 11px; background: #fff; display: inline-flex; align-items: center; justify-content: center; color: var(--accent); }
	.mm__li-txt { display: grid; min-width: 0; }
	.mm__li-txt small { font-size: 12.5px; font-weight: 500; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
	.mm__sub { margin-top: 0; }
	.mm__sub a small { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--muted); }
	.mm__sub a small + .icon { margin-left: 6px !important; }
	.mm__all { display: flex; align-items: center; gap: 12px; margin: 4px 0 12px; padding: 14px; border-radius: 16px; background: var(--accent); color: #fff; transition: transform .15s var(--ease); }
	.mm__all:active { transform: scale(.98); }
	.mm__all strong { display: block; font-size: 15px; }
	.mm__all small { font-size: 12.5px; opacity: .75; }
	.mm__all > .icon { flex: none; margin-left: auto; }
	.mm__contact { margin-top: 18px; padding: 18px; border-radius: 18px; background: var(--hero-bg); color: #fff; }
	.mm__contact p { margin: 0 0 12px; font-family: var(--font-head); font-size: 16px; font-weight: 800; }
	.mm__contact small { display: block; font-size: 12.5px; opacity: .7; }
	.mm__contact-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
	.mm__pill { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; border-radius: 12px; background: #fff; color: var(--ink); font-weight: 800; transition: transform .15s var(--ease); }
	.mm__pill:active { transform: scale(.96); }
	.mm .lang--mobile { margin-top: 14px; }
	/* entrance: tiles and rows rise in, a little after the sheet */
	.mm.is-open .mm__panel[data-panel="root"] .mm__cat { animation: ap-rise .5s var(--spring) both; animation-delay: calc(var(--i, 0) * 22ms + 90ms); }
	.mm__panel.is-active .mm__sub li { animation: ap-slide-in .42s var(--spring) both; animation-delay: calc(var(--i, 0) * 16ms + 60ms); }

	/* ---------- Search overlay ---------- */
	html.search-mode { overflow: hidden; }
	html.search-mode .site-header { z-index: 330; transform: none !important; }
	.site-header.search-open .header-main .search { position: fixed; inset: 0; z-index: 330; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 10px; max-width: none; margin: 0; padding: calc(12px + env(safe-area-inset-top)) 16px 24px; background: #fff; border: 0; overflow-y: auto; animation: ap-search-in .34s var(--spring); }
	.site-header.search-open .search__input { flex: 1 1 0; min-width: 0; width: auto; height: 48px; padding-left: 44px; border-radius: 14px; border-color: transparent; background: var(--stone); font-size: 16px; }
	.site-header.search-open .search__btn { left: 18px; right: auto; top: calc(15px + env(safe-area-inset-top)); width: 40px; color: var(--muted); pointer-events: none; }
	.search__cancel { display: none; }
	.site-header.search-open .search__cancel { display: inline-flex; align-items: center; height: 48px; padding: 0 2px; font-weight: 700; color: var(--accent); }
	.site-header.search-open .search__drop { position: static; flex: 1 1 100%; max-height: none; border: 0; box-shadow: none; border-radius: 0; animation: ap-fade .2s ease; }
	.search__quick { display: none; }
	.site-header.search-open .search__quick { display: block; flex: 1 1 100%; padding-top: 10px; animation: ap-rise .45s var(--spring) .05s both; }
	.site-header.search-open .search__drop:not([hidden]) ~ .search__quick { display: none; }
	.search__quick p { margin: 0 0 10px; font-size: 11.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
	.search__quick div { display: flex; flex-wrap: wrap; gap: 8px; }

	/* ---------- Things that sit above the tab bar ---------- */
	.ap-sticky { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)) !important; padding-bottom: 10px !important; border-radius: 16px 16px 0 0; box-shadow: 0 -10px 30px -18px rgba(17, 24, 39, .45); }
	.ap-modal { z-index: 300; }
	.ap-modal__panel { border-radius: 22px 22px 0 0 !important; transform: translateY(100%); opacity: 1; transition: transform .5s var(--spring); padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
	.ap-modal__panel::before { content: ""; display: block; width: 38px; height: 5px; margin: -12px auto 14px; border-radius: 99px; background: #dcdad3; }

	/* ---------- Filters: bottom sheet like the menu ---------- */
	.shop__sidebar { top: auto !important; left: 0; right: 0; bottom: 0; width: 100% !important; height: calc(100% - 56px - env(safe-area-inset-top)); border-radius: 22px 22px 0 0 !important; transform: translateY(100%); visibility: hidden; transition: transform .5s var(--spring), visibility 0s .5s; box-shadow: 0 -24px 60px -24px rgba(0, 0, 0, .4); }
	.shop__sidebar.is-open { transform: none; visibility: visible; transition: transform .5s var(--spring); }
	.shop__sidebar::before { content: ""; position: absolute; top: 7px; left: 50%; z-index: 2; width: 38px; height: 5px; margin-left: -19px; border-radius: 99px; background: #dcdad3; }
	.shop__sidebar-backdrop { transition: opacity .4s, visibility 0s .4s; }
	.shop__sidebar-backdrop.is-open { transition: opacity .4s; }

	/* ---------- Press feedback ---------- */
	.btn { transition: background .2s, color .2s, border-color .2s, transform .15s var(--ease); }
	.btn:active { transform: scale(.97); }
	.icon-btn { transition: background .2s, transform .15s var(--ease); }
	.icon-btn:active { transform: scale(.92); }
	.cat-chip { transition: border-color .15s, color .15s, background .15s, transform .15s var(--ease); }
	.cat-chip:active { transform: scale(.95); }
	ul.products > li:active { transform: scale(.985); }
	.ap-opt:active, .ap-chip:active, .ap-dlv__opt:active { transform: scale(.96); }
}

/* ---------- Scroll reveal (JS adds .js-reveal and .rv) ---------- */
@media (max-width: 1023px) and (prefers-reduced-motion: no-preference) {
	.js-reveal .rv { opacity: 0; transform: translateY(18px); transition: opacity .6s var(--ease), transform .6s var(--spring); transition-delay: calc(var(--rv, 0) * 70ms); }
	.js-reveal .rv.is-in { opacity: 1; transform: none; }

	/* page to page: quick cross-fade with a small rise, tab bar stays put */
	@view-transition { navigation: auto; }
	::view-transition-old(root) { animation: .16s ease both ap-vt-out; }
	::view-transition-new(root) { animation: .32s var(--spring) both ap-vt-in; }
}
@media (prefers-reduced-motion: reduce) {
	.mm__sheet, .mm__panel, .tabbar__badge, .ap-modal__panel { transition-duration: .01ms !important; }
	.mm *, .tabbar *, .search__quick { animation: none !important; }
}

@keyframes ap-tab-pill { from { transform: scaleX(.4); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes ap-bump { 0% { transform: scale(1); } 35% { transform: scale(1.5); } 100% { transform: scale(1); } }
@keyframes ap-rise { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes ap-slide-in { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
@keyframes ap-search-in { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }
@keyframes ap-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ap-vt-out { to { opacity: 0; } }
@keyframes ap-vt-in { from { opacity: 0; transform: translateY(10px); } }
