/* Blue Sky Header De-duplication & Responsive Lock — 0.11.37
   One canonical wishlist/compare group, no repeated navigation entries, and
   mutually-exclusive desktop/mobile header layouts. Loaded after v15. */

/* Remove stale static copies from previous releases if an old HTML fragment is
   still present during an atomic activation or browser restoration. */
body.commerce-page .shop-header-luxury .shop-header-actions > .shop-favorite-button,
body.commerce-page .shop-header-luxury .shop-nav > a[href="/favorites"],
body.commerce-page .shop-header-luxury .shop-nav > a[href="/compare"],
body.commerce-page .shop-header-luxury .shop-nav > [data-discovery-nav] {
  display: none !important;
}

body.commerce-page .shop-header-luxury .shop-header-row {
  grid-template-columns: minmax(188px, 218px) minmax(0, 1fr) max-content;
  column-gap: clamp(14px, 1.8vw, 28px);
}

body.commerce-page .shop-header-luxury .shop-header-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  width: max-content;
  min-width: max-content;
  gap: 6px;
  direction: ltr;
}

body.commerce-page .shop-header-luxury .shop-discovery-header-tools {
  order: 3;
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

body.commerce-page .shop-header-luxury .shop-discovery-header-tools[hidden] {
  display: none !important;
}

body.commerce-page .shop-header-luxury .shop-discovery-header-tools .shop-discovery-icon {
  position: relative !important;
  inset: auto !important;
  display: grid;
  place-items: center;
  width: 44px;
  min-width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border-radius: 13px;
  transform: none;
}

body.commerce-page .shop-header-luxury .shop-discovery-header-tools .shop-discovery-icon:hover {
  transform: translateY(-1px);
}

body.commerce-page .shop-header-luxury .shop-mobile-menu { order: 0; }
body.commerce-page .shop-header-luxury .shop-cart-button { order: 1; }
body.commerce-page .shop-header-luxury [data-action="open-search"] { order: 2; }
body.commerce-page .shop-header-luxury .shop-theme-slot { order: 4; }
body.commerce-page .shop-header-luxury .shop-account-link { order: 5; }

/* The account control becomes a profile icon on medium desktop widths. The
   accessible text remains in the DOM while the header stays compact. */
@media (min-width: 1041px) and (max-width: 1360px) {
  body.commerce-page .shop-header-luxury .shop-account-link {
    display: inline-flex !important;
    position: relative;
    width: 44px;
    min-width: 44px;
    height: 44px;
    padding: 0 !important;
    border: 1px solid rgba(169, 197, 239, .08);
    border-radius: 13px;
    font-size: 0 !important;
    background: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.018));
  }
  body.commerce-page .shop-header-luxury .shop-account-link::before {
    content: "";
    width: 20px;
    height: 20px;
    background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23eef5ff' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4.5 21a7.5 7.5 0 0 1 15 0'/%3E%3C/svg%3E");
  }
}

/* Desktop and mobile rules are deliberately mutually exclusive. This prevents
   the full navigation and hamburger button from appearing at the same time. */
@media (min-width: 1041px) {
  body.commerce-page .shop-header-luxury .shop-mobile-menu {
    display: none !important;
  }
  body.commerce-page .shop-header-luxury .shop-nav {
    position: static !important;
    inset: auto !important;
    display: flex !important;
    width: 100%;
    max-height: none !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    overflow: visible !important;
    opacity: 1 !important;
    transform: none !important;
    pointer-events: auto !important;
  }
}

@media (max-width: 1280px) and (min-width: 1041px) {
  body.commerce-page .shop-header-luxury .shop-header-row {
    grid-template-columns: minmax(174px, 196px) minmax(0, 1fr) max-content;
    column-gap: 12px;
  }
  body.commerce-page .shop-header-luxury .shop-nav {
    gap: 0;
  }
  body.commerce-page .shop-header-luxury .shop-nav > a,
  body.commerce-page .shop-header-luxury .shop-nav > button,
  body.commerce-page .shop-header-luxury .shop-category-nav > button {
    min-height: 44px;
    padding-inline: 7px;
    font-size: 10px;
  }
  body.commerce-page .shop-header-luxury .shop-icon-button,
  body.commerce-page .shop-header-luxury .shop-theme-slot,
  body.commerce-page .shop-header-luxury .shop-theme-slot .theme-control,
  body.commerce-page .shop-header-luxury .shop-theme-slot .theme-trigger,
  body.commerce-page .shop-header-luxury .shop-discovery-header-tools .shop-discovery-icon,
  body.commerce-page .shop-header-luxury .shop-account-link {
    width: 42px;
    min-width: 42px;
    height: 42px;
  }
  body.commerce-page .shop-header-luxury .shop-header-actions,
  body.commerce-page .shop-header-luxury .shop-discovery-header-tools {
    gap: 4px;
  }
}

@media (max-width: 1040px) {
  body.commerce-page .shop-header-luxury .shop-header-row {
    grid-template-columns: 1fr auto;
    min-height: 74px;
  }
  body.commerce-page .shop-header-luxury .shop-mobile-menu {
    display: grid !important;
  }
  body.commerce-page .shop-header-luxury .shop-account-link,
  body.commerce-page .shop-header-luxury .shop-theme-slot,
  body.commerce-page .shop-header-luxury .shop-discovery-header-tools {
    display: none !important;
  }
  body.commerce-page .shop-header-luxury .shop-nav {
    position: absolute !important;
    top: calc(100% + 8px) !important;
    right: 16px !important;
    left: 16px !important;
    display: grid !important;
    max-height: calc(100dvh - 120px) !important;
    padding: 12px !important;
    border: 1px solid rgba(156,187,235,.18) !important;
    border-radius: 20px !important;
    background: rgba(4, 14, 31, .985) !important;
    box-shadow: 0 28px 70px rgba(0,0,0,.45) !important;
    overflow-y: auto !important;
    opacity: 0 !important;
    transform: translateY(-8px) !important;
    pointer-events: none !important;
  }
  body.commerce-page .shop-header-luxury .shop-nav.open {
    opacity: 1 !important;
    transform: none !important;
    pointer-events: auto !important;
  }
}

@media (max-width: 620px) {
  body.commerce-page .shop-header-luxury .shop-brand span { display: none; }
  body.commerce-page .shop-header-luxury .shop-header-actions { gap: 3px; }
}
