/* Order-only styles; shared navigation, footer, fonts and colors use styles.css. */
.order-page .site-header a[aria-current="page"] {
  border-bottom: 1px solid currentColor;
  padding-bottom: 4px;
}

.order-page .testbar {
  padding: 10px 22px;
  background: var(--accent);
  color: var(--paper);
  text-align: center;
  font-size: 12px;
}

.order-page .testbar b { font-weight: 500; }
.order-page .order-shell { padding-top: 48px; padding-bottom: 88px; }
.order-page .section-kicker { margin-bottom: 12px; }
.order-page #cart-glance { margin: 16px 0 0; font-size: 14px; line-height: 1.7; }
.order-page #cart-glance a { text-decoration: underline; text-underline-offset: 4px; }

.order-page .order-layout > *,
.order-page #order-form > * { min-width: 0; }
.order-page .order-products { min-width: 0; }
.order-page .tabs { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-bottom: 26px; }
.order-page button,
.order-page input,
.order-page select { font: inherit; }
.order-page button { cursor: pointer; }
.order-page button:disabled { cursor: not-allowed; opacity: .55; }
.order-page .tab {
  min-height: 44px;
  padding: 8px 0;
  border: 0;
  border-bottom: 1px solid transparent;
  background: transparent;
  color: var(--ink-3);
  font-size: 13px;
}
.order-page .tab[aria-pressed="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.order-page .tab:hover { color: var(--accent); }

/* Match the ruled product and price rows on beans.html. */
.order-page .grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
.order-page .item { min-width: 0; padding-top: 22px; border-top: 1px solid var(--line-2); }
.order-page .item h3 { margin: 0 0 8px; font-size: 24px; font-weight: 500; line-height: 1.3; }
.order-page .kind { color: var(--ink-3); font-size: 12px; }
.order-page .notes { min-height: 52px; margin: 12px 0 16px; color: var(--ink-2); font-size: 13px; line-height: 1.8; }
.order-page .price {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-family: var(--font-meta);
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}
.order-page .price span { color: var(--ink-3); font-size: 11px; }
.order-page .row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; }
.order-page input:not([type="checkbox"]),
.order-page select {
  min-width: 0;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line-2);
  border-radius: 2px;
  background: var(--card);
  color: var(--ink);
  font-size: 14px;
}
.order-page input[readonly] { background: var(--paper-2); }
.order-page input::placeholder { color: var(--ink-3); }

.order-page :is(button, input, select, a):focus-visible { outline: 2px solid var(--accent-soft); outline-offset: 3px; }
.order-page .item select { flex: 1 1 130px; width: 100%; }
.order-page .qty { width: 64px; text-align: center; }
.order-page .add,
.order-page #address-search,
.order-page #retry-confirm,
.order-page #result button,
.order-page .order-details button,
.order-page #order-form > section button {
  min-height: 44px;
  padding: 12px 18px;
  border: 1px solid var(--ink);
  border-radius: 2px;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.3;
}
.order-page .add { width: 100%; }
.order-page .add:hover,
.order-page #address-search:hover { background: var(--ink); color: var(--paper); }
.order-page .cold-option { width: 100%; font-size: 12px; line-height: 1.8; }
.order-page .cold-note { width: 100%; margin: 0; color: var(--ink-3); font-size: 12px; }
.order-page #notice { margin: 16px 0 0; color: #9c2929; font-size: 13px; overflow-wrap: anywhere; }
.order-page #notice:empty { display: none; }

.order-page #order-form { min-width: 0; }
.order-page fieldset { min-width: 0; margin: 0 0 30px; padding: 24px 0 0; border: 0; border-top: 1px solid var(--line-2); }
.order-page legend { padding: 0 16px 0 0; font-size: 20px; font-weight: 500; }
.order-page .fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; }
.order-page .fields label { display: flex; min-width: 0; flex-direction: column; gap: 8px; color: var(--ink-2); font-size: 12px; }
.order-page .fields input { width: 100%; }
.order-page .wide { grid-column: 1 / -1; }

