/* ==============================
   MOBILE BOTTOM NAVIGATION
   Sticky bottom bar, mobile-only (<=576px), injected by js/mobilenav.js
   on every page that includes it. Themed via dedicated --mbn-* variables
   so it doesn't collide with style.css's --bg/--card/etc, but still
   flips with the same body.dark-theme toggle the rest of the site uses.
============================== */

:root {
  --mbn-bg: #fdf3e3; /* creamy ? light theme */
  --mbn-border: #ecdfc4;
  --mbn-icon: #6b5c3f;
  --mbn-active: #198754; /* matches the site's existing green accent */
}

body.dark-theme {
  --mbn-bg: #2a2a2a; /* soft grey ? dark theme */
  --mbn-border: #3a3a3a;
  --mbn-icon: #cfcfcf;
  --mbn-active: #3ddc84;
}

.mobile-bottom-nav {
  display: none;
}

@media (max-width: 576px) {
  .mobile-bottom-nav {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1100;
    background: var(--mbn-bg);
    border-top: 1px solid var(--mbn-border);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    box-shadow: 0 -4px 14px rgba(0, 0, 0, 0.08);
  }

  /* Keep page content (and the site's own footer) from sitting under
     the bar. */
  body {
    padding-bottom: calc(58px + env(safe-area-inset-bottom));
  }

  /* Keep the floating WhatsApp button above the new bar instead of
     overlapping it ? mobile-only positioning tweak, nothing else about
     that widget changes. */
  .whatsapp-widget {
    bottom: calc(70px + env(safe-area-inset-bottom));
  }
}

.mbn-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: none;
  border: none;
  color: var(--mbn-icon);
  text-decoration: none;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 4px 2px;
}

.mbn-item i {
  font-size: 17px;
}

.mbn-item.active {
  color: var(--mbn-active);
}

.mbn-icon-wrap {
  position: relative;
  display: inline-flex;
}

.mbn-badge {
  position: absolute;
  top: -6px;
  right: -8px;
  background: #dc3545;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 999px;
  min-width: 14px;
  text-align: center;
}

/* ===== Menu drawer ===== */
.mbn-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 1150;
}
.mbn-overlay.open {
  display: block;
}

.mbn-drawer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  transform: translateY(100%);
  transition: transform 0.25s ease;
  background: var(--mbn-bg);
  border-top: 1px solid var(--mbn-border);
  border-radius: 14px 14px 0 0;
  z-index: 1200;
  padding: 10px 0 calc(10px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
}
.mbn-drawer.open {
  transform: translateY(0);
}

.mbn-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 16px 10px;
  font-weight: 700;
  color: var(--mbn-icon);
  border-bottom: 1px solid var(--mbn-border);
  margin-bottom: 4px;
}
.mbn-drawer-header button {
  background: none;
  border: none;
  font-size: 20px;
  line-height: 1;
  color: var(--mbn-icon);
}

.mbn-drawer a {
  padding: 12px 16px;
  color: var(--mbn-icon);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}
.mbn-drawer a:active {
  background: rgba(0, 0, 0, 0.05);
}
