/* Shared site header — stable layout + Apple-style mobile sheet */
:root {
  --le-header-h: 64px;
  --le-shell-w: 1140px;
}

@media (min-width: 961px) {
  html { scrollbar-gutter: stable; }
}

html, body {
  width: 100%;
  max-width: 100%;
}

.le-site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
  max-width: 100%;
  height: var(--le-header-h);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid #e2e8f0;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

.le-site-header.is-scrolled {
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.08);
}

.le-header-inner {
  max-width: var(--le-shell-w);
  width: 100%;
  margin: 0 auto;
  padding: 0 16px;
  height: 100%;
  display: grid;
  grid-template-columns: minmax(100px, 120px) 1fr minmax(0, auto);
  align-items: center;
  gap: 12px;
}

.le-header-logo {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-self: start;
}
.le-header-logo img {
  height: 36px;
  width: auto;
  max-height: 36px;
  object-fit: contain;
  display: block;
}

.le-header-main {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 2vw, 20px);
  min-width: 0;
  justify-self: center;
}
.le-header-main a {
  font-size: 0.84rem;
  font-weight: 500;
  color: #64748b;
  white-space: nowrap;
  text-decoration: none;
  transition: color 0.2s;
  padding: 4px 0;
}
.le-header-main a:hover,
.le-header-main a[aria-current="page"] {
  color: #4f8ef7;
}
.le-header-main a[aria-current="page"] {
  font-weight: 600;
}

.le-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
  justify-self: end;
}

.le-header-staff {
  display: flex;
  align-items: center;
  gap: 6px;
}
.le-header-staff:empty { display: none; }
.le-header-staff a {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 999px;
  white-space: nowrap;
  text-decoration: none;
}
.le-header-staff .le-sales-nav-link {
  color: #ea580c !important;
  background: #fff7ed;
  border: 1px solid rgba(234, 88, 12, 0.25);
}
.le-header-staff .le-admin-nav-link {
  color: #7c3aed !important;
  background: #f5f3ff;
  border: 1px solid rgba(124, 58, 237, 0.25);
}

.le-header-spin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fff7ed, #ffedd5);
  border: 1px solid rgba(249, 115, 22, 0.35);
  font-size: 1rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.2s, box-shadow 0.2s;
}
.le-header-spin:hover {
  transform: scale(1.06);
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.2);
}

.le-header-actions .le-nav-auth {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 0;
}

.le-header-online {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  background: #4f8ef7;
  color: #fff !important;
  font-weight: 600;
  font-size: 0.78rem;
  white-space: nowrap;
  text-decoration: none;
  transition: background 0.2s, transform 0.2s;
}
.le-header-online:hover {
  background: #3b7de8;
  transform: translateY(-1px);
}

.le-header-menu-btn {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #fff;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  color: #0f172a;
}

/* Mobile backdrop + sheet (portaled to body) */
.le-mobile-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1090;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s ease, visibility 0.28s;
}
.le-mobile-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.le-header-mobile {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(340px, 90vw);
  z-index: 1095;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-left: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: -12px 0 48px rgba(15, 23, 42, 0.14);
  transform: translateX(105%);
  transition: transform 0.38s cubic-bezier(0.32, 0.72, 0, 1);
  padding: calc(12px + env(safe-area-inset-top, 0px)) 16px calc(20px + env(safe-area-inset-bottom, 0px));
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex !important;
  flex-direction: column;
  gap: 0;
}
.le-header-mobile.open {
  transform: translateX(0);
}

.le-mobile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 4px 14px;
  margin-bottom: 4px;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
}
.le-mobile-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #94a3b8;
}
.le-mobile-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: #f1f5f9;
  color: #475569;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.le-header-mobile-auth {
  flex-shrink: 0;
  padding: 8px 0 12px;
  margin-bottom: 4px;
  border-bottom: 1px solid #e2e8f0;
}
.le-header-mobile-auth:empty {
  display: none;
  padding: 0;
  margin: 0;
  border: none;
}

.le-header-mobile-auth .le-nav-signin {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px !important;
  border-radius: 12px;
  border: 1px solid rgba(79, 142, 247, 0.35) !important;
  background: #fff !important;
  font-weight: 600;
  font-size: 0.88rem;
  color: #1e293b;
}

.le-mobile-profile-row {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  text-decoration: none;
  color: inherit;
  width: 100%;
  box-sizing: border-box;
}
body.user-signed-in .le-header-mobile-auth .le-mobile-profile-row {
  display: flex !important;
}
body.user-signed-in .le-header-mobile-auth .le-nav-signin,
body.user-signed-in .le-header-actions .le-nav-signin {
  display: none !important;
}
body.user-signed-in .le-header-actions .le-nav-profile-link {
  display: inline-flex !important;
}
.le-mobile-profile-row img {
  width: 44px !important;
  height: 44px !important;
  border-radius: 50%;
  border: 2px solid #4f8ef7;
  object-fit: cover;
  flex-shrink: 0;
}
.le-mobile-profile-row strong {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.25;
}
.le-mobile-profile-row span {
  display: block;
  font-size: 0.78rem;
  color: #64748b;
  margin-top: 2px;
}

