/* ==========================================================================
   Page chrome — tab bar, footer, floating contact rail
   ========================================================================== */

/* --------------------------------------------------------------------------
   Bottom tab bar
   -------------------------------------------------------------------------- */

.tabbar {
  position: fixed;
  left: 50%;
  bottom: calc(0.4rem + env(safe-area-inset-bottom, 0px));
  z-index: 50;
  width: min(100% - 2 * var(--gutter), var(--shell) - 2 * var(--gutter));
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: end;
  padding: 0.6rem 0.25rem 0.5rem;
  border: 1px solid var(--c-line);
  border-radius: var(--r-xl);
  background: linear-gradient(180deg, rgba(19, 19, 24, 0.94), rgba(5, 5, 7, 0.97));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow:
    0 -8px 24px -12px rgba(0, 0, 0, 0.9),
    var(--shadow-card);
}

.tab {
  display: grid;
  justify-items: center;
  gap: 0.25rem;
  padding-top: 0.15rem;
  font-size: clamp(0.58rem, 0.48rem + 0.5vw, 0.72rem);
  font-weight: 700;
  color: var(--c-text-dim);
  transition: color var(--dur-normal) ease;
}

.tab .icon {
  font-size: 1.35rem;
  transition: transform var(--dur-normal) var(--ease-out-back);
}

.tab:hover,
.tab:focus-visible {
  color: var(--c-gold);
}

.tab:hover .icon {
  transform: translateY(-3px);
}

.tab[aria-current="page"] {
  color: var(--c-orange);
}

.tab[aria-current="page"]::after {
  content: "";
  width: 34px;
  height: 3px;
  border-radius: var(--r-pill);
  background: var(--grad-gold-btn);
  box-shadow: 0 0 10px rgba(255, 154, 31, 0.8);
}

/* Raised centre action */
.tab--hero {
  position: relative;
  color: var(--c-gold);
}

.tab--hero .icon-shell {
  display: grid;
  place-items: center;
  width: clamp(52px, 15vw, 62px);
  aspect-ratio: 1;
  margin-top: clamp(-30px, -7vw, -24px);
  border-radius: var(--r-pill);
  background: var(--grad-gold-btn);
  color: #2a1900;
  font-size: 1.6rem;
  box-shadow:
    0 0 0 5px #08080a,
    0 0 22px -2px rgba(243, 195, 87, 0.75),
    inset 0 2px 0 rgba(255, 255, 255, 0.65);
  transition: transform var(--dur-normal) var(--ease-out-back);
}

.tab--hero:hover .icon-shell,
.tab--hero:focus-visible .icon-shell {
  transform: translateY(-4px) scale(1.04);
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
  display: grid;
  gap: 0.4rem;
  justify-items: center;
  padding: var(--space-3) 0 var(--space-2);
  text-align: center;
  font-size: var(--text-sm);
  color: var(--c-text-faint);
}

.site-footer strong {
  color: var(--c-text-dim);
  font-weight: 700;
}

.footer-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  font-size: var(--text-sm);
}

.footer-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
}

.footer-meta .icon {
  color: var(--c-gold);
}

.footer-meta .divider {
  width: 1px;
  height: 12px;
  background: var(--c-line-strong);
}

.age-badge {
  padding: 0.05rem 0.35rem;
  border-radius: var(--r-sm);
  background: var(--c-surface-3);
  color: var(--c-text-dim);
  font-size: var(--text-xs);
  font-weight: 800;
}

/* --------------------------------------------------------------------------
   Floating contact rail
   -------------------------------------------------------------------------- */

.rail {
  position: fixed;
  right: max(0.25rem, calc(50vw - var(--shell) / 2 - 3.4rem));
  bottom: clamp(120px, 24vh, 300px);
  z-index: 40;
  display: grid;
  gap: 0.4rem;
  justify-items: center;
}

.rail-item {
  display: grid;
  justify-items: center;
  gap: 0.1rem;
  font-size: 0.5rem;
  font-weight: 700;
  color: var(--c-text-dim);
}

.rail-item .bubble {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--r-pill);
  background: var(--bubble-bg, #fff);
  color: var(--bubble-fg, #111);
  font-size: 1.25rem;
  box-shadow:
    0 6px 14px -6px rgba(0, 0, 0, 0.9),
    inset 0 0 0 2px rgba(255, 255, 255, 0.75);
  transition: transform var(--dur-normal) var(--ease-out-back);
}

.rail-item:hover .bubble,
.rail-item:focus-visible .bubble {
  transform: scale(1.08);
}

.rail-item--telegram {
  --bubble-bg: linear-gradient(180deg, #37bdf5, #1d94d2);
  --bubble-fg: #fff;
}

.rail-item--zalo {
  --bubble-bg: linear-gradient(180deg, #1eb24b, #0d8f39);
  --bubble-fg: #fff;
}

.rail-item--zalo .bubble {
  font-family: var(--font-display);
  font-size: 0.8rem;
}

.rail-item--chat {
  --bubble-bg: #fff;
  --bubble-fg: #1f2937;
}

.rail-promo {
  position: relative;
  display: grid;
  justify-items: center;
  margin-top: 0.1rem;
}

.rail-promo svg {
  width: 46px;
  height: auto;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.7));
}

.rail-promo b {
  margin-top: -8px;
  padding: 0.12rem 0.4rem;
  border-radius: var(--r-sm);
  background: linear-gradient(180deg, #ff3b3b, #c00d14);
  color: #fff;
  font-size: 0.5rem;
  font-weight: 900;
  line-height: 1.3;
  text-align: center;
  letter-spacing: var(--track-caps);
  box-shadow: 0 4px 10px -4px rgba(255, 59, 59, 0.9);
}

@keyframes rail-pulse {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

.rail-promo svg {
  animation: rail-pulse 2.4s var(--ease-out-expo) infinite;
}

/* Narrow viewports: the rail overlays content, so keep its footprint small */
@media (max-width: 34rem) {
  .rail-item .bubble {
    width: 34px;
    height: 34px;
    font-size: 1.05rem;
  }

  .rail-item--zalo .bubble {
    font-size: 0.68rem;
  }

  .rail-promo svg {
    width: 38px;
  }
}

@media (max-width: 22rem) {
  .rail {
    gap: 0.25rem;
  }

  .rail-item span:last-child {
    display: none;
  }
}
