/* ============================================================
   merchant-header.css
   Self-contained top-bar / header styles for the BuyUSAFirst
   merchant and admin shell.

   Isolated from sidebar and content styles.
   ============================================================ */

/* ── Sticky header bar ── */
.jcrec-admin .ops-header,
.jcrec-admin .top-header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  height: var(--bu-header-height) !important;
  background: #fff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  z-index: 1030;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* ── Header inner layout ── */
.jcrec-admin .header-content {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.5rem;
  width: 100%;
}

.jcrec-admin .header-left,
.jcrec-admin .header-right {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.jcrec-admin .header-left {
  flex: 1 1 auto;
}

.jcrec-admin .header-right {
  margin-left: auto;
  flex: 0 0 auto;
}

/* ── Header buttons ── */
.jcrec-admin .sidebar-toggle,
.jcrec-admin .header-icon-btn,
.jcrec-admin .header-user-btn {
  color: var(--bu-primary-dark);
  border: none;
}

.jcrec-admin .header-user-btn i {
  color: var(--bu-primary-dark);
}

.jcrec-admin .header-icon-btn:hover,
.jcrec-admin .header-user-btn:hover,
.jcrec-admin .sidebar-toggle:hover {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 6px;
}

.jcrec-admin .header-icon-btn {
  width: 32px !important;
  height: 32px !important;
  padding: 0.2rem !important;
  font-size: 0.82rem !important;
}

.jcrec-admin .header-user-btn {
  padding: 0.35rem 0.45rem;
}

.jcrec-admin .header-user-btn .user-avatar-small {
  width: 30px !important;
  height: 30px !important;
  font-size: 0.7rem !important;
}

/* ── Header branding ── */
.jcrec-admin .header-brand {
  color: var(--bu-primary-dark);
  font-weight: 600;
  font-size: 0.9rem;
}

.jcrec-admin .header-logo {
  height: 30px !important;
}

.jcrec-admin .user-type {
  background: rgba(0, 117, 178, 0.1);
  color: var(--bu-primary-dark);
  border: 1px solid rgba(0, 117, 178, 0.2);
  font-size: 0.6rem;
  padding: 2px 6px;
}

/* ── User menu (header dropdown) ── */
.jcrec-admin .header-user-menu {
  position: relative;
}

.jcrec-admin .header-user-btn .user-name {
  font-weight: 600;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.jcrec-admin .header-user-dropdown {
  right: 0;
}

/* ── Company switcher ── */
.jcrec-admin .header-company-switcher {
  position: relative;
}

.jcrec-admin .header-company-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0.3rem 0.6rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--bu-primary-dark);
  background: rgba(0, 117, 178, 0.07);
  border: 1px solid rgba(0, 117, 178, 0.18);
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  max-width: 180px;
  transition: background .15s;
}
.jcrec-admin .header-company-btn:hover {
  background: rgba(0, 117, 178, 0.14);
}
.jcrec-admin .header-company-btn .company-name-label {
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 130px;
}

.jcrec-admin .header-company-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 220px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  padding: 6px 0;
  z-index: 1050;
  display: none;
}
.jcrec-admin .header-company-dropdown.show { display: block; }

.jcrec-admin .company-dropdown-label {
  padding: 4px 14px 6px;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #94a3b8;
}

.jcrec-admin .company-dropdown-item {
  display: flex;
  align-items: center;
  padding: 7px 14px;
  font-size: .85rem;
  color: #1e293b;
  text-decoration: none;
  cursor: pointer;
  transition: background .12s;
}
.jcrec-admin .company-dropdown-item:hover { background: #f0f7ff; }
.jcrec-admin .company-dropdown-item.active { font-weight: 600; color: #0075b2; }
.jcrec-admin .company-dropdown-item.text-primary { color: #0075b2; }

.jcrec-admin .company-dropdown-divider {
  height: 1px;
  background: #e2e8f0;
  margin: 4px 0;
}

/* ── Responsive ── */
@media (max-width: 991px) {
  .jcrec-admin .header-content {
    padding: 0 1rem;
  }
}

@media (max-width: 640px) {
  .jcrec-admin .header-user-btn .user-name { display: none; }
  .jcrec-admin .header-company-btn .company-name-label { display: none; }
}
