/* ============================================================
   PWA / standalone app mode
   Applied only when the site is launched from the home screen
   (html.is-app is set by pwa-head.php). The web layout is untouched.
   ============================================================ */

.app-tabbar { display: none; }

html.is-app {
  --app-tabbar-h: 62px;
  --app-safe-top: env(safe-area-inset-top, 0px);
  --app-safe-bottom: env(safe-area-inset-bottom, 0px);
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior-y: none;
}

html.is-app body {
  padding-bottom: calc(var(--app-tabbar-h) + var(--app-safe-bottom));
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
html.is-app input,
html.is-app textarea,
html.is-app [contenteditable] {
  -webkit-user-select: text;
  user-select: text;
}

/* ---------- Top header: compact, no hamburger ---------- */
html.is-app .navbar {
  padding-top: var(--app-safe-top);
  background: rgba(5, 1, 15, 0.92);
  min-height: 0;
}
html.is-app .navbar-inner {
  width: 100%;
  min-height: 56px;
  padding: 8px 14px;
  flex-wrap: nowrap;
  gap: 8px;
}
html.is-app .nav-toggle,
html.is-app .nav-links,
html.is-app .language-picker {
  display: none !important;
}
html.is-app .brand { gap: 10px; }
html.is-app .brand-logo {
  height: 30px;
  filter: drop-shadow(0 0 8px rgba(0,240,255,0.45));
}
html.is-app .brand-text {
  font-size: 15px;
  letter-spacing: .12em;
}
html.is-app .nav-auth {
  width: auto;
  margin-left: auto;
  padding: 3px;
  gap: 6px;
  justify-content: flex-end;
  border-color: transparent;
  background: transparent;
}
html.is-app .nav-user {
  max-width: none;
  padding-inline-start: 0;
  gap: 6px;
  font-size: 11px;
}
html.is-app .nav-user > strong { max-width: 80px; }
html.is-app .nav-panel-link,
html.is-app .nav-login-link,
html.is-app .nav-logout-button {
  min-height: 30px;
  padding: 6px 10px;
  font-size: 10px;
}
html.is-app .nav-panel-link { display: none; }
html.is-app .nav-login-link { width: auto; }
html.is-app .auth-flash-message { top: calc(70px + var(--app-safe-top)); }

/* ---------- Bottom tab bar ---------- */
html.is-app .app-tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1100;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  height: calc(var(--app-tabbar-h) + var(--app-safe-bottom));
  padding: 6px 4px calc(6px + var(--app-safe-bottom));
  background: rgba(8, 3, 24, 0.94);
  border-top: 1px solid var(--border-soft);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 -8px 30px rgba(0, 0, 0, .45);
}
html.is-app .app-tabbar a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 0;
  padding: 4px 2px;
  border-radius: 12px;
  color: var(--text-dim);
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  transition: color .2s, background .2s;
}
html.is-app .app-tabbar a span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
html.is-app .app-tabbar svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
html.is-app .app-tabbar a:active { background: rgba(255, 255, 255, .06); }
html.is-app .app-tabbar a.active {
  color: var(--primary);
  text-shadow: 0 0 14px rgba(0, 240, 255, .6);
}
html.is-app .app-tabbar a.active svg {
  filter: drop-shadow(0 0 8px rgba(0, 240, 255, .7));
}

/* ---------- Content: tighter, app-like ---------- */
html.is-app .pwa-install-card,
html.is-app .pwa-install-footer { display: none !important; }
html.is-app .hero { padding: 28px 18px 18px; }
html.is-app .hero-badge {
  font-size: 10px;
  padding: 5px 12px;
  margin-bottom: 14px;
}
html.is-app .hero h1 {
  font-size: clamp(30px, 9vw, 44px);
  margin-bottom: 10px;
  text-shadow: 0 0 30px rgba(176, 38, 255, 0.35);
}
html.is-app .hero p { font-size: 14px; }
html.is-app .hero-cta { margin-top: 14px; gap: 10px; }
html.is-app .hero-cta .buy-btn,
html.is-app .hero-cta .buy-btn2 { flex: 1 1 140px; }

html.is-app .section { padding: 8px 14px 32px; }
html.is-app .section-title h2 { font-size: 22px; }
html.is-app .section-title small { font-size: 10px; }
html.is-app .welcome { margin-bottom: 8px; }

html.is-app .store-container,
html.is-app .offers-container {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 12px 0;
}
html.is-app .offers-container { padding: 12px; border-radius: 16px; }
html.is-app .item { border-radius: 16px; }
html.is-app .item:hover { transform: none; }
html.is-app .item img,
html.is-app .item video { height: 150px; }
html.is-app .item h3 {
  margin: 10px 12px 5px;
  font-size: 15px;
}
html.is-app .item p {
  margin: 0 12px 8px;
  font-size: 12px;
}
html.is-app .item-badges {
  margin: 2px 12px 4px;
  gap: 6px;
}
html.is-app .badge-pill,
html.is-app .availability-pill {
  padding: 3px 8px;
  font-size: 9px;
}
html.is-app .price-row {
  margin: 0 12px 10px;
  gap: 6px;
  flex-wrap: wrap;
}
html.is-app .price-tag {
  font-size: 14px;
  letter-spacing: .02em;
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.35);
}
html.is-app .price-tag--discount { font-size: 14px; }
html.is-app .price-tag--original { font-size: 11px; }
html.is-app .item .buy-btn,
html.is-app .item a.buy-btn {
  margin: 6px 12px 12px;
  font-size: 11px;
  padding: 10px 12px;
}
html.is-app .home-banner-wrap { margin-top: 24px; }
html.is-app .home-banner-image { border-radius: 14px; }

@media (min-width: 640px) {
  html.is-app .store-container,
  html.is-app .offers-container {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  html.is-app .item img,
  html.is-app .item video { height: 190px; }
}

/* ---------- Footer: hidden (the tab bar replaces it) ---------- */
html.is-app .site-footer { display: none; }

/* ---------- Floating cart: sits above the tab bar ---------- */
html.is-app .cart-widget {
  left: 12px;
  bottom: calc(var(--app-tabbar-h) + var(--app-safe-bottom) + 12px);
}
html.is-app .cart-panel {
  max-height: calc(100vh - var(--app-tabbar-h) - var(--app-safe-bottom) - var(--app-safe-top) - 110px);
}

