/**
 * Site header — J Taylor
 */

.jt-header {
  --jt-header-text: #272727;
  --jt-header-muted: #5a5a5a;
  --jt-header-border: #e8e8e8;
  --jt-header-badge: #db222a;
  --jt-header-height: 76px;
  --jt-header-ease: cubic-bezier(0.22, 1, 0.36, 1);

  position: relative;
  z-index: 100;
  width: 100%;
  max-width: none;
  background: #fff;
  border-bottom: 1px solid var(--jt-header-border);
  padding-block: 0;
  padding-inline: 0;
  color: var(--jt-header-text);
}

.jt-header .jt-header__inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: var(--jt-header-height);
  width: 100%;
  max-width: var(--jt-shell-width, calc(var(--jt-content-width, 1200px) + (var(--jt-gutter, 24px) * 2)));
  margin-inline: auto;
  padding-inline: var(--jt-gutter, 24px);
  box-sizing: border-box;
}

.jt-header .jt-header__brand {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
}

.jt-header .jt-header__brand .custom-logo-link {
  display: block;
  line-height: 0;
}

.jt-header .jt-header__brand .custom-logo {
  display: block;
  max-height: 52px;
  width: auto;
  height: auto;
}

.jt-header .jt-header__brand .site-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.2;
}

.jt-header .jt-header__brand .site-title a {
  color: inherit;
  text-decoration: none;
}

/* Push nav + actions toward the right */
.jt-header .jt-header__nav {
  display: flex;
  align-items: center;
  margin-left: auto;
}

.jt-header .jt-primary-menu {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.jt-header .jt-primary-menu > li {
  position: relative;
  display: flex;
  align-items: center;
}

.jt-header .jt-primary-menu > li > a {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.75rem 0.25rem;
    min-height: 44px;
    color: var(--jt-header-text);
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    transition: color 0.2s var(--jt-header-ease);
}

.jt-header .jt-primary-menu > li > a:hover,
.jt-header .jt-primary-menu > li > a:focus-visible,
.jt-header .jt-primary-menu > li.current-menu-item > a,
.jt-header .jt-primary-menu > li.current-menu-ancestor > a {
    color: #385dff;
}

.jt-header .jt-primary-menu > li > a:focus-visible {
    outline: 2px solid #385dff;
    outline-offset: 2px;
    border-radius: 2px;
}

.jt-header .jt-primary-menu > li.menu-item-has-children > a::after {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-left: 2px;
  margin-top: -2px;
  border-right: 1.75px solid currentColor;
  border-bottom: 1.75px solid currentColor;
  transform: rotate(45deg);
  transform-origin: center;
  transition: transform 0.25s var(--jt-header-ease);
  flex-shrink: 0;
}

.jt-header .jt-primary-menu > li.is-submenu-open > a::after {
  margin-top: 2px;
  transform: rotate(225deg);
}

/* Desktop dropdown */
.jt-header .jt-primary-menu .sub-menu {
  list-style: none;
  margin: 0.35rem 0 0;
  padding: 0.35rem 0;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  z-index: 120;
}

.jt-header .jt-primary-menu .sub-menu a {
    display: block;
    padding: 0.75rem 1rem;
    min-height: 44px;
    color: #333;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
  transition: background-color 0.2s var(--jt-header-ease), color 0.2s var(--jt-header-ease);
}

.jt-header .jt-primary-menu .sub-menu a:hover,
.jt-header .jt-primary-menu .sub-menu a:focus-visible {
    background: #f5f5f5;
}

.jt-header .jt-primary-menu .sub-menu a:focus-visible {
    outline: 2px solid #385dff;
    outline-offset: 2px;
}

.jt-header .jt-primary-menu .sub-menu > li.current-menu-item > a,
.jt-header .jt-primary-menu .sub-menu > li.current_page_item > a,
.jt-header .jt-primary-menu .sub-menu > li.current-menu-ancestor > a {
  color: #385dff;
  background: #f5f7ff;
  font-weight: 600;
}

@media (min-width: 992px) {
  .jt-header .jt-primary-menu .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 260px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    pointer-events: none;
    transition:
      opacity 0.22s var(--jt-header-ease),
      transform 0.22s var(--jt-header-ease),
      visibility 0.22s;
  }

  /* Click-to-open only (no hover) */
  .jt-header .jt-primary-menu > li.is-submenu-open > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
  }
}

