/* 연하장 소량·세트 바구니(np_basket.php) — 사이트 공용 머리 아래 새 모양 (2026-10-20 QA #2382)
   이 화면 안(.np-basket)만 꾸민다. 결제 입력 조각(np_basket_pay.php)의 옛 표(#tbl_order)도 여기서 줄 모양으로 바꾼다. */

.np-basket {
  box-sizing: border-box;
  width: 100%;
  max-width: var(--bj-content-max, 1000px);
  margin: 0 auto;
  padding: var(--bj-space-3, 32px) var(--bj-page-gutter, 24px) var(--bj-space-4, 64px);
  color: var(--bj-ink, #181817);
  font-family: var(--bj-font-family, "Pretendard Variable", Pretendard, "Noto Sans KR", sans-serif);
  font-size: var(--bj-type-body, 16px);
  line-height: var(--bj-type-body-line, 1.6);
}
.np-basket *, .np-basket *::before, .np-basket *::after { box-sizing: border-box; }

.np-basket .bj-commerce-page-heading { margin-bottom: var(--bj-space-1, 8px); }
.np-basket__lead { margin: 0 0 var(--bj-space-3, 32px); color: var(--bj-muted, #66635e); font-size: var(--bj-type-caption, 14px); }

.np-basket__layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--bj-space-3, 32px); align-items: start; }
.np-basket__main { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--bj-space-2, 16px); }
/* 격자 칸 안의 상자·폼이 내용 폭(옛 입력칸 고정 폭)만큼 버티지 않고 화면 폭으로 줄게 한다 — 320 폭에서 30px 넘쳤다 */
.np-basket__layout > *, .np-basket__main > *, .np-basket__section { min-width: 0; }
.np-basket #tbl_order input, .np-basket #tbl_order select, .np-basket #tbl_order textarea { max-width: 100%; }
.np-basket__aside { position: sticky; top: calc(var(--bj-header-sticky-height, 64px) + 16px); }