.order-page .fields + .check { margin: 22px 0 0; }
.order-page .check a { text-decoration: underline; text-underline-offset: 3px; }
.order-page .hint { margin: 14px 0 0; color: var(--ink-3); font-size: 12px; line-height: 1.85; word-break: keep-all; overflow-wrap: anywhere; }
.order-page .order-details > .hint { margin-bottom: 28px; }

/* Member UI is inserted directly into the form by order-member.mjs. */
.order-page #order-form > section:not(.order-summary) { padding-bottom: 24px; color: var(--ink-2); font-size: 12px; }
.order-page #order-form > section h2 { margin: 0 0 18px; font-size: 20px; font-weight: 500; }
.order-page [data-benefit-inputs] { display: grid; gap: 18px; }
.order-page [data-benefit-inputs] label { display: flex; flex-direction: column; gap: 8px; }
.order-page #order-form > .hint:empty { display: none; }

.order-page .cart h2 { margin: 0 0 20px; font-size: 20px; font-weight: 500; }
.order-page #cart { overflow-x: auto; }
.order-page table { width: 100%; border-collapse: collapse; font-size: 12px; }
.order-page th,
.order-page td { padding: 12px 4px; border-bottom: 1px solid var(--line-2); text-align: left; vertical-align: top; }
.order-page th { color: var(--ink-3); font-size: 11px; font-weight: 400; }
.order-page td.num { text-align: right; white-space: nowrap; }
.order-page .del { padding: 0 6px; border: 0; background: transparent; color: var(--ink-2); font-size: 20px; line-height: 1; }
.order-page .empty { margin: 0 0 24px; padding: 18px 0; color: var(--ink-3); font-size: 13px; }

.order-page .sumrow { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; font-size: 13px; }
.order-page .sumrow.total { margin-top: 12px; padding-top: 14px; border-top: 1px solid var(--line-2); font-size: 19px; font-weight: 500; }

.order-page #pay:disabled { opacity: 1; background: var(--line-2); border-color: var(--line-2); color: var(--ink-2); }
.order-page #result { margin-top: 28px; padding: 22px; border: 1px solid var(--line-2); background: var(--paper-2); font-size: 14px; overflow-wrap: anywhere; scroll-margin-top: var(--anchor-offset); }
.order-page #result:empty { display: none; }
.order-page #result button { margin: 12px 8px 0 0; }
.order-page #guest-lookup-link { font-size: 14px; text-decoration: underline; }

.order-page .order-shell > .biz-info { margin-top: 40px; }

@media (max-width: 959px) {
  .order-page #order-form > .hint { margin-bottom: 24px; }
}

@media (max-width: 600px) {
  .order-page .tabs { gap: 4px 16px; margin-bottom: 22px; }
  .order-page .tab { font-size: 12px; }
  .order-page .grid { grid-template-columns: 1fr; gap: 28px; }
  .order-page .notes { min-height: 0; }
  .order-page .fields { grid-template-columns: 1fr; gap: 16px; }
  .order-page input:not([type="checkbox"]),
  .order-page select { font-size: 16px; }
}

.order-page [hidden] { display:none !important; }

.order-page #payment-pending:empty,.order-page #cart-storage-notice:empty { display:none; }
.order-page #cart { overflow-x:visible; }
.order-page #cart td:first-child { overflow-wrap:anywhere; }
.order-page #cart .cart-qty { width:56px; min-height:44px; padding:8px 4px; font-size:16px; text-align:center; }

