/* Stable shared navigation for React/hash and WordPress/WooCommerce pages. */

@view-transition {
  navigation: auto;
}

::view-transition-group(tc-tryycart-header) {
  animation-duration: 0.01s;
}

::view-transition-old(root) {
  animation: tc-route-out 0.14s ease both;
}

::view-transition-new(root) {
  animation: tc-route-in 0.2s ease both;
}

body .tc-site-chrome.tc-site-chrome {
  position: relative;
  z-index: 2000;
}

body .tc-site-chrome.tc-site-chrome .tc-utility-bar,
body .tc-site-chrome.tc-site-chrome .tc-utility-inner {
  height: 38px;
  min-height: 38px;
}

body .tc-site-chrome.tc-site-chrome .tc-main-header {
  view-transition-name: tc-tryycart-header;
  position: sticky;
  top: 0;
  height: 76px;
  min-height: 76px;
  isolation: isolate;
}

body.admin-bar .tc-site-chrome.tc-site-chrome .tc-main-header {
  top: 32px;
}

body .tc-site-chrome.tc-site-chrome .tc-nav-inner {
  display: grid;
  height: 76px;
  min-height: 76px;
  grid-template-columns: 190px minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
}

body .tc-site-chrome.tc-site-chrome .tc-site-logo {
  width: 142px;
  height: 42px;
  flex: 0 0 142px;
}

body .tc-site-chrome.tc-site-chrome .tc-site-logo img {
  width: 142px;
  height: auto;
  max-width: 142px;
}

body .tc-site-chrome.tc-site-chrome .tc-desktop-nav {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-self: center;
}

body .tc-site-chrome.tc-site-chrome .tc-desktop-nav a,
body .tc-site-chrome.tc-site-chrome .tc-desktop-nav a:hover,
body .tc-site-chrome.tc-site-chrome .tc-desktop-nav a:focus-visible {
  transform: none;
}

body
  .tc-site-chrome.tc-site-chrome:not(.tc-route-ready)
  .tc-desktop-nav
  a.active {
  background: transparent;
  box-shadow: none;
  color: #46566d;
}

body
  .tc-site-chrome.tc-site-chrome:not(.tc-route-ready)
  .tc-desktop-nav
  a.active
  i {
  color: var(--tc-blue);
}

body .tc-site-chrome.tc-site-chrome .tc-nav-actions {
  display: flex;
  min-width: max-content;
  height: 44px;
  align-items: center;
  gap: 8px;
  justify-self: end;
}

body .tc-site-chrome.tc-site-chrome .tc-nav-actions .icon-action {
  position: relative;
  display: inline-flex;
  overflow: visible;
  width: 40px;
  min-width: 40px;
  height: 40px;
  flex: 0 0 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid #c8d3df;
  padding: 0;
  font-size: 19px;
  line-height: 1;
}

body .tc-site-chrome.tc-site-chrome .icon-action > span:first-child {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  line-height: 1;
}

body .tc-site-chrome.tc-site-chrome .icon-action .badge {
  position: absolute;
  top: 3px;
  right: 3px;
  display: flex;
  width: 15px;
  min-width: 15px;
  height: 15px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.94);
  margin: 0;
  padding: 0 2px;
  font-size: 8px;
  line-height: 13px;
  transform: none;
}

body .tc-site-chrome.tc-site-chrome .icon-action .badge[hidden] {
  display: none !important;
}

body .tc-site-chrome.tc-site-chrome .nav-signup {
  flex: 0 0 auto;
  white-space: nowrap;
}

/*
 * The full labelled navigation is wider than the centre grid track on common
 * 1280–1400px laptops. Compact it before it can enter the protected account
 * action column. The labels stay visible; only their decorative icons collapse.
 */
@media (max-width: 1420px) and (min-width: 1021px) {
  body .tc-site-chrome.tc-site-chrome .tc-nav-inner {
    grid-template-columns: 160px minmax(0, 1fr) 260px;
    gap: 14px;
  }

  body .tc-site-chrome.tc-site-chrome .tc-desktop-nav {
    width: 100%;
    max-width: 100%;
    justify-content: center;
    justify-self: stretch;
    padding: 4px;
  }

  body .tc-site-chrome.tc-site-chrome .tc-desktop-nav a {
    gap: 0;
    min-width: 0;
    padding-inline: 9px;
  }

  body .tc-site-chrome.tc-site-chrome .tc-desktop-nav i {
    display: none;
  }

  body .tc-site-chrome.tc-site-chrome .tc-nav-actions {
    width: 260px;
    min-width: 260px;
  }
}

html.tc-content-leaving
  body.tryycart-global-theme
  :is(#tryycart-app, .tc-service-page, .tc-wp-main) {
  opacity: 0;
  transform: translateY(3px);
  transition:
    opacity 0.11s ease,
    transform 0.11s ease;
}

html.tc-content-arriving
  body.tryycart-global-theme
  :is(#tryycart-app, .tc-service-page, .tc-wp-main) {
  animation: tc-route-in 0.2s ease both;
}

@keyframes tc-route-out {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@keyframes tc-route-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1160px) {
  body .tc-site-chrome.tc-site-chrome .tc-nav-inner {
    grid-template-columns: 155px minmax(0, 1fr) auto;
    gap: 14px;
  }

  body .tc-site-chrome.tc-site-chrome .tc-site-logo,
  body .tc-site-chrome.tc-site-chrome .tc-site-logo img {
    width: 136px;
    max-width: 136px;
  }
}

@media (max-width: 1020px) {
  body .tc-site-chrome.tc-site-chrome .tc-nav-inner {
    display: flex;
    justify-content: space-between;
  }

  body .tc-site-chrome.tc-site-chrome .tc-desktop-nav {
    display: none;
  }

  body .tc-site-chrome.tc-site-chrome .tc-nav-actions {
    width: auto;
    min-width: max-content;
  }
}

@media (max-width: 782px) {
  body.admin-bar .tc-site-chrome.tc-site-chrome .tc-main-header {
    top: 46px;
  }

  body .tc-site-chrome.tc-site-chrome .tc-main-header,
  body .tc-site-chrome.tc-site-chrome .tc-nav-inner {
    height: 68px;
    min-height: 68px;
  }

  body .tc-site-chrome.tc-site-chrome .tc-nav-actions .icon-action {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: none;
  }

  html.tc-content-leaving
    body.tryycart-global-theme
    :is(#tryycart-app, .tc-service-page, .tc-wp-main),
  html.tc-content-arriving
    body.tryycart-global-theme
    :is(#tryycart-app, .tc-service-page, .tc-wp-main) {
    animation: none;
    opacity: 1;
    transform: none;
    transition: none;
  }
}
