/* Shop parts the kit does not have: the script wordmark, the cart, the colour swatches, the add-to-cart rows. Tokens only. */
.nav__logo img.brand-logo { height: 30px; width: auto; }
.footer .nav__logo img.brand-logo--lg { height: 48px; }
@media (max-width: 639px) { .nav__logo img.brand-logo { height: 24px; } .footer .nav__logo img.brand-logo--lg { height: 34px; } }

.cart-open { display: inline-flex; align-items: center; gap: var(--s-2); background: none; border: 0; padding: 0; min-height: 44px; font: inherit; color: inherit; cursor: pointer; }
.cart-count { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 var(--s-2); border-radius: 12px;
  background: var(--surface); color: var(--ink); font: 500 var(--t-label)/1 var(--font-text); font-variant-numeric: tabular-nums; }

/* the order card beside the cap */
.order { display: grid; gap: var(--s-5); align-content: start; }
.order__price { display: grid; gap: var(--s-1); margin: 0; }
.order__amount { font: var(--display-weight) var(--t-h2)/1 var(--font-display); letter-spacing: var(--display-tracking); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.thumbs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-3); margin-top: var(--s-3); }
.thumb { padding: 0; border: 0; border-radius: var(--r-md); overflow: clip; aspect-ratio: 1; background: var(--surface); cursor: pointer; }
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 600ms var(--ease); }
@media (hover: hover) and (pointer: fine) { .thumb:hover img { transform: scale(1.03); } }
.swatches { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s-3); }
.swatches legend { padding: 0; margin-bottom: var(--s-3); }
.swatch { position: relative; display: inline-flex; align-items: center; gap: var(--s-2); min-height: 44px; padding: 0 var(--s-4) 0 var(--s-2);
  border: 1px solid var(--line-strong); border-radius: 22px; cursor: pointer; font-size: var(--t-body); }
.swatch input { position: absolute; inset: 0; margin: 0; width: 100%; height: 100%; appearance: none; -webkit-appearance: none; background: transparent; border: 0; border-radius: 22px; cursor: pointer; }
.swatch input:focus-visible { outline: 2px solid var(--action); outline-offset: 3px; }
.swatch__dot { width: 28px; height: 28px; border-radius: 50%; background: var(--sw); box-shadow: inset 0 0 0 1px var(--line-strong); }
.swatch:has(input:checked) { border: 2px solid var(--ink); padding-left: calc(var(--s-2) - 1px); padding-right: calc(var(--s-4) - 1px); }
.order__added:empty, .tile .order__added:empty { display: none; }
.order__frame, #closeup .frame { aspect-ratio: 16 / 10; }
.order__frame .frame__img, #closeup .frame .frame__img { width: 100%; height: 100%; object-fit: cover; }
@media (min-width: 1024px) {
  .order__frame, #closeup .frame { aspect-ratio: auto; height: min(708px, calc(100svh - var(--padt) - var(--padb))); }
  #caps .split-col { height: min(708px, calc(100svh - var(--padt) - var(--padb))); }
}

/* the range tiles */
.tile__form { display: grid; gap: var(--s-3); }
.tile__form select { width: 100%; height: var(--btn-h); padding: 0 var(--s-3); border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: var(--bg); color: var(--ink); font: 400 var(--t-body)/1.4 var(--font-text); }
.tile__form .tile__opt { margin: 0; min-height: var(--btn-h); display: flex; align-items: center; }
.range .tile__media { --tile-ratio: 1 / 1; }
@media (max-width: 639px) {
  .range .tile__media { --tile-ratio: 4 / 3; }
  .tile__form p.tile__facts { display: none; }
  .range .tile__head { flex-direction: column; gap: 0; }
}
.tile__form .btn { width: 100%; }

