/* Product cards, size controls and shop drawers. */
:root {
  --trs-paper: var(--paper);
  --trs-ink: var(--ink);
  --trs-red: var(--red);
  --trs-muted: var(--muted);
  --trs-rule: var(--stone);
  --trs-plinth: var(--tile);
  --trs-ease: cubic-bezier(.22, 1, .36, 1);
}
.trs-icon { display: inline-block; flex-shrink: 0; vertical-align: middle; }
.trs-visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0;
  margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
.trs-product-card, .trs-product-card *, .trs-drawer, .trs-drawer * { box-sizing: border-box; }
.trs-product-card {
  min-width: 0; align-self: start; color: var(--trs-ink);
  font-family: var(--sans, Arial, sans-serif); text-align: left; position: relative;
}
.trs-product-card [hidden], .trs-drawer [hidden], [data-clear-size][hidden] { display: none !important; }
.trs-product-card a, .trs-drawer a { color: inherit; }
.trs-product-card button, .trs-drawer button, .trs-drawer input, .trs-quick-form select {
  font: inherit; color: inherit;
}
.trs-card-frame { position: relative; aspect-ratio: 1; isolation: isolate; background: var(--trs-plinth); overflow: hidden; }
.trs-card-image { position: absolute; inset: 0; display: block; }
.trs-card-photo { width: 100%; height: 100%; position: absolute; inset: 0; object-fit: contain; mix-blend-mode: multiply; opacity: 0; }
.trs-card-frame[data-photo-index="0"] .trs-photo-0,
.trs-card-frame[data-photo-index="1"] .trs-photo-1,
.trs-card-frame[data-photo-index="2"] .trs-photo-2 { opacity: 1; }
.trs-card-badge {
  position: absolute; top: 10px; left: 10px; padding: 5px 8px;
  background: var(--trs-paper); color: var(--trs-red); font-size: .72rem; line-height: 1.2; font-weight: 600;
}
.trs-icon-button {
  display: inline-grid; place-items: center; padding: 0; min-height: 44px; min-width: 44px;
  background: transparent; border: 0; cursor: pointer;
}
.trs-card-wish { position: absolute; top: 3px; right: 3px; }
.trs-card-wish svg { width: 19px; height: 19px; }
.trs-card-wish[aria-pressed="true"] { color: var(--trs-red); }
.trs-card-wish[aria-pressed="true"] svg { fill: currentColor; }
.trs-card-description { padding: 12px 0 0; }
.trs-card-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; flex-wrap: wrap; }
.trs-card-heading h3 { margin: 0; font: 650 clamp(1rem, 1.3vw, 1.25rem)/1.2 var(--sans); letter-spacing: -.035em; }
.trs-card-heading h3 a { display: inline-flex; align-items: center; min-height: 32px; text-decoration: none; }
.trs-price { font-size: .85rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.trs-price del { color: var(--trs-muted); font-size: .78rem; margin-right: 2px; }
.trs-sale-price { color: var(--trs-red); }
.trs-card-actions { display: flex; justify-content: space-between; align-items: center; gap: 5px; min-width: 0; }
.trs-colour-count { color: var(--trs-muted); font-size: .77rem; }
.trs-card-actions button, .trs-card-actions a {
  border: none; background: transparent; display: inline-flex; align-items: center; justify-content: center;
  gap: 5px; min-height: 44px; padding: 0; font-size: .76rem; font-weight: 500; cursor: pointer; text-decoration: none;
}
.trs-card-actions .trs-icon { width: 14px; height: 14px; }
.trs-size-match { display: inline-flex; min-height: 24px; align-items: center; gap: 5px; color: var(--trs-muted); font-size: .72rem; }
.trs-size-match .trs-icon { width: 13px; height: 13px; }
.trs-photo-dots { position: absolute; display: flex; bottom: 0; left: 50%; transform: translateX(-50%); }
.trs-photo-dots button {
  display: grid; place-items: center; width: 44px; height: 44px; background: transparent; border: 0; padding: 0; cursor: pointer;
}
.trs-photo-dots span {
  width: 6px; height: 6px; border: 1px solid #514d46; border-radius: 100%; background: var(--paper);
}
.trs-photo-dots button[aria-pressed="true"] span { background: var(--trs-ink); }
@media (hover: hover) and (pointer: fine) {
  .trs-photo-dots { display: none; }
  .trs-card-image:has(.trs-photo-1):hover .trs-card-photo { opacity: 0; }
  .trs-card-image:has(.trs-photo-1):hover .trs-photo-1 { opacity: 1; }
  .trs-card-wish:hover, .trs-card-actions :is(a,button):hover, .trs-card-heading a:hover { color: var(--trs-red); }
}
.trs-quick-form { margin-top: 10px; padding-top: 11px; border-top: 1px solid var(--trs-rule); }
.trs-quick-form fieldset { min-width: 0; padding: 0; margin: 0; border: 0; }
.trs-quick-form legend, .trs-quick-colour { font-size: .79rem; font-weight: 600; }
.trs-quick-sizes { display: grid; grid-template-columns: repeat(auto-fit, minmax(74px,1fr)); gap: 4px; margin: 6px 0 12px; max-height: 184px; overflow: auto; overscroll-behavior: contain; }
.trs-quick-sizes label { display: flex; position: relative; min-width: 0; cursor: pointer; }
.trs-quick-sizes input { position: absolute; opacity: 0; margin: 0; width: 1px; height: 1px; }
.trs-quick-sizes span, .trs-size-list a {
  display: flex; align-items: center; justify-content: center; min-height: 44px; border: 1px solid var(--trs-rule);
  color: var(--trs-ink); font-size: .72rem; font-variant-numeric: tabular-nums; text-decoration: none;
}
.trs-quick-sizes span { width: 100%; text-align: center; }
.trs-quick-sizes .trs-preferred span { border-color: var(--trs-red); }
.trs-quick-sizes input:checked + span, .trs-size-list [aria-current="true"] { background: var(--trs-ink); border-color: var(--trs-ink); color: var(--trs-paper); }
.trs-quick-sizes input:focus-visible + span { outline: 2px solid var(--trs-red); outline-offset: -3px; }
.trs-quick-colour { display: grid; gap: 6px; margin-bottom: 10px; }
.trs-quick-colour select { max-width: 100%; height: 44px; padding: 0 6px; border: 1px solid var(--trs-rule); border-radius: 0; background: var(--trs-paper); }
.trs-primary, .trs-drawer .trs-primary {
  display: inline-flex; justify-content: center; align-items: center; gap: 10px; padding: 11px 18px; min-height: 44px;
  background: var(--trs-ink); border: 1px solid var(--trs-ink); color: var(--trs-paper); font-size: .87rem;
  font-weight: 500; text-decoration: none; cursor: pointer; text-align: center; line-height: 1.3;
}
.trs-primary .trs-icon { width: 17px; height: 17px; }
.trs-quick-form .trs-primary { width: 100%; color: var(--trs-paper); }
.trs-drawer-visible { overflow: hidden; }
.trs-drawer {
  color: var(--trs-ink); background: var(--trs-paper); font: 400 1rem/1.5 var(--sans, Arial, sans-serif);
  position: fixed; top: 0; right: 0; bottom: 0; left: auto; width: min(480px, 100%);
  height: 100vh; height: 100dvh; max-height: 100dvh; max-width: 100%; padding: 0; margin: 0;
  overflow: hidden; border: 0; box-shadow: -10px 0 70px rgb(33 31 27 / .08);
}
.trs-drawer[open] { display: flex; flex-direction: column; }
.trs-drawer::backdrop { background: rgb(24 22 18 / .44); }
.trs-drawer-header { display: flex; align-items: center; justify-content: space-between; padding: 20px clamp(18px, 4vw, 32px); gap: 10px; border-bottom: 1px solid var(--trs-rule); }
.trs-drawer-header h2 { font: 700 clamp(1.65rem, 4vw, 2.2rem)/1.1 var(--sans); letter-spacing: -.055em; margin: 0; }
.trs-drawer-body { overflow: auto; overscroll-behavior: contain; padding: 22px clamp(18px, 4vw, 32px) max(40px, env(safe-area-inset-bottom)); }
.trs-drawer-body h3 { font: 400 1.5rem/1.15 var(--sans); letter-spacing: -.035em; margin: 22px 0 10px; }
.trs-drawer-body h3:first-child, .trs-drawer-body p:first-child { margin-top: 0; }
.trs-drawer-body p, .trs-guide-steps { font-size: .91rem; color: var(--trs-muted); }
.trs-drawer-intro { margin: 0 0 20px; }
.trs-size-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.trs-size-list a { min-height: 48px; font-size: .81rem; }
.trs-drawer-links { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 4px 16px; margin-top: 17px; }
.trs-drawer-links :is(button,a), .trs-text-link, .trs-remove {
  background: transparent; border: 0; padding: 0; min-height: 44px; display: inline-flex; align-items: center; gap: 7px;
  cursor: pointer; font-size: .83rem; text-decoration: underline; text-underline-offset: 4px;
}
.trs-drawer-links .trs-icon, .trs-added .trs-icon { width: 16px; height: 16px; }
.trs-guide-steps { padding-left: 23px; }
.trs-guide-steps li + li { margin-top: 7px; }
.trs-size-chart { width: 100%; border-collapse: collapse; font-size: .87rem; font-variant-numeric: tabular-nums; }
.trs-size-chart caption { text-align: left; font: normal 1.5rem/1.1 var(--sans); margin: 12px 0; }
.trs-size-chart td, .trs-size-chart th { padding: 8px; text-align: left; border-bottom: 1px solid var(--trs-rule); }
.trs-size-chart thead th { background: var(--trs-plinth); color: var(--trs-ink); font-size: .76rem; }
.trs-size-chart tbody th { font-weight: 500; }
.trs-cart-line { display: grid; grid-template-columns: 80px minmax(0, 1fr); align-items: flex-start; gap: 13px; padding: 16px 0; border-bottom: 1px solid var(--trs-rule); }
.trs-cart-photo, .trs-search-result > span { aspect-ratio: 1; display: block; background: var(--trs-plinth); }
.trs-cart-photo img, .trs-search-result img { display: block; width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.trs-line-title { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.trs-line-title > a, .trs-search-result b { font: normal 1.4rem/1.15 var(--sans); text-decoration: none; }
.trs-line-title > span { font-size: .85rem; }
.trs-cart-line p { margin: 3px 0 0; font-size: .79rem; }
.trs-qty { display: flex; align-items: center; }
.trs-qty .trs-icon { width: 15px; height: 15px; }
.trs-qty > span { text-align: center; font-size: .87rem; min-width: 14px; }
.trs-drawer .trs-remove { margin-left: auto; font-size: .73rem; color: var(--trs-muted); }
.trs-bag-summary { margin-top: 28px; }
.trs-bag-summary > div { display: flex; justify-content: space-between; }
.trs-bag-summary > div strong { font-weight: 500; }
.trs-bag-summary p { display: flex; gap: 9px; align-items: center; margin: 12px 0 20px; font-size: .83rem; }
.trs-bag-summary .trs-primary, .trs-bag-summary .trs-text-link { width: 100%; justify-content: center; }
.trs-drawer .trs-added { display: flex; align-items: center; gap: 7px; margin: 0; color: var(--trs-red); font-size: .86rem; }
.trs-added .trs-icon { fill: currentColor; }
.trs-empty { padding: 38px 0; text-align: center; }
.trs-empty > .trs-icon { width: 34px; height: 34px; }
.trs-empty .trs-primary { margin-top: 10px; }
.trs-search-field { display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--trs-ink); padding-bottom: 5px; }
.trs-search-field input { min-width: 0; width: 100%; min-height: 44px; padding: 6px; border: 0; border-radius: 0; color: var(--trs-ink); background: transparent; font-size: 16px; }
.trs-popular { display: flex; flex-wrap: wrap; gap: 8px; }
.trs-popular button { border: 1px solid var(--trs-rule); background: transparent; min-height: 44px; display: flex; align-items: center; gap: 8px; padding: 7px 12px; cursor: pointer; font-size: .83rem; }
.trs-popular svg, .trs-search-result > .trs-icon { width: 16px; height: 16px; }
.trs-search-count { margin: 16px 0 4px !important; }
.trs-search-result { display: grid; grid-template-columns: 68px 1fr 18px; gap: 14px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--trs-rule); text-decoration: none; }
.trs-search-result small { display: block; color: var(--trs-muted); margin-top: 4px; }
.trs-product-card :is(a,button,select):focus-visible, .trs-drawer :is(a,button,input):focus-visible { outline: 2px solid var(--trs-red); outline-offset: 2px; }
.trs-card-image:focus-visible { outline-offset: -3px !important; }
@media (hover: hover) {
  .trs-size-list a:hover, .trs-quick-sizes label:hover span, .trs-popular button:hover { border-color: var(--trs-ink); }
  .trs-search-result:hover b, .trs-drawer-links :is(button,a):hover { color: var(--trs-red); }
  .trs-primary:hover { opacity: .9; }
}
@media (max-width: 540px) {
  .trs-card-description { padding-top: 7px; }
  .trs-card-heading { display: block; }
  .trs-card-heading h3 { font-size: 1rem; }
  .trs-card-heading h3 a { min-height: 44px; }
  .trs-card-heading .trs-price { display: block; margin-top: -3px; }
  .trs-card-actions { margin-top: 2px; }
  .trs-card-actions :is(a,button), .trs-colour-count { font-size: .71rem; }
  .trs-card-badge { top: 7px; left: 7px; font-size: .67rem; }
  .trs-card-wish { right: 0; top: 0; }
  .trs-quick-colour select { font-size: 16px; }
}
@media (prefers-reduced-motion: no-preference) {
  .trs-card-photo { transition: opacity 180ms ease-out; }
  .trs-drawer[open] { animation: trs-drawer-in 250ms var(--trs-ease) both; }
  .trs-drawer[open]::backdrop { animation: trs-fade-in 220ms ease-out both; }
  .trs-drawer.trs-closing { animation: trs-drawer-out 150ms ease-in both; }
  .trs-drawer.trs-closing::backdrop { animation: trs-fade-out 150ms ease-in both; }
  .trs-quick-form { animation: trs-enter 180ms var(--trs-ease) both; }
  .trs-tick, .trs-size-set { display: inline-block; animation: trs-enter 240ms var(--trs-ease) both; }
  .trs-heartbeat .trs-icon, .trs-added .trs-icon { animation: trs-beat 270ms var(--trs-ease) both; }
  .trs-quick-sizes input:checked + span, .trs-size-list a:active { animation: trs-select 130ms var(--trs-ease); }
  @keyframes trs-beat { 45% { transform: scale(1.22); } }
  @keyframes trs-select { 35% { transform: scale(.96); } }
  @keyframes trs-enter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
  @keyframes trs-drawer-in { from { transform: translateX(100%); } to { transform: translateX(0); } }
  @keyframes trs-drawer-out { to { transform: translateX(100%); } }
  @keyframes trs-fade-in { from { opacity: 0; } to { opacity: 1; } }
  @keyframes trs-fade-out { to { opacity: 0; } }
}

.card-quick {
  position: absolute; z-index: 2; inset: auto 6px 6px auto;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  min-width: 44px; height: 44px; background: white; border: var(--line);
  font-size: .84rem; font-weight: 650; border-radius: 2px;
}
.card-quick span:first-child { font-size: 20px; font-weight: 450; }
.card-quick span:last-child { display: none; }
.trs-photo-dots { left: 0; transform: none; }
.trs-photo-dots button { width: 24px; height: 36px; }
@media (hover:hover) and (pointer:fine) {
  .card-quick { left: 6px; opacity: 0; }
  .card-quick span:last-child { display: inline; }
  .trs-product-card:is(:hover,:focus-within,[data-quick-open]) .card-quick { opacity: 1; }
}
