/* ORIGONA header behavior layer.
   Bricks-owned: active header structure, brand/nav/actions sections, and the editor-readable order of desktop/mobile rows.
   CSS-owned: sticky shell, desktop dropdown geometry, caret spacing, hover/focus/active states for DOM-driven menu surfaces, and mobile menu layout.
   JS-owned: .is-open, hidden, aria-expanded, search panel open/close, and submenu toggles.
   Keep base layout settings in Bricks where possible; use this file for DOM-dependent behavior and responsive state handling.
*/
.or-header__mount {
  position: relative;
}

.or-header__spacer {
  height: 72px;
}

.or-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--og-z-header);
  background: var(--og-bg-surface);
  border-bottom: 1px solid var(--og-border-main);
}

.or-header__inner {
  box-sizing: border-box;
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--og-space-m);
  min-height: 72px;
  width: min(calc(100% - (2 * var(--og-lay-gutter))), var(--og-lay-site));
  margin-inline: auto;
  padding-block: var(--og-space-s);
}

.or-header__brand-wrap {
  position: relative;
  z-index: 2;
}

.or-header__brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: inherit;
  text-decoration: none;
}

.or-header__brand:focus-visible,
.or-header__submenu-toggle:focus-visible,
.or-header__search-submit:focus-visible,
.or-header__menu-link:focus-visible,
.or-header__submenu-link:focus-visible {
  outline: 2px solid var(--og-focus-ring);
  outline-offset: 2px;
  border-radius: var(--og-rad-m);
}

.or-header__brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 30px;
}

.or-header__brand-image {
  display: block;
  width: auto;
  height: 100%;
}

.or-brx-header__brand-slot img {
  display: block;
  width: auto;
  height: 100%;
}

/* ORIGONA header shell ownership.
   Bricks-owned: the active header tree, brand slot, nav slot, actions slot, and the order of desktop vs. mobile rows in the template.
   CSS-owned: centered rail alignment, DOM-driven dropdown geometry, caret spacing, sticky shell behavior, and responsive state handling.
   JS-owned: open/close state classes and aria-expanded updates for submenu and mobile controls.
   Keep this file on the behavior side so the base layout remains readable in Bricks.
*/
.or-header__navigation-shell {
  display: flex;
  justify-content: center;
  min-width: 0;
  transform: translateY(-1px);
}

/* Desktop navigation is a behavior layer because submenu spacing, caret affordance, and hover/focus states depend on the rendered menu DOM.
   Bricks should keep the nav tree and menu content; CSS only shapes the interaction and dropdown geometry here.
*/
.or-header__menu-list,
.or-header__submenu-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.or-header__menu-list {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 1.25vw, 20px);
  flex-wrap: nowrap;
  width: max-content;
}

.or-header__menu-item {
  position: relative;
  flex: 0 0 auto;
}

.or-header__menu-item.has-children::after {
  content: "";
  position: absolute;
  top: 100%;
  left: -10px;
  right: -10px;
  height: 18px;
}

.or-header__menu-row {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.or-header__menu-link,
.or-header__submenu-toggle,
.or-header__menu-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  color: var(--og-text-main);
  font-family: var(--og-font-ui);
  font-weight: var(--og-weight-semibold);
  font-size: 0.9375rem;
  line-height: var(--og-leading-normal);
  letter-spacing: var(--og-track-normal);
  text-decoration: none;
  white-space: nowrap;
}

.or-brx-header__desktop-nav .bricks-nav-menu > li > a,
.or-brx-header__desktop-nav .brx-submenu-toggle > a {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  white-space: nowrap;
}

.or-brx-header__desktop-nav .bricks-nav-menu > li > a:hover,
.or-brx-header__desktop-nav .bricks-nav-menu > li > a:focus-visible,
.or-brx-header__desktop-nav .brx-submenu-toggle > a:hover,
.or-brx-header__desktop-nav .brx-submenu-toggle > a:focus-visible {
  color: var(--og-brand-primary-d-3);
}