.le-mobile-section-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94a3b8;
  padding: 14px 8px 6px;
  flex-shrink: 0;
}

.le-header-mobile a,
.le-header-mobile button.le-header-mobile-link,
.le-header-mobile button.le-mobile-spin {
  display: block;
  width: 100%;
  padding: 11px 10px;
  margin: 0;
  border-radius: 10px;
  font-weight: 500;
  font-size: 0.92rem;
  border: none;
  background: transparent;
  text-decoration: none;
  color: #334155;
  font: inherit;
  text-align: left;
  cursor: pointer;
  box-sizing: border-box;
  flex-shrink: 0;
}
.le-header-mobile a:hover,
.le-header-mobile button.le-header-mobile-link:hover,
.le-header-mobile button.le-mobile-spin:hover {
  background: #f1f5f9;
  color: #0f172a;
}
.le-header-mobile a[aria-current="page"] {
  background: #eff6ff;
  color: #2563eb;
  font-weight: 600;
}

.le-header-mobile .nav-staff {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  padding: 0;
}
.le-header-mobile .nav-staff a {
  text-align: left;
  font-size: 0.88rem;
  padding: 11px 10px;
  border-radius: 10px;
  border: none;
  background: transparent;
}
.le-header-mobile .nav-staff a:hover {
  background: #fff7ed;
}

.le-mobile-spin {
  color: #ea580c !important;
  font-weight: 700 !important;
}

body.le-menu-open {
  overflow: hidden;
}

/* Secondary page nav */
.le-header-stack {
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
  max-width: 100%;
  background: #fff;
}
.le-header-stack .le-site-header {
  position: relative;
  top: auto;
}
.le-header-stack .le-scroll-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 0;
  top: auto;
  z-index: 1003;
  pointer-events: none;
  background: linear-gradient(90deg, #f97316, #4f8ef7);
  transition: width 0.08s linear;
}
.le-subnav {
  width: 100%;
  max-width: 100%;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}
@media (max-width: 960px) {
  .le-subnav {
    position: relative;
    z-index: 999;
    -webkit-overflow-scrolling: touch;
  }
  .le-subnav-inner {
    padding-bottom: 2px;
  }
  .le-header-stack.is-pinned .le-subnav {
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
  }
}
.le-subnav-inner {
  max-width: var(--le-shell-w);
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.le-subnav-inner::-webkit-scrollbar { display: none; }
.le-subnav a,
.le-subnav button {
  flex-shrink: 0;
  padding: 10px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #64748b;
  text-decoration: none;
  border: none;
  background: none;
  font: inherit;
  cursor: pointer;
  white-space: nowrap;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
}
.le-subnav a:hover,
.le-subnav button:hover {
  color: #4f8ef7;
  background: rgba(79, 142, 247, 0.08);
}
.le-subnav a.is-active,
.le-subnav a[aria-current="section"] {
  color: #4f8ef7 !important;
  background: rgba(79, 142, 247, 0.1);
  box-shadow: inset 0 -2px 0 #4f8ef7;
  font-weight: 700;
}
.le-subnav .le-subnav-cta {
  margin-left: auto;
  padding: 8px 14px;
  border-radius: 999px;
  background: #4f8ef7;
  color: #fff !important;
}
.le-subnav .le-subnav-cta:hover {
  background: #3b7de8;
}

@media (max-width: 960px) {
  .le-header-main,
  .le-header-staff,
  .le-header-online,
  .le-header-spin,
  .le-header-actions .le-nav-auth {
    display: none !important;
  }
  .le-header-menu-btn {
    display: inline-flex !important;
  }
  .le-header-inner {
    grid-template-columns: 1fr auto;
  }
  .le-header-main {
    display: none !important;
  }
  .le-header-logo {
    justify-self: start;
  }
}

/* Shield from page-level CSS resets */
.le-site-header .le-header-inner {
  padding-left: 16px !important;
  padding-right: 16px !important;
  margin: 0 auto !important;
}
.le-site-header .le-header-logo {
  margin: 0 !important;
  padding: 0 !important;
}
.le-site-header .le-header-main {
  margin: 0 !important;
  padding: 0 !important;
}
.le-site-header .le-header-main a {
  margin: 0 !important;
}
.le-site-header .le-header-actions {
  margin: 0 !important;
  padding: 0 !important;
}
.le-site-header .le-header-online {
  margin: 0 !important;
  padding: 8px 14px !important;
  border: none !important;
}
.le-site-header .le-header-menu-btn {
  margin: 0 !important;
  padding: 0 !important;
  width: 40px !important;
  height: 40px !important;
  border: 1px solid #e2e8f0 !important;
  background: #fff !important;
}
.le-header-actions .le-nav-auth .le-nav-signin {
  padding: 8px 16px !important;
  border: 1px solid rgba(79, 142, 247, 0.35) !important;
  background: #fff !important;
}
.le-header-actions .le-nav-profile-link {
  width: 38px !important;
  height: 38px !important;
  flex-shrink: 0;
}
