/* Spareza shared header — rebuilt as one responsive component. */
.store-header {
  --store-blue: #2563eb;
  --store-blue-dark: #1d4ed8;
  --store-ink: #111827;
  --store-text: #475569;
  --store-line: #dbe3ef;
  --store-soft: #f5f8fc;
  position: sticky !important;
  top: 0 !important;
  z-index: 800;
  width: 100%;
  border: 0;
  background: #fff;
  box-shadow: none;
}

/* One shared offset for every sticky panel on the storefront. */
body {
  --store-context-height: 0px;
  --store-sticky-gap: 16px;
  --store-sticky-offset: calc(
    var(--store-header-height, 172px) + var(--store-context-height) + var(--store-sticky-gap)
  );
}
body.has-active-vehicle {
  --store-context-height: 49px;
}

/* Persistent context for the vehicle used by catalogue compatibility. */
.active-vehicle-bar {
  position: sticky;
  top: var(--store-header-height, 172px);
  z-index: 799;
  border-bottom: 1px solid #bfdbfe;
  background: rgba(239, 246, 255, 0.97);
  box-shadow: 0 5px 14px rgba(37, 99, 235, 0.07);
  backdrop-filter: blur(10px);
}
body.has-floating-header .active-vehicle-bar {
  top: var(--store-header-height, 172px);
}
.active-vehicle-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 6px 20px;
}
.active-vehicle-icon {
  display: grid;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  background: #dbeafe;
  color: #2563eb;
}
.active-vehicle-copy {
  display: flex;
  align-items: baseline;
  gap: 7px;
  min-width: 0;
}
.active-vehicle-copy small {
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}
.active-vehicle-copy strong {
  overflow: hidden;
  color: #172033;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.active-vehicle-copy > span {
  overflow: hidden;
  color: #64748b;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.active-vehicle-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  color: #047857;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.active-vehicle-status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
}
.active-vehicle-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}
.active-vehicle-actions a,
.active-vehicle-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #fff;
  color: #1d4ed8;
  font:
    700 12px/1 Inter,
    sans-serif;
  text-decoration: none;
  cursor: pointer;
}
.active-vehicle-actions a {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
}
.active-vehicle-actions .active-vehicle-clear {
  min-width: 32px;
  padding: 0;
  color: #64748b;
  font-size: 18px;
}

@media (max-width: 900px) {
  .active-vehicle-inner {
    gap: 8px;
    min-height: 52px;
    padding: 6px 14px;
  }
  .active-vehicle-copy {
    display: grid;
    gap: 1px;
  }
  .active-vehicle-copy small,
  .active-vehicle-status,
  .active-vehicle-copy > span {
    display: none;
  }
  .active-vehicle-actions a {
    display: none;
  }
  .active-vehicle-actions {
    margin-left: auto;
  }
}

.store-shell {
  box-sizing: border-box;
  width: 100%;
  max-width: 1420px;
  margin-right: auto;
  margin-left: auto;
}

/* Utility row */
.store-utility {
  height: 34px;
  border-bottom: 1px solid #e7edf5;
  background: #f7f9fc;
}
.store-utility-inner {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 24px;
  height: 34px;
  padding: 0 28px;
}
.store-utility-services,
.store-utility-settings {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}
.store-utility-services span,
.store-utility-services a {
  color: #5d6b7f;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}
.store-utility-services a:hover {
  color: var(--store-blue-dark);
}
.store-utility-settings {
  gap: 4px;
}
.store-utility-settings::before {
  display: none;
}
.store-header .tb-vat-btn,
.store-header .tb-country-btn,
.store-header .tb-lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #475569;
  font-size: 13px;
}
.store-header .tb-vat-btn:hover,
.store-header .tb-country-btn:hover,
.store-header .tb-lang-btn:hover {
  background: #e9f1ff;
  color: var(--store-blue-dark);
}
.store-header .tb-dropdown {
  border: 1px solid var(--store-line);
  background: #fff;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.15);
}
.store-header .tb-dropdown-country {
  width: min(300px, calc(100vw - 24px));
  max-height: 360px;
}
.store-header .tb-dropdown-country-search {
  box-sizing: border-box;
  width: calc(100% - 16px);
  height: 42px;
  margin: 8px;
  padding: 0 42px 0 12px;
  border: 1px solid #cbd5e1 !important;
  border-radius: 9px;
  outline: 0;
  background-color: #fff;
  background-position: right 13px center;
  background-size: 16px;
  color: #334155;
  font-size: 14px;
  box-shadow: none !important;
}
.store-header .tb-dropdown-country-search:focus {
  border-color: var(--store-blue) !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.11) !important;
}
.store-header .tb-country-list {
  max-height: 286px;
  overscroll-behavior: contain;
}
.store-header .tb-country-list-item {
  box-sizing: border-box;
  width: 100%;
}
.store-header .tb-country-list > .tb-country-list-item > .tb-dd-item {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  width: 100%;
}
.store-header .tb-language-list .tb-dd-item {
  box-sizing: border-box;
  display: block;
  width: 100%;
  font-weight: 600;
}
.store-header .tb-dd-item {
  color: #334155;
  font-size: 13px;
}
.store-header .tb-dd-item:hover {
  background: #eff6ff;
  color: var(--store-blue-dark);
}

