/* ==========================================================
   ACMOBOOK Universal Public Header
   Two-row shell: nav + global search. Guest + authenticated.
   ========================================================== */

.acm-public-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #fff;
  border-bottom: 1px solid #E8EDF5;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.04);
}

.acm-public-header.desktop-only {
  top: 0;
}

.acm-public-header__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 56px;
}

.acm-public-header__row--nav {
  border-bottom: 1px solid #F1F5F9;
}

.acm-public-header__row--search {
  padding: 8px 0 12px;
  background: #fff;
}

.acm-public-header__search-inner {
  justify-content: stretch;
  min-height: 0;
  padding-top: 0;
  padding-bottom: 0;
}

.acm-public-header .header-left {
  display: flex;
  align-items: center;
  gap: 28px;
  min-width: 0;
  flex: 1;
}

.acm-public-header .header-logo img {
  height: 36px;
  width: auto;
  max-width: 148px;
}

.acm-public-header .acmo-nav {
  height: auto;
  min-height: 56px;
  gap: 2px;
  flex-wrap: nowrap;
}

.acm-public-header .nav-item > a {
  height: 40px;
  min-height: 44px;
  padding: 0 12px;
  font-size: 14px;
  border-radius: 10px;
}

.acm-public-header .nav-item--cta {
  margin-left: 4px;
}

.acm-nav-cta {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px !important;
  border-radius: 10px !important;
  background: #0F172A !important;
  color: #fff !important;
  font-weight: 650 !important;
  font-size: 13.5px !important;
  white-space: nowrap;
  box-shadow: none !important;
}

.acm-nav-cta:hover,
.acm-nav-cta:focus-visible {
  background: #1E293B !important;
  color: #fff !important;
  transform: none !important;
}

.acm-public-header__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.acm-account-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid #E2E8F0;
  background: #fff;
  color: #0F172A;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}

.acm-account-btn:hover,
.acm-account-btn:focus-visible {
  border-color: #CBD5E1;
  outline: 2px solid #94A3B8;
  outline-offset: 2px;
}

.acm-public-header .header-action,
.acm-public-header .header-profile {
  min-width: 44px;
  min-height: 44px;
}

.acm-public-header .header-action {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  box-shadow: none;
}

.acm-public-header .header-action:hover {
  transform: none;
}

.acm-avatar-initial {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #EEF2FF;
  color: #4338CA;
  font-weight: 700;
  font-size: 14px;
}

.acm-avatar-initial--lg {
  width: 44px;
  height: 44px;
  font-size: 16px;
}

/* Global search — major product feature, not oversized */
.acm-public-header .acmo-search-wrap {
  width: 100%;
  margin: 0;
}

.acm-public-header .acmo-search {
  width: 100%;
  max-width: 100%;
  height: 48px;
  padding: 0 12px 0 4px;
  border-radius: 12px;
  border: 1px solid #E2E8F0;
  box-shadow: none;
  background: #F8FAFC;
}

.acm-public-header .acmo-search:hover,
.acm-public-header .acmo-search:focus-within {
  transform: none;
  background: #fff;
  border-color: #CBD5E1;
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.06);
}

.acm-public-header .search-icon {
  width: 44px;
  height: 44px;
  font-size: 18px;
  color: #64748B;
  flex-shrink: 0;
}

.acm-public-header .acmo-search input {
  font-size: 14.5px;
  background: transparent;
}

.acm-public-header .search-shortcut {
  display: none;
}

@media (min-width: 1100px) {
  .acm-public-header .search-shortcut {
    display: flex;
  }
}

/* Mobile compact sticky */
.acm-public-header--mobile {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #fff;
  border-bottom: 1px solid #E8EDF5;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.05);
}

.acm-public-header--mobile .mobile-topbar {
  min-height: 52px;
  padding: 4px 10px;
  padding-top: max(4px, env(safe-area-inset-top, 0px));
  display: flex;
  align-items: center;
  gap: 8px;
}

.acm-public-header--mobile .mobile-logo .header-logo img {
  height: 28px;
  max-width: 120px;
}

.acm-public-header__row--search-mobile {
  padding: 0 10px 10px;
}

.acm-public-header--mobile .acmo-search {
  height: 44px;
  border-radius: 10px;
}

.acm-public-header--mobile .search-shortcut {
  display: none !important;
}

.acm-public-header--mobile .mobile-login-btn {
  border: 1px solid #E2E8F0;
  background: #fff;
  border-radius: 10px;
  padding: 0 12px;
  font-weight: 600;
  font-size: 13px;
  color: #0F172A;
}

.acm-public-header--mobile .mobile-icon-btn {
  position: relative;
}

.acm-public-header--mobile .mobile-profile-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid #E2E8F0;
  background: #F8FAFC;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.acm-public-header--mobile .mobile-profile-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/*
 * Spec desktop ≥1024px. Below that: mobile/tablet shell (menu + search + account).
 * Overrides legacy 991px header split for the public header only.
 */
@media (max-width: 1023.98px) {
  .acm-public-header.desktop-only {
    display: none !important;
  }

  .acm-public-header--mobile.mobile-only,
  body.acm-shell > .mobile-only {
    display: block !important;
  }
}

@media (min-width: 1024px) {
  .acm-public-header.desktop-only {
    display: block !important;
  }

  .acm-public-header--mobile.mobile-only {
    display: none !important;
  }

  /* Drawers / bottom nav stay mobile-only at desktop */
  body.acm-shell > .mobile-only:not(.acm-public-header--mobile) {
    display: none !important;
  }
}

/* Focus visibility */
.acm-public-header a:focus-visible,
.acm-public-header button:focus-visible {
  outline: 2px solid #334155;
  outline-offset: 2px;
}
