/* ============================================================
   E-Tenga Mobile Navigation
   Applies only below the lg breakpoint (991.98px). Desktop header
   markup/behavior is untouched — it's simply hidden on mobile and
   replaced with the components below.
   ============================================================ */

:root {
  --etenga-navy: #1a1a2e;
  --etenga-pink: #e94560;
  --mbn-height: 60px;
}

@media (max-width: 991.98px) {
  /* Hide the legacy desktop header rows on mobile */
  .top-link.top-link-padding,
  .main-header.three,
  .header-bottom.three {
    display: none !important;
  }

  body {
    padding-bottom: calc(var(--mbn-height) + env(safe-area-inset-bottom));
  }

  /* Keep the install banner clear of the bottom tab bar */
  #etengaInstallBar {
    bottom: calc(var(--mbn-height) + 12px + env(safe-area-inset-bottom)) !important;
  }

  /* Toast messages: sit above the bottom nav, centered feels more native */
  .sf-toast-wrap {
    left: 12px;
    right: 12px;
    bottom: calc(var(--mbn-height) + 16px + env(safe-area-inset-bottom)) !important;
  }
}

@media (min-width: 992px) {
  .mobile-header,
  .mobile-search-row,
  .mobile-bottom-nav {
    display: none !important;
  }
}

/* ---- Mobile top header --------------------------------- */
.mobile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  background: #fff;
  padding: 10px 10px;
  padding-top: calc(10px + env(safe-area-inset-top));
  position: sticky;
  top: 0;
  z-index: 1030;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}

.mh-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f5f7;
  color: var(--etenga-navy);
  font-size: 16px;
  border: none;
  flex-shrink: 0;
  text-decoration: none;
  position: relative;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.mh-icon-btn:active {
  background: #ececee;
}

.mh-auction-btn {
  color: #b8860b;
  background: #fff8e6;
}

.mh-live-dot {
  position: absolute;
  top: 6px;
  right: 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--etenga-pink);
  animation: mh-pulse 1.2s infinite;
}

@keyframes mh-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .45; transform: scale(1.15); }
}

.mh-logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--etenga-navy);
  text-decoration: none;
  letter-spacing: -.3px;
}

/* ---- Mobile search row ---------------------------------- */
.mobile-search-row {
  background: #fff;
  padding: 0 12px 10px;
  position: sticky;
  top: 60px;
  z-index: 1029;
}

.mobile-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f5f5f7;
  border-radius: 12px;
  padding: 0 6px 0 14px;
  height: 42px;
}

.mobile-search-box > i {
  color: #9a9aa5;
  font-size: 14px;
}

.mobile-search-box input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 14px;
  min-width: 0;
  height: 100%;
}

.mobile-search-box button {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--etenga-navy);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 12px;
}

.mobile-search-row .search-dropdown {
  position: static;
  margin-top: 6px;
  border-radius: 12px !important;
}

/* ---- Off-canvas drawer ----------------------------------- */
.mobile-drawer {
  width: 84vw;
  max-width: 340px;
}

.mobile-drawer .offcanvas-header {
  background: var(--etenga-navy);
  padding: 18px 16px;
  padding-top: calc(18px + env(safe-area-inset-top));
}

.mobile-drawer-logo {
  color: #fff;
  font-weight: 800;
  font-size: 1.4rem;
  text-decoration: none;
}

.mobile-drawer .btn-close {
  filter: invert(1) grayscale(100);
  opacity: .85;
}

.mobile-drawer .offcanvas-body {
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
}

.drawer-account-block {
  padding: 16px;
  border-bottom: 8px solid #f5f5f7;
}

.drawer-account-info {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.drawer-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--etenga-pink);
  color: #fff;
  font-weight: 700;
  font-size: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.drawer-account-info strong {
  display: block;
  font-size: 15px;
}

.drawer-account-info span {
  font-size: 12px;
  color: #888;
}

.drawer-account-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.drawer-account-links a {
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 20px;
  background: #f5f5f7;
  color: #333 !important;
  text-decoration: none;
}

.drawer-auth-buttons {
  display: flex;
  gap: 10px;
}

.btn-drawer-primary,
.btn-drawer-outline {
  flex: 1;
  text-align: center;
  padding: 11px 0;
  border-radius: 24px;
  font-weight: 700;
  font-size: 13.5px;
  text-decoration: none;
}

.btn-drawer-primary {
  background: var(--etenga-pink);
  color: #fff !important;
}

.btn-drawer-outline {
  background: #fff;
  border: 1.5px solid var(--etenga-navy);
  color: var(--etenga-navy) !important;
}

.drawer-section-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #aaa;
  padding: 16px 16px 8px;
}

.drawer-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: #222 !important;
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 500;
  border-bottom: 1px solid #f5f5f7;
}

.drawer-link i {
  width: 18px;
  text-align: center;
  color: #999;
}

.drawer-link:active {
  background: #fafafa;
}

.drawer-link-accent { color: #b8860b !important; }
.drawer-link-accent i { color: #b8860b; }
.drawer-link-purple { color: #7c3aed !important; }
.drawer-link-purple i { color: #7c3aed; }

.drawer-accordion .accordion-item {
  border: none;
  border-bottom: 1px solid #f5f5f7;
}

.drawer-accordion .accordion-button {
  font-size: 14.5px;
  font-weight: 600;
  padding: 12px 16px;
  color: #222;
  box-shadow: none !important;
}

.drawer-accordion .accordion-button:not(.collapsed) {
  background: #fff8fa;
  color: var(--etenga-pink);
}

.drawer-accordion .accordion-button::after {
  width: 14px;
  height: 14px;
  background-size: 14px;
}

.drawer-accordion .accordion-body {
  padding: 4px 16px 10px 20px;
  display: flex;
  flex-direction: column;
}

.drawer-sub-link {
  padding: 8px 4px;
  font-size: 13.5px;
  color: #555 !important;
  text-decoration: none;
  border-bottom: 1px solid #f8f8f8;
}

.drawer-sub-all {
  font-weight: 700;
  color: var(--etenga-navy) !important;
}

.drawer-child-link {
  padding: 7px 4px 7px 16px;
  font-size: 12.5px;
  color: #888 !important;
  text-decoration: none;
}

.drawer-cat-link.accordion-button {
  cursor: pointer;
}

.drawer-cat-link.accordion-button::after {
  display: none;
}

/* ---- Bottom tab bar --------------------------------------- */
.mobile-bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1040;
  display: flex;
  background: #fff;
  border-top: 1px solid #eee;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.06);
  padding-bottom: env(safe-area-inset-bottom);
  height: calc(var(--mbn-height) + env(safe-area-inset-bottom));
}

.mbn-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: #8a8a95;
  text-decoration: none;
  font-size: 10.5px;
  font-weight: 600;
  background: transparent;
  border: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

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

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

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

.mbn-badge {
  position: absolute;
  top: -6px;
  right: -10px;
  background: var(--etenga-pink);
  color: #fff;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  font-size: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}
