/* The shop's app look on phones (2026-10-31): partials/app-bar.ejs + public/js/app-mobile.js.
   Everything here is scoped to html.is-app-ui (phones and tablets), so computers keep the normal look.
   Loaded after the other style files, so "html body" in front is enough to win. */
.appbar, .app-sheet, .app-sheet-backdrop, .app-buybar, .app-nudge { display: none; }

/* app frame: phones and tablets (html.is-app-ui, set by src/appView.js or by the narrow-screen check in layout.ejs) */
html.is-app-ui { --appbar-h: 62px; --app-safe: env(safe-area-inset-bottom, 0px); --app-bottom: calc(var(--appbar-h) + var(--app-safe)); }
html.is-app-ui body { padding-bottom: var(--app-bottom); }

/* ---- slim top bar: logo + language; search, basket, account and the menu live in the bottom bar ---- */
html.is-app-ui body .site-header { position: sticky; top: 0; z-index: 900; transition: transform 0.25s ease; }
html.is-app-ui body .site-header.app-hide { transform: translateY(-100%); }
html.is-app-ui body .header-top-row { flex-wrap: nowrap; padding: 0.45rem 0.85rem; gap: 0.6rem; min-height: 54px; }
html.is-app-ui body .site-header .search-form,
html.is-app-ui body .site-header .account-link,
html.is-app-ui body .site-header .cart-link,
html.is-app-ui body .site-header .header-nav { display: none; }
html.is-app-ui body .logo-round { width: 36px; height: 36px; }
html.is-app-ui body .logo-wordmark { font-size: 1.12rem; }
html.is-app-ui body .lang-switch { margin-left: auto; }
/* the notice under the header: two short lines at most (it can still be closed with its X) */
html.is-app-ui body .announce-bar { font-size: 0.78rem; line-height: 1.35; padding-top: 0.45rem; padding-bottom: 0.45rem; }
html.is-app-ui body .announce-bar p, html.is-app-ui body .announce-bar .announce-text { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---- bottom menu bar ---- */
html.is-app-ui .appbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 960;
  height: var(--app-bottom); padding-bottom: var(--app-safe); background: #fffdf9; border-top: 1px solid #ead9c4; box-shadow: 0 -6px 18px rgba(43, 38, 32, 0.08); }
html.is-app-ui .appbar__item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 0; padding: 0; border: 0; background: none;
  color: #5c554c; font: inherit; font-size: 0.68rem; font-weight: 600; text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
html.is-app-ui .appbar__item svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
html.is-app-ui .appbar__item > span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html.is-app-ui .appbar__item.is-active, html.is-app-ui .appbar__item[aria-expanded="true"] { color: #ba6c00; }
html.is-app-ui .appbar__item.is-active svg { stroke-width: 2.2; }
html.is-app-ui .appbar__item:active { transform: scale(0.94); }
html.is-app-ui .appbar__icon { position: relative; display: block; line-height: 0; }
html.is-app-ui .appbar__badge { position: absolute; top: -6px; right: -10px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #ba6c00; color: #fff;
  font-size: 0.68rem; font-weight: 700; line-height: 18px; text-align: center; }
html.is-app-ui .appbar__badge[hidden] { display: none; }
html.is-app-ui .appbar__badge.bump { animation: appBump 0.4s ease; }
@keyframes appBump { 40% { transform: scale(1.35); } }

/* ---- panels that slide up from the bottom bar ---- */
html.is-app-ui .app-sheet-backdrop { display: block; position: fixed; inset: 0; z-index: 940; background: rgba(43, 38, 32, 0.45); opacity: 0; transition: opacity 0.2s ease; }
html.is-app-ui .app-sheet-backdrop.is-open { opacity: 1; }
html.is-app-ui .app-sheet-backdrop[hidden], html.is-app-ui .app-sheet[hidden] { display: none; }
html.is-app-ui .app-sheet { display: flex; flex-direction: column; position: fixed; left: 0; right: 0; bottom: var(--app-bottom); z-index: 950; max-height: calc(100vh - var(--app-bottom) - 40px); max-height: calc(100dvh - var(--app-bottom) - 40px);
  background: #fbf6ee; border-radius: 20px 20px 0 0; box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.18); transform: translateY(24px); opacity: 0; transition: transform 0.22s ease, opacity 0.22s ease; }
html.is-app-ui .app-sheet.is-open { transform: none; opacity: 1; }
html.is-app-ui .app-sheet--search { top: 0; bottom: var(--app-bottom); max-height: none; border-radius: 0; }
html.is-app-ui .app-sheet__head { display: flex; align-items: center; justify-content: space-between; padding: 0.9rem 1rem 0.5rem 1.1rem; }
html.is-app-ui .app-sheet__head h2 { margin: 0; font-family: 'Fraunces', Georgia, serif; font-size: 1.3rem; color: #3b4e00; }
html.is-app-ui .app-sheet__x { width: 40px; height: 40px; border: 0; border-radius: 50%; background: #fff; color: #2b2620; font-size: 1.6rem; line-height: 1; cursor: pointer; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12); }
html.is-app-ui .app-sheet__body { overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 0.3rem 1rem 1.2rem; }
html.is-app-ui.app-sheet-open { overflow: hidden; }

html.is-app-ui .app-quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; margin-bottom: 0.9rem; }
html.is-app-ui .app-quick a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 0.65rem 0.3rem; border-radius: 14px; background: #3b4e00; color: #fff;
  font-size: 0.8rem; font-weight: 600; text-align: center; text-decoration: none; line-height: 1.2; }
html.is-app-ui .app-quick a span { font-size: 1.25rem; }
html.is-app-ui .app-tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.65rem; }
html.is-app-ui .app-tile { display: flex; flex-direction: column; background: #fff; border: 1px solid #ead9c4; border-radius: 14px; overflow: hidden; text-decoration: none; color: #2b2620; }
html.is-app-ui .app-tile:active { transform: scale(0.97); }
html.is-app-ui .app-tile__pic { display: block; position: relative; height: 0; padding-top: 78%; background: #fff; overflow: hidden; }
html.is-app-ui .app-tile__pic img { position: absolute; inset: 6px; width: calc(100% - 12px); height: calc(100% - 12px); object-fit: contain; display: block; }   /* the whole picture, never cropped */
html.is-app-ui .app-tile__name { padding: 0.45rem 0.6rem 0.55rem; font-size: 0.86rem; font-weight: 600; line-height: 1.25; border-top: 1px solid #f3e8d8; }
html.is-app-ui .app-sheet__home { display: block; margin-top: 1rem; text-align: center; color: #5c554c; font-size: 0.9rem; }

html.is-app-ui .app-search { display: flex; gap: 0.5rem; margin: 0.3rem 0 1.1rem; }
html.is-app-ui .app-search input { flex: 1; min-width: 0; height: 52px; padding: 0 1rem; border: 2px solid #ead9c4; border-radius: 14px; background: #fff; font: inherit; font-size: 1rem; }
html.is-app-ui .app-search input:focus { outline: none; border-color: #ba6c00; }
html.is-app-ui .app-search button { width: 52px; height: 52px; border: 0; border-radius: 14px; background: #ba6c00; color: #fff; cursor: pointer; }
html.is-app-ui .app-search button svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
html.is-app-ui .app-search__label { margin: 0 0 0.5rem; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: #5c554c; }
html.is-app-ui .app-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
html.is-app-ui .app-chips a { padding: 0.55rem 1rem; border-radius: 999px; background: #fff; border: 1px solid #ead9c4; color: #2b2620; text-decoration: none; font-size: 0.92rem; }

/* ---- "add to home screen" hint ---- */
html.is-app-ui .app-install { display: flex; gap: 0.8rem; align-items: flex-start; margin-top: 1.1rem; padding: 0.85rem; background: #fff; border: 1px solid #ead9c4; border-radius: 14px; }
html.is-app-ui .app-install[hidden] { display: none; }
html.is-app-ui .app-install img { width: 48px; height: 48px; border-radius: 12px; flex: none; }
html.is-app-ui .app-install strong { display: block; color: #3b4e00; }
html.is-app-ui .app-install p { margin: 0.2rem 0 0.5rem; font-size: 0.85rem; line-height: 1.4; color: #5c554c; }
html.is-app-ui .app-install .btn-primary { padding: 0.55rem 1rem; font-size: 0.88rem; }
html.is-app-ui .app-nudge { display: flex; position: fixed; left: 10px; right: 10px; bottom: calc(var(--app-bottom) + 10px); z-index: 955; margin: 0; padding-right: 0.85rem; flex-wrap: wrap;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2); animation: appUp 0.3s ease; }
html.is-app-ui .app-nudge__later { margin-left: auto; border: 0; background: none; color: #5c554c; text-decoration: underline; font: inherit; font-size: 0.85rem; cursor: pointer; }
@keyframes appUp { from { transform: translateY(20px); opacity: 0; } }

/* ---- product page: price and Add to cart within thumb reach ---- */
html.is-app-ui .app-buybar { display: flex; align-items: center; gap: 0.8rem; position: fixed; left: 0; right: 0; bottom: var(--app-bottom); z-index: 930; padding: 0.55rem 0.9rem;
  background: rgba(255, 253, 249, 0.97); border-top: 1px solid #ead9c4; box-shadow: 0 -4px 14px rgba(43, 38, 32, 0.08); }
html.is-app-ui .app-buybar[hidden] { display: none; }
html.is-app-ui .app-buybar__price { font-weight: 700; font-size: 1.05rem; color: #2b2620; white-space: nowrap; }
html.is-app-ui .app-buybar__btn { flex: 1; padding: 0.75rem 1rem; }

/* ---- product photos: swipe sideways, thumbnails in one scrolling row ---- */
html.is-app-ui body .product-thumb-strip { display: flex; flex-wrap: nowrap; overflow-x: auto; scroll-snap-type: x mandatory; gap: 8px; padding-bottom: 4px; }
html.is-app-ui body .product-thumb-strip .product-thumb { flex: none; scroll-snap-align: center; }

/* ---- everything that floats at the bottom moves above the bar ---- */
html.is-app-ui body .hd { bottom: calc(var(--app-bottom) + 12px); }
html.is-app-ui.app-buybar-on body .hd { bottom: calc(var(--app-bottom) + 76px); }
html.is-app-ui body .xmt { bottom: calc(var(--app-bottom) + 10px); }
html.is-app-ui body .cookie-banner { bottom: var(--app-bottom); }
html.is-app-ui body:has(#cookieBanner:not([hidden])) .hd { display: none; }   /* the chat bubble waits until the cookie choice is made */
html.is-app-ui body .editbar { bottom: calc(var(--app-bottom) + 8px); }
html.is-app-ui body .cart-toast { bottom: calc(var(--app-bottom) + 12px); }
html.is-app-ui body .lang-suggest { bottom: calc(var(--app-bottom) + 12px); }
html.is-app-ui body .promo-popup, html.is-app-ui body .qrw { padding-bottom: var(--app-bottom); }
html.is-app-ui body .site-footer { padding-bottom: 1rem; }

/* Opened from the home screen: no "back to the homepage" browser bar exists, so keep the header always visible at the top */
@media (display-mode: standalone) {
  html.is-app-ui body .site-header, html.is-app-ui body .ap-top { padding-top: env(safe-area-inset-top, 0px); }
}
@media (prefers-reduced-motion: reduce) {
  html body .site-header, .app-sheet, .app-sheet-backdrop { transition: none; }
}
@media print { .appbar, .app-sheet, .app-buybar, .app-nudge { display: none !important; } }
