/**
 * Cart drawer — per the "Cart drawer, mobile" wireframe (05).
 * Mobile (≤720): full-bleed panel, exactly the 390×844 wireframe.
 * Desktop: same drawer as a 420px right-side panel (sibling-theme pattern).
 * The shared drawer shell + overlay live in style.css §9; this file adds
 * the right-side variant and every .ustd-cart* component.
 */

/* Right-side variant of the shared drawer shell. */
.ustd-drawer--right {
  left: auto;
  right: 0;
  transform: translateX(100%);
}
.ustd-drawer--right.is-open { transform: translateX(0); }

.ustd-cart-drawer {
  background: var(--ustd-cream-2); /* wireframe #FFFDFA */
  color: var(--usr-ink);
  overflow-wrap: anywhere;
}
@media (max-width: 720px) {
  .ustd-cart-drawer { width: 100vw; max-width: none; }
}

/* Head — 64px, paper hairline, navy 20/26 medium title, 44px close. */
.ustd-cart__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: auto;
  min-height: 64px;
  flex-shrink: 0;
  padding: 9px 12px 9px 24px;
  border-bottom: 1px solid var(--ustd-hairline-paper);
}
.ustd-cart__title {
  min-width: 0;
  margin: 0;
  color: var(--usr-navy);
  font-size: 20px;
  line-height: 26px;
  font-weight: 500;
  letter-spacing: var(--usr-ls-heading);
}
.ustd-cart__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  padding: 0;
  border: 0;
  border-radius: var(--usr-radius-pill);
  background: none;
  color: var(--usr-ink);
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.ustd-cart__close:hover { background: rgba(19, 38, 107, 0.08); }

/* Fragment-swapped wrapper fills the aside below the head. */
.ustd-cart {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}
.ustd-cart-drawer.is-updating .ustd-cart {
  opacity: 0.55;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.ustd-cart__scroll {
  display: flex;
  flex-direction: column;
  flex: 1;
  /* Reserve a usable item viewport; oversized footer copy scrolls with the body. */
  min-height: min(12rem, 40vh);
  min-height: min(12rem, 40dvh);
  overflow-y: auto;
}
.ustd-cart__grow { flex: 1 0 24px; }

/* Free-US-shipping strip — cream panel, 6px navy progress. */
.ustd-cart__ship {
  flex-shrink: 0;
  padding: 16px 24px;
  background: var(--usr-cream); /* wireframe #FDF8F0 */
  border-bottom: 1px solid var(--ustd-hairline-paper);
}
.ustd-cart__ship-msg { margin: 0; font-size: 14px; line-height: 20px; }
.ustd-cart__ship-msg strong { font-weight: 700; }
.ustd-cart__ship-track {
  height: 6px;
  margin-top: 10px;
  border-radius: 3px;
  background: var(--ustd-hairline-paper);
  overflow: hidden;
}
.ustd-cart__ship-fill { height: 6px; background: var(--usr-navy); }

/* Error notice (qty validation) — inserted above the items by site.js. */
.ustd-cart__error {
  flex-shrink: 0;
  margin: 12px 24px 0;
  padding: 10px 14px;
  border-radius: var(--usr-radius);
  background: var(--usr-tint-red);
  color: var(--usr-red);
  font-size: 13px;
  line-height: 18px;
}

/* Line items. */
.ustd-cart__items {
  list-style: none;
  margin: 0;
  padding: 0 24px;
  flex-shrink: 0;
}
.ustd-cart__item {
  display: flex;
  gap: 14px;
  padding: 20px 0;
  border-bottom: 1px solid var(--ustd-hairline-paper);
}
.ustd-cart__item-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 88px;
  height: 88px;
  flex-shrink: 0;
  background: var(--usr-well);
}
.ustd-cart__item-thumb img { width: 64px; height: 64px; object-fit: contain; }
.ustd-cart__item-main {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  min-width: 0;
}
.ustd-cart__item-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.ustd-cart__item-name {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--usr-ink);
  font-size: 16px;
  line-height: 22px;
  font-weight: 500;
  text-decoration: none;
}
.ustd-cart__item-name:hover { text-decoration: underline; }
.ustd-cart__item-price {
  font-size: 16px;
  line-height: 22px;
  font-weight: 700;
  min-width: 0;
  max-width: 100%;
  white-space: normal;
}
.ustd-cart__item-meta {
  margin: 2px 0 0;
  color: var(--ustd-grey-mid);
  font-size: 13px;
  line-height: 18px;
}
.ustd-cart__item-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
}
.ustd-cart__qty {
  display: flex;
  max-width: 100%;
  align-items: center;
  min-height: 44px;
  border: 1px solid #CFC5B4; /* wireframe stepper border */
  border-radius: 22px;
}
.ustd-cart__qty-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 42px;
  flex: 0 0 40px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--usr-ink);
  cursor: pointer;
}
.ustd-cart__qty-value {
  min-width: 16px;
  text-align: center;
  font-size: 15px;
  font-weight: 500;
}
.ustd-cart__remove {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  min-height: 44px;
  padding: 0 4px;
  color: var(--ustd-grey-mid);
  font-size: 13px;
  text-decoration: underline;
  border: 0;
  background: none;
  cursor: pointer;
}

