/* Mineralne Atelier: approved A header. Commerce, navigation and preview stay native. */
.mineral-header {
  --header-ink: #46334f;
  --header-line: #d2c7d3;
  --header-tint: #e5dce9;
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: 0 1px 0 #44345012;
  background: #faf7f2;
  color: var(--header-ink);
  border-bottom: 1px solid #e6dfe6;
  font-family: Manrope, sans-serif;
  font-synthesis: none;
}
.mineral-header.palette-sage { --header-ink: #173832; --header-line: #c5cdbb; --header-tint: #e1e5d6; }
.mineral-product-page .mineral-header.palette-pearl { --header-ink:#50433b; --header-line:#cfc5b7; --header-tint:#efebe2; }
.mineral-product-page .mineral-header.palette-rose { --header-ink:#69344d; --header-line:#c9afb9; --header-tint:#f2dce0; }
.mineral-product-page .mineral-header.palette-sky { --header-ink:#254451; --header-line:#b4c8cd; --header-tint:#dcebf0; }
.mineral-header .site-header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 1440px;
  min-height: 72px;
  margin: 0 auto;
  padding: 0 60px;
  gap: 24px;
}
.mineral-header .site-brand { order: 1; display: flex; flex: 0 0 144px; align-items: center; min-height: 44px; }
.mineral-header .site-brand img { display: block; width: 144px; height: auto; }
/* Enlarged text may reflow; the flex min-content width must not push actions out. */
.mineral-header .primary-navigation { order: 2; flex: 0 1 auto; min-width: 0; }
.mineral-header .primary-navigation .menu { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; }
.mineral-header .primary-navigation a { display: inline-flex; align-items: center; min-height: 44px; font-size: 16px; line-height: 1.35; padding: 0; overflow-wrap: anywhere; }
.mineral-header .header-actions { order: 3; display: flex; align-items: center; gap: 16px; margin: 0; font-size: 16px; line-height: 1.35; }
.mineral-header .header-search summary { display: flex; align-items: center; gap: 12px; min-height: 44px; min-width: 44px; }
.mineral-header .header-search summary svg { width: 22px; height: 22px; }
.mineral-header .search-label { display: inline; }
.mineral-header .header-divider { width: 1px; height: 24px; flex: 0 0 1px; background: var(--header-line); }
.mineral-header .lunavia-cart-link { position: relative; display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; gap: 12px; font-size: 16px; line-height: 1.35; }
.mineral-header .lunavia-cart-count { display: grid; place-items: center; width: 32px; min-width: 32px; height: 32px; padding: 0; border: 0; background: var(--header-tint); color: var(--header-ink); border-radius: 50%; font-size: 16px; line-height: 1; }
.mineral-header .lunavia-cart-icon, .mineral-header .nav-toggle { display: none; }
.mineral-header .header-search-panel { right: 60px; background: #faf7f2; color: var(--header-ink); border-color: var(--header-line); }
.mineral-header :focus-visible { outline: 2px solid var(--header-ink); outline-offset: 3px; }
.mineral-header .lunavia-search-form button { font-size: 16px; }
.mineral-header .lunavia-mobile-contact { display: none; }

@media (max-width: 1099px) {
  .mineral-header .lunavia-mobile-contact { display: block; }
  .mineral-header .site-header-inner { display: grid; grid-template-columns: minmax(0,1fr) auto 44px; min-height: 64px; padding: 8px 20px; gap: 0; }
  .mineral-header .nav-toggle { display: none; grid-column: 3; grid-row: 1; order: initial; align-items: center; justify-content: center; width: 44px; min-width: 44px; height: 44px; min-height: 44px; padding: 0; border: 0; background: none; color: inherit; }
  .has-navigation-js .mineral-header .nav-toggle { display: inline-flex; }
  .mineral-header .nav-toggle > span { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); }
  .mineral-header .site-brand { grid-column: 1; grid-row: 1; order: initial; justify-self: start; flex-basis: auto; min-height: 44px; }
  .mineral-header .site-brand img { width: 124px; max-width: 100%; }
  .mineral-header .header-actions { grid-column: 2; grid-row: 1; order: initial; gap: 0; margin: 0; }
  .mineral-header .header-search summary, .mineral-header .lunavia-cart-link { width: 44px; height: 44px; padding: 0; justify-content: center; }
  .mineral-header .lunavia-cart-icon { display: block; }
  .mineral-header .search-label, .mineral-header .header-divider { display: none; }
  .mineral-header .lunavia-cart-label { position: absolute; width: 1px; min-width: 0; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); }
  .mineral-header .lunavia-cart-link { width: 72px; gap: 8px; }
  .mineral-header .lunavia-cart-count { position: static; width: 26px; min-width: 26px; height: 26px; font-size: 12px; }
  .mineral-header .primary-navigation { grid-column: 1/-1; grid-row: 2; order: initial; width: 100%; padding: 14px 0 6px; }
  .mineral-header .primary-navigation .menu { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,max(9em,calc((100% - 24px)/2))),1fr)); gap: 0 24px; }
  .mineral-header .primary-navigation a { display: flex; width: 100%; min-height: 48px; padding: 10px 0; border-top: 1px solid var(--header-line); white-space: normal; }
  .has-navigation-js .mineral-header .primary-navigation { display: none; }
  .has-navigation-js .mineral-header .primary-navigation.is-open { display: block; }
  .mineral-header .header-search-panel { right: 20px; width: calc(100vw - 40px); max-width: 500px; padding: 20px; }
}
@media (max-width: 359px) {
  .mineral-header .site-brand img { width: 100px; }
  .mineral-header .primary-navigation .menu { grid-template-columns: 1fr; }
}

/* Mineral desktop starts at 1100px; legacy editorial mobile rules include 1100px. */
@media (min-width: 1100px) {
  .mineral-header .site-header-inner { flex-wrap: nowrap; }
  .mineral-header .primary-navigation { display: block; width: auto; padding: 0; }
  .mineral-header .primary-navigation a { width: auto; border-top: 0; }
}

/* R9 account: inactive NoSales preview slot, object-key icon, desktop R03/R06 only.
 * PHP supplies the descriptive span only for product 32 or the existing Dopasowanie page. */
.mineral-header .header-account-slot { display:none; }
@media (min-width:1280px) {
  .lunavia-fidelity21 .mineral-header .header-account-slot {
    display:inline-flex;
    flex:0 0 44px;
    align-items:center;
    justify-content:center;
    width:44px;
    min-width:44px;
    height:44px;
    min-height:44px;
    color:inherit;
    cursor:default;
  }
  .lunavia-fidelity21 .mineral-header .header-account-slot svg { width:16px;height:16px; }
}

/* Keep anchored content and keyboard focus clear of the sticky navigation. */
html { scroll-padding-top: calc(var(--lunavia-header-height, 76px) + 16px); }
.mineral-header .header-search-panel { max-height: calc(100dvh - 100px); overflow-y: auto; }
@media (max-width:1099px) {
 .mineral-header .primary-navigation.is-open { max-height:calc(100dvh - 88px); overflow-y:auto; overscroll-behavior:contain; }
}