.or-header__menu-link::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 7px;
  width: 72%;
  height: 2px;
  background: var(--og-brand-primary);
  border-radius: 9999px;
  transform: translateX(-50%) scaleX(0);
  transform-origin: center;
  opacity: 0;
}

.or-header__menu-link:hover,
.or-header__menu-link:focus-visible,
.or-header__menu-link.is-current,
.or-header__menu-item.is-open > .or-header__menu-row > .or-header__menu-link {
  color: var(--og-brand-primary-d-3);
}

.or-header__menu-link:hover::after,
.or-header__menu-link:focus-visible::after,
.or-header__menu-item.is-open > .or-header__menu-row > .or-header__menu-link::after {
  transform: translateX(-50%) scaleX(1);
  opacity: 1;
}

.or-header__submenu-toggle,
.or-header__search-submit {
  appearance: none;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0;
}

.or-header__submenu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-top: 0;
  color: var(--og-text-main);
}

.or-header__submenu-toggle svg {
  display: block;
  width: 14px;
  height: 14px;
  transition: transform var(--og-mot-hover-duration) var(--og-mot-hover-easing);
}

.or-brx-header__desktop-nav .brx-submenu-toggle,
.or-brx-header__mobile-nav .brx-submenu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0;
}

.or-brx-header__desktop-nav .brx-submenu-toggle button,
.or-brx-header__mobile-nav .brx-submenu-toggle button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  min-width: 20px;
  height: 20px;
  min-height: 20px;
  margin-left: 4px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  border-radius: 9999px;
}

.or-header__menu-item.is-open .or-header__submenu-toggle,
.or-header__submenu-toggle:hover,
.or-header__submenu-toggle:focus-visible {
  color: var(--og-brand-primary-d-3);
  background: transparent;
}

.or-header__menu-item.is-open .or-header__submenu-toggle svg {
  transform: rotate(180deg);
}

.or-brx-header__desktop-nav .brx-submenu-toggle .menu-item-icon,
.or-brx-header__mobile-nav .brx-submenu-toggle .menu-item-icon {
  width: 18px;
  height: 18px;
}

.or-brx-header__desktop-nav .brx-submenu-toggle button:hover,
.or-brx-header__desktop-nav .brx-submenu-toggle button:focus-visible,
.or-brx-header__mobile-nav .brx-submenu-toggle button:hover,
.or-brx-header__mobile-nav .brx-submenu-toggle button:focus-visible,
.or-brx-header__desktop-nav .menu-item:hover > .brx-submenu-toggle button,
.or-brx-header__desktop-nav .menu-item:focus-within > .brx-submenu-toggle button {
  color: var(--og-brand-primary-d-3);
  background: var(--og-bg-hover);
}

.or-brx-header__desktop-nav .brx-submenu-toggle button:active,
.or-brx-header__mobile-nav .brx-submenu-toggle button:active {
  color: var(--og-brand-primary-d-4);
  background: color-mix(in srgb, var(--og-brand-primary-l-10) 74%, var(--og-brand-primary-l-9) 26%);
}

.or-header__actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--og-space-s);
}

/* ORIGONA header actions ownership.
   Bricks-owned: the search/account/cart presence and ordering in the builder tree.
   CSS-owned: 44px hit areas, icon sizing, hover/focus/active states, and the mobile action row alignment.
   JS-owned: header search toggle, action-button state changes, and any aria-expanded wiring.
   This stays here because the action shell is coupled to rendered interaction state, not to base content structure.
*/
.or-brx-header__actions-slot > .brxe-search,
.or-brx-header__actions-slot > a.bricks-link-wrapper {
  flex: 0 0 auto;
  margin: 0;
}

.or-header__cart-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  min-height: 18px;
  padding: 0 5px;
  border-radius: 9999px;
  font-size: 10px;
  line-height: 1;
  color: var(--og-text-inverse);
  background: var(--og-brand-primary);
}

