/* =========================================================
   Shared mobile brand-header
   Mirrors the homepage's mobile header on every page that
   uses .brand-header. Loaded AFTER the page's own CSS, with
   !important on the rules that conflict with legacy page
   styles, so the layout stays consistent across pages.
   ========================================================= */

/* ---- Hamburger overflow menu (hidden on desktop) ---- */
.mobile-menu-wrap {
  display: none;
  position: relative;
}
.mobile-menu-btn {
  padding: 6px !important;
}
.mobile-menu-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 3000;
  min-width: 180px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  padding: 6px 0;
  flex-direction: column;
}
.mobile-menu-dropdown.open {
  display: flex;
}
.mobile-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 500;
  color: #1a1a1a;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.12s ease;
}
.mobile-menu-item:hover {
  background: #f3f4f6;
}
.mobile-menu-score {
  border-top: 1px solid #e5e7eb;
  margin-top: 2px;
  padding-top: 10px;
}
.mobile-menu-score .score-mode__label {
  color: #1a1a1a;
  font-size: 14px;
}

/* ---- Mobile (max 640px) — match homepage layout ---- */
@media (max-width: 640px) {
  .brand-header {
    padding: 10px 12px !important;
    gap: 0 !important;
    flex-wrap: wrap !important;
  }

  .brand-logo {
    height: 42px !important;
    max-width: 110px !important;
    order: 1;
  }

  .brand-actions {
    order: 2;
    margin-left: auto;
    gap: 6px !important;
    flex-wrap: nowrap !important;
  }

  /* Items consolidated into the hamburger dropdown */
  .brand-header .auth-status,
  .brand-header .btn-feedback,
  .brand-header .score-mode,
  .brand-header #tutorialBtn {
    display: none !important;
  }

  /* Icon-only buttons */
  .btn-label-full,
  .btn-label-short,
  .cart-label {
    display: none !important;
  }

  .brand-header .btn-secondary {
    padding: 6px !important;
    font-size: 0 !important;
    gap: 0 !important;
    white-space: nowrap;
  }
  .brand-header .btn-secondary svg {
    width: 18px !important;
    height: 18px !important;
    flex-shrink: 0;
  }

  .cart-btn {
    padding: 6px !important;
  }
  .cart-btn svg {
    width: 18px !important;
    height: 18px !important;
  }
  #userProfileBtn {
    padding: 6px !important;
  }
  #userProfileBtn svg {
    width: 18px !important;
    height: 18px !important;
  }

  /* Reveal the hamburger */
  .mobile-menu-wrap {
    display: block;
  }

  /* Search bar on its own row below the actions */
  .header-search {
    order: 3;
    flex: 1 1 100%;
    max-width: calc(100vw - 24px);
    height: 36px;
    padding: 0 10px;
    margin: 8px 0 0 !important;
    border-radius: 8px;
  }
  .header-search-input {
    font-size: 14px;
  }
}
