/* Shared header and palette for the ShopX storefront. */
html[data-shopx-showcase-palette] {
  --showcase-accent: #ffd719;
  --showcase-accent-hover: #ffe45a;
  --showcase-accent-ink: #161400;
  --showcase-accent-line: #9f823d;
  --showcase-accent-tint: #fffcf3;
  --showcase-focus-on-light: #8e6400;
  --showcase-hero-glow: #735722;
  --showcase-demo-glow: #514125;
  --showcase-font: Manrope, Arial, sans-serif;
}

html[data-shopx-showcase-palette="orange"] {
  --showcase-accent: #ff9f58;
  --showcase-accent-hover: #ffb77f;
  --showcase-accent-ink: #25140c;
  --showcase-accent-line: #a6532c;
  --showcase-accent-tint: #fff2e8;
  --showcase-focus-on-light: #963f09;
  --showcase-hero-glow: #8b4525;
  --showcase-demo-glow: #603620;
}

html[data-shopx-showcase-palette="blue"] {
  --showcase-accent: #8abaff;
  --showcase-accent-hover: #aecfff;
  --showcase-accent-ink: #0c1d36;
  --showcase-accent-line: #5278ad;
  --showcase-accent-tint: #eff6ff;
  --showcase-focus-on-light: #255697;
  --showcase-hero-glow: #385b91;
  --showcase-demo-glow: #2c405c;
}

html[data-shopx-showcase-palette="emerald"] {
  --showcase-accent: #70dfb2;
  --showcase-accent-hover: #9beaca;
  --showcase-accent-ink: #0d261e;
  --showcase-accent-line: #38846d;
  --showcase-accent-tint: #eef9f3;
  --showcase-focus-on-light: #146653;
  --showcase-hero-glow: #306452;
  --showcase-demo-glow: #27493e;
}

.shopx-showcase-header {
  --showcase-header-bg: #fdfcfb;
  --showcase-header-ink: #151516;
  --showcase-header-mark: var(--showcase-accent);
  --showcase-header-divider: #dedbd8;
  --showcase-header-focus: var(--showcase-focus-on-light);
  --showcase-header-shadow: 0 2px 4px rgb(36 29 23 / 5%), 0 9px 24px rgb(36 29 23 / 8%);
  --showcase-header-shadow-divider: rgb(36 29 23 / 9%);
  font-family: var(--showcase-font);
  letter-spacing: normal;
  box-shadow: inset 0 -1px var(--showcase-header-shadow-divider);
  background: var(--showcase-header-bg);
  color: var(--showcase-header-ink);
}

.shopx-showcase-header[data-shopx-header-mode="dark"] {
  --showcase-header-shadow: 0 2px 5px rgb(0 0 0 / 20%), 0 9px 25px rgb(0 0 0 / 27%);
  --showcase-header-shadow-divider: rgb(0 0 0 / 30%);
}

.shopx-showcase-header[data-shopx-showcase-header="black"],
.shopx-showcase-header[data-shopx-header-mode="dark"][data-shopx-showcase-header="match"] {
  --showcase-header-bg: #101012;
  --showcase-header-ink: #fff;
  --showcase-header-mark: var(--showcase-accent);
  --showcase-header-divider: #414149;
  --showcase-header-focus: var(--showcase-accent);
}

.shopx-showcase-header[data-shopx-showcase-header="accent"] {
  --showcase-header-bg: var(--showcase-accent);
  --showcase-header-ink: var(--showcase-accent-ink);
  --showcase-header-mark: var(--showcase-accent-ink);
  --showcase-header-divider: rgb(0 0 0 / 27%);
  --showcase-header-focus: var(--showcase-accent-ink);
}

.shopx-showcase-header .shopx-showcase-shell {
  inline-size: min(calc(100% - clamp(3.2rem, 8vw, 12rem)), 141.6rem);
  margin-inline: auto;
  display: grid;
  grid-template-areas: "brand nav actions";
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 1.6rem;
  min-block-size: 68px;
}

body.ocx-shop-body .shopx-showcase-header :is(.shopx-showcase-brand, .shopx-showcase-navigation a, .shopx-showcase-language-list a, .shopx-showcase-cart) {
  color: var(--showcase-header-ink) !important;
  text-decoration: none;
}


