/* Order builder — guided steps beside a live preview, laid out like a product
   page: the garment on one side, a quiet column of choices on the other. */

.ob-main { padding: 46px 0 0; }
.ob-head { text-align: center; max-width: 620px; margin: 0 auto; }
.ob-head h1 { font-size: clamp(2.4rem, 4.4vw, 3.4rem); margin: 0 0 .1em; }
.ob-head__sub { color: var(--muted); margin: 0; }

/* stepper: pinned under the header, so the next step is always one tap away */
.order-page { --header-h: 77px; --steps-h: 64px; }
.ob-steps { position: sticky; top: var(--header-h); z-index: 20; margin: 38px 0 36px; background: var(--paper); }
.ob-stepper { list-style: none; margin: 0; padding: 0 0 10px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.ob-stepper button { width: 100%; min-width: 0; display: grid; grid-template-columns: auto 1fr; gap: 0 10px; align-items: center; text-align: start; padding: 16px 4px 0; padding-inline-end: 14px; margin-top: -1px; background: none; border: 0; border-top: 2px solid transparent; font: inherit; color: inherit; cursor: pointer; }
.ob-stepper__num { grid-row: span 2; font-family: var(--font-latin); font-size: .78rem; color: var(--muted); }
.ob-stepper__num::before { content: '0'; }
.ob-stepper__label { color: var(--plum); font-size: .95rem; }
.ob-stepper__value { font-size: .8rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.ob-stepper .is-current button { border-top-color: var(--maroon); }
.ob-stepper .is-current .ob-stepper__num { color: var(--maroon); }
.ob-stepper .is-current .ob-stepper__label { color: var(--maroon); }
.ob-stepper .is-done button { border-top-color: var(--gold); }
.ob-stepper .is-done .ob-stepper__num { color: var(--gold-text); }
.ob-stepper button:hover .ob-stepper__label { color: var(--maroon); }
.ob-stepper button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* layout */
.ob-layout { display: grid; grid-template-columns: 1fr 400px; gap: 56px; align-items: start; }
.ob-panel__count { font-size: .85rem; color: var(--gold-text); margin: 0 0 4px; }
.ob-panel h2 { font-size: clamp(1.9rem, 3vw, 2.4rem); margin: 0 0 24px; outline: none; }

/* the steps, one after another */
.ob-section { scroll-margin-top: calc(var(--header-h) + var(--steps-h) + 12px); padding-bottom: 8px; margin-bottom: 56px; }
.ob-section:last-child { margin-bottom: 24px; }

/* the way on: a wide row with the next step's name and an arrow pointing down */
.ob-next { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; margin-top: 4px; padding: 18px 22px; background: var(--tint); border: 1px solid var(--line); font: inherit; color: var(--ink); text-align: start; cursor: pointer; transition: background .2s ease, border-color .2s ease; }
.ob-next__text { display: grid; gap: 2px; font-size: 1.05rem; color: var(--maroon); }
.ob-next__text small { font-size: .78rem; color: var(--muted); }
.ob-next__arrow { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--maroon); color: var(--cream); }
.ob-next__arrow::before { content: ''; width: 10px; height: 10px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); }
.ob-next:hover { background: rgba(86, 25, 36, .06); border-color: var(--mauve); }
.ob-next:hover .ob-next__arrow { animation: ob-nudge 1s var(--ease) infinite; }
.ob-next:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
@keyframes ob-nudge { 50% { transform: translateY(4px); } }
.ob-send { width: 100%; margin-top: 4px; }

/* option groups */
.ob-group { border: 0; padding: 0; margin: 0 0 36px; min-width: 0; }
.ob-group legend { padding: 0; margin-bottom: 12px; font-size: .92rem; color: var(--plum); }
.ob-hint { color: var(--muted); font-size: .86rem; margin: -6px 0 14px; }
.ob-note { color: var(--plum); }
.ob-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; }
.ob-more { margin: 18px 0 0; }
.ob-fix { margin: 8px 0 12px; padding-inline-start: 38px; font-size: .9rem; }