/* Cross-sell — "Pairs well with your order". */
.ustd-cart__pairs { flex-shrink: 0; padding: 20px 24px 0; }
.ustd-cart__pairs-label { font-size: 14px; line-height: 20px; font-weight: 500; }
.ustd-cart__pairs-card {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 12px;
  background: var(--usr-white);
  border: 1px solid var(--ustd-hairline-paper);
}
.ustd-cart__pairs-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  background: var(--usr-well);
}
.ustd-cart__pairs-thumb img { width: 42px; height: 42px; object-fit: contain; }
.ustd-cart__pairs-info {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  min-width: 0;
}
.ustd-cart__pairs-name {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--usr-ink);
  font-size: 15px;
  line-height: 20px;
  font-weight: 500;
  text-decoration: none;
}
.ustd-cart__pairs-name:hover { text-decoration: underline; }
.ustd-cart__pairs-price { color: var(--ustd-grey-mid); font-size: 13px; line-height: 18px; }
.ustd-cart__pairs-add {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 11px 18px;
  flex-shrink: 0;
  border: 1px solid var(--usr-navy);
  border-radius: 22px;
  color: var(--usr-navy);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}
.ustd-cart__pairs-add:hover { background: var(--usr-tint-blue); }

/* Pinned foot. */
.ustd-cart__foot {
  flex-shrink: 0;
  padding: 20px 24px 28px;
  background: var(--usr-white);
  border-top: 1px solid var(--ustd-hairline-paper);
}
.ustd-cart__subtotal {
  display: flex;
  justify-content: space-between;
  font-size: 16px;
  line-height: 22px;
}
.ustd-cart__subtotal-label { font-weight: 500; }
.ustd-cart__subtotal-amount { font-weight: 700; }
.ustd-cart__foot-note {
  margin: 6px 0 0;
  color: var(--ustd-grey-mid);
  font-size: 13px;
  line-height: 18px;
}
.ustd-cart__checkout {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 56px;
  padding: 16px 20px;
  line-height: 24px;
  text-align: center;
  overflow-wrap: anywhere;
  margin-top: 16px;
  border-radius: 28px;
  background: var(--usr-navy);
  color: var(--usr-white);
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.15s ease;
}
.ustd-cart__checkout:hover { background: #0E1D52; color: #FFF; }
.ustd-cart__checkout:focus { color: #FFF; }
.ustd-cart__payments {
  margin: 12px 0 0;
  color: var(--ustd-grey-mid);
  font-size: 13px;
  line-height: 18px;
  text-align: center;
}

/* Empty state. */
.ustd-cart__scroll--empty {
  align-items: center;
  justify-content: center;
  justify-content: safe center;
  gap: 16px;
  padding: 40px 24px;
  text-align: center;
}
.ustd-cart__empty-msg { margin: 0; color: var(--usr-ink); font-size: 16px; line-height: 24px; }
.ustd-cart__scroll--empty > * { min-width: 0; max-width: 100%; }
.ustd-cart__empty-cta {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 11px 22px;
  line-height: 20px;
  border: 1px solid var(--usr-navy);
  border-radius: 22px;
  color: var(--usr-navy);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}
.ustd-cart__empty-cta:hover { background: var(--usr-tint-blue); }

/* Direct port of the preserved Research menu, with the .us logo and field.
   Text rows use Research's intrinsic sizing so longer labels remain visible. */
#ustd-menu-drawer {
  font-family: "Aeonik", Arial, sans-serif;
  top: 0;
  bottom: auto;
  width: 100vw;
  max-width: none;
  height: 100vh;
  height: 100dvh;
  /* Native House image fill 147:433; shared with the home chapter. */
  background: #4944a5 url(../design/home-chapter.webp) center / cover no-repeat;
  color: #FFFFFF;
}
#ustd-menu-drawer .ustd-menu-drawer__head {
  height: auto;
  min-height: 60px;
  padding: 8px;
  border: 0;
  background: transparent;
}
.ustd-menu-drawer__logo {
  display: flex;
  align-items: center;
  gap: 0;
  width: 155.177px;
  height: 44px;
  color: #FFFFFF;
  font-size: 20px;
  font-weight: 500;
  line-height: 23px;
  text-decoration: none;
  white-space: nowrap;
}
.ustd-menu-drawer__logo:hover,
.ustd-menu-drawer__logo:focus { color: #FFFFFF; text-decoration: none; }
#ustd-menu-drawer .ustd-drawer__close {
  width: 44px;
  height: 44px;
  margin: 0;
  border-radius: 0;
  color: #FFFFFF;
}
#ustd-menu-drawer .ustd-drawer__close:hover { background: rgba(255, 255, 255, 0.1); }
.ustd-menu-drawer__body {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 0;
  color: #FFFFFF;
  overscroll-behavior: contain;
}
.ustd-menu-drawer__primary {
  flex: 0 0 auto;
  padding: 16px 24px 12px;
}
.ustd-menu-drawer__primary a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: auto;
  min-height: 60px;
  padding: 16px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  color: #FFFFFF;
  font-size: 21px;
  font-weight: 500;
  line-height: 27px;
  text-decoration: none;
}
.ustd-menu-drawer__primary a:hover,
.ustd-menu-drawer__primary a:focus { color: #FFFFFF; text-decoration: none; }
.ustd-menu-drawer__primary a > span:last-child { font-size: 16px; font-weight: 400; line-height: 24px; }
.ustd-menu-drawer__primary a > span:first-child { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.ustd-menu-drawer__primary a > span:last-child { flex: none; width: .625em; }
.ustd-menu-drawer__accordions {
  flex: 0 0 auto;
  padding: 16px 24px 24px;
}
.ustd-menu-accordion { border: 0; }
.ustd-menu-accordion__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: auto;
  min-height: 54px;
  padding: 16px 0;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  background: transparent;
  color: #FFFFFF;
  font-size: 15px;
  font-weight: 400;
  line-height: 21px;
  text-align: left;
  cursor: pointer;
}
.ustd-menu-accordion__toggle > span:first-child { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.ustd-menu-accordion__mark { flex: none; width: .529411765em; font-size: 17px; font-weight: 500; line-height: 21px; }
[aria-expanded="true"] .ustd-menu-accordion__mark { width: .647058824em; }
.ustd-menu-accordion__panel { padding: 6px 0 12px 2px; }
.ustd-menu-accordion__panel[hidden] { display: none; }
.ustd-menu-accordion__panel a,
.ustd-menu-accordion__text {
  display: flex;
  align-items: center;
  height: auto;
  min-height: 45px;
  padding: 12px 0;
  color: #FFFFFF;
  font-size: 15px;
  font-weight: 400;
  line-height: 21px;
  text-decoration: none;
  overflow-wrap: anywhere;
  opacity: .75;
}
.ustd-menu-accordion__panel a:hover,
.ustd-menu-accordion__panel a:focus { color: #FFFFFF; text-decoration: underline; }
.ustd-menu-drawer__utilities {
  flex: 0 0 auto;
  margin-top: auto;
  padding: 20px 24px 24px;
  background: rgba(255,255,255,.08);
}
.ustd-menu-drawer__utilities > a {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  height: auto;
  min-height: 46px;
  gap: 12px;
  padding: 12px 0;
  border: 0;
  background: transparent;
  color: #FFFFFF;
  font-size: 16px;
  font-weight: 500;
  line-height: 22px;
  text-decoration: none;
}
.ustd-menu-drawer__utilities > a:hover,
.ustd-menu-drawer__utilities > a:focus { color: #FFFFFF; text-decoration: none; }
.ustd-menu-drawer__utilities > a > span:not(.ustd-cart-count) { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.ustd-menu-drawer__utilities :is(svg,img) { flex: 0 0 22px; width: 22px; height: 22px; }
#ustd-menu-drawer :is(.ustd-menu-drawer__primary a,.ustd-menu-accordion__toggle,.ustd-menu-drawer__utilities > a):hover { background: rgba(255,255,255,.08); }
#ustd-menu-drawer :is(a,button):focus-visible { outline: 2px solid #9FBEFF; outline-offset: 2px; }
html[data-ustd-font-rendering="windows"] #ustd-menu-drawer,
html[data-ustd-font-rendering="windows"] #ustd-menu-drawer button { font-family: "Aeonik Screen", "Aeonik", Arial, sans-serif; }
html[data-ustd-font-rendering="windows"] #ustd-menu-drawer :is(.ustd-menu-drawer__primary a > span,.ustd-menu-accordion__toggle > span,.ustd-menu-accordion__panel a,.ustd-menu-accordion__text,.ustd-menu-drawer__utilities > a > span:not(.screen-reader-text)) { filter: url(#ustd-text-edge-alpha); }
@media (prefers-reduced-motion: reduce) { #ustd-menu-drawer { transition: none; } }

/* House: contained product imagery, regular navy prices and reachable controls. */
.ustd-cart__item-thumb {border-radius:12px;background:#EAF1FD;overflow:hidden;}
.ustd-cart__item-thumb img {width:100%;height:100%;object-fit:contain;}
.ustd-cart__item-name,.ustd-cart__item-price {font-weight:400;}
.ustd-cart__item-price {color:#13266B;}
.ustd-cart-drawer :is(a,button,input):focus-visible {outline:2px solid #264BD0;outline-offset:3px;}