/* Search, submenu, and mobile panel rules live here because they depend on the active menu DOM and JS state.
   The template provides the structure; this layer only positions and animates the interactive surfaces.
*/
.or-header__search-panel {
  position: fixed;
  top: 72px;
  right: 0;
  left: 0;
  width: min(420px, calc(100vw - (2 * var(--og-lay-gutter))));
  margin-inline: auto;
  padding: var(--og-space-m);
  border: 1px solid var(--og-border-main);
  border-radius: var(--og-rad-m);
  background: var(--og-bg-surface);
  box-shadow: var(--og-shd-overlay);
}

.or-header__search-panel-inner {
  display: flex;
  flex-direction: column;
  gap: var(--og-space-s);
}

.or-header__search-title {
  margin: 0;
  color: var(--og-text-main);
  font-family: var(--og-font-heading);
  font-weight: var(--og-weight-semibold);
  font-size: var(--og-text-s);
  line-height: var(--og-leading-normal);
  letter-spacing: var(--og-track-normal);
}

.or-header__search-form {
  display: flex;
  gap: var(--og-space-s);
}

.or-header__search-input {
  min-height: 44px;
  padding: 0 var(--og-space-m);
  border: 1px solid var(--og-border-main);
  border-radius: var(--og-rad-m);
  background: var(--og-bg-surface);
  color: var(--og-text-main);
  font-family: var(--og-font-ui);
  font-weight: var(--og-weight-medium);
  font-size: var(--og-text-m);
}

.or-header__search-input::placeholder {
  color: var(--og-text-muted);
}

.or-header__search-submit {
  min-width: 44px;
  min-height: 44px;
  border-radius: var(--og-rad-m);
  color: var(--og-text-main);
}

/* ORIGONA desktop submenu ownership.
   Bricks-owned: submenu labels, order, and the menu tree that feeds the dropdown.
   CSS-owned: dropdown placement, panel width/radius/shadow, item padding, title/subtitle typography, and hover backgrounds.
   JS-owned: submenu open state and keyboard toggles.
   Keep the dropdown itself in repo CSS because it depends on the rendered menu DOM.
*/
.or-header__submenu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 300px;
  padding: 10px;
  border: 1px solid var(--og-border-main);
  border-radius: calc(var(--og-rad-m) + 4px);
  background: var(--og-bg-surface);
  box-shadow: var(--og-shd-overlay);
}

.or-header__submenu-link {
  display: block;
  padding: 10px 12px;
  color: var(--og-text-main);
  text-decoration: none;
}

.or-header__submenu-link:hover,
.or-header__submenu-link:focus-visible {
  color: var(--og-brand-primary-d-3);
  background: var(--og-brand-primary-l-10);
}

.or-brx-header__desktop-nav .sub-menu.brx-submenu-positioned {
  position: absolute;
  top: 44px !important;
  left: 0;
  min-width: 266.25px !important;
  width: 266.25px !important;
  margin: 0;
  padding: 12px !important;
  list-style: none;
  border: 1px solid rgb(241, 242, 243) !important;
  border-radius: 12px !important;
  background: var(--og-bg-surface);
  box-shadow: rgb(37 38 38 / 12%) 0 12px 28px 0 !important;
  color: var(--og-text-main);
  z-index: 30;
}

.or-brx-header__desktop-nav .sub-menu.brx-submenu-positioned > li {
  margin: 0;
}

.or-brx-header__desktop-nav .sub-menu.brx-submenu-positioned > li > a {
  display: grid;
  gap: 2px;
  padding: 12px 14px !important;
  border-radius: 10px;
  color: var(--og-text-main);
  text-decoration: none;
  transition: background-color var(--og-mot-hover-duration) var(--og-mot-hover-easing), color var(--og-mot-hover-duration) var(--og-mot-hover-easing);
}