.np-basket__section {
  border: var(--bj-order-panel-border, 1px solid #cec8bf);
  border-radius: var(--bj-order-panel-radius, 12px);
  background: #fff;
  padding: 24px;
}
.np-basket__title {
  margin: 0 0 16px;
  font-size: 20px;
  font-weight: var(--bj-type-subsection-weight, 700);
  line-height: 1.4;
}
.np-basket__help { margin: -8px 0 16px; color: var(--bj-muted, #66635e); font-size: var(--bj-type-caption, 14px); }
.np-basket__sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* 담은 상품 */
.np-basket__items { list-style: none; margin: 0; padding: 0; }
.np-basket__item {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto auto 44px;
  gap: 16px;
  align-items: center;
  padding: 16px 0;
  border-top: 1px solid var(--bj-line, #ece9e6);
}
.np-basket__item:first-child { border-top: 0; padding-top: 0; }
.np-basket__thumb { display: block; width: 72px; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--bj-soft-surface, #f5f5f3); }
.np-basket__thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.np-basket__info { min-width: 0; display: grid; gap: 2px; }
.np-basket__info > * { font-size: var(--bj-type-body, 16px); line-height: 1.45; }
.np-basket__type { color: var(--bj-attention, #7d653b); font-size: 13px; font-weight: 600; }
.np-basket__name { color: var(--bj-ink, #181817); font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.np-basket__name:hover { text-decoration: underline; }
.np-basket__code { color: var(--bj-muted, #66635e); font-size: 13px; }
.np-basket .amount_select {
  min-width: 96px; height: 44px; padding: 0 12px;
  border: 1px solid var(--bj-line-strong, #938d86); border-radius: var(--bj-control-radius, 8px);
  background: #fff; color: var(--bj-ink, #181817); font-size: var(--bj-type-control, 15px);
}
.np-basket__price { min-width: 88px; text-align: right; font-size: var(--bj-type-body, 16px); font-weight: 700; white-space: nowrap; }
.np-basket #total_price_txt { font-size: var(--bj-type-body, 16px); }
.np-basket .np_backet_list_price_free { display: block; font-size: 12px; font-weight: 400; color: var(--bj-success, #3f6b4f); }
.np-basket__remove {
  width: 44px; height: 44px; display: grid; place-items: center;
  border: 0; border-radius: var(--bj-control-radius, 8px); background: transparent; color: var(--bj-muted, #66635e); cursor: pointer;
}
.np-basket__remove:hover { background: var(--bj-soft-surface, #f5f5f3); color: var(--bj-ink, #181817); }
.np-basket__remove svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.np-basket__empty { margin: 0; padding: 32px 0; text-align: center; color: var(--bj-muted, #66635e); }
.np-basket__more {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; margin-top: 16px; padding: 0 20px;
  border: 1px solid var(--bj-line-strong, #938d86); border-radius: var(--bj-control-radius, 8px);
  color: var(--bj-ink, #181817); font-size: var(--bj-type-control, 15px); text-decoration: none; background: #fff;
}
.np-basket__more:hover { background: var(--bj-soft-surface, #f5f5f3); }

/* 비회원 안내 */
.np-basket__guest {
  display: flex; gap: 16px; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-radius: var(--bj-order-panel-radius, 12px); background: var(--bj-soft-surface, #f5f5f3);
  font-size: var(--bj-type-caption, 14px); color: var(--bj-muted, #66635e);
}
.np-basket__guest p { margin: 0; }
.np-basket__guest-actions { display: flex; gap: 8px; flex: none; }
.np-basket__guest-actions a {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px;
  border: 1px solid var(--bj-line-strong, #938d86); border-radius: var(--bj-control-radius, 8px);
  background: #fff; color: var(--bj-ink, #181817); text-decoration: none; white-space: nowrap;
}

/* 배송 정보 — 옛 표(#tbl_order)를 줄 모양으로 */
.np-basket #tbl_order { width: 100%; border-collapse: collapse; }
.np-basket #tbl_order > tbody > tr > th,
.np-basket #tbl_order > tbody > tr > td {
  height: auto; padding: 12px 0; border-bottom: 1px solid var(--bj-line, #ece9e6);
  font-size: var(--bj-type-control, 15px); font-weight: 400; vertical-align: middle;
}
.np-basket #tbl_order > tbody > tr > th { width: 104px; padding-right: 16px; text-align: left; color: var(--bj-muted, #66635e); font-weight: 600; }
.np-basket #tbl_order > tbody > tr > td { padding-left: 0; text-align: left; }
.np-basket #tbl_order input[type=text],
.np-basket #tbl_order input[type=tel],
.np-basket #tbl_order select,
.np-basket #tbl_order textarea {
  min-height: 44px; padding: 8px 12px;
  border: 1px solid var(--bj-line-strong, #938d86); border-radius: var(--bj-control-radius, 8px);
  background: #fff; color: var(--bj-ink, #181817); font-size: var(--bj-type-control, 15px);
}
.np-basket #tbl_order input[type=tel] { width: 76px; }
.np-basket #tbl_order textarea { width: 100%; min-height: 88px; }
.np-basket #tbl_order input[name=addr1], .np-basket #tbl_order input[name=addr2] { width: 100%; max-width: 100%; }

.np-basket .renew-address-search { display: flex; gap: 8px; margin-bottom: 8px; }
.np-basket .renew-address-search .zip_number { width: 112px; flex: none; }
.np-basket .renew-address-search__button {
  min-height: 44px; padding: 0 16px; flex: none;
  border: 1px solid var(--bj-line-strong, #938d86); border-radius: var(--bj-control-radius, 8px);
  background: #fff; color: var(--bj-ink, #181817); font-size: var(--bj-type-control, 15px); cursor: pointer;
}
.np-basket #tbl_order .addr1_wrapper, .np-basket #tbl_order .addr2_wrapper { width: 100%; }
.np-basket #tbl_order input.addr1 { margin-bottom: 8px; }

/* 결제방법 */
.np-basket__payways { display: flex; flex-wrap: wrap; gap: 8px; }
.np-basket .pm_btns {
  min-height: 44px; padding: 0 18px;
  border: 1px solid var(--bj-line-strong, #938d86); border-radius: var(--bj-control-radius, 8px);
  background: #fff; color: var(--bj-ink, #181817); font-size: var(--bj-type-control, 15px); cursor: pointer;
}
.np-basket .pm_btns.is-selected { border-color: var(--bj-ink, #181817); background: var(--bj-ink, #181817); color: #fff; }
.np-basket .pm_btns:focus-visible, .np-basket__submit:focus-visible { outline: 2px solid var(--bj-ink, #181817); outline-offset: 2px; }

/* 주문 요약 */
.np-basket__summary dl { width: 100%; margin: 0 0 16px; display: grid; gap: 8px; text-align: left; }
.np-basket__summary dl > div { display: flex; width: 100%; justify-content: space-between; gap: 16px; }
.np-basket__summary dt, .np-basket__summary dd { float: none; width: auto; margin: 0; padding: 0; font-size: var(--bj-type-body, 16px); font-weight: 400; line-height: 1.5; }
.np-basket__summary dt { color: var(--bj-muted, #66635e); text-align: left; }
.np-basket__summary dd { text-align: right; }
.np-basket__summary .np-basket__total { margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--bj-line, #ece9e6); font-weight: 700; }
.np-basket__summary .np-basket__total dt { color: var(--bj-ink, #181817); }
.np-basket__summary .np-basket__total dt, .np-basket__summary .np-basket__total dd { font-weight: 700; }
.np-basket__summary .np-basket__total dd { font-size: 20px; }
.np-basket__summary .np-basket__help { margin: 0 0 16px; }
.np-basket__submit {
  width: 100%; min-height: 52px; border: 0; border-radius: var(--bj-control-radius, 8px);
  background: var(--bj-ink, #181817); color: #fff; font-size: var(--bj-type-action, 16px); font-weight: 700; cursor: pointer;
}
.np-basket__submit:disabled { background: var(--bj-line-strong, #938d86); cursor: not-allowed; }

/* PC 카드·휴대폰 결제 창 — 옛 자리(본문 아래 절대 위치) 대신 화면 가운데 */
.np-basket__payif { position: relative; }
.np-basket__payif #payif {
  position: fixed; z-index: 10000; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(650px, calc(100vw - 32px)); height: min(650px, calc(100vh - 32px));
  border: 1px solid var(--bj-line-strong, #938d86); border-radius: 12px; background: #fff;
  box-shadow: 0 16px 48px rgba(0, 0, 0, .2);
}

@media (max-width: 767px) {
  .np-basket { padding: 16px var(--bj-page-gutter-mobile, 16px) 120px; }
  .np-basket .bj-commerce-page-heading__back { display: none; } /* 짧은 머리가 뒤로 가기를 맡는다 */
  .np-basket__layout { grid-template-columns: minmax(0, 1fr); gap: var(--bj-space-2, 16px); }
  .np-basket__aside { position: static; }
  .np-basket__section { padding: 20px 16px; }
  .np-basket__item { grid-template-columns: 64px minmax(0, 1fr) auto; grid-template-areas: "thumb info remove" "thumb qty price"; gap: 8px 12px; }
  .np-basket__thumb { grid-area: thumb; width: 64px; align-self: start; }
  .np-basket__info { grid-area: info; }
  .np-basket__qty { grid-area: qty; }
  .np-basket__price { grid-area: price; min-width: 0; justify-self: end; }
  .np-basket__remove { grid-area: remove; align-self: start; justify-self: end; }
  .np-basket__guest { flex-direction: column; align-items: stretch; }
  .np-basket__guest-actions a { flex: 1; justify-content: center; }
  .np-basket #tbl_order > tbody > tr > th,
  .np-basket #tbl_order > tbody > tr > td { display: block; width: auto; padding: 0; border-bottom: 0; }
  .np-basket #tbl_order > tbody > tr > th { padding-top: 12px; padding-bottom: 6px; }
  .np-basket #tbl_order > tbody > tr > td { padding-bottom: 12px; border-bottom: 1px solid var(--bj-line, #ece9e6); }
  .np-basket #tbl_order input[name=eml1], .np-basket #tbl_order input[name=eml2] { width: calc(50% - 14px) !important; }
  .np-basket #tbl_order input[type=tel] { width: calc(33.3% - 14px); }
  .np-basket .pm_btns { flex: 1; }
}
