/* Shared header for the embedded Store and all custom ordering tools. */

body {
  margin: 0;
}

.v2-site-header {
  width: 100%;
  font-family: var(--v2-font-family);
  background: var(--v2-color-primary);
  color: var(--v2-color-header-text);
  box-shadow: 0 1px 2px var(--v2-color-header-shadow);
}

.v2-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.v2-header {
  display: grid;
  grid-template-columns: minmax(210px, 1fr) minmax(320px, 720px) minmax(210px, 1fr);
  align-items: center;
  gap: 28px;
  width: 100%;
  min-height: 74px;
  padding: 12px clamp(18px, 4vw, 64px);
  box-sizing: border-box;
}

.v2-header__brand-wrap {
  display: flex;
  align-items: center;
  min-width: 0;
}

.v2-header__title {
  color: inherit;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: clamp(24px, 2vw, 32px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.7px;
  text-decoration: none;
  white-space: nowrap;
}

.v2-header__back {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  margin-right: 5px;
  color: inherit;
  background: transparent;
  border: 0;
  border-radius: 50%;
  font-size: 21px;
  cursor: pointer;
}

.v2-header__search {
  display: flex;
  width: 100%;
  min-width: 0;
  height: 46px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.22);
  border-radius: 5px;
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.v2-header__search:focus-within {
  border-color: #004c93;
  box-shadow: 0 0 0 3px rgba(0, 76, 147, 0.18);
}

.v2-header__search-input {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  padding: 0 14px;
  color: #222222 !important;
  background: transparent !important;
  border: 0;
  outline: 0;
  font: 400 16px/1.3 var(--v2-font-family);
  -webkit-appearance: none;
  appearance: none;
}

.v2-header__search--preparing .v2-header__search-button {
  position: relative;
}

.v2-header__search--preparing .v2-header__search-button::after {
  content: '';
  position: absolute;
  width: 15px;
  height: 15px;
  border: 2px solid rgba(0, 76, 147, 0.25);
  border-top-color: #004c93;
  border-radius: 50%;
  animation: v2-search-prepare-spin 0.7s linear infinite;
}

.v2-header__search--preparing .v2-header__search-button svg {
  opacity: 0.18;
}

@keyframes v2-search-prepare-spin {
  to { transform: rotate(360deg); }
}

/* The existing Ecwid custom app appends this dropdown directly to body. */
#ecwid-live-search-dd {
  max-height: min(660px, calc(100dvh - 150px)) !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
  font-family: var(--v2-font-family);
  -webkit-overflow-scrolling: touch;
}

.v2-header__search-input::placeholder {
  color: #6f6f6f;
  opacity: 1;
}

.v2-header__search-input::-webkit-search-cancel-button {
  cursor: pointer;
}

.v2-header__search-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 52px;
  height: 100%;
  padding: 0;
  color: #111111;
  background: #ffffff;
  border: 0;
  border-left: 1px solid rgba(0, 0, 0, 0.12);
  cursor: pointer;
}

.v2-header__search-button:hover {
  background: #f5f5f5;
}

.v2-header__search-button svg,
.v2-header__action-icon svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.v2-header__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
}

.v2-header__action {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  min-height: 48px;
  padding: 2px 4px;
  color: inherit;
  background: transparent;
  border: 0;
  border-radius: 5px;
  cursor: pointer;
}

.v2-header__action:hover {
  background: rgba(255, 255, 255, 0.22);
}

.v2-header__action-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.v2-header__action-label {
  margin-top: 2px;
  font-size: 12px;
  font-weight: 650;
  line-height: 1;
}

.v2-header__cart-count {
  position: absolute;
  top: -8px;
  right: -11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  box-sizing: border-box;
  color: #ffffff;
  background: #004c93;
  border: 2px solid var(--v2-color-primary);
  border-radius: 10px;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

.v2-header__cart-count[hidden] {
  display: none;
}

.v2-header__contact {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(28px, 6vw, 88px);
  min-height: 35px;
  padding: 6px clamp(18px, 4vw, 64px);
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.18);
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  font-size: 13px;
  font-weight: 600;
}

.v2-header__contact-link {
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}

.v2-header__contact-link:hover {
  text-decoration: underline;
}

.v2-header__contact-hours {
  font-weight: 450;
}