.or-brx-header__desktop-nav .sub-menu.brx-submenu-positioned > li > a:hover,
.or-brx-header__desktop-nav .sub-menu.brx-submenu-positioned > li > a:focus-visible {
  color: var(--og-brand-primary-d-3);
  background: var(--og-brand-primary-l-10);
}
.or-brx-header__submenu-title {
  display: block;
  color: var(--og-text-main);
  font-family: var(--og-font-ui);
  font-size: 16px;
  font-weight: var(--og-weight-semibold);
  line-height: 1.5;
  letter-spacing: var(--og-track-normal);
}

.or-brx-header__submenu-description {
  display: block;
  color: var(--og-text-muted);
  font-family: var(--og-font-ui);
  font-size: 16px;
  font-weight: var(--og-weight-regular);
  line-height: 1.25;
  letter-spacing: var(--og-track-normal);
}

.or-brx-header__section {
  position: sticky;
  top: 0;
  z-index: var(--og-z-header);
  width: 100%;
  background: var(--og-bg-surface);
  border-bottom: 0;
  box-shadow: none;
}

.or-brx-header__sticky-placeholder {
  display: block;
  width: 100%;
  height: 0;
}

.or-brx-header__section.is-stuck {
  position: fixed !important;
  inset: 0 0 auto 0 !important;
  z-index: calc(var(--og-z-dropdown) + 1) !important;
  background: var(--og-bg-surface);
  box-shadow: var(--og-shd-overlay);
}

/* ORIGONA header desktop and dropdown behavior.
   Bricks-owned: desktop header row, nav tree, submenu labels, and action order.
   CSS-owned: rail width, menu gaps, caret size/padding, dropdown dimensions, submenu typography, and action icon geometry.
   JS-owned: the open/close state of desktop submenu buttons and any state class used for hover/active synchronization.
   This block is a behavior layer because the spacing and dropdown contract are tied to the rendered menu DOM.
*/
.or-brx-header__frame {
  width: min(calc(100% - (2 * var(--og-lay-gutter))), var(--og-lay-site)) !important;
  max-width: none !important;
  margin: 0 auto;
  padding: 0 !important;
}

.or-brx-header__desktop-row,
.or-brx-header__mobile-row {
  width: 100%;
  margin: 0;
  padding: 0 !important;
}

.or-brx-header__desktop-nav {
  justify-self: center;
  width: 100%;
}

.or-brx-header__desktop-nav .bricks-nav-menu > li {
  display: flex;
  align-items: center;
}

.or-brx-header__desktop-nav .brx-submenu-toggle {
  gap: 0 !important;
}

.or-brx-header__desktop-nav .brx-submenu-toggle button {
  width: 22px;
  min-width: 22px;
  height: 44px;
  min-height: 44px;
  margin-left: 10px;
  border-radius: 12px;
}

.or-brx-header__desktop-nav .brx-submenu-toggle .menu-item-icon {
  width: 18px;
  height: 18px;
}

.or-brx-header__desktop-nav .sub-menu.brx-submenu-positioned {
  top: calc(100% + 12px);
  min-width: min(360px, 80vw);
  padding: 16px 20px;
  border-radius: 12px;
}

.or-brx-header__desktop-nav .sub-menu.brx-submenu-positioned > li > a {
  gap: 2px;
  padding: 12px 14px;
  border-radius: 10px;
}

.or-brx-header__submenu-title {
  font-size: 16px;
  line-height: 1.5;
}

.or-brx-header__submenu-description {
  font-size: 16px;
  line-height: 1.35;
}

.or-brx-header__mobile-nav-shell[hidden],
.or-brx-header__mobile-nav[hidden] {
  display: none !important;
}

html.or-header-scroll-lock,
body.or-header-scroll-lock {
  overflow: hidden;
}

