/* ==========================================================================
   FAVOR MOBILE BOTTOM NAVIGATION & CENTER MENU SHEET
   Reverse-Engineered from https://topupgamez.id/id via Chrome DevTools & REA
   Visible ONLY on mobile (< 768px / md:hidden). Zero impact on desktop/tablet.
   ========================================================================== */

.tgz-mnav,
.tgz-msheet,
.tgz-msheet-backdrop {
  display: none;
}

@media (max-width: 767.98px) {
  body {
    padding-bottom: calc(74px + env(safe-area-inset-bottom, 0px));
  }

  /* Keep floating WA button & product sticky CTA cleanly above the bottom nav */
  .tgz-wa-float {
    bottom: calc(82px + env(safe-area-inset-bottom, 0px)) !important;
  }

  body.tgz-product .pp-cta {
    bottom: calc(66px + env(safe-area-inset-bottom, 0px)) !important;
    z-index: 85 !important;
  }

  /* ---------- FIXED BOTTOM NAVIGATION BAR (5 positions) ---------- */
  .tgz-mnav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 95;
    width: 100%;
    background: var(--fv-surface, #1A222C);
    border-top: 1px solid var(--fv-border, rgba(49, 60, 76, 0.52));
    border-radius: 14px 14px 0 0;
    padding: 10px 8px calc(12px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.36);
    box-sizing: border-box;
    font-family: 'Barlow', 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  }

  .tgz-mnav__row {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin: 0;
    padding: 0;
  }

  .tgz-mnav__item {
    flex: 1 1 0%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 2px 2px;
    color: #FFFFFF;
    text-decoration: none;
    background: transparent;
    border: 0;
    cursor: pointer;
    transition: color 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-tap-highlight-color: transparent;
  }

  .tgz-mnav__item:hover,
  .tgz-mnav__item:focus-visible {
    color: #EBB23B;
    outline: none;
  }

  .tgz-mnav__item.is-active {
    color: #EBB23B;
    font-weight: 500;
  }

  .tgz-mnav__icon {
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .tgz-mnav__item:active .tgz-mnav__icon {
    transform: scale(0.92);
  }

  .tgz-mnav__icon svg {
    width: 20px;
    height: 20px;
    display: block;
  }

  .tgz-mnav__label {
    font-size: 10px;
    line-height: 1.33;
    font-weight: 400;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }

  .tgz-mnav__item.is-active .tgz-mnav__label {
    font-weight: 500;
  }

  /* Center spacer slot (exact 3rd flex-1 slot behind elevated button) */
  .tgz-mnav__center-slot {
    flex: 1 1 0%;
    min-width: 0;
    display: block;
    height: 36px;
  }

  /* Elevated Circular Center Grid Button (exact h-12 w-12 -top-3 bg-custom-primary rounded-full) */
  .tgz-mnav__fab {
    position: absolute;
    top: -12px;
    left: 0;
    right: 0;
    margin-inline: auto;
    width: 48px;
    height: 48px;
    border-radius: 9999px;
    background: #EBB23B;
    color: #FFFFFF;
    border: 0;
    box-shadow: 0 6px 18px rgba(235, 178, 59, 0.4);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.15s ease;
    -webkit-tap-highlight-color: transparent;
  }

  .tgz-mnav__fab:hover,
  .tgz-mnav__fab:active {
    background: #D49B27;
    transform: scale(1.04);
  }

  .tgz-mnav__fab:focus-visible {
    outline: 2px solid rgba(235, 178, 59, 0.65);
    outline-offset: 2px;
  }

  .tgz-mnav__fab svg {
    width: 24px;
    height: 24px;
    display: block;
  }

  /* ---------- CENTER MENU BOTTOM SHEET OVERLAY (FAVOR Layered Slate-Charcoal) ---------- */
  .tgz-msheet-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 980;
    background: rgba(11, 14, 20, 0.68);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease-in-out;
  }

  .tgz-msheet-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
  }

  .tgz-msheet {
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 990;
    height: auto;
    max-height: 85vh;
    background: var(--fv-surface, #1A222C);
    border-top: 1px solid var(--fv-border-strong, rgba(148, 163, 184, 0.22));
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -14px 36px rgba(0, 0, 0, 0.52);
    padding: 0;
    transform: translateY(100%);
    pointer-events: none;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
    font-family: 'Barlow', 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  }

  .tgz-msheet.is-open {
    transform: translateY(0);
    pointer-events: auto;
    transition: transform 0.42s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .tgz-msheet__sr-title {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .tgz-msheet__close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 2;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid var(--fv-border, rgba(49, 60, 76, 0.52));
    border-radius: 10px;
    background: var(--fv-elevated, #242E3C);
    color: var(--fv-text, #F8FAFC);
    opacity: 0.92;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: opacity 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
    -webkit-tap-highlight-color: transparent;
  }

  .tgz-msheet__close:hover,
  .tgz-msheet__close:active,
  .tgz-msheet__close:focus-visible {
    opacity: 1;
    background: var(--fv-card-secondary, #313C4C);
    border-color: var(--fv-border-gold, rgba(229, 176, 56, 0.52));
    color: #FFFFFF;
    outline: none;
  }

  .tgz-msheet__body {
    width: 100%;
    max-height: 74vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 50px 16px calc(24px + env(safe-area-inset-bottom, 0px));
    display: flex;
    flex-direction: column;
    gap: 20px;
    scrollbar-width: none;
    box-sizing: border-box;
  }

  .tgz-msheet__body::-webkit-scrollbar {
    display: none;
  }

  .tgz-msheet .tgz-menu-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .tgz-msheet .tgz-menu-group__title {
    margin: 0;
    font-size: 12.5px;
    line-height: 18px;
    font-weight: 700;
    color: var(--fv-text-soft, #CBD5E1);
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }

  .tgz-msheet .tgz-menu-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }

  .tgz-msheet .tgz-menu-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 8px;
    border-radius: 12px;
    background: var(--fv-elevated, #242E3C);
    border: 1px solid var(--fv-border, rgba(49, 60, 76, 0.52));
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
    color: var(--fv-text, #F8FAFC);
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.16s ease, border-color 0.16s ease, transform 0.14s ease;
    -webkit-tap-highlight-color: transparent;
  }

  .tgz-msheet .tgz-menu-card:hover,
  .tgz-msheet .tgz-menu-card:active,
  .tgz-msheet .tgz-menu-card.is-active {
    background: var(--fv-card-secondary, #313C4C);
    border-color: var(--fv-border-gold, rgba(229, 176, 56, 0.52));
    color: #FFFFFF;
  }

  .tgz-msheet .tgz-menu-card:active {
    transform: scale(0.98);
  }

  .tgz-msheet .tgz-menu-card__icon {
    width: 20px;
    height: 20px;
    color: var(--fv-gold, #E5B038);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  .tgz-msheet .tgz-menu-card__icon svg {
    width: 20px;
    height: 20px;
    display: block;
  }

  .tgz-msheet .tgz-menu-card__label {
    font-size: 11.5px;
    line-height: 1.3;
    font-weight: 600;
    color: var(--fv-text, #F8FAFC);
    text-align: center;
    word-break: break-word;
  }

  /* Bottom Auth Buttons (Daftar & Masuk) */
  .tgz-msheet__actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 10px 14px calc(16px + env(safe-area-inset-bottom, 0px));
    background: var(--fv-surface, #1A222C);
    border-top: 1px solid var(--fv-border, rgba(49, 60, 76, 0.52));
    flex-shrink: 0;
    box-sizing: border-box;
  }

  .tgz-msheet__btn {
    flex: 1 1 0%;
    min-width: 0;
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    min-height: 38px;
    border-radius: 10px;
    font-size: 14px;
    line-height: 20px;
    font-weight: 600;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
  }

  .tgz-msheet__btn--outline {
    background: transparent;
    border: 1px solid var(--fv-gold, #E5B038);
    color: var(--fv-gold, #E5B038) !important;
  }

  .tgz-msheet__btn--outline:hover,
  .tgz-msheet__btn--outline:active {
    background: var(--fv-gold-soft, rgba(229, 176, 56, 0.14));
    color: var(--fv-gold-bright, #F0C14B) !important;
  }

  .tgz-msheet__btn--primary {
    background: var(--fv-gold, #E5B038);
    border: 1px solid var(--fv-gold, #E5B038);
    color: var(--fv-gold-ink, #13161C) !important;
  }

  .tgz-msheet__btn--primary:hover,
  .tgz-msheet__btn--primary:active {
    background: var(--fv-gold-bright, #F0C14B);
    color: var(--fv-gold-ink, #13161C) !important;
  }
}