/* close-up and questions */
.closeup__head { align-items: start; }
.closeup__pic { margin: var(--s-7) 0 0; border-radius: var(--r-lg); overflow: clip; aspect-ratio: 1280 / 410; }
.closeup__pic { position: relative; }
.closeup__pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 42%; }
@media (max-width: 1023px) { .closeup__pic { aspect-ratio: 16 / 10; } }
.questions__faq .faq__item h3 { font-size: var(--t-body); }
.questions__faq { margin-top: var(--s-6); }
.questions__pic { margin: 0; }
.questions__pic .frame__img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 60%; }
@media (min-width: 1024px) { .questions__pic { height: min(708px, calc(100svh - var(--padt) - var(--padb))); } }
@media (min-width: 640px) and (max-width: 1023px) {
  .questions__text { display: contents; }
  .questions__head { grid-column: 1 / span 6; grid-row: 1; }
  .questions__pic { grid-column: 7 / -1; grid-row: 1; aspect-ratio: 4 / 3; }
  .questions__faq { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 639px) { .questions__pic { aspect-ratio: 2 / 1; } .questions__faq { margin-top: var(--s-5); } }

/* a phone: the beach photograph takes what the head row leaves, so the hero stays one screen */
@media (max-width: 639px) { main > .hero--product .hero__stage { aspect-ratio: auto; flex: 1 1 auto; min-height: 240px; } main > .hero--product h1 { font-size: 34px; } }

/* the cart: a dialog that slides in from the right (a sheet on a phone) */
dialog.cart { position: fixed; inset: 0 0 0 auto; margin: 0; width: min(440px, 100vw); height: 100dvh; max-height: none; max-width: none;
  border: 0; border-left: 1px solid var(--line); padding: var(--s-6); background: var(--p-bg); color: var(--p-ink);
  display: none; flex-direction: column; gap: var(--s-5); overflow-y: auto; }
dialog.cart[open] { display: flex; animation: cart-in 260ms var(--ease); }
dialog.cart::backdrop { background: color-mix(in oklab, var(--p-ink) 40%, transparent); }
@keyframes cart-in { from { transform: translateX(24px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { dialog.cart[open] { animation: none; } }
.cart__head { display: flex; align-items: center; justify-content: space-between; }
.cart__title { font: var(--display-weight) var(--t-h3)/1.1 var(--font-display); letter-spacing: var(--display-tracking); margin: 0; }
.cart__close { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--line-strong); border-radius: var(--r-btn); background: var(--p-bg); color: inherit; cursor: pointer; }
.cart__lines { list-style: none; margin: 0; padding: 0; display: grid; }
.cart__line { display: grid; grid-template-columns: 72px 1fr auto; gap: var(--s-4); align-items: start; padding: var(--s-4) 0; border-bottom: 1px solid var(--line); }
.cart__line img { width: 72px; height: 90px; object-fit: cover; border-radius: var(--r-sm); background: var(--p-surface); }
.cart__info { display: grid; gap: var(--s-2); }
.cart__name { font-weight: 500; margin: 0; }
.cart__price { margin: 0; color: var(--p-muted); font-variant-numeric: tabular-nums; }
.cart__bar { height: 6px; border-radius: 3px; background: var(--p-surface); overflow: hidden; }
.cart__bar > span { display: block; height: 100%; width: var(--fill, 0%); background: var(--p-accent); transition: width 300ms var(--ease); }
.summary .qty, .summary .cart__remove { display: none; }
.summary .cart__line { grid-template-columns: 72px 1fr; }
.steps { list-style: none; margin: 0 0 var(--s-7); padding: 0; display: grid; gap: var(--s-3); max-width: 52ch; }
.steps { counter-reset: step; }
.steps li { padding-left: calc(28px + var(--s-3)); position: relative; min-height: 28px; display: flex; align-items: center; counter-increment: step; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; background: var(--p-accent); color: var(--p-accent-ink); font: 500 var(--t-label)/1 var(--font-text); }
.cart__remove { background: none; border: 0; padding: 0; min-height: 44px; font: inherit; font-size: var(--t-small); color: var(--p-ink); text-decoration: underline; cursor: pointer; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: var(--r-btn); width: max-content; }
.qty button { width: 44px; height: 44px; border: 0; background: none; color: inherit; font-size: 18px; cursor: pointer; }
.qty span { min-width: 28px; text-align: center; font-variant-numeric: tabular-nums; }
.cart__empty[hidden], .cart__totals[hidden], .cart__checkout[hidden] { display: none; }
.cart__totals { margin: 0; display: grid; gap: var(--s-2); }
.cart__totals > div { display: flex; justify-content: space-between; }
.cart__totals dd { margin: 0; font-variant-numeric: tabular-nums; }
.cart__total { padding-top: var(--s-3); border-top: 1px solid var(--line); font-weight: 500; font-size: var(--t-lead); }
.cart__checkout { width: 100%; }
.cart__brand { display: grid; gap: var(--s-2); }
.cart__brand img { height: 22px; width: auto; }
.cart__pay:empty { display: none; }

/* checkout page */
.checkout { padding-top: calc(var(--nav) + var(--s-8)); padding-bottom: var(--s-9); }
.summary { background: var(--surface); border-radius: var(--r-lg); padding: var(--s-6); display: grid; gap: var(--s-4); align-content: start; }
.summary .cart__line { grid-template-columns: 72px 1fr auto; }
.summary h2 { font: var(--display-weight) var(--t-h3)/1.1 var(--font-display); }
.pay-card[hidden] { display: none; }
.legal { padding-top: calc(var(--nav) + var(--s-8)); padding-bottom: var(--s-9); }
.legal .measure > * + * { margin-top: var(--s-4); }
.legal h2 { font: var(--display-weight) var(--t-h3)/1.2 var(--font-display); margin-top: var(--s-7); }
.checkout__h1 { font: var(--display-weight) var(--t-h2)/1.08 var(--font-display); letter-spacing: var(--display-tracking); margin: 0 0 var(--s-4); }
.checkout__lead { margin-bottom: var(--s-7); max-width: 52ch; }
.pay-card { display: grid; gap: var(--s-3); margin-bottom: var(--s-7); padding-bottom: var(--s-7); border-bottom: 1px solid var(--line); }
.legal-foot { height: auto; padding-block: var(--s-7); }
@media (max-width: 1023px) { .summary { grid-row: 1; margin-bottom: var(--s-7); } }

/* the smallest phones: the logo narrows so the cart and the menu stay on the screen */
@media (max-width: 380px) { .nav__logo img.brand-logo { height: 18px; } .nav__actions { gap: var(--s-2); } }

/* tablets and phones: the product photographs sit on their own studio colour so a wide crop never cuts the product */
:root { --backdrop: #f8f3ef; }
@media (max-width: 1023px) {
  .thumbs { display: none; }
  .order__frame { order: -1; }
  .order__frame { aspect-ratio: 21 / 9; background: var(--backdrop); }
  .order__frame .frame__img { object-fit: contain; }
}
@media (min-width: 640px) and (max-width: 1023px) {
  .range .tile__media { --tile-ratio: 2 / 1; background: var(--backdrop); }
  .range .tile__media > img { object-fit: contain; }
  .tile__form p.tile__facts { display: none; }
  .closing__links .footer__col { grid-column: auto / span 4; }
}
@media (max-width: 639px) {
  .order__frame { aspect-ratio: 4 / 3; }
  .footer__lede, .closing__links .footer__col:last-of-type { display: none; }
}

/* the cart stays in the bar on tablets and phones; on a phone it takes the main button's place (the button moves to the sheet) */
@media (max-width: 1023px) { .nav:not(.is-open) .nav__actions > .cart-open { display: inline-flex; } }
@media (max-width: 639px) {
  .nav:not(.is-open) .nav__actions > .btn--primary { display: none; }
  .nav.is-open .nav__actions > .cart-open { display: none; }
  /* colour swatches as one row of dots, the chosen name in the legend */
  .swatch { padding: 0; border-radius: 50%; width: 48px; height: 48px; justify-content: center; }
  .swatch:has(input:checked) { padding: 0; }
  .swatch__name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .swatch input { border-radius: 50%; }
}
@media (max-width: 639px) { .order__frame .frame__img { object-fit: cover; } }

/* round 3 */
.order__specs { margin-top: var(--s-3); }
.order .section-head { margin-bottom: 0; }
.tile__form { grid-template-rows: auto var(--btn-h) var(--btn-h); }
.tile__form .tile__facts { margin: 0; color: var(--muted); font-size: var(--t-small); }
@media (max-width: 1023px) { .tile__form { grid-template-rows: auto; } .tile__form p.tile__opt { display: none; } }
.form > .field-row { grid-column: 1 / -1; display: grid; grid-template-columns: 2fr 1fr 1fr; gap: var(--s-4); }
@media (max-width: 639px) { .form > .field-row { grid-template-columns: 1fr 1fr; } .form > .field-row > .field:first-child { grid-column: 1 / -1; } }
.checkout { padding-top: calc(var(--nav) + var(--s-7)); }
.checkout__lead { margin-bottom: var(--s-5); }
.steps { margin-bottom: var(--s-6); }
.tile__size { gap: var(--s-3); }
.tile__size select { flex: 1; }
@media (max-width: 1023px) { .tile__form .tile__size { display: flex; } }

/* round 4 */
@media (max-width: 639px) {
  .order__specs > li, .closeup__head .rows > li { grid-template-columns: 1fr; gap: var(--s-1); }
  .order__specs .rows__value, .closeup__head .rows__value { text-align: left; grid-column: 1; grid-row: auto; max-width: none; white-space: normal; }
}
.cart__pay { margin: 0; font-size: var(--t-body); }
.back-link { display: inline-flex; align-items: center; min-height: 44px; }
@media (max-width: 1023px) { .nav__actions > .back-link { display: inline-flex !important; } .nav__actions { display: flex !important; margin-left: auto; } }
.questions__pic .frame__img { object-position: 50% 50%; }

/* round 5 */
.order .order__price .t-small { font-size: var(--t-body); color: var(--ink); }
#caps .order { gap: var(--s-4); }
#closeup .rows--spec .rows__name { color: color-mix(in oklab, var(--ink) 82%, transparent); }
#closeup .closeup__pic img { object-position: 50% 42%; }
.cart__line { grid-template-columns: 84px 1fr auto; }
.cart__line img { width: 84px; height: 84px; }
.cart__total { font-size: var(--t-h3); }
.cart__total dt, .cart__total dd { font-family: var(--font-display); font-weight: var(--display-weight); }
.cart__pay { padding: var(--s-4); border-radius: var(--r-md); background: var(--p-surface); }
.form .field :is(input, select):focus-visible { outline: 2px solid var(--action); outline-offset: 1px; border-color: var(--action); }
.closing__links .footer__lede { font-family: var(--font-text); font-size: var(--t-body); }
.closing__links .footer__col a { font-size: var(--t-body); }
.cart__opt { margin: 0; color: var(--p-muted); font-size: var(--t-small); }
.form > .btn-row .btn { width: 100%; }