/* ORIGONA mobile header ownership.
   Bricks-owned: mobile row composition, mobile brand placement, and the visible menu tree.
   CSS-owned: 78px shell height, 44px action hit areas, 56px menu rows, full-width submenu panels, and responsive breakpoint swapping.
   JS-owned: default-closed state, open/close toggles, submenu expansion, and scroll-lock.
   Keep the mobile contract here so the Bricks tree stays clean and the DOM-dependent behavior stays explicit.
*/
@media (max-width: 1179px) {
  .or-brx-header__desktop-row {
    display: none !important;
  }

  .or-brx-header__brand-slot--mobile {
    justify-self: center;
    min-width: 0;
    max-width: 240px;
  }

  .or-brx-header__brand-slot--mobile img {
    width: auto;
    height: 24px;
    max-width: 100%;
  }

  .or-brx-header__mobile-nav {
    display: block !important;
    width: 100% !important;
  }

  .or-brx-header__mobile-nav .bricks-nav-menu {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100% !important;
    gap: 0;
  }

  .or-brx-header__mobile-nav .bricks-nav-menu > li {
    display: block;
    width: 100%;
    border-bottom: 1px solid var(--og-border-main);
  }

  .or-brx-header__mobile-nav .bricks-nav-menu > li:last-child {
    border-bottom: 0;
  }

  /* ORIGONA mobile submenu ownership.
     Bricks-owned: submenu content nodes, titles, and descriptions.
     CSS-owned: full-width submenu row layout, touch target sizing, hover/active treatment, and the caret button column.
     JS-owned: submenu open/close state and aria-expanded wiring.
     This is intentionally kept as behavior because the mobile submenu depends on row-level DOM structure.
  */
  .or-brx-header__mobile-nav .menu-item-has-children > .brx-submenu-toggle,
  .or-brx-header__mobile-nav .menu-item-has-children > .sub-menu.brx-submenu-positioned {
    width: 100% !important;
  }

  .or-brx-header__mobile-nav .brx-submenu-toggle > a,
  .or-brx-header__mobile-nav .bricks-nav-menu > li > a {
    display: inline-flex;
    align-items: center;
    width: 100%;
    text-decoration: none;
  }

  .or-brx-header__mobile-nav .sub-menu.brx-submenu-positioned {
    display: block;
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0 0 10px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .or-brx-header__mobile-nav .sub-menu.brx-submenu-positioned > li {
    width: 100%;
  }

  .or-brx-header__mobile-nav .sub-menu.brx-submenu-positioned > li > a {
    display: grid;
    gap: 2px;
    width: 100%;
    padding: 14px 44px 14px 44px;
    border-radius: 0;
    font-size: 16px;
  }

  .or-brx-header__mobile-nav .sub-menu.brx-submenu-positioned > li > a:hover,
  .or-brx-header__mobile-nav .sub-menu.brx-submenu-positioned > li > a:focus-visible,
  .or-brx-header__mobile-nav .sub-menu.brx-submenu-positioned > li > a[aria-current="page"] {
    color: var(--og-brand-primary-d-3);
    background: var(--og-bg-hover);
  }

  .or-brx-header__mobile-nav .sub-menu.brx-submenu-positioned .or-brx-header__submenu-title {
    font-size: inherit;
    line-height: 1.5;
    font-weight: var(--og-weight-semibold);
  }

  .or-brx-header__mobile-nav .sub-menu.brx-submenu-positioned .or-brx-header__submenu-description {
    display: block;
    font-size: inherit;
    line-height: 1.25;
    color: var(--og-text-muted);
  }

  .or-header__search-panel {
    top: 78px;
    width: calc(100vw - (2 * var(--og-space-m)));
    padding: 16px var(--og-space-m) 20px;
    border-left: 0;
    border-right: 0;
    border-radius: 0 0 12px 12px;
  }
}

@media (max-width: 767px) {
  .or-brx-header__brand-slot--mobile {
    max-width: 140px;
  }

  .or-brx-header__brand-slot--mobile img {
    width: 140px;
    height: auto;
  }

  .or-header__search-panel {
    width: calc(100vw - (2 * var(--og-space-m)));
  }
}

@media (max-width: 390px) {
  .or-brx-header__brand-slot--mobile {
    max-width: 130px;
  }

  .or-brx-header__brand-slot--mobile img {
    width: 130px;
    height: auto;
  }
}
