/* AF-Health unified public header branding.
 * The entire header row is one rounded container: logo + navigation + actions.
 * The bilingual logo keeps a fixed layout footprint with no visual wrapper:
 * no border, no background, no corner radius, and no shadow. The menu owns
 * all remaining horizontal space. This file loads after frontend theme CSS so
 * theme-specific inner menu frames cannot split the header visually.
 */
body.guest-shell .public-header{
  position:relative!important;
  top:auto!important;
  z-index:86!important;
  width:calc(100% - 20px)!important;
  max-width:none!important;
  min-height:72px!important;
  margin:0 10px!important;
  overflow:visible!important;
  border:1px solid color-mix(in srgb,var(--public-menu-border,var(--border,#dbe4ee)) 82%,transparent)!important;
  border-radius:20px!important;
  background:var(--afghan-public-header-background,color-mix(in srgb,var(--surface,#fff) 82%,transparent))!important;
  box-shadow:0 12px 34px rgba(7,24,46,.08)!important;
  backdrop-filter:blur(18px) saturate(1.08)!important;
  -webkit-backdrop-filter:blur(18px) saturate(1.08)!important;
  transform:none!important;
}
body.guest-shell .temporary-frontend-header{
  position:sticky!important;
  top:10px!important;
  z-index:100!important;
}
body.guest-shell .public-header::before,
body.guest-shell .public-header::after{
  content:none!important;
  display:none!important;
}
body.guest-shell .public-header .public-nav{
  width:100%!important;
  max-width:none!important;
  height:70px!important;
  min-height:70px!important;
  margin:0!important;
  padding:6px 9px!important;
  transform:none!important;
  min-width:0!important;
  border:0!important;
  border-radius:inherit!important;
  background:transparent!important;
  box-shadow:none!important;
}
body.guest-shell .public-header .public-brand{
  display:inline-flex!important;
  flex:0 0 224px!important;
  width:224px!important;
  height:56px!important;
  min-width:224px!important;
  max-width:224px!important;
  padding:0!important;
  margin:0!important;
  border:0!important;
  border-radius:0!important;
  background:transparent!important;
  box-shadow:none!important;
  transform:none!important;
  overflow:visible!important;
  align-items:center!important;
}
body.guest-shell .public-header .public-brand::before,
body.guest-shell .public-header .public-brand::after{
  content:none!important;
  display:none!important;
}
body.guest-shell .afghan-cure-header-logo-shell{
  display:flex!important;
  align-items:center!important;
  justify-content:flex-start!important;
  width:224px!important;
  height:56px!important;
  min-width:224px!important;
  max-width:224px!important;
  padding:0!important;
  border:0!important;
  border-radius:0!important;
  background:transparent!important;
  box-shadow:none!important;
  backdrop-filter:none!important;
  -webkit-backdrop-filter:none!important;
  overflow:visible!important;
}
body.guest-shell .afghan-cure-header-logo-image,
body.guest-shell .public-nav .brand .afghan-cure-header-logo-image{
  display:block!important;
  width:214px!important;
  height:48px!important;
  min-width:214px!important;
  max-width:214px!important;
  object-fit:contain!important;
  object-position:left center!important;
  filter:none!important;
  border:0!important;
  border-radius:0!important;
  box-shadow:none!important;
}

/* The theme's former bordered .public-links capsule caused the header to look
 * split into separate pieces. Navigation is now visually part of the outer
 * rounded header and gets only layout spacing, never its own frame. */
body.guest-shell .public-header .public-links{
  min-width:0!important;
  max-width:100%!important;
  border:0!important;
  border-radius:0!important;
  background:transparent!important;
  box-shadow:none!important;
  backdrop-filter:none!important;
  -webkit-backdrop-filter:none!important;
  clip-path:none!important;
}
body.guest-shell .public-header .public-actions{
  min-width:max-content!important;
  margin:0!important;
  padding:0!important;
  align-items:center!important;
}

/* Desktop: one grid, one border, no horizontal scrolling frame. */
@media(min-width:1181px){
  body.guest-shell .public-header .public-nav{
    display:grid!important;
    grid-template-columns:224px minmax(0,1fr) auto!important;
    gap:8px!important;
    align-items:center!important;
  }
  body.guest-shell .public-header .public-menu-toggle{
    display:none!important;
  }
  body.guest-shell .public-header .public-links{
    position:static!important;
    inset:auto!important;
    width:100%!important;
    display:flex!important;
    flex-direction:row!important;
    align-items:center!important;
    justify-self:stretch!important;
    justify-content:center!important;
    gap:2px!important;
    padding:0!important;
    overflow:visible!important;
    opacity:1!important;
    pointer-events:auto!important;
    transform:none!important;
  }
  body.guest-shell .public-header .public-links .public-nav-link{
    flex:0 0 auto!important;
    min-height:44px!important;
    gap:6px!important;
    padding:7px 8px!important;
    font-size:.76rem!important;
    white-space:nowrap!important;
  }
  body.guest-shell .public-header .public-nav-link-icon{
    width:26px!important;
    height:26px!important;
    flex-basis:26px!important;
  }
  body.guest-shell .public-header .public-actions{
    display:flex!important;
    flex-direction:row!important;
    justify-self:end!important;
    gap:5px!important;
  }
  body.guest-shell .public-header .public-actions .icon-button{
    width:44px!important;
    height:44px!important;
    flex:0 0 44px!important;
  }
  body.guest-shell .public-header .public-actions .public-signin,
  body.guest-shell .public-header .public-actions .public-dashboard-link,
  body.guest-shell .public-header .public-actions .public-registration-link{
    min-height:44px!important;
    padding-inline:10px!important;
    white-space:nowrap!important;
  }
}

/* Tighter desktop: shrink the logo and navigation before switching to the
 * existing mobile menu. This prevents the final links/actions from colliding. */
@media(min-width:1181px) and (max-width:1360px){
  body.guest-shell .public-header{
    width:calc(100% - 20px)!important;
    max-width:none!important;
    margin-inline:10px!important;
  }
  body.guest-shell .public-header .public-nav{
    grid-template-columns:204px minmax(0,1fr) auto!important;
    gap:6px!important;
    padding-inline:7px!important;
  }
  body.guest-shell .public-header .public-brand,
  body.guest-shell .afghan-cure-header-logo-shell{
    flex-basis:204px!important;
    width:204px!important;
    min-width:204px!important;
    max-width:204px!important;
  }
  body.guest-shell .afghan-cure-header-logo-image,
  body.guest-shell .public-nav .brand .afghan-cure-header-logo-image{
    width:194px!important;
    min-width:194px!important;
    max-width:194px!important;
  }
  body.guest-shell .public-header .public-links .public-nav-link{
    gap:4px!important;
    padding-inline:6px!important;
    font-size:.71rem!important;
  }
  body.guest-shell .public-header .public-nav-link-icon{
    width:24px!important;
    height:24px!important;
    flex-basis:24px!important;
  }
  body.guest-shell .public-header .public-actions .public-signin,
  body.guest-shell .public-header .public-actions .public-dashboard-link,
  body.guest-shell .public-header .public-actions .public-registration-link{
    padding-inline:8px!important;
    font-size:.74rem!important;
  }
}

/* Mobile/tablet: keep the same rounded outer header. The project's existing
 * responsive menu toggle remains in charge of opening the dropdown. */
@media(max-width:1180px){
  body.guest-shell .public-header{
    width:calc(100% - 16px)!important;
    max-width:none!important;
    min-height:70px!important;
    height:auto!important;
    margin:0 8px!important;
    border-radius:18px!important;
  }
  body.guest-shell .temporary-frontend-header{
    position:sticky!important;
    top:8px!important;
    z-index:100!important;
  }
  body.guest-shell .public-header .public-nav{
    width:100%!important;
    min-height:68px!important;
    height:68px!important;
    padding:7px 8px!important;
  }
  body.guest-shell .public-header .public-brand{
    flex-basis:204px!important;
    width:204px!important;
    height:54px!important;
    min-width:204px!important;
    max-width:204px!important;
  }
  body.guest-shell .afghan-cure-header-logo-shell{
    width:204px!important;
    height:54px!important;
    min-width:204px!important;
    max-width:204px!important;
  }
  body.guest-shell .afghan-cure-header-logo-image,
  body.guest-shell .public-nav .brand .afghan-cure-header-logo-image{
    width:194px!important;
    height:46px!important;
    min-width:194px!important;
    max-width:194px!important;
  }
  /* Dropdown is intentionally a separate floating panel only after the menu
   * button is used; the closed header itself remains one unified container. */
  body.guest-shell .public-header .public-links{
    border:1px solid var(--public-menu-border,var(--border,#dbe4ee))!important;
    border-radius:16px!important;
    background:color-mix(in srgb,var(--public-menu-bg,var(--surface,#fff)) 96%,var(--surface,#fff))!important;
    box-shadow:0 24px 60px rgba(7,20,36,.22)!important;
    backdrop-filter:blur(18px)!important;
    -webkit-backdrop-filter:blur(18px)!important;
  }
}
@media(max-width:520px){
  body.guest-shell .public-header{
    width:calc(100% - 12px)!important;
    margin-inline:6px!important;
    border-radius:16px!important;
  }
  body.guest-shell .public-header .public-brand{
    flex-basis:170px!important;
    width:170px!important;
    min-width:170px!important;
    max-width:170px!important;
  }
  body.guest-shell .afghan-cure-header-logo-shell{
    width:170px!important;
    min-width:170px!important;
    max-width:170px!important;
  }
  body.guest-shell .afghan-cure-header-logo-image,
  body.guest-shell .public-nav .brand .afghan-cure-header-logo-image{
    width:160px!important;
    min-width:160px!important;
    max-width:160px!important;
  }
}
@media(max-width:390px){
  body.guest-shell .public-header .public-brand{
    flex-basis:148px!important;
    width:148px!important;
    min-width:148px!important;
    max-width:148px!important;
  }
  body.guest-shell .afghan-cure-header-logo-shell{
    width:148px!important;
    min-width:148px!important;
    max-width:148px!important;
  }
  body.guest-shell .afghan-cure-header-logo-image,
  body.guest-shell .public-nav .brand .afghan-cure-header-logo-image{
    width:138px!important;
    min-width:138px!important;
    max-width:138px!important;
  }
}

/* Fixed single-line public menu + badge below the menu ---------------------
 * The legacy full-width trust strip stays retired. The editable هوالشافی
 * badge is now a dedicated row immediately below the sticky menu, so it never
 * overlaps the logo/navigation. The sticky shell owns both pieces and keeps
 * them together while scrolling.
 */
body.guest-shell .public-sticky-shell{
  position:sticky!important;
  top:0!important;
  z-index:100!important;
  width:100%!important;
  margin:0!important;
  padding:8px 0 9px!important;
  isolation:isolate!important;
  background:transparent!important;
  background-image:none!important;
}
body.guest-shell .public-sticky-shell>.public-trust-bar{
  display:none!important;
}
body.guest-shell .public-sticky-shell>.public-header{
  position:relative!important;
  top:auto!important;
  z-index:3!important;
}
body.guest-shell .public-header-bottom-badge-row{
  position:relative!important;
  z-index:4!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  width:100%!important;
  min-height:30px!important;
  margin:5px 0 0!important;
  padding:0!important;
  pointer-events:none!important;
}
body.guest-shell .public-header-bottom-badge{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  min-width:104px!important;
  max-width:min(78vw,320px)!important;
  min-height:28px!important;
  padding:4px 18px!important;
  border:var(--theme-trust-badge-border-width,1px) solid var(--theme-trust-badge-border,var(--trust-badge-border,color-mix(in srgb,var(--primary,#2563eb) 28%,var(--border,#dbe4ee))))!important;
  border-radius:999px!important;
  background:var(--theme-trust-badge-bg,var(--trust-badge-bg,color-mix(in srgb,var(--surface,#fff) 94%,var(--primary,#2563eb) 6%)))!important;
  color:var(--theme-trust-badge-text,var(--trust-badge-text,var(--text,#10213a)))!important;
  box-shadow:0 8px 20px color-mix(in srgb,var(--primary,#2563eb) 13%,transparent)!important;
  font-family:var(--theme-trust-badge-font,inherit)!important;
  font-size:clamp(11px,var(--theme-trust-badge-font-size,14px),16px)!important;
  font-weight:850!important;
  line-height:1.05!important;
  letter-spacing:.01em!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  backdrop-filter:blur(12px) saturate(1.05)!important;
  -webkit-backdrop-filter:blur(12px) saturate(1.05)!important;
}
body.guest-shell.frontend-theme-crimson_pulse .public-header-bottom-badge{
  border-radius:8px!important;
}
body.guest-shell .public-header .public-nav{
  flex-wrap:nowrap!important;
}
body.guest-shell .public-header .public-links,
body.guest-shell .public-header .public-actions{
  flex-wrap:nowrap!important;
}
body.guest-shell .public-header .public-contextual-join{
  gap:6px!important;
  white-space:nowrap!important;
}

/* Full-screen-width header contract. Keep a small viewport gutter so the
 * rounded border/corners remain visible while the menu uses essentially the
 * whole screen width. */
body.guest-shell .public-header{
  box-sizing:border-box!important;
  width:calc(100% - 20px)!important;
  max-width:none!important;
  margin-inline:10px!important;
  background:var(--afghan-public-header-background,color-mix(in srgb,var(--surface,#fff) 82%,transparent))!important;
}

@media(min-width:1181px){
  body.guest-shell .public-header .public-actions .public-contextual-join{
    font-size:.72rem!important;
    padding-inline:10px!important;
  }
  body.guest-shell .public-header .public-actions .public-contextual-join .ui-icon{
    width:14px!important;
    height:14px!important;
  }
}
@media(min-width:1181px) and (max-width:1280px){
  body.guest-shell .public-header .public-nav{
    grid-template-columns:194px minmax(0,1fr) auto!important;
    gap:4px!important;
  }
  body.guest-shell .public-header .public-brand,
  body.guest-shell .afghan-cure-header-logo-shell{
    flex-basis:194px!important;
    width:194px!important;
    min-width:194px!important;
    max-width:194px!important;
  }
  body.guest-shell .afghan-cure-header-logo-image,
  body.guest-shell .public-nav .brand .afghan-cure-header-logo-image{
    width:184px!important;
    min-width:184px!important;
    max-width:184px!important;
  }
  body.guest-shell .public-header .public-links .public-nav-link{
    padding-inline:5px!important;
    font-size:.69rem!important;
  }
  body.guest-shell .public-header .public-actions{
    gap:4px!important;
  }
  body.guest-shell .public-header .public-actions .public-signin,
  body.guest-shell .public-header .public-actions .public-registration-link{
    padding-inline:7px!important;
    font-size:.7rem!important;
  }
}
@media(max-width:1180px){
  body.guest-shell .public-sticky-shell{
    padding-top:7px!important;
    padding-bottom:7px!important;
  }
  body.guest-shell .public-header{
    width:calc(100% - 16px)!important;
    margin-inline:8px!important;
  }
  body.guest-shell .public-header-bottom-badge-row{
    min-height:28px!important;
    margin-top:4px!important;
  }
  body.guest-shell .public-header-bottom-badge{
    min-width:92px!important;
    min-height:25px!important;
    padding:3px 14px!important;
    font-size:clamp(10px,var(--theme-trust-badge-font-size,13px),14px)!important;
  }
  body.guest-shell .public-mobile-account-links .public-contextual-join{
    white-space:normal!important;
    text-align:center!important;
  }
}
@media(max-width:520px){
  body.guest-shell .public-header{
    width:calc(100% - 12px)!important;
    margin-inline:6px!important;
  }
  body.guest-shell .public-header-bottom-badge{
    max-width:68vw!important;
    padding-inline:12px!important;
  }
}



/* Edge-to-edge public navigation bar (v3) ---------------------------------
 * The live public header intentionally behaves like a conventional healthcare
 * marketplace navigation bar: it spans the complete viewport width and is not
 * presented as a floating card. Theme-specific width, border, radius, clip,
 * and shadow rules are neutralized here with matching specificity because the
 * regression guardrails intentionally constrain normal page content to a
 * narrower reading width. Header background color/transparency is resolved per active theme in
 * Frontend Manager and exposed through --afghan-public-header-background.
 */
body.guest-shell.ui-v2[class*="frontend-theme-"]:not(.role-admin)
.public-sticky-shell{
  width:100%!important;
  max-width:none!important;
  margin:0!important;
  padding:0 0 6px!important;
}
body.guest-shell.ui-v2[class*="frontend-theme-"]:not(.role-admin)
.public-sticky-shell>.public-header{
  box-sizing:border-box!important;
  width:100%!important;
  max-width:none!important;
  margin:0!important;
  inset-inline:0!important;
  border:0!important;
  border-width:0!important;
  border-radius:0!important;
  outline:0!important;
  clip-path:none!important;
  background:var(--afghan-public-header-background,color-mix(in srgb,var(--surface,#fff) 82%,transparent))!important;
  box-shadow:none!important;
  transform:none!important;
  overflow:visible!important;
}
body.guest-shell.ui-v2[class*="frontend-theme-"]:not(.role-admin)
.public-sticky-shell>.public-header>.container.public-nav{
  box-sizing:border-box!important;
  width:100%!important;
  max-width:none!important;
  margin:0!important;
  padding-inline:clamp(14px,2.35vw,42px)!important;
  border:0!important;
  border-radius:0!important;
  background:transparent!important;
  box-shadow:none!important;
}
body.guest-shell.ui-v2[class*="frontend-theme-"]:not(.role-admin)
.public-sticky-shell>.public-header::before,
body.guest-shell.ui-v2[class*="frontend-theme-"]:not(.role-admin)
.public-sticky-shell>.public-header::after{
  content:none!important;
  display:none!important;
}

/* The badge remains its own centered row directly below the full-width bar. */
body.guest-shell.ui-v2[class*="frontend-theme-"]:not(.role-admin)
.public-header-bottom-badge-row{
  margin-top:4px!important;
}

/* Temporary-access frontends use the same edge-to-edge header geometry. */
body.guest-shell.ui-v2[class*="frontend-theme-"]:not(.role-admin)
.public-header.temporary-frontend-header{
  box-sizing:border-box!important;
  width:100%!important;
  max-width:none!important;
  margin:0!important;
  top:0!important;
  border:0!important;
  border-radius:0!important;
  clip-path:none!important;
  box-shadow:none!important;
  transform:none!important;
}
body.guest-shell.ui-v2[class*="frontend-theme-"]:not(.role-admin)
.public-header.temporary-frontend-header>.container.public-nav{
  width:100%!important;
  max-width:none!important;
  margin:0!important;
  padding-inline:clamp(14px,2.35vw,42px)!important;
}

@media(max-width:1180px){
  body.guest-shell.ui-v2[class*="frontend-theme-"]:not(.role-admin)
  .public-sticky-shell{
    padding-bottom:5px!important;
  }
  body.guest-shell.ui-v2[class*="frontend-theme-"]:not(.role-admin)
  .public-sticky-shell>.public-header{
    width:100%!important;
    max-width:none!important;
    margin:0!important;
    border:0!important;
    border-radius:0!important;
    box-shadow:none!important;
  }
  body.guest-shell.ui-v2[class*="frontend-theme-"]:not(.role-admin)
  .public-sticky-shell>.public-header>.container.public-nav{
    padding-inline:12px!important;
  }
}

/* Badge-only sticky area (v4) ----------------------------------------------
 * The edge-to-edge header owns its own translucent surface, so the legacy
 * viewport-sized sticky atmosphere mirror is no longer needed. Removing that
 * mirror prevents the space beneath the header from reading as a second
 * full-width sticky bar. The editable top badge remains sticky with the header
 * but its wrapper collapses to the badge's own width and paints no surface.
 */
body.guest-shell.ui-v2[class*="frontend-theme-"]:not(.role-admin)
.public-sticky-shell > .public-sticky-background{
  display:none!important;
}
body.guest-shell.ui-v2[class*="frontend-theme-"]:not(.role-admin)
.public-header-bottom-badge-row{
  box-sizing:border-box!important;
  width:max-content!important;
  max-width:100%!important;
  min-height:0!important;
  margin:4px auto 0!important;
  padding:0!important;
  border:0!important;
  border-radius:0!important;
  outline:0!important;
  background:transparent!important;
  background-image:none!important;
  box-shadow:none!important;
  backdrop-filter:none!important;
  -webkit-backdrop-filter:none!important;
}


/* Theme-aware header fallback (v5) -----------------------------------------
 * The server writes a per-theme light-mode header color. Dark mode should not
 * carry a pale light-theme surface into a dark frontend, so it follows the
 * active theme's dark --surface while preserving the configured transparency.
 */
html[data-theme="dark"] body.guest-shell.ui-v2[class*="frontend-theme-"]:not(.role-admin)
.public-sticky-shell>.public-header{
  background:color-mix(in srgb,var(--surface,#0c192a) var(--afghan-public-header-background-opacity,82%),transparent)!important;
}

/* Viewport-centered primary navigation (v6) -------------------------------
 * Desktop uses equal flexible tracks on both sides of the primary links.
 * This keeps Home / Doctors / Laboratories / Hospitals / Pharmacies locked
 * to the true horizontal center of the header regardless of whether Sign in,
 * Join, Dashboard, or the theme toggle appear on the right. Branding remains
 * aligned to the start edge and account actions remain aligned to the end.
 */
@media(min-width:1181px){
  body.guest-shell.ui-v2[class*="frontend-theme-"]:not(.role-admin)
  .public-sticky-shell>.public-header>.container.public-nav,
  body.guest-shell.ui-v2[class*="frontend-theme-"]:not(.role-admin)
  .public-header.temporary-frontend-header>.container.public-nav{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) max-content minmax(0,1fr)!important;
    align-items:center!important;
    column-gap:10px!important;
  }

  body.guest-shell.ui-v2[class*="frontend-theme-"]:not(.role-admin)
  .public-header .public-brand{
    grid-column:1!important;
    justify-self:start!important;
  }

  body.guest-shell.ui-v2[class*="frontend-theme-"]:not(.role-admin)
  .public-header .public-links{
    grid-column:2!important;
    justify-self:center!important;
    width:max-content!important;
    max-width:none!important;
    margin-inline:auto!important;
  }

  body.guest-shell.ui-v2[class*="frontend-theme-"]:not(.role-admin)
  .public-header .public-actions{
    grid-column:3!important;
    justify-self:end!important;
  }
}