.jt-header .jt-header__actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 0 0 auto;
}

.jt-header .jt-header__toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 0 0 auto;
  margin-left: 0;
}

.jt-header .jt-header__search,
.jt-header .jt-header__account {
  display: flex;
  align-items: center;
}

.jt-header .jt-header__search .dc-cs {
  height: 24px;
}

.jt-header .jt-header__search .dc-cs .dc-cs-trigger {
  color: var(--jt-header-text);
}

.jt-header .jt-header__cart {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    color: var(--jt-header-text);
    text-decoration: none;
    transition: transform 0.2s var(--jt-header-ease);
}

.jt-header .jt-header__cart:hover,
.jt-header .jt-header__cart:focus-visible {
    transform: scale(1.1);
}

.jt-header .jt-header__cart:focus-visible {
    outline: 2px solid #385dff;
    outline-offset: 2px;
    border-radius: 999px;
}

.jt-header .jt-header__cart-icon {
  display: block;
  width: 24px;
  height: 24px;
}

.jt-header .jt-header__cart-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.jt-header .jt-cart-count {
  position: absolute;
  top: -8px;
  right: -10px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--jt-header-badge);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  box-sizing: border-box;
}

.jt-header .jt-cart-count.is-empty {
  opacity: 1;
}

/* Account icon (logged out → login, logged in → menu toggle) */
.jt-header .jt-account-login {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    color: var(--jt-header-text);
    text-decoration: none;
    transition: transform 0.2s var(--jt-header-ease);
}

.jt-header .jt-account-login:hover,
.jt-header .jt-account-login:focus-visible {
    transform: scale(1.1);
}

.jt-header .jt-account-login:focus-visible {
    outline: 2px solid #385dff;
    outline-offset: 2px;
    border-radius: 999px;
}

.jt-header .user-menu-wrapper {
  position: relative;
  display: inline-block;
}

.jt-header .user-menu-toggle {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    margin: 0;
    padding: 0;
    border: none;
    background: none;
    color: var(--jt-header-text);
    cursor: pointer;
    transition: transform 0.2s var(--jt-header-ease);
}

.jt-header .user-menu-toggle:hover,
.jt-header .user-menu-toggle:focus-visible {
    transform: scale(1.1);
}

.jt-header .user-menu-toggle:focus-visible {
    outline: 2px solid #385dff;
    outline-offset: 2px;
    border-radius: 6px;
}

.jt-header .user-account-icon {
  display: inline-flex;
  width: 24px;
  height: 24px;
}

.jt-header .user-account-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.jt-header .user-menu-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 260px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  z-index: 130;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition:
    opacity 0.22s var(--jt-header-ease),
    transform 0.22s var(--jt-header-ease),
    visibility 0.22s;
}

.jt-header .user-menu-dropdown.open,
.jt-header .user-menu-dropdown:not([hidden]) {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.jt-header .user-menu-dropdown[hidden] {
  display: block;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  pointer-events: none;
}

.jt-header .user-menu-dropdown ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.jt-header .user-menu-dropdown li a {
    display: block;
    padding: 12px 15px;
    min-height: 44px;
    color: #333;
    text-decoration: none !important;
    transition: background-color 0.2s var(--jt-header-ease);
}

.jt-header .user-menu-dropdown li a:hover,
.jt-header .user-menu-dropdown li a:focus-visible {
    background: #f5f5f5;
}

.jt-header .user-menu-dropdown li a:focus-visible {
    outline: 2px solid #385dff;
    outline-offset: 2px;
}

.jt-header .user-menu-toggle .jt-notice-count {
  position: absolute;
  top: -8px;
  right: -10px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--jt-header-badge);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  box-sizing: border-box;
}

.jt-header .jt-notice-count.is-empty {
  display: none;
}

.jt-header .user-menu-dropdown li.jt-notifications-menu-item a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.jt-header .user-menu-dropdown .jt-notice-count {
  flex: 0 0 auto;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--jt-header-badge);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  box-sizing: border-box;
}

/* Mobile toggle */
.jt-header .jt-header__menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--jt-header-text);
  cursor: pointer;
  flex-shrink: 0;
}

.jt-header .jt-header__menu-toggle:focus-visible {
  outline: 2px solid #385dff;
  outline-offset: 2px;
}

