/* Mobile app-style bottom tab bar for marketing landing pages */
:root {
  --tabbar-h: 64px;
  --tabbar-bg: rgba(12, 10, 8, 0.94);
  --tabbar-border: rgba(255, 255, 255, 0.08);
  --tabbar-muted: rgba(255, 255, 255, 0.55);
  --tabbar-active: #e4bc6a;
  --tabbar-primary: #f29400;
  --tabbar-primary-text: #1a1200;
}

.app-tabbar {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 400;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--tabbar-bg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--tabbar-border);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.35);
}

.app-tabbar-inner {
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  height: var(--tabbar-h);
  max-width: 520px;
  margin: 0 auto;
  padding: 0 6px;
}

.app-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 0;
  padding: 6px 4px;
  color: var(--tabbar-muted);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  transition: color 0.2s ease, transform 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.app-tab svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-tab span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.app-tab.is-active {
  color: var(--tabbar-active);
}

.app-tab:active {
  transform: scale(0.94);
}

.app-tab--primary {
  position: relative;
  flex: 1.15;
  color: var(--tabbar-primary-text);
}

.app-tab--primary::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--tabbar-primary), color-mix(in srgb, var(--tabbar-primary) 75%, #000));
  box-shadow: 0 6px 20px color-mix(in srgb, var(--tabbar-primary) 45%, transparent);
  z-index: 0;
}

.app-tab--primary svg,
.app-tab--primary span {
  position: relative;
  z-index: 1;
}

.app-tab--primary svg {
  stroke: var(--tabbar-primary-text);
  fill: none;
}

.app-tab--primary span {
  color: var(--tabbar-primary-text);
  font-weight: 700;
}

/* Themes */
[data-tabbar-theme="amore"] {
  --tabbar-bg: rgba(16, 14, 10, 0.96);
  --tabbar-border: rgba(228, 188, 106, 0.14);
  --tabbar-muted: #9a8b72;
  --tabbar-active: #e4bc6a;
  --tabbar-primary: #e4bc6a;
  --tabbar-primary-text: #1a1408;
}

[data-tabbar-theme="oldtown"] {
  --tabbar-bg: rgba(13, 11, 8, 0.96);
  --tabbar-border: rgba(205, 168, 94, 0.2);
  --tabbar-muted: #8c8270;
  --tabbar-active: #e0c489;
  --tabbar-primary: #cda85e;
  --tabbar-primary-text: #231a09;
}

[data-tabbar-theme="smashpasta"] {
  --tabbar-bg: rgba(10, 4, 6, 0.96);
  --tabbar-border: rgba(139, 41, 66, 0.35);
  --tabbar-muted: #8f7373;
  --tabbar-active: #ffb340;
  --tabbar-primary: #f29400;
  --tabbar-primary-text: #2a1200;
}

[data-tabbar-theme="viking"] {
  --tabbar-bg: rgba(10, 16, 22, 0.96);
  --tabbar-border: rgba(200, 134, 10, 0.24);
  --tabbar-muted: #8a9bab;
  --tabbar-active: #e8a317;
  --tabbar-primary: #c8860a;
  --tabbar-primary-text: #1a1200;
}

@media (max-width: 899px) {
  body.has-app-tabbar {
    padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
  }

  body.has-app-tabbar .app-tabbar {
    display: block;
  }

  body.has-app-tabbar .burger,
  body.has-app-tabbar .am-menu-toggle,
  body.has-app-tabbar .fab,
  body.has-app-tabbar .am-fab,
  body.has-app-tabbar .drawer,
  body.has-app-tabbar .am-drawer,
  body.has-app-tabbar .overlay,
  body.has-app-tabbar .am-drawer-overlay {
    display: none !important;
  }

  body.has-app-tabbar .nav-cta .btn,
  body.has-app-tabbar .am-nav-actions .hide-mobile {
    display: none !important;
  }

  body.has-app-tabbar .am-footer {
    padding-bottom: calc(1.5rem + var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
  }
}

@media (min-width: 900px) {
  .app-tabbar {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-tab {
    transition: none;
  }
}
