/**
 * Aalam Account/Header Light — promotion-bar/native-sticky offset bridge.
 *
 * Scope is deliberately narrow: only an Elementor sticky row that is already
 * active as either a direct header child or the active row inside XStore's
 * stacked-sticky wrapper is moved below the visible Aalam promotion bar.
 * XStore/Elementor continue to own height, colors, transforms, spacers,
 * navigation, drawers, and sticky activation.
 */

:root {
  --aalam-ahl-pbp-fallback-edge: 34px;
  --aalam-ahl-pbp-admin-edge: 0px;
}

@media (min-width: 783px) and (max-width: 1024px) {
  :root {
    --aalam-ahl-pbp-fallback-edge: 32px;
  }
}

@media (max-width: 782px) {
  :root {
    --aalam-ahl-pbp-fallback-edge: 30px;
  }
}

body.admin-bar {
  --aalam-ahl-pbp-admin-edge: 32px;
}

@media (max-width: 782px) {
  body.admin-bar {
    --aalam-ahl-pbp-admin-edge: 46px;
  }
}

/*
 * Early-paint fallback. It is disabled as soon as JavaScript has measured the
 * actual promotion-bar edge, so a dismissed or scrolled-away bar can return
 * the row to the native XStore/Elementor top without a residual offset.
 */
html:not(.aalam-ahl-pbp-offset-measured)
body > .aalam-pbp.aalam-pbp-position-top:not(.hidden):not(.aalam-pbp-hidden):not(.aalam-pbp-dismissed):not([hidden]):not([aria-hidden="true"]) ~ *
header.elementor-location-header
> .elementor-sticky.elementor-sticky--active:not(.elementor-sticky__spacer),
html:not(.aalam-ahl-pbp-offset-measured)
body > .aalam-pbp.aalam-pbp-position-top:not(.hidden):not(.aalam-pbp-hidden):not(.aalam-pbp-dismissed):not([hidden]):not([aria-hidden="true"]) ~ *
header.elementor-location-header
> .etheme-elementor-header-wrapper
> .etheme-elementor-header-sticky.elementor-sticky.elementor-sticky--active:not(.elementor-sticky__spacer) {
  top: calc(
    var(--aalam-ahl-pbp-fallback-edge, 34px)
    + var(--aalam-ahl-pbp-admin-edge, 0px)
  ) !important;
}

/*
 * Measured state. JavaScript stores the final native-or-promotion edge on the
 * active row itself. The data attribute keeps this rule limited to rows the
 * bridge actually measured; no inactive row, spacer clone, menu, or drawer is
 * touched.
 */
html.aalam-ahl-pbp-offset-measured.aalam-ahl-pbp-offset-managed
body header.elementor-location-header
> .elementor-sticky.elementor-sticky--active[data-aalam-ahl-pbp-managed="1"]:not(.elementor-sticky__spacer),
html.aalam-ahl-pbp-offset-measured.aalam-ahl-pbp-offset-managed
body header.elementor-location-header
> .etheme-elementor-header-wrapper
> .etheme-elementor-header-sticky.elementor-sticky.elementor-sticky--active[data-aalam-ahl-pbp-managed="1"]:not(.elementor-sticky__spacer) {
  top: var(--aalam-ahl-pbp-final-top, 0px) !important;
}

@media print {
  html:not(.aalam-ahl-pbp-offset-measured)
  body > .aalam-pbp.aalam-pbp-position-top:not(.hidden):not(.aalam-pbp-hidden):not(.aalam-pbp-dismissed):not([hidden]):not([aria-hidden="true"]) ~ *
  header.elementor-location-header
  > .elementor-sticky.elementor-sticky--active:not(.elementor-sticky__spacer),
  html:not(.aalam-ahl-pbp-offset-measured)
  body > .aalam-pbp.aalam-pbp-position-top:not(.hidden):not(.aalam-pbp-hidden):not(.aalam-pbp-dismissed):not([hidden]):not([aria-hidden="true"]) ~ *
  header.elementor-location-header
  > .etheme-elementor-header-wrapper
  > .etheme-elementor-header-sticky.elementor-sticky.elementor-sticky--active:not(.elementor-sticky__spacer),
  html.aalam-ahl-pbp-offset-measured.aalam-ahl-pbp-offset-managed
  body header.elementor-location-header
  > .elementor-sticky.elementor-sticky--active[data-aalam-ahl-pbp-managed="1"]:not(.elementor-sticky__spacer),
  html.aalam-ahl-pbp-offset-measured.aalam-ahl-pbp-offset-managed
  body header.elementor-location-header
  > .etheme-elementor-header-wrapper
  > .etheme-elementor-header-sticky.elementor-sticky.elementor-sticky--active[data-aalam-ahl-pbp-managed="1"]:not(.elementor-sticky__spacer) {
    top: auto !important;
  }
}