/* Main row */
.store-main-form {
  background: #fff;
}
.store-main {
  display: grid;
  grid-template-columns: 220px minmax(360px, 1fr) auto;
  align-items: center;
  gap: 20px;
  min-height: 90px;
  padding: 15px 28px;
}
.store-main .hdr-logo {
  display: flex;
  align-items: center;
  width: 220px;
  min-width: 0;
}
.store-main .hdr-logo img {
  display: block;
  width: auto;
  max-width: 220px;
  height: 56px !important;
  object-fit: contain;
}
.store-search {
  box-sizing: border-box;
  display: flex;
  align-items: stretch;
  width: 100%;
  min-width: 0;
  height: 52px;
  overflow: hidden;
  border: 1px solid #bdc9d8;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition:
    border-color 0.16s,
    box-shadow 0.16s;
}
.store-search:focus-within {
  border-color: var(--store-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.store-search .hdr-search-inner {
  height: 100%;
  min-width: 0;
}
.store-search .hdr-search-input {
  width: 100%;
  min-width: 0;
  height: 100%;
  padding-right: 38px;
  font-size: 14px;
}
.store-search .hdr-search-btn {
  align-self: stretch;
  box-sizing: border-box;
  height: 100%;
  min-width: 108px;
  padding: 0 22px;
  border: 0;
  border-radius: 0 10px 10px 0;
  background: var(--store-blue);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}
.store-search .hdr-search-btn:hover {
  background: var(--store-blue-dark);
}

.store-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}
.store-actions .hdr-action-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-direction: row;
  gap: 9px;
  box-sizing: border-box;
  height: 48px;
  min-width: 96px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: #f4f7fb;
  color: #334155;
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}
.store-actions .hdr-action-btn:hover {
  border-color: #c6d5ef;
  background: #eaf1fd;
  color: var(--store-blue-dark);
}
.store-actions .hdr-action-label {
  display: inline !important;
  color: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}
.store-actions .hdr-action-btn > svg {
  width: 23px;
  height: 23px;
  flex: 0 0 23px;
}
.store-actions .hdr-action-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  display: grid;
  place-items: center;
  min-width: 19px;
  height: 19px;
  padding: 0 4px;
  border: 2px solid #fff;
  border-radius: 999px;
  color: #fff;
  font-size: 9px;
  line-height: 1;
}
.store-actions .hdr-cart .hdr-action-badge {
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
}
.store-actions .hdr-cart {
  padding-right: 34px;
}