.shopx-showcase-brand {
  grid-area: brand;
  display: inline-flex;
  align-items: center;
  gap: 0.72rem;
  justify-self: start;
  font-size: clamp(2.6rem, 2.08rem + 1vw, 3.6rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -.045em;
}

.shopx-brand-mark {
  --shopx-mark-color: var(--showcase-header-mark, var(--showcase-accent, #ffd719));
  position: relative;
  display: inline-block;
  flex: none;
  inline-size: .53em;
  block-size: .53em;
  border-radius: 50%;
  background: var(--shopx-mark-color);
  box-shadow: 0 0 .33em color-mix(in srgb, var(--shopx-mark-color) 33%, transparent);
}

body.ocx-shop-body .ocx-shop-header .ocx-shop-logo-main:has(> .shopx-brand-mark) {
  text-transform: none !important;
}

.ocx-shop-logo-main > .shopx-brand-mark {
  margin-inline-start: .25em;
  vertical-align: .13em;
}

@media (prefers-reduced-motion: no-preference) {
  .shopx-brand-mark::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: 0 0 .4em .09em var(--shopx-mark-color);
    opacity: 0;
    pointer-events: none;
    animation: shopx-brand-pulse 2.3s ease-in-out 2;
  }

  @keyframes shopx-brand-pulse {
    0%, 100% { opacity: 0; scale: .85; }
    45% { opacity: .65; scale: 1.16; }
  }
}

.shopx-showcase-menu-toggle {
  grid-area: toggle;
  display: none;
}

.shopx-showcase-menu-toggle,
.shopx-showcase-drawer-close {
  min-inline-size: 44px;
  min-block-size: 44px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--showcase-header-divider);
  border-radius: .7rem;
  background: transparent;
  color: var(--showcase-header-ink) !important;
  font-size: 1.85rem;
}


.shopx-showcase-navigation {
  grid-area: nav;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: clamp(1.15rem, 1.7vw, 2.6rem);
  min-inline-size: 0;
}

.shopx-showcase-nav,
.shopx-showcase-utility {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

.shopx-showcase-nav {
  justify-content: center;
  gap: 0 clamp(1.2rem, 2vw, 3.1rem);
}

.shopx-showcase-nav a,
.shopx-showcase-utility a,
.shopx-showcase-cart,
.shopx-showcase-language summary,
.shopx-showcase-language-list a {
  display: inline-flex;
  align-items: center;
  min-block-size: 44px;
}

.shopx-showcase-nav a {
  font-size: clamp(1.4rem, 1.088rem + .55vw, 2.2rem);
  font-weight: 700;
  white-space: nowrap;
}

.shopx-showcase-header-actions {
  grid-area: actions;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .7rem;
  min-inline-size: 0;
}

.shopx-showcase-utility {
  justify-content: flex-end;
  gap: 0 clamp(.8rem, 1.25vw, 1.8rem);
}

.shopx-showcase-utility a {
  gap: .6rem;
  font-size: 1.5rem;
  font-weight: 650;
  line-height: 1.3;
}

.shopx-showcase-language {
  position: relative;
  z-index: 1;
  color: var(--showcase-header-ink);
  font-size: 1.4rem;
  font-weight: 750;
}

.shopx-showcase-language summary {
  gap: .5rem;
  padding-inline: .6rem;
  border-radius: .55rem;
  list-style: none;
  cursor: pointer;
  white-space: nowrap;
}

.shopx-showcase-language summary::-webkit-details-marker {
  display: none;
}

.shopx-showcase-language[open] summary .fa-angle-down {
  transform: rotate(180deg);
}

.shopx-showcase-language img {
  display: block;
  flex: 0 0 18px;
  inline-size: 18px;
  block-size: 12px;
  object-fit: cover;
  border-radius: 2px;
}

.shopx-showcase-language-list {
  position: absolute;
  inset-block-start: calc(100% + .35rem);
  inset-inline-end: 0;
  min-inline-size: 15rem;
  margin: 0;
  padding: .45rem;
  border: 1px solid var(--showcase-header-divider);
  border-radius: .8rem;
  background: var(--showcase-header-bg);
  box-shadow: var(--showcase-header-shadow);
  list-style: none;
}

.shopx-showcase-language-list a {
  inline-size: 100%;
  gap: .8rem;
  padding-inline: .75rem;
  border-radius: .45rem;
  white-space: nowrap;
}

body.ocx-shop-body .shopx-showcase-header .shopx-showcase-language-list a:is([aria-current], :hover, :focus-visible) {
  background: var(--showcase-header-divider);
  text-decoration: underline;
  text-underline-offset: .18em;
}

.shopx-showcase-cart {
  justify-content: center;
  min-inline-size: 44px;
  font-size: clamp(1.8rem, 1.28rem + .9vw, 2.9rem);
}

.shopx-showcase-drawer:not([open]) {
  display: none;
}

.shopx-showcase-drawer {
  position: fixed;
  inset: 0;
  box-sizing: border-box;
  inline-size: 100%;
  block-size: 100%;
  block-size: 100dvh;
  max-inline-size: none;
  max-block-size: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: transparent;
  color: var(--showcase-header-ink);
}

.shopx-showcase-drawer::backdrop {
  background: rgb(0 0 0 / 52%);
}

.shopx-showcase-drawer-panel {
  box-sizing: border-box;
  inline-size: min(34rem, calc(100% - 4.8rem));
  block-size: 100%;
  padding: max(1rem, env(safe-area-inset-top)) max(1.5rem, env(safe-area-inset-right))
    max(1.5rem, env(safe-area-inset-bottom)) max(1.5rem, env(safe-area-inset-left));
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--showcase-header-bg);
  box-shadow: 0 0 2.2rem rgb(0 0 0 / 23%);
}

.shopx-showcase-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-block-end: .75rem;
}

