/* Cart and login controls shared by the desktop header and mobile shell. */

@media (min-width: 1024px) {
  #header .right-head .cart {
    height: 58px;
    margin-top: 25px;
    margin-right: 1px;
    padding: 0;
    background: none;
    box-shadow: none;
    font-size: inherit;
    line-height: normal;
  }

  #header .right-head .cart::before {
    content: none;
  }

  #header .right-head .cart a.ns-cart-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    box-sizing: border-box;
    min-width: 52px;
    min-height: 58px;
    padding: 0 5px;
    color: var(--d-top-ink);
    font: 600 17px/1 var(--d-font);
    text-decoration: none;
  }

  #header .right-head .cart a.ns-cart-link:hover {
    color: var(--d-top-hover);
  }

  #header .right-head .cart a.ns-cart-link:focus-visible {
    outline: var(--d-focus-w) solid var(--d-focus-on-dark);
    outline-offset: 2px;
    border-radius: var(--d-radius);
  }

  #header .right-head .navigation a.ns-login-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-height: 44px;
    margin: -12px 0;
    padding: 0 16px;
    border-radius: var(--d-radius);
    background: #464646;
    box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.22);
    color: #fff;
    font: 600 13px/1 var(--d-font);
    text-decoration: none;
    vertical-align: middle;
  }

  #header .right-head .navigation a.ns-login-link:hover,
  #header .right-head .navigation a.ns-login-link[aria-current="page"] {
    background: #585858;
    box-shadow: inset 0 0 0 2px rgb(255 255 255 / 0.55);
    color: #fff;
    text-decoration: none;
  }

  #header .right-head .navigation a.ns-login-link:focus,
  #header .right-head .navigation a.ns-login-link:focus-visible {
    outline: var(--d-focus-w) solid var(--d-focus-on-dark);
    outline-offset: 3px;
  }
}

.ns-cart-link__icon,
.ns-tab--cart .ns-tab__icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.ns-cart-link__icon svg {
  display: block;
  width: 29px;
  height: 29px;
}

.ns-cart-link__count[hidden],
.ns-tab--cart .ns-badge[hidden] {
  display: none;
}

@media (max-width: 1023px) {
  .ns-tab--cart .ns-tab__icon {
    justify-content: center;
    min-width: 0;
    max-width: 100%;
  }

  .ns-tab--cart .ns-badge {
    position: static;
    display: inline;
    flex: none;
    min-width: 0;
    height: auto;
    padding: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    color: var(--m-ink);
    font: 700 11px/1.1 var(--m-font);
  }

  .ns-drawer .ns-nav__list a.ns-login-link {
    justify-content: center;
    box-sizing: border-box;
    min-height: 44px;
    margin: 6px 20px;
    padding: 0 12px;
    border-radius: var(--m-radius);
    background: #464646;
    box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.22);
    color: #fff;
    font-weight: 600;
  }

  .ns-drawer .ns-nav__list a.ns-login-link svg {
    color: #fff;
  }

  .ns-drawer .ns-nav__list a.ns-login-link:hover,
  .ns-drawer .ns-nav__list a.ns-login-link[aria-current="page"] {
    background: #585858;
    color: #fff;
  }

  .ns-drawer .ns-nav__list a.ns-login-link:focus,
  .ns-drawer .ns-nav__list a.ns-login-link:focus-visible {
    outline: 2px solid #2d2d2d;
    outline-offset: 2px;
  }

  .ns-tabs .ns-tab.ns-login-link {
    box-sizing: border-box;
    min-height: 44px;
    margin: 5px 2px;
    border-radius: var(--m-radius);
    background: #464646;
    box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.22);
    color: #fff;
    font-weight: 600;
  }

  .ns-tabs .ns-tab.ns-login-link:hover,
  .ns-tabs .ns-tab.ns-login-link[aria-current="page"] {
    background: #585858;
    color: #fff;
  }

  .ns-tabs .ns-tab.ns-login-link:focus,
  .ns-tabs .ns-tab.ns-login-link:focus-visible {
    outline: 2px solid #2d2d2d;
    outline-offset: 2px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  [data-ns-cart-count].ns-cart-sparkle .ns-cart-link__icon svg,
  [data-ns-cart-count].ns-cart-sparkle .ns-tab__icon svg {
    animation: ns-cart-pop 720ms ease-out both;
  }

  [data-ns-cart-count].ns-cart-sparkle .ns-cart-link__icon::before,
  [data-ns-cart-count].ns-cart-sparkle .ns-cart-link__icon::after,
  [data-ns-cart-count].ns-cart-sparkle .ns-tab__icon::before,
  [data-ns-cart-count].ns-cart-sparkle .ns-tab__icon::after {
    position: absolute;
    z-index: 1;
    color: #f9bd00;
    font-size: 13px;
    line-height: 1;
    pointer-events: none;
    animation: ns-cart-spark 720ms ease-out both;
  }

  [data-ns-cart-count].ns-cart-sparkle .ns-cart-link__icon::before,
  [data-ns-cart-count].ns-cart-sparkle .ns-tab__icon::before {
    content: "✦";
    top: -6px;
    left: -7px;
  }

  [data-ns-cart-count].ns-cart-sparkle .ns-cart-link__icon::after,
  [data-ns-cart-count].ns-cart-sparkle .ns-tab__icon::after {
    content: "✧";
    top: -10px;
    right: -6px;
    animation-delay: 80ms;
  }

  @keyframes ns-cart-pop {
    0% {
      transform: scale(1);
    }
    35% {
      transform: scale(1.25);
    }
    100% {
      transform: scale(1);
    }
  }

  @keyframes ns-cart-spark {
    0% {
      opacity: 0;
      transform: translateY(3px) scale(0.5);
    }
    30% {
      opacity: 1;
    }
    100% {
      opacity: 0;
      transform: translateY(-9px) scale(1.1);
    }
  }
}