.hdr-account-menu { position: relative; }
.hdr-account-trigger { cursor: pointer; }
.hdr-account-chevron { margin-left: -3px; transition: transform .16s ease; }
.hdr-account-dropdown {
  position: absolute;
  z-index: 1200;
  top: calc(100% + 10px);
  right: 0;
  width: 230px;
  padding: 8px;
  border: 1px solid var(--neutral-200);
  border-radius: 12px;
  background: var(--white);
  box-shadow: 0 16px 42px rgba(34, 52, 84, .18);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-5px);
  transition: opacity .16s ease, transform .16s ease, visibility .16s ease;
}
.hdr-account-menu:hover .hdr-account-dropdown,
.hdr-account-menu:focus-within .hdr-account-dropdown,
.hdr-account-menu.is-open .hdr-account-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.hdr-account-menu:hover .hdr-account-chevron,
.hdr-account-menu:focus-within .hdr-account-chevron,
.hdr-account-menu.is-open .hdr-account-chevron { transform: rotate(180deg); }
.hdr-account-dropdown::before {
  content: "";
  position: absolute;
  right: 0;
  bottom: 100%;
  width: 100%;
  height: 12px;
}
.hdr-account-dropdown-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px 10px;
  border-bottom: 1px solid var(--neutral-200);
  margin-bottom: 5px;
}
.hdr-account-dropdown-head small {
  color: var(--neutral-500);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.hdr-account-dropdown-head strong {
  overflow: hidden;
  color: var(--neutral-900);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hdr-account-dropdown > a {
  display: flex;
  align-items: center;
  min-height: 36px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--neutral-800);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.hdr-account-dropdown > a:hover,
.hdr-account-dropdown > a:focus-visible {
  background: var(--neutral-100);
  color: var(--primary-600);
  outline: none;
}
.hdr-account-dropdown > .hdr-account-logout {
  margin-top: 5px;
  border-top: 1px solid var(--neutral-200);
  border-radius: 0 0 8px 8px;
  color: #b42318;
}

/* Navigation row */
.store-nav {
  position: relative;
  z-index: 390;
  height: 48px;
  border-top: 1px solid #edf1f6;
  border-bottom: 1px solid var(--store-line);
  background: var(--store-soft);
}
.store-nav-inner {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 48px;
  padding: 0 28px;
  overflow-x: auto;
  scrollbar-width: none;
}
.store-nav-inner::-webkit-scrollbar {
  display: none;
}
.store-nav .hdr-nav-link {
  display: inline-flex;
  align-items: center;
  box-sizing: border-box;
  height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 9px;
  color: #475569;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.store-nav .hdr-nav-link:hover,
.store-nav .hdr-nav-link.active {
  background: #fff;
  color: var(--store-blue-dark);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}

/* Floating state */
.store-header .header-search-placeholder {
  display: none;
}
.store-header .header-search-placeholder.is-active {
  display: none;
}
.store-main-form.is-floating {
  position: static;
  border-bottom: 0;
  box-shadow: none;
}
.store-main-form.is-floating .store-main {
  min-height: 90px;
  padding: 15px 28px;
}
.store-nav.is-floating {
  position: relative;
  top: auto;
  box-shadow: none;
}

/* Tablet */
@media (min-width: 769px) and (max-width: 1100px) {
  .store-utility {
    display: block;
    height: 36px;
  }
  .store-utility-inner {
    justify-content: flex-end;
    height: 36px;
    padding: 0 16px;
  }
  .store-utility-services {
    display: none;
  }
  .store-utility-settings {
    display: flex;
    margin-left: auto;
  }
  /* Legacy header.css hides `.topbar-inner > div:first-child` in this
     breakpoint. In the unified header that first child is the complete
     VAT/country/language control group, so explicitly keep it visible. */
  .store-header .store-utility-inner > .store-utility-settings:first-child {
    display: flex;
  }
  .store-utility-settings::before {
    display: none;
  }
  .store-main {
    grid-template-columns: 138px minmax(260px, 1fr) auto;
    gap: 13px;
    min-height: 72px;
    padding: 10px 16px;
  }
  .store-main .hdr-logo {
    width: 138px;
  }
  .store-main .hdr-logo img {
    max-width: 138px;
    height: 33px !important;
  }
  .store-search {
    height: 48px;
  }
  .store-search .hdr-search-btn {
    min-width: 88px;
    padding: 0 16px;
  }
  .store-actions {
    gap: 7px;
  }
  .store-actions .hdr-action-btn {
    width: 44px;
    min-width: 44px;
    height: 44px;
    padding: 0;
  }
  .store-actions .hdr-action-label {
    display: none !important;
  }
  .store-nav-inner {
    padding: 0 16px;
  }
  .store-nav .hdr-nav-link {
    padding: 0 11px;
    font-size: 13px;
  }
}

/* Phone */
@media (max-width: 768px) {
  .hdr-account-menu { display: none; }
  .store-utility,
  .store-nav {
    display: none !important;
  }
  .store-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    align-items: center;
    gap: 9px 10px;
    width: 100%;
    min-height: 0;
    max-width: none;
    padding: 9px 11px 11px;
  }
  .store-main .hdr-logo {
    grid-column: 1;
    grid-row: 1;
    width: max-content;
    min-width: 0;
  }
  .store-main .hdr-logo img {
    display: block;
    width: 138px;
    max-width: 138px;
    height: 33px !important;
    object-fit: contain;
    object-position: left center;
  }
  .store-actions {
    grid-column: 2;
    grid-row: 1;
    gap: 7px;
  }
  .store-actions .hdr-action-btn:not(.hdr-cart) {
    display: none;
  }
  .store-main .hdr-menu-btn,
  .store-actions .hdr-cart {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-direction: row;
    gap: 6px;
    box-sizing: border-box;
    height: 40px;
    min-height: 40px;
    padding: 0 10px;
    border: 1px solid var(--store-line);
    border-radius: 10px;
    background: #fff;
    color: var(--store-ink);
    text-decoration: none;
  }
  .store-main .hdr-menu-btn span,
  .store-actions .hdr-cart-label {
    display: inline !important;
    color: inherit;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
  }
  .store-main .hdr-menu-btn svg,
  .store-actions .hdr-cart > svg {
    width: 19px;
    height: 19px;
  }
  .store-actions .hdr-cart {
    padding-right: 30px;
  }
  .store-actions .hdr-cart .hdr-action-badge {
    top: 50%;
    right: 7px;
    transform: translateY(-50%);
  }
  .store-search {
    grid-column: 1/-1;
    grid-row: 2;
    width: 100%;
    height: 44px;
    border-color: #94a3b8;
    border-radius: 10px;
  }
  .store-search .hdr-search-input {
    height: 100%;
    padding: 0 34px 0 38px;
    font-size: 16px;
    text-overflow: ellipsis;
  }
  .store-search .hdr-search-btn {
    display: none;
  }
  .store-main-form.is-floating .store-main {
    padding: 9px 11px 11px;
  }
}

@media (max-width: 350px) {
  .store-main {
    gap: 8px;
    padding-right: 8px;
    padding-left: 8px;
  }
  .store-main .hdr-logo img {
    max-width: 88px;
  }
  .store-main .hdr-menu-btn,
  .store-actions .hdr-cart {
    width: 40px;
    padding: 0;
  }
  .store-actions .hdr-cart .hdr-action-badge {
    top: 2px;
    right: 2px;
    transform: none;
  }
  .store-main .hdr-menu-btn span,
  .store-actions .hdr-cart-label {
    display: none !important;
  }
}

/*
 * Compact desktop header after the page starts scrolling. The complete
 * utility, search and navigation layout remains unchanged at the top of the
 * page; only the sticky state releases vertical space on laptop screens.
 */
@media (min-width: 769px) {
  .store-header.is-compact .store-utility,
  .store-header.is-compact .store-nav {
    display: none;
  }

  .store-header.is-compact .store-main {
    grid-template-columns: 180px minmax(300px, 1fr) auto;
    min-height: 64px;
    padding-top: 6px;
    padding-bottom: 6px;
  }

  .store-header.is-compact .store-main .hdr-logo {
    width: 180px;
  }

  .store-header.is-compact .store-main .hdr-logo img {
    max-width: 180px;
    height: 42px !important;
  }

  .store-header.is-compact .store-search {
    height: 44px;
  }

  .store-header.is-compact .store-actions .hdr-action-btn {
    height: 42px;
  }
}

@media (max-width: 480px) {
  .store-main .hdr-logo img {
    width: 118px;
    max-width: 118px;
    height: 31px !important;
  }
}

@media (max-width: 380px) {
  .store-main .hdr-logo img {
    width: 100px;
    max-width: 100px;
    height: 29px !important;
  }
}