.v2-header__back:focus-visible,
.v2-header__title:focus-visible,
.v2-header__action:focus-visible,
.v2-header__search-button:focus-visible,
.v2-header__contact-link:focus-visible,
.v2-header__tab:focus-visible {
  outline: 2px solid #004c93;
  outline-offset: 2px;
}

/* Product navigation tabs */
.v2-tabs-hint,
.v2-header__tabs {
  display: none;
}

@media (min-width: 992px) {
  .v2-header__tabs {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 12px;
    background: #ffffff;
    border-bottom: 1px solid var(--v2-color-header-shadow);
  }

  .v2-header__tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 9px;
    color: #222222;
    background: transparent;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 8px;
    font: 600 14px/1.2 var(--v2-font-family);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
  }

  .v2-header__tab-icon {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    border-radius: 4px;
  }

  .v2-header__tab-label {
    white-space: nowrap;
  }

  .v2-header__tab:not(.v2-header__tab--active):hover {
    background: rgba(0, 0, 0, 0.04);
  }

  .v2-header__tab--active {
    color: #ffffff;
    background: #004c93;
    border-color: #004c93;
  }
}

@media (min-width: 1440px) {
  .v2-header__tabs {
    gap: 10px;
    padding: 9px 16px;
  }

  .v2-header__tab {
    gap: 7px;
    padding: 7px 11px;
  }

  .v2-header__tab-icon {
    width: 24px;
    height: 24px;
  }
}

@media (max-width: 1100px) and (min-width: 992px) {
  .v2-header {
    grid-template-columns: minmax(190px, auto) minmax(280px, 1fr) auto;
    gap: 18px;
    padding-inline: 20px;
  }

  .v2-header__actions {
    gap: 8px;
  }
}

@media (max-width: 991px) {
  .v2-header {
    grid-template-columns: 1fr auto;
    gap: 8px 12px;
    min-height: auto;
    padding: 9px 12px 11px;
  }

  .v2-header__brand-wrap {
    min-height: 42px;
  }

  .v2-header__back {
    display: inline-flex;
  }

  .v2-header__title {
    font-size: clamp(21px, 6vw, 27px);
  }

  .v2-header__actions {
    grid-column: 2;
    grid-row: 1;
    gap: 4px;
  }

  .v2-header__action {
    min-width: 47px;
    min-height: 42px;
  }

  .v2-header__action-label {
    display: none;
  }

  .v2-header__search {
    grid-column: 1 / -1;
    grid-row: 2;
    height: 43px;
  }

  .v2-header__contact {
    gap: 18px;
    justify-content: space-between;
    min-height: 32px;
    padding: 6px 12px;
    overflow-x: auto;
    font-size: 12px;
    scrollbar-width: none;
  }

  .v2-header__contact::-webkit-scrollbar {
    display: none;
  }

  .v2-header__contact-hours {
    display: none;
  }

  body.v2-page--module .v2-tabs-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    color: #e53935;
    background: #ffffff;
    border-bottom: 1px solid var(--v2-color-header-shadow);
    font: 600 13px/1.2 var(--v2-font-family);
    user-select: none;
  }

  body.v2-page--module .v2-header__tabs {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    color: #222222;
    background: #ffffff;
    border-bottom: 0;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  body.v2-page--module .v2-header__tabs::-webkit-scrollbar {
    display: none;
  }

  body.v2-page--module .v2-header__tab {
    flex: 0 0 auto;
    padding: 6px 12px;
    color: #222222;
    background: transparent;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 6px;
    font: 600 16px/1.2 var(--v2-font-family);
    -webkit-tap-highlight-color: transparent;
  }

  body.v2-page--module .v2-header__tab.v2-header__tab--active {
    color: #ffffff;
    background: #004c93;
    border-color: #004c93;
  }

  body.v2-page--module .v2-header__tab-icon,
  body.v2-page--home .v2-header__tabs,
  body.v2-page--home .v2-tabs-hint,
  body.v2-page--home .v2-header__back {
    display: none;
  }

  body.v2-page--module {
    overflow-x: hidden;
  }
}

@media (max-width: 991px) {
  #ecwid-live-search-dd {
    max-height: calc(100dvh - 175px) !important;
  }
}

@media (max-width: 520px) {
  .v2-header__contact {
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    min-height: 43px;
    overflow: visible;
    font-size: 11px;
  }

  .v2-header__contact-link:first-child {
    padding-right: 0;
    border-right: 0;
  }
}