.jt-header .jt-header__menu-toggle-icon,
.jt-header .jt-header__menu-toggle-icon::before,
.jt-header .jt-header__menu-toggle-icon::after {
  display: block;
  width: 20px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transition: transform 0.28s var(--jt-header-ease), opacity 0.2s ease, top 0.28s var(--jt-header-ease);
}

.jt-header .jt-header__menu-toggle-icon {
  position: relative;
}

.jt-header .jt-header__menu-toggle-icon::before,
.jt-header .jt-header__menu-toggle-icon::after {
  content: "";
  position: absolute;
  left: 0;
}

.jt-header .jt-header__menu-toggle-icon::before {
  top: -6px;
}

.jt-header .jt-header__menu-toggle-icon::after {
  top: 6px;
}

.jt-header.is-nav-open .jt-header__menu-toggle-icon {
  background: transparent;
}

.jt-header.is-nav-open .jt-header__menu-toggle-icon::before {
  top: 0;
  transform: rotate(45deg);
}

.jt-header.is-nav-open .jt-header__menu-toggle-icon::after {
  top: 0;
  transform: rotate(-45deg);
}

@media (max-width: 991px) {
  .jt-header {
    --jt-header-mobile-height: 64px;
  }

  .jt-header .jt-header__inner {
    flex-wrap: nowrap;
    gap: 0.75rem;
    min-height: var(--jt-header-mobile-height);
    padding-block: 0.5rem;
  }

  .jt-header .jt-header__toolbar {
    margin-left: auto;
    gap: 0.5rem;
  }

  .jt-header .jt-header__actions {
    gap: 0.75rem;
  }

  .jt-header .jt-header__menu-toggle {
    display: inline-flex;
  }

  /* Full-height overlay under the header bar */
  .jt-header .jt-header__nav {
    position: fixed;
    top: var(--jt-header-offset, var(--jt-header-mobile-height));
    left: 0;
    right: 0;
    display: block;
    margin-left: 0;
    width: 100%;
    height: calc(100dvh - var(--jt-header-offset, var(--jt-header-mobile-height)));
    max-height: none;
    padding: 0.75rem var(--jt-gutter, 24px) 1.5rem;
    background: #fff;
    border-bottom: none;
    box-shadow: none;
    z-index: 150;
    overflow-x: hidden;
    overflow-y: auto;
    box-sizing: border-box;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-6px);
    transition:
      opacity 0.28s var(--jt-header-ease),
      transform 0.32s var(--jt-header-ease),
      visibility 0.28s;
  }

  .jt-header.is-nav-open .jt-header__nav {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
  }

  .jt-header .jt-primary-menu {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .jt-header .jt-primary-menu > li {
    display: block;
    width: 100%;
    border-bottom: 1px solid var(--jt-header-border);
  }

  .jt-header .jt-primary-menu > li:last-child {
    border-bottom: none;
  }

  .jt-header .jt-primary-menu > li > a {
    padding: 1rem 0;
    min-height: 44px;
    font-size: 1.0625rem;
  }

  .jt-header .jt-primary-menu .sub-menu {
    position: static;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transform: none;
    transition:
      max-height 0.35s var(--jt-header-ease),
      opacity 0.25s var(--jt-header-ease),
      padding 0.35s var(--jt-header-ease);
  }

  .jt-header .jt-primary-menu > li.is-submenu-open > .sub-menu {
    max-height: 420px;
    opacity: 1;
    padding: 0 0 0.75rem;
  }

  .jt-header .jt-primary-menu .sub-menu a {
    padding: 0.75rem 0 0.75rem 1rem;
    min-height: 44px;
  }
}

@media (max-width: 575px) {
  .jt-header .jt-header__toolbar {
    gap: 0.25rem;
  }

  .jt-header .jt-header__actions {
    gap: 0.65rem;
  }

  .jt-header .jt-header__brand .custom-logo {
    max-height: 40px;
  }

  .jt-header .jt-header__menu-toggle {
    width: 44px;
    height: 44px;
  }
}

.jt-header :is(a, button):focus-visible {
  outline: 3px solid #385dff !important;
  outline-offset: 3px !important;
}

.skip-link:focus,
.skip-link:focus-visible {
  outline: 3px solid #385dff;
  outline-offset: 3px;
}

/* Lock page scroll while the mobile nav is open */
body.jt-nav-open {
  overflow: hidden;
}
