/* NOKSHI — checkout, confirmation & order tracking */
.btn--ghost { --bg: transparent; --fg: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn--ghost::before { background: var(--paper-2); }
.btn--ghost:hover { box-shadow: inset 0 0 0 1.5px var(--ink); }
.muted { color: var(--muted); }
.free { color: #1f6b52; font-weight: 600; }

/* full-height sheet */
.modal--sheet { padding: 0; place-items: stretch; }
.co {
  position: relative; background: var(--paper); width: 100%; height: 100%; overflow-y: auto; overscroll-behavior: contain;
  animation: sheetIn .5s var(--ease) both;
}
@keyframes sheetIn { from { transform: translateY(24px); opacity: 0; } }
.co__head {
  position: sticky; top: 0; z-index: 3; display: flex; justify-content: space-between; align-items: flex-end; gap: 20px;
  width: min(1180px, 100% - 40px); margin: 0 auto; padding: 28px 0 18px; background: var(--paper); border-bottom: 1px solid var(--line);
}
.co__title { font-family: var(--serif); font-weight: 400; font-size: clamp(30px, 4vw, 46px); line-height: 1; letter-spacing: -.02em; margin-top: 8px; }
.co__title em { font-style: italic; color: var(--t-accent); }

.co__body { width: min(1180px, 100% - 40px); margin: 0 auto; display: grid; grid-template-columns: 1fr 400px; gap: 48px; padding: 28px 0 60px; align-items: start; }
.co__body[hidden] { display: none; }
.co__sec { padding: 6px 0 26px; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.co__sec h3 { font-family: var(--serif); font-size: 24px; font-weight: 450; display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.co__sec h3 span { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--t-deep); color: var(--paper); font: 600 14px var(--sans); }
.co__grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.field label small { font-weight: 400; color: var(--muted); }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; font-size: 16px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: #fff; color: var(--ink);
  transition: border-color .2s, box-shadow .2s;
}
.field textarea { resize: vertical; min-height: 64px; }
.field select { appearance: none; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%232a1c16' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 14px center / 11px; padding-right: 36px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--t-deep); box-shadow: 0 0 0 3px color-mix(in srgb, var(--t-accent) 18%, transparent); }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: #b42318; }
.field.nudge { animation: shake .4s; }
.field__prefix { display: flex; border: 1px solid var(--line); border-radius: 12px; background: #fff; overflow: hidden; }
.field__prefix span { display: grid; place-items: center; padding: 0 12px; background: var(--paper-2); color: var(--ink-2); font-size: 15px; border-right: 1px solid var(--line); }
.field__prefix input { border: 0; border-radius: 0; }
.field__prefix:focus-within { border-color: var(--t-deep); box-shadow: 0 0 0 3px color-mix(in srgb, var(--t-accent) 18%, transparent); }
.field__prefix input:focus { box-shadow: none; }
.field.invalid .field__prefix { border-color: #b42318; }
.field__hint { font-size: 13px; color: var(--muted); margin-top: 5px; }
.field__err { font-size: 13px; color: #b42318; margin-top: 5px; }
.field__err:empty { display: none; }
.co__ship-note { font-size: 14px; color: var(--ink-2); background: var(--paper-2); border-radius: 10px; padding: 10px 14px; }
.co__more { margin-top: 12px; }
.co__more summary { cursor: pointer; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; color: var(--ink-2); }
.co__more .field { margin-top: 10px; }
.co__remember { display: flex; gap: 10px; align-items: center; font-size: 14px; color: var(--ink-2); }
.co__remember input { width: 18px; height: 18px; accent-color: var(--t-deep); }

/* payment */
.pay { display: grid; gap: 10px; }
.pay__opt { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1.5px solid var(--line); border-radius: 14px; background: #fff; cursor: pointer; transition: border-color .2s, background .2s; }
.pay__opt:hover { border-color: var(--ink-2); }
.pay__opt:has(input:checked) { border-color: var(--t-deep); background: color-mix(in srgb, var(--t-accent) 6%, #fff); }
.pay__opt input { width: 18px; height: 18px; accent-color: var(--t-deep); flex: none; }
.pay__opt b { display: block; font-weight: 600; }
.pay__opt small { color: var(--muted); font-size: 13px; }
.pay__logo { width: 38px; height: 38px; flex: none; border-radius: 10px; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 18px; }
.pay__logo--cod { background: #1f6b52; }
.pay__logo--bkash { background: #d12053; }
.pay__logo--nagad { background: #ec6e1c; }
.pay__wallet { margin-top: 14px; padding: 16px 18px 4px; border-radius: 14px; background: var(--paper-2); }
.pay__wallet[hidden] { display: none; }
.pay__wallet ol { margin: 0 0 14px; padding-left: 20px; font-size: 14px; color: var(--ink-2); display: grid; gap: 4px; }

/* summary */
.co__summary { position: sticky; top: 130px; background: #fff; border: 1px solid var(--line); border-radius: 22px; padding: 22px; box-shadow: var(--shadow); }
.co__summary h3 { font-family: var(--serif); font-size: 22px; font-weight: 450; }
.co__summary h3 span { font: 400 14px var(--sans); color: var(--muted); }
.co__items { margin: 12px 0; max-height: 300px; overflow-y: auto; }
.co__item { display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.co__item.has-problem { background: #fff4f2; margin: 0 -10px; padding: 10px; border-radius: 10px; }
.co__thumb { position: relative; width: 56px; aspect-ratio: 4 / 5; border-radius: 10px; background: var(--tile); display: grid; place-items: center; }
.co__thumb .garment { width: 88%; height: auto; }
.co__thumb .garment--photo { width: 100%; height: 100%; aspect-ratio: auto; }
.co__thumb .garment__frame { border-radius: inherit; }
.co__thumb b { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; border-radius: 10px; background: var(--ink); color: #fff; font-size: 11px; display: grid; place-items: center; padding: 0 5px; }
.co__item-main b { display: block; font-family: var(--serif); font-weight: 500; font-size: 15px; line-height: 1.2; }
.co__item-main small { color: var(--muted); font-size: 12.5px; }
.co__item-main em { display: block; font-style: normal; color: #b42318; font-size: 12.5px; margin-top: 2px; }
.co__item-price { font-weight: 600; font-size: 14px; }
.co__problems p { font-size: 13px; color: #b42318; }
.co__problems .linkish { font-size: 13px; color: #b42318; margin-top: 4px; }
.co__coupon { display: flex; gap: 8px; margin-top: 14px; }
.co__coupon input { flex: 1; min-width: 0; font: inherit; font-size: 15px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 999px; text-transform: uppercase; letter-spacing: .06em; }
.co__coupon input:focus { outline: none; border-color: var(--t-deep); }
.co__coupon .btn { padding: 10px 18px; }
.co__coupon-msg { font-size: 13px; min-height: 1.2em; margin-top: 6px; }
.co__coupon-msg.good { color: #1f6b52; }
.co__coupon-msg.bad { color: #b42318; }
.co__totals { margin: 12px 0 18px; display: grid; gap: 8px; font-size: 15px; }
.co__totals div { display: flex; justify-content: space-between; gap: 12px; }
.co__totals div[hidden] { display: none; }
.co__totals dt { color: var(--ink-2); }
.co__totals dt small { color: var(--muted); }
.co__totals dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.co__total { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 4px; }
.co__total dt { color: var(--ink); font-weight: 600; }
.co__total dd { font-family: var(--serif); font-size: 26px; font-weight: 500; }
#coPlace.loading { opacity: .7; }
.co__err { color: #b42318; font-size: 14px; margin-top: 10px; }
.co__err:empty { display: none; }
.co__trust { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.co__trust li::before { content: '✓  '; color: #1f6b52; font-weight: 700; }

/* confirmation */
.co__done { width: min(720px, 100% - 40px); margin: 0 auto; padding: 40px 0 80px; outline: none; }
.co__done[hidden] { display: none; }
.done { text-align: center; display: flex; flex-direction: column; align-items: center; }
.done .lede { margin-inline: auto; }
.done__badge svg { width: 84px; height: 84px; fill: none; stroke: #1f6b52; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 18px; }
.done__badge circle { stroke-dasharray: 151; stroke-dashoffset: 151; animation: draw .7s .1s var(--ease) forwards; fill: #dcefe3; }
.done__badge path { stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw .45s .6s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.done__card { width: 100%; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 20px 22px; margin-top: 24px; }
.done__items { list-style: none; padding: 0; margin: 0 0 8px; }
.done__items li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.done__items small { color: var(--muted); display: block; }
.done__meta { font-size: 14px; color: var(--ink-2); margin-top: 8px; }
.done__meta b { color: var(--ink); margin-right: 6px; }
.done__actions { display: flex; gap: 10px; margin-top: 26px; flex-wrap: wrap; justify-content: center; }

/* status steps */
.steps { list-style: none; padding: 0; margin: 26px 0 0; display: grid; grid-template-columns: repeat(4, 1fr); width: 100%; text-align: center; }
.steps li { position: relative; padding-top: 30px; font-size: 13px; color: var(--muted); }
.steps li::before { content: ''; position: absolute; top: 9px; left: -50%; right: 50%; height: 2px; background: var(--line); }
.steps li:first-child::before { display: none; }
.steps li.is-done::before, .steps li.is-now::before { background: #1f6b52; }
.steps__dot { position: absolute; top: 0; left: 50%; translate: -50% 0; width: 20px; height: 20px; border-radius: 50%; background: var(--paper); border: 2px solid var(--line); z-index: 1; }
.steps li.is-done .steps__dot { background: #1f6b52; border-color: #1f6b52; }
.steps li.is-now .steps__dot { border-color: #1f6b52; box-shadow: 0 0 0 5px #dcefe3; background: #fff; }
.steps li.is-now .steps__dot::after { content: ''; position: absolute; inset: 4px; border-radius: 50%; background: #1f6b52; }
.steps b { display: block; color: var(--ink); font-weight: 600; }
.steps li:not(.is-done):not(.is-now) b { color: var(--muted); font-weight: 500; }
.steps small, .steps time { display: block; font-size: 12px; margin-top: 2px; }

/* tracking */
.track__form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; align-items: end; }
.track__form .field { margin: 0; }
.track__recent p { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.track__recent .chips { margin-bottom: 18px; }
.track__head { font-family: var(--serif); font-size: 22px; font-weight: 450; margin-top: 24px; }
.track__head small { font: 400 13px var(--sans); color: var(--muted); margin-left: 6px; }
.track__cancelled { margin-top: 16px; padding: 12px 14px; border-radius: 12px; background: #fdecea; color: #8a1c12; font-size: 14px; }
#trackResult .steps { text-align: center; }

@media (max-width: 900px) {
  .co__body { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .co__summary { position: static; }
  .co__head { padding-top: 18px; }
}
@media (max-width: 560px) {
  .co__grid2, .track__form { grid-template-columns: minmax(0, 1fr); }
  .co__body { width: calc(100% - 32px); }
  .co__summary { padding: 18px; border-radius: 18px; }
  .steps { grid-template-columns: 1fr; text-align: left; gap: 14px; }
  .steps li { padding: 0 0 0 34px; }
  .steps li::before { top: -14px; bottom: auto; left: 9px; right: auto; width: 2px; height: 14px; }
  .steps__dot { left: 0; translate: none; }
}