.ob-list { border-top: 1px solid var(--line); }
.ob-list--two { display: grid; grid-template-columns: 1fr 1fr; column-gap: 24px; }
.ob-opt { position: relative; display: grid; grid-template-columns: 20px 1fr auto; gap: 16px; align-items: center; margin: 0; padding: 16px 8px; border-bottom: 1px solid var(--line); cursor: pointer; font-weight: 400; transition: background .15s ease; }
.ob-opt:hover { background: rgba(86, 25, 36, .035); }
.ob-opt input, .ob-color input, .ob-pattern input, .ob-thread input { position: absolute; inset-inline-start: 0; top: 0; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.ob-opt__mark { width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--mauve); background: transparent; transition: box-shadow .15s ease, background .15s ease; }
.ob-opt:has(input[type=checkbox]) .ob-opt__mark { border-radius: 0; display: grid; place-items: center; font-size: .66rem; color: var(--cream); }
.ob-opt__text strong { display: block; font-weight: 400; font-size: 1rem; color: var(--ink); }
.ob-opt__text small { display: block; color: var(--muted); font-size: .85rem; }
.ob-opt__aside { color: var(--plum); font-size: .92rem; white-space: nowrap; }
.ob-opt:has(input:checked) .ob-opt__mark { border-color: var(--maroon); background: var(--maroon); box-shadow: inset 0 0 0 3px var(--paper); }
.ob-opt:has(input[type=checkbox]:checked) .ob-opt__mark { box-shadow: none; }
.ob-opt:has(input[type=checkbox]:checked) .ob-opt__mark::after { content: '✓'; }
.ob-opt:has(input:checked) strong { color: var(--maroon); }
.ob-opt:has(input:focus-visible) .ob-opt__mark { outline: 2px solid var(--gold); outline-offset: 3px; }
.ob-opt.is-disabled { cursor: not-allowed; opacity: .6; }
.ob-opt.is-disabled:hover { background: none; }

/* colours: real fabric swatches */
.ob-colors { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 20px 12px; }
.ob-color { position: relative; margin: 0; text-align: center; font-size: .8rem; font-weight: 400; color: var(--muted); cursor: pointer; }
.ob-color img { width: 56px; height: 56px; object-fit: cover; margin: 0 auto 8px; box-shadow: 0 0 0 1px var(--line); transition: box-shadow .2s ease; }
.ob-color:has(input:checked) img { box-shadow: 0 0 0 3px var(--paper), 0 0 0 4px var(--maroon); }
.ob-color:has(input:checked) { color: var(--maroon); }
.ob-color:has(input:focus-visible) img { box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--gold); }

/* patterns: the shop's own, as line art on the page; the chosen one in maroon with a rule beneath */
.ob-patterns { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 22px 12px; }
.ob-pattern { position: relative; margin: 0; padding-bottom: 10px; cursor: pointer; --thread: #b9aeab; }
.ob-pattern:hover { --thread: var(--plum); }
.ob-pattern:has(input:checked) { --thread: var(--maroon); }
.ob-pattern::after { content: ''; position: absolute; inset-inline: 22%; bottom: 0; height: 2px; background: var(--maroon); transform: scaleX(0); transition: transform .25s var(--ease); }
.ob-pattern:has(input:checked)::after { transform: scaleX(1); }
.ob-pattern:has(input:focus-visible) .pattern { outline: 2px solid var(--gold); outline-offset: 2px; }
.ob-pattern__price { display: block; margin-top: 6px; text-align: center; font-size: .78rem; color: var(--muted); }
.ob-pattern:has(input:checked) .ob-pattern__price { color: var(--maroon); }

.ob-threads { display: flex; flex-wrap: wrap; gap: 18px; }
.ob-thread { position: relative; margin: 0; display: grid; justify-items: center; gap: 6px; font-size: .8rem; font-weight: 400; color: var(--muted); cursor: pointer; }
.ob-thread i { width: 30px; height: 30px; border-radius: 50%; box-shadow: 0 0 0 1px var(--line); }
.ob-thread:has(input:checked) i { box-shadow: 0 0 0 3px var(--paper), 0 0 0 4px var(--maroon); }
.ob-thread:has(input:checked) { color: var(--maroon); }
.ob-thread:has(input:focus-visible) i { box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--gold); }

.ob-qty { display: inline-flex; align-items: center; border: 1px solid var(--line); }
.ob-qty button { width: 46px; height: 46px; border: 0; background: none; font-size: 1.2rem; color: var(--maroon); cursor: pointer; }
.ob-qty button:hover { background: var(--tint); }
.ob-qty output { min-width: 48px; text-align: center; }
.ob-group .field { margin: 16px 0 0; }