@media(max-width:600px) { .order-page #cart th,.order-page #cart td { padding-left:2px; padding-right:2px; } .order-page #cart td.num { white-space:normal; } }

/* Cart before customer details; payment follows consent and member benefits. */
.order-page .order-head { align-items: end; padding-bottom: 24px; margin-bottom: 28px; border-bottom: 1px solid var(--line-2); }
.order-page .lede { max-width: 520px; margin: 0; font-size: 14px; color: var(--ink-2); }
.order-page .order-layout { display: grid; gap: 0; }
.order-page .order-cart { min-width: 0; margin-bottom: 28px; }
.order-page .order-cart-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; margin-bottom: 12px; }
.order-page .order-cart h2, .order-page .order-summary h2 { margin: 0; font-size: 20px; font-weight: 500; }
.order-page .more-beans { display: inline-flex; margin: 0; font-size: 13px; text-decoration: underline; text-underline-offset: 4px; min-height: 44px; align-items: center; }
.order-page .order-summary { min-width: 0; padding: 24px 26px 26px; border: 1px solid var(--line-2); background: var(--paper-2); border-radius: 2px; }
.order-page .order-summary h2 { margin-bottom: 14px; }
.order-page .sum { padding: 18px 0; border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); font-size: 18px; font-variant-numeric: tabular-nums; margin-top: 0; }
.order-page .pay-note { color: var(--ink-2); }
.order-page .order-cart-alert { margin: 10px 0 0; color: #9c2929; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }   /* [r1 ④] 장바구니 오류 거울 */
.order-page .order-cart-alert:empty { display: none; }
.order-page .field-help { display: block; margin-top: 4px; color: var(--ink-3); font-size: 12px; }
.order-page .zip-pair { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end; }
.order-page .zip-pair label { min-width: 0; }
.order-page .zip-row { align-self: end; margin: 0; }
.order-page .check { display: block; margin: 0 0 10px; color: var(--ink-2); font-size: 12px; line-height: 1.6; min-height: 44px; padding: 8px 0; }      /* 글 사이에 <a> 가 섞여 flex/grid 를 쓰면 글 조각이 따로 놀므로 block 유지 */
.order-page input[type="checkbox"] { width: 20px; height: 20px; margin: 2px 10px 0 0; accent-color: var(--accent); vertical-align: top; }
.order-page #cart .del { min-width: 44px; min-height: 44px; }
.order-page input:user-invalid { border-color: #9c2929; }
.order-page #pay { width: 100%; min-height: 52px; margin-top: 24px; font-size: 15px; }
.order-page .order-details { margin-bottom: 8px; }

@media (min-width: 960px) {
  .order-page #cart-glance { display: none; }
  .order-page .order-layout { grid-template-columns: minmax(0, 1fr) minmax(340px, .7fr); grid-template-rows: auto auto auto auto minmax(0, 1fr); gap: 0 48px; align-items: start; }
  .order-page #order-form { display: contents; }                    /* 양식 조상 보존 */
  .order-page .order-products { grid-column: 1 / -1; grid-row: 1; margin-bottom: 32px; }   /* 도매·저장 차단 때만 보임 */
  .order-page #order-form > p.hint { grid-column: 2; grid-row: 2; margin: 0 0 12px; }        /* 회원 표시 한 줄(회원 모듈이 form 맨 앞에 넣음) */
  .order-page .order-details { grid-column: 1; grid-row: 2 / span 4; }                        /* 줄 2~5 — 줄 5 가 1fr 이라 남는 높이를 다 가져감 */
  .order-page .order-cart { grid-column: 2; grid-row: 3; margin-bottom: 24px; }
  .order-page #order-form > section:not(.order-summary) { grid-column: 2; grid-row: 4; margin-bottom: 24px; }   /* [r1 ②③] 쿠폰·적립금 — 장바구니 아래·결제 칸 바로 위(DOM 도 같은 자리 · §5-5b) */
  .order-page .order-summary { grid-column: 2; grid-row: 5; position: sticky; top: calc(var(--header-h) + 24px); max-height: calc(100dvh - var(--header-h) - 48px); overflow-y: auto; scrollbar-width: thin; }
}
@media (max-width: 959px) {
  .order-page .order-shell { padding-top: 28px; padding-bottom: 56px; }
  .order-page .order-head { padding-bottom: 20px; margin-bottom: 24px; }
}
@media (max-width: 600px) {
  .order-page .order-head { grid-template-columns: 1fr; gap: 12px; }
  .order-page .section-kicker { font-size: 28px; margin-bottom: 8px; }
  .order-page .zip-pair { grid-template-columns: minmax(0, 1fr) auto; }   /* 휴대폰에서도 한 줄 */
  .order-page .order-summary { padding: 22px 18px; }
}