body.ocx-shop-body #shopx-showcase-drawer-title {
  margin: 0;
  color: var(--showcase-header-ink) !important;
  font-size: 2rem;
  font-weight: 800;
}

.shopx-showcase-drawer-close {
  display: inline-grid;
}

.shopx-showcase-drawer .shopx-showcase-navigation {
  grid-template-columns: minmax(0, 1fr);
}

.shopx-showcase-drawer .shopx-showcase-utility {
  border-inline-start: 0;
  border-block-start: 1px solid var(--showcase-header-divider);
}

@media (prefers-reduced-motion: no-preference) {
  @keyframes shopx-showcase-drawer-enter {
    from { translate: -100% 0; }
    to { translate: 0 0; }
  }

  .shopx-showcase-drawer[open] .shopx-showcase-drawer-panel {
    animation: shopx-showcase-drawer-enter 180ms ease-out;
  }
}


.shopx-showcase-nav a:hover,
.shopx-showcase-utility a:hover {
  text-decoration: underline;
  text-underline-offset: .2em;
}


.shopx-showcase-header :is(a, button, summary):focus-visible {
  outline: 2px solid var(--showcase-header-focus);
  outline-offset: 3px;
}

.shopx-showcase-header[data-shopx-mobile-only] {
  display: none;
}

.shopx-showcase-cart-slot {
  position: relative;
  min-inline-size: 44px;
}

.shopx-showcase-cart-source,
.shopx-showcase-cart-slot .shopx-showcase-cart[hidden] {
  display: none;
}

@media (max-width: 67.5rem) {
  .shopx-showcase-header[data-shopx-mobile-only][data-shopx-header-ready] {
    display: block;
  }

  .shopx-showcase-header[data-shopx-mobile-only][data-shopx-header-ready] + .ocx-shop-header {
    display: none !important;
  }

  html body.ocx-shop-body header.shopx-showcase-header .shopx-showcase-cart-slot.ocx-shop-cart #cart > button.dropdown-toggle {
    display: grid !important;
    place-items: center;
    inline-size: 44px !important;
    min-block-size: 44px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    color: var(--showcase-header-ink) !important;
    box-shadow: none !important;
  }

  html body.ocx-shop-body header.shopx-showcase-header .shopx-showcase-cart-slot.ocx-shop-cart #cart > button.dropdown-toggle::after,
  html body.ocx-shop-body header.shopx-showcase-header .shopx-showcase-cart-slot.ocx-shop-cart #cart > button.dropdown-toggle > span {
    display: none !important;
  }

  html body.ocx-shop-body header.shopx-showcase-header .shopx-showcase-cart-slot.ocx-shop-cart #cart > button.dropdown-toggle > i {
    margin: 0 !important;
    color: inherit !important;
    font-size: clamp(1.8rem, 1.28rem + .9vw, 2.9rem) !important;
  }

  .shopx-showcase-cart-slot #cart > button > i::before {
    content: "\f07a";
  }
}