/* preview */
.ob-look { position: sticky; top: calc(var(--header-h) + var(--steps-h) + 12px); }
.ob-look__stage .garment { height: clamp(320px, 48vh, 480px); }
.ob-look__body { padding: 20px 0 0; }
.ob-details { margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.ob-details summary { list-style: none; cursor: pointer; padding: 4px 0 12px; color: var(--plum); display: flex; justify-content: space-between; }
.ob-details summary::-webkit-details-marker { display: none; }
.ob-details summary::after { content: '+'; color: var(--gold-text); font-size: 1.1rem; line-height: 1; }
.ob-details[open] summary::after { content: '−'; }
.ob-summary { margin: 0 0 12px; }
.ob-summary div { display: flex; justify-content: space-between; gap: 14px; padding: 7px 0; border-bottom: 1px solid rgba(86, 25, 36, .08); font-size: .9rem; }
.ob-summary dt { color: var(--muted); }
.ob-summary dd { margin: 0; color: var(--ink); text-align: end; }
.ob-price { display: grid; gap: 4px; font-size: .92rem; color: var(--plum); }
.ob-price div { display: flex; justify-content: space-between; }
.ob-price__total { margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--line); align-items: baseline; color: var(--ink); }
.ob-price__total span:last-child { font-family: var(--font-display); font-size: 1.8rem; color: var(--maroon); }
.ob-look__submit { width: 100%; margin-top: 18px; }
.ob-look__note { color: var(--muted); font-size: .8rem; margin: 12px 0 0; }

/* mobile bottom bar */
.ob-bar { display: none; }

/* confirmation */
.ob-done { display: grid; grid-template-columns: 280px 1fr; gap: 48px; align-items: center; max-width: 880px; margin: 30px auto; }
.ob-done h1 { font-size: clamp(2rem, 3.6vw, 2.7rem); margin: 0 0 .2em; outline: none; }
.ob-done .notice { margin: 18px 0 24px; }

@media (max-width: 1000px) {
  .ob-layout { grid-template-columns: 1fr; gap: 28px; }
  .ob-look { position: static; order: -1; display: grid; grid-template-columns: 42% 1fr; }
  .ob-look__stage .garment { height: 100%; min-height: 260px; }
  .ob-look { background: var(--tint); }
  .ob-look__body { padding: 18px 22px; align-self: end; }
  .ob-look__note, .ob-look__submit { display: none; }
  .ob-summary div { font-size: .82rem; padding: 5px 0; }
  .ob-price__total span:last-child { font-size: 1.4rem; }
  .order-page .house-foot { padding-bottom: 110px; }
  .ob-bar { display: flex; position: fixed; inset-inline: 0; bottom: 0; z-index: 40; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); background: var(--paper); border-top: 1px solid var(--line); }
  .ob-bar[hidden] { display: none; }
  .ob-bar__total small { display: block; font-size: .75rem; color: var(--muted); }
  .ob-bar__total { margin-inline-end: auto; }
  .ob-bar__total b { font-family: var(--font-display); font-size: 1.4rem; font-weight: 500; color: var(--maroon); }
  .ob-bar__look { width: 44px; height: 52px; overflow: hidden; flex: none; background: var(--tint); }
  .ob-bar__look .garment { width: 100%; height: 100%; }
  .ob-bar__look img { width: 100%; height: 100%; object-fit: cover; }
  .ob-bar__go.is-next::after { content: ''; display: inline-block; width: 7px; height: 7px; margin-inline-start: 10px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-3px) rotate(45deg); }
  .ob-send { display: none; }
}
@media (max-width: 700px) {
  .ob-patterns { grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 18px 10px; }
  .ob-main { padding-top: 30px; }
  .ob-steps { margin: 24px -4px 30px; }
  .ob-stepper button { grid-template-columns: 1fr; justify-items: center; text-align: center; padding: 12px 2px 0; gap: 6px; }
  .ob-stepper__num { grid-row: auto; }
  .ob-stepper__label { font-size: .74rem; overflow-wrap: anywhere; }
  .ob-stepper__value { display: none; }
  .ob-look { grid-template-columns: 1fr; }
  .ob-look__stage .garment { height: 230px; min-height: 0; }
  .ob-look__body { display: none; }
  .ob-done { grid-template-columns: 1fr; text-align: center; gap: 24px; }
  .ob-done__photo { max-width: 240px; margin: 0 auto; }
  .ob-done .ob-actions { justify-content: center; }
}