@media (max-width: 900px) {
  /* Keep the existing search and catalog overlays available to the optional mobile dock. */
  .shopx-showcase-header[data-shopx-mobile-only][data-shopx-header-ready] + .ocx-shop-header:has(.ocx-shop-search.is-mobile-open, .ocx-mega-wrap.is-open),
  .shopx-showcase-header[data-shopx-mobile-only][data-shopx-header-ready] + .ocx-shop-header :is(.ocx-shop-head-main, .ocx-shop-head-row, .ocx-mega-wrap.is-open) {
    display: contents !important;
  }

  .shopx-showcase-header[data-shopx-mobile-only][data-shopx-header-ready] + .ocx-shop-header .ocx-shop-head-row > :not(.ocx-shop-search.is-mobile-open, .ocx-mega-wrap.is-open),
  .shopx-showcase-header[data-shopx-mobile-only][data-shopx-header-ready] + .ocx-shop-header :is(.ocx-shop-subnav, .ocx-mega-trigger) {
    display: none !important;
  }

  .shopx-showcase-header[data-shopx-mobile-only][data-shopx-header-ready] + .ocx-shop-header .ocx-shop-search.is-mobile-open {
    position: fixed !important;
    inset-block-start: 67px !important;
  }
}


@media (max-width: 67.5rem) {
  html:has(.shopx-showcase-drawer) {
    scrollbar-gutter: stable;
  }

  html:has(.shopx-showcase-drawer[open]) {
    overflow: hidden;
  }

  .shopx-showcase-header .shopx-showcase-shell {
    grid-template-areas: "toggle brand actions" "nav nav nav";
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-rows: minmax(60px, auto) auto;
    gap: 0 .7rem;
    min-block-size: 60px;
  }

  .shopx-showcase-menu-toggle:not([hidden]) {
    display: inline-grid;
  }


  .shopx-showcase-header-actions {
    gap: .1rem;
  }

  .shopx-showcase-navigation {
    padding: .6rem 0;
    border-block-start: 1px solid var(--showcase-header-divider);
  }

  .shopx-showcase-nav,
  .shopx-showcase-utility {
    display: grid;
    justify-content: stretch;
    gap: 0;
  }

  .shopx-showcase-nav a,
  .shopx-showcase-utility a {
    padding-inline: .85rem;
    white-space: normal;
  }

  .shopx-showcase-utility {
    border-inline-start: 1px solid var(--showcase-header-divider);
  }
}

/* Keep the mobile header one row tall while the drawer initializes. */
@media (max-width: 67.5rem) and (scripting: enabled) {
  @supports selector(dialog:modal) {
    html:not(.shopx-header-fallback) .shopx-showcase-header[data-shopx-mobile-only]:not([data-shopx-header-ready]) {
      display: block;
    }

    html:not(.shopx-header-fallback) .shopx-showcase-header[data-shopx-mobile-only]:not([data-shopx-header-ready]) + .ocx-shop-header {
      display: none !important;
    }

    html:not(.shopx-header-fallback) .shopx-showcase-header > .shopx-showcase-shell > .shopx-showcase-navigation {
      display: none;
    }

    html:not(.shopx-header-fallback) .shopx-showcase-header .shopx-showcase-menu-toggle[hidden] {
      display: inline-grid;
      visibility: hidden;
    }
  }
}

@media (max-width: 35rem) {
  .shopx-showcase-navigation {
    grid-template-columns: minmax(0, 1fr);
  }

  .shopx-showcase-utility {
    border-inline-start: 0;
    border-block-start: 1px solid var(--showcase-header-divider);
  }
}

.shopx-back-to-top {
  display: none;
}

@media (max-width: 67.5rem) {
  body.ocx-shop-body:not(:has(.ocx-mobile-bottom-nav)) {
    padding-bottom: 0 !important;
  }

  .shopx-back-to-top:not([hidden]) {
    position: fixed;
    z-index: 1100;
    inset-inline-end: max(12px, env(safe-area-inset-right));
    inset-block-end: max(12px, env(safe-area-inset-bottom), var(--shopx-back-to-top-offset, 0px));
    display: grid;
    place-items: center;
    inline-size: 46px;
    block-size: 46px;
    padding: 0;
    border: 1px solid rgb(255 255 255 / 45%);
    border-radius: 50%;
    background: #000;
    color: #fff;
    box-shadow: 0 5px 16px rgb(0 0 0 / 22%);
    font-size: 16px;
    cursor: pointer;
  }

  .shopx-back-to-top:not([hidden]):active {
    background: #262626;
  }

  body:has(.shopx-back-to-top:not([hidden])) :is(.ocx-chat-panel.side-right, .ocx-callback-pill.side-right) {
    translate: 0 var(--shopx-floating-clearance, 0px);
  }

  .shopx-showcase-header .shopx-back-to-top:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
    box-shadow: 0 0 0 5px #161616;
  }
}
