/* ==========================================================================
   order.css (주문서 작성)
   - 회원/비회원, 단일/복수 배송지를 order.html 한 파일에서 전환한다.
   - 공통 컴포넌트(.btn / .chip / .form-input / .form-select / .form-check /
     .price / .product-badge / .pay-summary)를 그대로 가져다 쓰고,
     이 파일에는 이 페이지의 레이아웃과 전용 요소만 둔다.
   - 반응형: PC 퍼스트
     PC     : 1100px 이상 (기본값)
     Tablet : @media (max-width: 1099px)
     Mobile : @media (max-width: 767px)
   ========================================================================== */

/* ==========================================================================
   화면 상태 전환 (회원/비회원 · 단일/복수 배송지)
   - <main> 의 data-login (member | guest) 과
     data-ship-mode (single | multi) 두 값으로만 갈린다. 서로 독립이라
     네 가지 시안(회원·비회원 × 단일·복수)이 이 4줄로 모두 나온다.
   - 상태별 요소에는 아래 4개 클래스 중 하나(또는 둘)를 붙인다.
       .order-member-only : 로그인 상태에서만 노출
       .order-guest-only  : 비로그인 상태에서만 노출
       .order-single-only : 배송지가 1곳일 때만 노출
       .order-multi-only  : 상품별 배송지일 때만 노출
   ========================================================================== */
/* 헤더의 모바일 전체메뉴(.allmenu-mo)도 data-login 을 쓰므로 main 으로 범위를 좁힌다 */
main[data-login="guest"] .order-member-only,
main[data-login="member"] .order-guest-only,
main[data-ship-mode="single"] .order-multi-only,
main[data-ship-mode="multi"] .order-single-only {
  display: none;
}

/* ==========================================================================
   페이지 레이아웃
   - 좌 : 입력 폼 / 우 : 결제 금액. 장바구니와 같은 768 : 384 비율을 fr 로 옮겨
     고정 너비를 쓰지 않는다.
   ========================================================================== */
.order {
  padding: var(--space-64) 0 var(--space-32);
}

.order__inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-32);
}

.order__tit {
  font-size: var(--fz-heading-l);
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-primary);
}

.order__body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.5fr);
  gap: var(--space-48);
  /* start 여야 우측 결제 금액의 sticky 가 동작한다 (stretch 면 박스가 컬럼 높이만큼
     늘어나 붙을 자리가 없어짐) */
  align-items: start;
}

.order__info {
  display: flex;
  flex-direction: column;
  gap: var(--space-64);
  min-width: 0;
}

/* 우측 결제 금액 : 스크롤을 따라 상단에 붙는다.
   헤더가 position:relative(스크롤 고정 아님)라 헤더 높이를 뺄 필요가 없다 */
.order-summary {
  position: sticky;
  top: var(--space-24);
}

/* ==========================================================================
   섹션 공통 (주문상품 / 배송지 / 배송날짜 / 할인적립 / 결제수단)
   ========================================================================== */
.order-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-24);
}

/* display 를 지정했으므로 [hidden] 규칙을 반드시 같이 둔다 —
   영수증 신청 섹션이 hidden 속성으로 여닫힌다 (order.js initPayMethod) */
.order-section[hidden] {
  display: none;
}

/* common 의 .form-check__label 기본값(--fz-label-l)은 대부분 그대로 두고,
   아래 두 곳(배송지 같아요/달라요 · 결제수단 · 영수증신청 라디오)만 --fz-body-xs,  --fz-body-s로 줄인다 (요청) */
.order-ship-mode__opts .form-check__label,
.order-pay__item .form-check__label {
  font-size: var(--fz-body-s);
}

/* 일반 상품이 1개뿐이면 "상품별로 배송지가 달라요" 는 고를 수 없다 (disabled).
   공통 .form-check 에는 비활성 모양이 없어서, 눌러도 안 된다는 게 보이도록 이 페이지에서만 옅게 처리한다 */
.order-ship-mode .form-check__input:disabled + .form-check__label {
  opacity: 0.4;
  cursor: not-allowed;
}

.order-section__head {
  padding-bottom: var(--space-14);
  border-bottom: 1px solid var(--text-primary);
}

.order-section__tit {
  font-size: var(--fz-body-xl);
  font-weight: 600;
  line-height: var(--lh-body);
  color: var(--text-primary);
}

.order-section__count {
  margin-left: var(--space-8);
  font-size: var(--fz-body-s);
  font-weight: 500;
  color: var(--text-secondary);
}

.order-section__req {
  margin-left: var(--space-8);
  font-size: var(--fz-body-xs);
  font-weight: 600;
  color: var(--brand-primary);
}

.order-section__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-32);
}

/* 결제수단은 항목마다 구분선이 있어 바깥 간격을 두지 않는다 */
.order-section__body--flush {
  gap: 0;
}

/* ==========================================================================
   주문 상품 (order-item)
   - 장바구니의 .cart-item 과 달리 체크박스 · 수량 · 삭제가 없고,
     가격이 우측 하단이 아니라 정보 컬럼 안에서 왼쪽 정렬로 쌓인다.
     구성이 달라 별도 블록으로 두고, 안쪽 배지·가격은 공통 컴포넌트를 그대로 쓴다.
   ========================================================================== */
.order-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
}

/* 이 페이지는 VIP 카드·더블 쿠폰 전환(order.js initVipDiscount) 때문에
   .product-badge 를 hidden 속성으로 여닫는다. 그런데 공통 .product-badge 가
   display: inline-flex 를 강제하고 있어 hidden 의 display:none 보다 우선해버려,
   텍스트가 비어 있어도 padding·둥근 모서리만 남아 작은 점처럼 보이는 문제가 있었다.
   공유 파일(common.css)은 건드리지 않고 이 페이지 안에서만 hidden 을 되살린다 */
.order-item .product-badge[hidden],
.order-ship__product-head .product-badge[hidden] {
  display: none;
}

.order-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-24);
  padding-top: var(--space-24);
  border-top: 1px solid var(--border-default);
}

.order-item:first-child {
  padding-top: 0;
  border-top: 0;
}

.order-item + .order-item {
  margin-top: var(--space-24);
}

/* 상품별 카드 — 상품이 여러 개일 때 어디서 어디까지가 한 상품인지 보이도록 (order/index.php · order/index2.php)
   선 하나로만 나누면 상품 · 옵션 상품 · 문구 입력칸이 이어져 보여서, 옅은 테두리 안에 상품마다 묶는다.
   .order-list--card 가 붙은 목록에만 적용되고, 다른 주문서(order.html · order-edit.html)는 그대로다 */
.order-list--card .order-item,
.order-list--card .order-item:first-child {
  padding: var(--space-24);
  border: 1px solid var(--border-default);
  border-radius: 8px;
}

/* 카드 사이 간격은 아래 margin-top 하나로만 둔다 (.order-list 의 gap 은 빼서 간격이 이중으로 잡히지 않게) */
.order-list--card {
  gap: 0;
}

.order-list--card .order-item + .order-item {
  margin-top: var(--space-16);
}

/* 상품 번호 + 회원 혜택 배지는 한 묶음으로 붙여서 오른쪽 끝에, 상품명은 왼쪽에 둔다.
   (번호는 마크업에서 상품명 바로 뒤, 배지 앞에 있다. 상품명이 남는 폭을 차지해 둘을 오른쪽으로 민다)
   모바일은 아래 Mobile 구간의 배치(배지 줄 → 상품명 줄)를 그대로 쓴다 */
/* 번호 ↔ 배지 간격은 모바일 배치와 같은 4px (모바일은 .order-item__info 의 gap 토큰이 줄어 4px 가 된다).
   PC 에서는 토큰이 8px 라 같은 값을 직접 쓴다. 상품명과 번호 사이는 따로 12px 를 띄워 둔다 */
/* (.order-list--num : 상품 번호가 있는 목록. 카드 테두리(.order-list--card)와 따로 켠다 — index2.php 는 번호만 쓰고 카드는 쓰지 않는다) */
.order-list--num .order-item__head {
  justify-content: flex-start;
  gap: 4px;
}

.order-list--num .order-item__name {
  margin-right: auto;
  padding-right: var(--space-12);
}

.order-item__product {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: var(--space-24);
  align-items: start;
}

.order-item__img {
  overflow: hidden;
  border-radius: 8px;
  aspect-ratio: 1 / 1;
}

.order-item__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.order-item__info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-8);
}

/* 상품 번호 ("상품 1") — 같은 상품을 여러 개 담아도 구분되게 한다.
   바로 옆의 회원 할인 · 적립 배지(.product-badge, common.css)와 같은 모양(패딩 · 라운드 · 글자)이고,
   회원 혜택 배지가 주인공이라 색만 옅은 회색으로 뺀다 */
.order-item__no[hidden] {
  display: none;
}

.order-item__no {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 8px;
  border-radius: var(--space-8);
  background: var(--base-gray);
  font-size: var(--fz-caption);
  font-weight: 600;
  white-space: nowrap;
  color: var(--text-secondary);
}

/* width: 100% 로 .order-item__info 폭을 꽉 채워서, 안의 할인·적립 배지가
   justify-content: space-between 으로 PC 기준 오른쪽 끝에 붙는다 (요청) */
.order-item__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-12);
  width: 100%;
}

.order-item__name {
  font-size: var(--fz-body-l);
  font-weight: 500;
  line-height: var(--lh-body);
  color: var(--text-primary);
}

.order-item__option {
  font-size: var(--fz-body-xs);
  font-weight: 400;
  line-height: var(--lh-tight);
  color: var(--text-secondary);
}

/* 옵션이 여러 개일 때 " / " 로 구분 (구분자는 텍스트가 아니라 장식) */
.order-item__option-divider {
  margin: 0 var(--space-12);
}

/* ===== [주석처리] 2026-10-08 / order/index2.php 에서만 쓰는 스타일 =====
   order/index.php 가 최종본이 되면서 .order-attach 는 index.php 에서 쓰이지 않는다.
   index2.php 를 다시 쓸 일이 없으면 삭제해도 된다. */
/* ----- 옵션 상품을 한 줄의 상품으로 둘 때 (order/index2.php 상품 3) -----
   리본/카드 자리(.order-msg__top)와 같은 점선으로 상품 정보와 구분하고,
   그 아래에 "함께 배송할 상품" 선택칸을 둔다.
   라벨은 리본 문구 입력칸의 "보내는 분 (왼쪽 리본)"과 같은 .order-msg__label, 라벨과 입력칸 간격도 .order-msg__field 와 같은 8px */
/* .order-attach {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: var(--space-24);
  border-top: 1px dashed var(--border-default);
} */
/* ===== [주석처리 끝] ===== */

/* ----- 추가 옵션 상품 (케이크 등) — order/index.php -----
   상품 정보 바로 아래에 "ㄴ [썸네일] 이름 … 가격" 한 줄로 붙는다.
   본 상품보다 한 단계 아래라는 게 보이도록 썸네일을 작게 하고 옅은 면 위에 올린다. */
.order-addon-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.order-addon {
  display: flex;
  align-items: center;
  gap: var(--space-12);
  padding: var(--space-12) var(--space-16);
  border-radius: 8px;
  background: var(--base-gray);
}

/* ㄴ 모양 표시 — 글자가 아니라 장식이라 선 두 개로 그린다 */
.order-addon::before {
  content: '';
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  margin-bottom: 6px;
  border-left: 1px solid var(--text-muted);
  border-bottom: 1px solid var(--text-muted);
}

.order-addon__img {
  flex-shrink: 0;
  overflow: hidden;
  width: 44px;
  border-radius: 8px;
  aspect-ratio: 1 / 1;
  background: var(--base-white);
}

.order-addon__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 이름이 남는 폭을 다 차지해서 가격을 오른쪽 끝으로 민다 */
.order-addon__name {
  flex: 1;
  min-width: 0;
  font-size: var(--fz-body-xs);
  line-height: var(--lh-tight);
  color: var(--text-primary);
}

.order-addon__price {
  flex-shrink: 0;
  font-size: var(--fz-body-xs);
  font-weight: 600;
  line-height: var(--lh-tight);
  color: var(--text-primary);
}

/* 공통 .price 를 세로 정렬로만 바꿔 쓴다 (common.css 의 정의는 건드리지 않는다) */
.order-item .price {
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  margin-top: var(--space-8);
}

.order-item .price__now {
  font-weight: 600;
}

/* 할인·적립 안내 문구 — 장바구니의 .cart-item__price-note 와 같은 규격.
   초록(#2F7A4A)은 common.css 의 .product-badge--point 와 같은 값이다.
   토큰이 없어 값을 그대로 쓴다 (base.css 는 공유 파일이라 별도 승인 필요) */
.order-item__price-note {
  font-size: 13px;
  line-height: var(--lh-tight);
  font-weight: 600;
}

.order-item__price-note--discount {
  color: var(--brand-primary);
}

.order-item__price-note--point {
  color: #2F7A4A;
}

/* ==========================================================================
   리본 / 카드 문구 (order-msg)
   - 칩으로 리본 · 카드 · 없음을 고르면 아래 패널이 바뀐다.
   - 패널 전환은 JS 가 hidden 속성으로 처리하므로, display 를 준 요소에는
     [hidden] 규칙을 반드시 같이 둔다 (common.css 의 .search-mo 와 같은 방식)
   ========================================================================== */
.order-msg {
  display: flex;
  flex-direction: column;
  gap: var(--space-24);
}

.order-msg__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-16);
  flex-wrap: wrap;
  padding-top: var(--space-24);
  border-top: 1px dashed var(--border-default);
}

.order-msg__chips {
  display: flex;
  gap: var(--space-8);
}

.order-msg__panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
}

.order-msg__panel[hidden] {
  display: none;
}

.order-msg__field {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.order-msg__label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-12);
  font-size: var(--fz-body-xs);
  font-weight: 500;
  line-height: var(--lh-tight);
  color: var(--text-primary);
}

.order-msg__count {
  font-size: var(--fz-caption);
  font-weight: 400;
  color: var(--text-muted);
}

/* .form-input 은 한 줄 입력용(높이 50px / 세로 여백 없음)이라 여기서만 되돌린다 */
.order-msg__textarea {
  min-height: 110px;
  padding: var(--space-16) var(--space-24);
  line-height: var(--lh-body);
  resize: vertical;
}

.order-msg__sug {
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
}

.order-msg__sug-btn {
  align-self: flex-start;
  font-size: 13px;
  font-weight: 500;
  line-height: var(--lh-tight);
  color: var(--brand-primary);
  margin-bottom: 4px;
}

/* 접힘/펼침 표시. 이미지 없이 문자로 그린다 */
.order-msg__sug-btn::after {
  content: '+';
  margin-left: 4px;
}

.order-msg__sug-btn[aria-expanded="true"]::after {
  content: '−';
}

.order-msg__sug-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-8);
  margin-bottom:  var(--space-14);
}

.order-msg__sug-list[hidden] {
  display: none;
}

/* common 의 .chip--s 기본값(--fz-caption)보다 한 단계 큰 --fz-label-l 로 (요청) */
.order-msg__chips .chip--s {
  font-size: var(--fz-body-xxs);
}

/* 추천·예시 문구 칩은 --fz-body-xxs 로 (요청) */
.order-msg__sug-list .chip--s {
  font-size: var(--fz-body-xxs);
}

.order-msg__notice {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: var(--space-16);
}

.order-msg__notice li {
  position: relative;
  padding-left: var(--space-8);
  font-size: var(--fz-caption);
  line-height: var(--lh-body);
  color: var(--text-secondary);
}

/* ==========================================================================
   받는 분 · 배송지 (order-ship)
   - 같은 블록을 단일 배송지 1개 / 복수 배송지 N개로 재사용한다.
     복수일 때만 켜지는 조각(.order-ship__product / 블록별 배송일)은
     마크업에 .order-multi-only 를 붙여 위의 상태 전환 규칙이 처리한다.
   ========================================================================== */
.order-ship-mode {
  display: flex;
  align-items: center;
  gap: var(--space-24);
  flex-wrap: wrap;
}

.order-ship-mode__q {
  font-size: var(--fz-body-s);
  font-weight: 600;
  line-height: var(--lh-tight);
  color: var(--text-primary);
}

.order-ship-mode__opts {
  display: flex;
  gap: var(--space-24);
}

.order-ship-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-48);
}

.order-ship {
  display: flex;
  flex-direction: column;
  gap: var(--space-24);
}

/* 복수 배송지일 때 블록 맨 위에 붙는 상품 요약 */
.order-ship__product {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr) auto;
  gap: var(--space-16);
  /* 위쪽 정렬 — 오른쪽 [배송지 N] 이 상품 번호 · 혜택 배지와 같은 첫 줄에 맞는다 */
  align-items: start;
  padding-bottom: var(--space-16);
  border-bottom: 1px solid var(--border-default);
}

.order-ship__product-img {
  overflow: hidden;
  border-radius: 8px;
  aspect-ratio: 1 / 1;
}

.order-ship__product-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.order-ship__product-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
}

/* [상품 번호][혜택 배지] 한 줄 → 상품명 줄 (주문상품 목록 모바일 배치와 같다. 번호 ↔ 배지 간격 4px).
   번호가 없는 페이지(order.html · order-edit.html)는 배지 한 줄 → 상품명 줄로 이전과 똑같이 보인다 */
.order-ship__product-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-8) 4px;
}

.order-ship__product-name {
  flex-basis: 100%;
  font-size: var(--fz-body-s);
  font-weight: 500;
  line-height: var(--lh-tight);
  color: var(--text-primary);
}

.order-ship__product-option {
  font-size: var(--fz-caption);
  line-height: var(--lh-tight);
  color: var(--text-secondary);
}

/* 상품별 배송지 블록 상단 : 이 배송지로 함께 가는 옵션 상품 ("+ 케익(소) 랜덤") */
.order-ship__product-attach {
  font-size: var(--fz-caption);
  font-weight: 500;
  line-height: var(--lh-tight);
  color: var(--brand-primary);
}

.order-ship__badge {
  flex-shrink: 0;
  padding: 4px 8px;
  border-radius: 8px;
  background: var(--brand-primary);
  font-size: var(--fz-caption);
  font-weight: 600;
  line-height: var(--lh-tight);
  color: var(--base-white);
  white-space: nowrap;
}

.order-ship__load {
  align-self: flex-start;
}

/* 배송지 블록 안의 "배송지 선택" 버튼은 한 단계 작은 텍스트로 (요청).
   common 의 .btn 기본값(--fz-body-s)보다 작은 --fz-body-xs 로 페이지 스코프에서만 낮춘다.
   (우편번호 검색 · VIP 적용 · 쿠폰 등록 · 적립금 사용 버튼은 .order-field__btn 쪽에 정리) */
.order-ship .btn {
  font-size: var(--fz-body-xs);
}

/* ===== 폼 그룹 · 라벨 (주문서 공용) =====
   배송지 · 배송일 · 할인적립 · 영수증 신청이 모두 같은 형태(라벨 위 + 입력칸 아래)라
   블록별로 나누지 않고 이 두 클래스 하나로 쓴다.
   (2026-09-02 : .order-ship__group / .order-ship__label 에서 이름 변경 — 배송지 전용이
    아니라 이미 VIP카드 · 쿠폰 · 적립금에서도 쓰고 있었음) */
.order-fields {
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
}

.order-label {
  margin-bottom: 4px;
  font-size: var(--fz-body-xs);
  font-weight: 500;
  line-height: var(--lh-tight);
  color: var(--text-primary);
}

/* 주문자 정보 아래 안내문구 (Figma : node-id=919-26866) */
.order-buyer__note {
  font-size: var(--fz-caption);
  line-height: var(--lh-body);
  color: var(--text-secondary);
}

/* ----- 이 배송지 저장 : 체크박스 + (체크 시에만) 배송지명 입력칸 -----
   배송지명 때문에 항상 폼이 늘어나 보이지 않도록, 체크 전에는 입력칸을 아예 감춘다 */
.order-ship__save {
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
}

.order-ship__save-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  /* 체크박스 텍스트와 줄을 맞춘다 (박스 18px + form-check__label gap 8px, common.css 참고) */
  padding-left: 26px;
}

.order-ship__save-field[hidden] {
  display: none;
}

/* 위 .order-label 의 margin-bottom 은 이 필드 안에서는 gap 이 대신하므로 상쇄 */
.order-ship__save-field .order-label {
  margin-bottom: 0;
}

.order-field__optional {
  margin-left: 4px;
  font-weight: 400;
  color: var(--text-muted);
}

.order-ship__row {
  display: flex;
  gap: var(--space-8);
}

/* 우편번호 + 검색 버튼 */
.order-ship__row--zip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
}

/* ----- 우편번호 검색 팝업 -----
   배송지 팝업과 같은 껍데기(.order-modal)를 쓰고, 폭도 그대로(550px, .order-modal__panel
   기본값) 맞춘다. 위젯은 iframe 으로 들어오므로 높이만 여기서 정해준다
   (embed 시 height: '100%' 로 넘기면 이 높이를 따라온다) */
.zip-embed {
  height: 480px;
  max-height: 70vh;
  padding: 0 var(--space-24) var(--space-24);
}

.zip-embed iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

/* 개발 참고용 예시 이미지 — 실제 embed(iframe)로 교체되면 이 규칙은 필요 없어진다 */
.zip-embed img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ==========================================================================
   입력 + 우측 버튼 / 안내문구 (배송지 · 할인적립 공용)
   ========================================================================== */
/* 우편번호 검색 · VIP 적용 · 쿠폰 등록 · 적립금 사용 버튼은 한 단계 작은 텍스트로 (요청).
   common 의 .btn 기본값(--fz-body-s)보다 작은 --fz-body-xs 로 페이지 스코프에서만 낮춘다.
   토큰이 변수설정값(base.css)이라 모바일에서 별도 오버라이드 없이 13px로 자동으로 줄어든다 */
.order-field__btn {
  flex-shrink: 0;
  min-height: 50px;
  padding: 0 var(--space-24);
  font-size: var(--fz-body-xs);
}

.order-field__hint {
  font-size: var(--fz-caption);
  line-height: var(--lh-tight);
  color: var(--text-secondary);
}

.order-field__hint--own strong {
  font-weight: 600;
  font-size: var(--fz-body-xs);
  color: var(--brand-primary);
}

/* 입력칸 오른쪽 안쪽에 표기를 얹는 자리 (VIP 카드 체크 · 적립금 "원") */
.order-field__suffix {
  position: relative;
  flex: 1;
  min-width: 0;
}

.order-field__suffix .form-input {
  padding-right: 48px;
}

/* ===== [추가] 2026-09-09 / 적용 상태 체크 표시 =====
   [적용]/[사용] 을 누르면 JS(initApplyToggle)가 hidden 을 벗겨 이 체크를 띄운다.
   hidden 속성으로만 여닫으므로 여기서 display 를 지정하면 안 된다 */
.order-field__check {
  position: absolute;
  top: 50%;
  right: var(--space-24);
  width: 20px;
  height: 20px;
  transform: translateY(-50%);
  background: url('../../images/order/svg/icon-check-circle.svg') no-repeat center / 20px 20px;
}
/* ===== [추가 끝] ===== */

/* 적립금 : 금액이라 우측 정렬하고, 오른쪽 안쪽에 "원" 표기가 붙는다 */
.order-field__suffix--amount .form-input {
  text-align: right;
}

/* 체크는 "원" 뒤(오른쪽 끝)에 붙는다. 체크가 켜져 있을 때만 "원" 을 왼쪽으로 밀고
   금액이 체크에 가리지 않도록 입력칸 오른쪽 여백을 넓힌다
   (꺼져 있을 때는 원래대로 "원" 이 오른쪽 끝에 붙어 여백이 뜨지 않음) */
.order-field__suffix--amount:has(.order-field__check:not([hidden])) .form-input {
  padding-right: 70px;
}

.order-field__suffix--amount:has(.order-field__check:not([hidden])) .order-field__unit {
  right: 52px;
}

.order-field__unit {
  position: absolute;
  top: 50%;
  right: var(--space-24);
  transform: translateY(-50%);
  font-size: 15px;
  line-height: var(--lh-tight);
  color: var(--text-secondary);
}

/* ==========================================================================
   배송 안내 박스 (축하화환 / 근조화환)
   ========================================================================== */
.order-notice {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  padding: 20px var(--space-24);
  border-radius: 8px;
  background: var(--base-gray);
}

.order-notice__tit {
  font-size: var(--fz-body-s);
  font-weight: 600;
  line-height: var(--lh-tight);
  color: var(--brand-primary);
}

.order-notice__txt {
  font-size: var(--fz-body-xxs);
  line-height: var(--lh-tight);
  color: var(--text-secondary);
}

.order-notice__txt strong {
  font-weight: 600;
  color: var(--text-primary);
}

/* ==========================================================================
   배송 날짜 · 시간
   - 달력은 PC 전용. 태블릿·모바일은 시안대로 오른쪽 셀렉트만 쓴다.
   ========================================================================== */
.order-date {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-48);
  align-items: start;
}

.order-date__panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
}

/* 연도 셀렉트(.order-date__selects 의 직계 select)와 월·일 묶음(.order-date__md)을
   flex-wrap 으로 감싼다. 자리가 좁아지면 셀렉트 안 글자("2026년" 등)가 잘리는 대신,
   월·일이 한 덩어리로 다음 줄로 내려간다 (연도만 따로 떨어지지 않도록 묶어서 처리) */
.order-date__selects {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-8);
}

/* min-width 는 "2026년"이 화살표 자리(오른쪽 48px)까지 포함해 안 잘리는 실측값(123px).
   이 아래로는 줄어들지 않고 통째로 다음 줄로 넘어간다 */
.order-date__selects > .form-select {
  flex: 1 1 124px;
  min-width: 124px;
}

/* "08월" · "27일" 도 같은 방식으로 실측(각 105px). 묶음 전체 최소폭은 105+8+105 */
.order-date__md {
  display: flex;
  flex: 2 1 218px;
  min-width: 218px;
  gap: var(--space-8);
}

.order-date__md .form-select {
  flex: 1 1 0;
  min-width: 105px;
}

.calendar {
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
}

.calendar__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-16);
}

.calendar__title {
  font-size: var(--fz-body-l);
  font-weight: 500;
  line-height: var(--lh-tight);
  color: var(--text-primary);
}

/* 좌우 화살표 — 이미지 없이 border 두 변을 회전시켜 그린다 */
.calendar__nav {
  position: relative;
  width: 32px;
  height: 32px;
}

.calendar__nav::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  border: solid var(--text-primary);
  border-width: 0 1px 1px 0;
}

.calendar__nav--prev::before {
  transform: translate(-35%, -50%) rotate(135deg);
}

.calendar__nav--next::before {
  transform: translate(-65%, -50%) rotate(-45deg);
}

.calendar__weekdays,
.calendar__grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: var(--space-8);
}

.calendar__weekday {
  font-size: var(--fz-body-xs);
  line-height: var(--lh-tight);
  color: var(--text-secondary);
  text-align: center;
}

.calendar__weekday--sun {
  color: var(--brand-primary);
}

.calendar__cell {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  font-size: var(--fz-body-s);
  line-height: var(--lh-tight);
  color: var(--text-primary);
}

/* 지난 날짜 등 고를 수 없는 날 */
.calendar__cell:disabled {
  color: var(--text-muted);
  cursor: default;
}

.calendar__cell.is-selected {
  background: var(--brand-primary);
  font-weight: 600;
  color: var(--base-white);
}

/* 1일 앞의 빈칸 — 자리만 차지한다 */
.calendar__cell--empty {
  visibility: hidden;
}

/* ==========================================================================
   결제 수단
   ========================================================================== */
.order-pay {
  display: flex;
  flex-direction: column;
}

.order-pay__item {
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
  padding: var(--space-24) 0;
  border-bottom: 1px solid var(--border-default);
}

/* 첫 항목(신용카드)은 섹션 제목 아래 여백(.order-section 의 gap)과 겹쳐 혼자 넓어 보여서
   위 패딩을 한 단계 줄인다 */
.order-pay__item:first-child {
  padding-top: var(--space-12);
}

/* 라디오 한 줄 + 우측 안내 버튼 (간편결제만 해당) */
.order-pay__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-16);
}

.order-pay__guide-btn {
  flex-shrink: 0;
  font-size: var(--fz-caption);
  line-height: var(--lh-tight);
  color: var(--brand-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.order-pay__detail {
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
}

.order-pay__detail[hidden] {
  display: none;
}

.order-pay__easy {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-8);
}

.order-pay__easy-item {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: var(--space-12);
  border: 1px solid var(--border-default);
  border-radius: 8px;
}

/* 로고 SVG 는 브랜드마다 원본 폭이 달라(58~122px) 높이는 24px 를 상한으로 맞추고
   폭은 비율대로 따라가게 둔다. width/height 를 모두 auto 로 두고 max-width/max-height
   로만 제한해야 버튼이 좁아져도 종횡비가 깨지지 않는다
   (height 를 고정값으로 두면 max-width 가 폭만 줄여 찌그러짐이 생김) */
.order-pay__easy-item img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 24px;
}

/* 애플페이 로고 원본 파일은 다른 브랜드 로고보다 상하 여백이 많아 같은 max-height(24px)
   기준으로는 글자가 유독 작아 보인다. 시각적 크기를 옆 로고들과 맞추기 위해 이 항목만 상한을 올림 */
.order-pay__easy-item[data-easy="applepay"] img {
  max-height: 32px;
}

.order-pay__easy-item.is-active {
  border-color: var(--brand-primary);
}

.order-pay__desc {
  font-size: var(--fz-caption);
  line-height: var(--lh-body);
  color: var(--text-secondary);
}

/* ==========================================================================
   영수증 신청 (무통장입금 · 실시간계좌이체 선택 시에만 노출되는 별도 order-section)
   - Figma : node-id=1291-19304 · 1297-27139 · 1297-27200 · 1297-27333 (2026-09-02)
   - "결제 수단 선택" 섹션과 같은 형태(order-section__head/body)를 쓰고, 안쪽은
     배송지와 같은 .order-fields + .order-label 조합을 그대로 쓴다.
     입력칸은 라벨 대신 placeholder 로 구분하는 시안이라 라벨은 .sr-only 로 둔다.
   ========================================================================== */
.order-receipt {
  display: flex;
  flex-direction: column;
  gap: var(--space-24);
}

.order-receipt .form-check__label {
  font-weight: 500;
  font-size:var(--fz-body-xs);
}


/* 2) 라벨과 입력칸 사이는 4px 로 바짝 붙인다 (공통 .order-fields 는 12px).
      그룹과 그룹 사이 간격(.order-receipt__set)은 아래에서 따로 잡으므로
      중첩된 .order-fields 만 좁히고, .order-label 의 margin 도 같이 뺀다 */
.order-receipt__set .order-fields {
  gap: 4px;
}

.order-receipt .order-label {
  margin-bottom: 0;
}

/* 발급양식 라디오 한 줄 */
.order-receipt__types {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-8) var(--space-24);
}

/* 수신방법(팩스 · 이메일)만 : 위 라벨 · 아래 입력칸과 너무 붙어 보여 상하 여백을 준다 */
.order-receipt__types--recv {
  padding: 6px 0;
}

.order-receipt__notice {
  font-size: var(--fz-caption);
  line-height: var(--lh-body);
  color: var(--text-secondary);
}

.order-receipt__notice[hidden] {
  display: none;
}

/* 입력 그룹(라벨+입력칸)이 여러 개 쌓이므로 그룹 사이는 한 단계 넓게 */
.order-receipt__set {
  gap: var(--space-24);
}

.order-receipt__set[hidden] {
  display: none;
}

/* 입력칸 + 우측 버튼(주문자 정보 동일) : 배송지의 우편번호 검색 줄과 같은 구성 */
.order-receipt__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-8);
}

/* 업태 · 종목처럼 한 줄에 입력칸 두 개가 나란히 오는 경우 */
.order-receipt__row--half {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-16);
}

/* 필수 표시 : 첫 항목만 "필수*"(.order-section__req)를 쓰고 나머지는 * 만 붙인다 */
.order-receipt__req {
  margin-left: 2px;
  color: var(--brand-primary);
}

/* 사업자번호 · 휴대폰 번호처럼 하이픈으로 나뉜 입력칸 */
.order-receipt__split {
  display: flex;
  align-items: center;
  gap: var(--space-8);
}

.order-receipt__split .form-input {
  flex: 1;
  min-width: 0;
  text-align: center;
}

.order-receipt__split span {
  flex-shrink: 0;
  color: var(--text-muted);
}

/* ==========================================================================
   정보 및 결제 동의
   ========================================================================== */
.order-section--agree .order-section__body {
  gap: var(--space-16);
}

.order-agree {
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
}

.order-agree__all {
  padding-bottom: var(--space-16);
  border-bottom: 1px solid var(--border-default);
}

.order-agree__all .form-check__label {
  font-size: var(--fz-body-s);
  font-weight: 600;
}

.order-agree__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
}

.order-agree__req {
  font-weight: 600;
  color: var(--brand-primary);
}

/* ==========================================================================
   결제 금액 박스 안쪽 — 주문 전 확인
   (박스 자체는 common.css 의 .pay-summary)
   ========================================================================== */
.order-summary__notice {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.order-summary__notice-tit {
  font-size: var(--fz-body-s);
  font-weight: 600;
  line-height: var(--lh-tight);
  color: var(--text-primary);
  margin-bottom: 4px;
}

.order-summary__notice-txt {
  font-size: 13px;
  line-height: var(--lh-body);
  color: var(--text-secondary);
}

/* ==========================================================================
   팝업 껍데기 (order-modal)
   - 배송지 불러오기(Figma : shipping_area_popup)와 우편번호 검색이 같은 껍데기를 쓴다.
     두 창이 한 시스템으로 보이도록 헤더·닫기·딤·모서리를 공유한다.
   - 여닫기는 JS 가 hidden 속성으로 처리한다 ([hidden] 규칙 필수)
   ========================================================================== */
.order-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-24);
}

.order-modal[hidden] {
  display: none;
}

.order-modal__dim {
  position: absolute;
  inset: 0;
  /* 배송지 선택 팝업 딤 — opacity 0.4 로 통일 (요청) */
  background: rgba(0, 0, 0, 0.4);
}

.order-modal__panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 550px;
  max-height: 80vh;
  overflow: hidden;
  /* 프로젝트 팝업 라운드 통일값(8px) — pdp.css 의 .review-modal__panel 과 동일 */
  border-radius: 8px;
  background: var(--base-white);
}

.order-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-16);
  padding: var(--space-24) var(--space-32);
  border-bottom: 1px solid var(--border-default);
}

.order-modal__tit {
  font-size: var(--fz-body-xl);
  font-weight: 600;
  line-height: var(--lh-tight);
  color: var(--text-primary);
}

/* 닫기(×) — 이미지 없이 두 선을 회전시켜 그린다 (장바구니 삭제 버튼과 같은 방식) */
.order-modal__close {
  position: relative;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
}

.order-modal__close::before,
.order-modal__close::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 1px;
  background: var(--text-primary);
}

.order-modal__close::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.order-modal__close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

/* 헤더 아래 본문 — 목록이 길어지면 이 영역만 스크롤된다.
   flex 컬럼 안에서는 min-height:0 이 없으면 자식이 내용 높이만큼 늘어나 버려
   overflow-y 가 동작하지 않는다 (패널의 overflow:hidden 에 잘려 나감) */
.order-modal__body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
  overflow-y: auto;
  padding: var(--space-32);
}

/* 배송지 선택 : 목록 항목이 자체 위아래 여백(24px)을 갖고 있어, 본문의 위아래 여백만 줄인다 (양옆은 그대로) */
.order-modal__body--list {
  padding-top: var(--space-8);
  padding-bottom: var(--space-8);
}

/* ----- 리본 · 카드 문구 팝업 : 분류 셀렉트 + 문구 표 -----
   .order-modal 껍데기를 그대로 쓰고, 안쪽(.sug-modal)만 새로 만든다.
   셀렉트(공통 .form-select)로 분류를 고르면 아래 표의 문구가 바뀐다. */
/* 표 머리글 한 줄 : 왼쪽 "문구 예시" · 오른쪽 "용도별 분류 [셀렉트]".
   머리글을 sticky 로 고정해, 문구 목록을 스크롤해도 분류 셀렉트는 그대로 보인다.
   sticky 는 스크롤 영역(본문)의 위쪽 안여백 안쪽까지만 붙으므로, 본문의 위쪽 안여백은 0 으로 하고
   머리글이 그 여백을 대신 가진다 (그렇지 않으면 문구가 머리글 위 빈 공간으로 비쳐 보인다) */
.sug-modal {
  padding-top: 0;
}

.sug-modal__table {
  width: 100%;
  border-collapse: collapse;
}

.sug-modal__table th {
  position: sticky;
  top: 0;
  z-index: 1;
  /* 좌우 여백은 아래 문구 줄(.sug-modal__item)과 같게 맞춘다 — 글자 시작 위치가 한 줄로 */
  padding: var(--space-24) var(--space-8) var(--space-12);
  border-bottom: 1px solid var(--border-default);
  background: var(--base-white);
  font-size: var(--fz-body-xs);
  font-weight: 600;
  line-height: var(--lh-tight);
  text-align: left;
  color: var(--text-primary);
  vertical-align: middle;
  white-space: nowrap;
}

.sug-modal__filter {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-12);
}

/* 라벨은 머리글 글자와 같은 계열이되 한 단계 가볍게, 셀렉트는 너무 넓어지지 않게 */
.sug-modal__label {
  flex-shrink: 0;
  font-size: var(--fz-body-xs);
  font-weight: 500;
  white-space: nowrap;
  color: var(--text-secondary);
}

/* 팝업 안에서는 공통 .form-select(50px)보다 한 단계 작게 — 글자 · 높이 · 안여백 */
.sug-modal__filter .form-select {
  width: 120px;
  min-width: 0;
  min-height: 40px;
  padding: 0 36px 0 var(--space-12);
  background-position: right var(--space-12) center;
  font-size: var(--fz-body-xs);
}

.sug-modal__table td {
  border-bottom: 1px solid var(--border-default);
  vertical-align: middle;
}

.sug-modal__table tbody[hidden] {
  display: none;
}

.sug-modal__item {
  display: block;
  width: 100%;
  padding: var(--space-14) var(--space-8);
  font-size: var(--fz-body-xs);
  line-height: var(--lh-body);
  text-align: left;
  color: var(--text-primary);
}

.sug-modal__item:hover {
  color: var(--brand-primary);
}

/* ----- 배송지 선택 : 주소록 목록 ----- */

/* 저장된 배송지가 없을 때의 안내 (목록이 비면 JS 가 hidden 을 푼다) */
.addr-empty {
  padding: var(--space-48) 0;
  font-size: var(--fz-body-s);
  line-height: var(--lh-body);
  text-align: center;
  color: var(--text-secondary);
}

.addr-list {
  display: flex;
  flex-direction: column;
}

.addr-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  padding: var(--space-24) 0;
  border-bottom: 1px solid var(--border-default);
}

/* 팝업 하단 고정 영역 — 본문(.order-modal__body)만 스크롤되고 이 줄은 항상 보인다 */
.order-modal__foot {
  padding: var(--space-8) var(--space-32) var(--space-24);
}

/* [배송지 추가] — 누르면 배송지 등록 / 수정 팝업으로 전환된다 */
.addr-add {
  width: 100%;
}

.addr-item__head {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  margin-bottom: 4px;
}

.addr-item__name {
  font-size: var(--fz-body-l);
  font-weight: 600;
  line-height: var(--lh-tight);
  color: var(--text-primary);
}

.addr-item__badge {
  padding: 4px 8px;
  border-radius: 8px;
  background: var(--base-gray);
  font-size: var(--fz-caption);
  font-weight: 500;
  line-height: var(--lh-tight);
  color: var(--text-secondary);
  white-space: nowrap;
}

.addr-item__row {
  font-size: var(--fz-body-xs);
  line-height: var(--lh-body);
  color: var(--text-secondary);
}

/* 좌 : 수정 · 삭제 / 우 : 선택.
   기본 배송지에는 삭제가 없어 [수정]만 남는다 */
.addr-item__foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-12);
  margin-top: 4px;
}

/* [수정] [삭제] 묶음 — margin-auto 로 밀어 [선택]이 항상 오른쪽에 남게 한다 */
.addr-item__actions {
  display: flex;
  align-items: center;
  gap: var(--space-16);
  margin-right: auto;
}

.addr-item__edit,
.addr-item__del {
  font-size: var(--fz-body-xs);
  line-height: var(--lh-tight);
  color: var(--text-secondary);
  /* 터치 영역 : 글자 높이(약 20px)만으로는 손가락이 작아 위아래로 12px 씩 넓힌다(약 44px).
     같은 크기의 음수 margin 으로 되돌려서 화면에 보이는 위치와 줄 높이는 그대로다.
     터치 크기는 기기 기준이라 토큰(모바일에서 줄어듦) 대신 px 로 둔다 */
  padding-block: 12px;
  margin-block: -12px;
}

/* 수정 | 삭제 — 둘이 나란히 있을 때만 사이에 구분선 (기본 배송지는 [수정]만 있어 선이 없다) */
.addr-item__edit + .addr-item__del {
  position: relative;
  padding-left: var(--space-16);
}

/* 선 길이는 글자 높이보다 짧게 (줄 높이 전체로 그으면 길어 보인다) */
.addr-item__edit + .addr-item__del::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  width: 1px;
  height: 0.85em;
  /* 글자와 같은 색을 절반 농도로 — 버튼 글자색이 바뀌면 선도 따라간다 */
  background: currentColor;
  opacity: 0.5;
  transform: translateY(-50%);
}

/* ----- 배송지 등록 / 수정 팝업 : 폼 -----
   마이페이지(member.php)의 배송지 등록/수정 팝업과 같은 폼.
   입력칸 · 라벨 · 우편번호 줄은 주문서의 기존 클래스(.order-fields / .order-label /
   .order-ship__row--zip / .order-field__btn)를 그대로 써서 주문서 본문과 같은 모양이다. */
.addr-form {
  /* 숨김 체크박스(.sr-only, position:absolute)의 기준이 팝업 패널이 되면, 체크할 때 포커스 이동으로
     overflow:hidden 인 패널 자체가 스크롤돼 내용이 위로 밀리고 아래에 빈 여백이 생긴다.
     폼을 기준으로 잡아 스크롤이 본문(.order-modal__body)에서만 일어나게 한다 */
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
}

.addr-form__req {
  margin-left: 4px;
  font-weight: 400;
  color: var(--brand-primary);
}

.addr-form input[readonly] {
  color: var(--text-secondary);
}

/* 주소 입력 상태 / 우편번호 검색 상태 : 같은 자리에서 서로 대신 노출된다 */
.addr-form__address {
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
}

.addr-form__address[hidden],
.addr-form__zip[hidden] {
  display: none;
}

/* 우편번호 위젯 자리 — 위젯은 iframe 으로 들어오므로 높이만 정해준다 */
.addr-form__zip-embed {
  height: 400px;
  border: 1px solid var(--border-default);
  border-radius: 8px;
  overflow: hidden;
}

/* 개발 참고용 예시 이미지 버튼 — 실제 embed 로 교체되면 아래 두 규칙은 필요 없어진다 */
.addr-form__zip-demo {
  display: block;
  width: 100%;
  height: 100%;
}

.addr-form__zip-demo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.addr-form__submit {
  width: 100%;
  min-height: 50px;
  margin-top: var(--space-8);
  font-weight: 500;
}

/* 팝업이 열린 동안 뒤쪽 페이지 스크롤 잠금 */
body.is-modal-open {
  overflow: hidden;
}

/* ==========================================================================
   간편결제 영수증 안내 팝업 (Figma : node-id=1304-27564)
   - 배송지 · 우편번호 팝업과 같은 껍데기(.order-modal)를 쓰되, 헤더 줄 없이
     제목까지 본문에 들어가고 닫기(×)만 우측 상단에 띄운다.
   - 시안 크기 351 × 445. 내용이 445px 를 넘으면 본문만 스크롤된다.
   ========================================================================== */
.order-modal__panel--guide {
  max-width: 450px;
  height: 540px;
  max-height: 100%;
}

.order-modal__close--float {
  position: absolute;
  top: var(--space-8);
  right: var(--space-8);
  z-index: 1;
}

/* 제목 줄 : 스크롤 영역에서 빼내 항상 고정한다 */
.pay-guide__head {
  flex-shrink: 0;
  padding: var(--space-32) var(--space-32) var(--space-32);
}

.pay-guide {
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
  padding: 0 var(--space-32) var(--space-32);
  overflow-y: auto;
}

.pay-guide__tit {
  font-size: var(--fz-body-l);
  font-weight: 600;
  line-height: var(--lh-tight);
  color: var(--text-primary);
}

.pay-guide__lead {
  font-size: var(--fz-body-xxs);
  line-height: var(--lh-body);
  color: var(--text-secondary);
}

.pay-guide__group {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.pay-guide__name {
  font-size: var(--fz-body-xs);
  font-weight: 600;
  line-height: var(--lh-tight);
  color: var(--text-primary);
}

.pay-guide__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

/* 항목명(- 결제 후 …)과 경로(A → B → C)를 두 줄로 나눠 보여준다.
   경로 줄은 항목명 아래에 한 칸 들여쓴다 (시안과 동일) */
.pay-guide__list li {
  display: flex;
  flex-direction: column;
}

.pay-guide__item {
  font-size: var(--fz-body-xxs);
  line-height: var(--lh-body);
  color: var(--text-primary);
}

.pay-guide__path {
  padding-left: 8px;
  font-size: var(--fz-body-xxs);
  line-height: var(--lh-body);
  color: var(--text-secondary);
}

/* ==========================================================================
   Tablet (~1099px)
   - 결제 금액 박스가 폼 아래로 내려오고 sticky 를 푼다.
   - 달력이 빠지고 배송일 셀렉트만 남는다 (시안 기준).
   ========================================================================== */
@media (max-width: 1099px) {
  .order__body {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-64);
  }

  /* 한 컬럼이 되면 붙을 곳이 없으므로 sticky 해제 */
  .order-summary {
    position: static;
  }

  .calendar {
    display: none;
  }

  .order-date {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ==========================================================================
   Mobile (~767px)
   - 상품 썸네일이 작아지고, 장바구니(cart.css)와 같은 순서로 쌓인다.
   - 간편결제가 3열 → 2열.
   ========================================================================== */
@media (max-width: 767px) {
  .order-item__product {
    grid-template-columns: 100px minmax(0, 1fr);
    gap: var(--space-16);
    padding: 4px 0 ;
  }

  .order-field__btn {
    padding: 0 var(--space-48);
  }

  .order-label, .order-msg__label {
  font-size: var(--fz-body-s);
}

  /* 영수증 신청 안의 .order-label 만 모바일에서도 PC와 동일하게 xs 유지 (요청) */
  .order-receipt .order-label {
    font-size: var(--fz-body-xs);
  }




  /* 세로 배치 순서 : [혜택 배지(할인·배송) 한 줄] → [상품명] → [옵션] → [가격]
     .order-item__head 는 PC 레이아웃(상품명+할인배지 한 줄)용 중첩 구조라 그대로 두고,
     모바일에서만 display: contents 로 펼쳐서 order 로 순서를 다시 정한다.
     (장바구니 cart.css 의 .cart-item__detail 모바일 처리와 같은 방식) */
  .order-item__info {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }

  .order-item__head {
    display: contents;
  }

  .order-item__info .product-badge {
    order: 1;
  }

  .order-item__name {
    order: 2;
    flex-basis: 100%;
  }

  .order-item__option {
    order: 3;
    flex-basis: 100%;
    margin-top: -4px;
  }

  .order-item__info .price {
    order: 4;
    flex-basis: 100%;
  }

  /* 가격 구성도 장바구니 모바일과 동일하게 : 원가(취소선)만 단독 줄로 띄우고,
     실제 가격과 할인·적립 안내 문구는 그 다음 줄에서 한 줄에 붙는다
     (cart.css 의 .cart-item .price 모바일 처리와 같은 방식) */
  .order-item .price {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0 8px;
  }

  .order-item .price__origin {
    flex-basis: 100%;
  }

  .order-item .price__now {
    font-size: 16px;
  }

  .order-item__price-note {
    font-size: 12px;
  }

  .order-ship__product {
    grid-template-columns: 60px minmax(0, 1fr) auto;
    gap: 12px;
  }

  .order-pay__easy {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .order-msg__textarea {
    min-height: 96px;
    padding: var(--space-12) var(--space-16);
  }

  /* ----- 배송지 선택 · 우편번호 검색 팝업 : 딤 없이 화면을 가득 채우는 창 -----
     PDP 의 리뷰 전체보기 팝업(.review-modal, pdp.css)과 같은 방식 */
  .order-modal {
    padding: 0;
  }

  .order-modal__dim {
    display: none;
  }

  .order-modal__panel {
    width: 100%;
    /* PC 기본값(550px)을 풀어야 550~767px 구간에서도 화면을 가득 채운다
       (해제 전에는 이 구간에서 폭만 550px 로 남아 좌우에 여백이 생겼음) */
    max-width: none;
    height: 100%;
    max-height: none;
    border-radius: 0;
  }

  .order-modal__head,
  .order-modal__body,
  .order-modal__foot {
    padding: var(--space-side);
  }

  /* 위 규칙이 모바일에서 사방 패딩을 다시 덮어쓰므로, 배송지 선택의 위아래 여백을 다시 줄인다 */
  .order-modal__body--list {
    padding-top: var(--space-8);
    padding-bottom: var(--space-8);
  }

  /* ===== [추가] 2026-09-09 / 간편결제 영수증 안내 팝업은 위 전체화면 규칙에서 제외 =====
     배송지·우편번호와 껍데기(.order-modal)를 공유하다 보니 딤이 사라지고 전체화면이 돼
     PC 와 형태가 달라졌었다. 읽기용 안내 팝업이라 모바일에서도 PC 와 같은
     가운데 카드 형태를 유지한다 */
  /* 패널은 계속 width:100% 라, 옆 여백을 늘리면 그만큼 패널이 좁아진다 (요청) */
  .order-modal--guide {
    padding: var(--space-48);
  }

  .order-modal--guide .order-modal__dim {
    display: block;
  }

  .order-modal--guide .order-modal__panel {
    max-width: 450px;
    height: 540px;
    max-height: 100%;
    border-radius: 8px;
  }
  /* ===== [추가 끝] ===== */

  .order-pay__item {
  padding: var(--space-32) 0;
}


  .addr-item {
    padding: var(--space-16) 0;
  }

  /* 헤더 아래 남은 세로 공간을 그대로 채운다 (고정 높이 대신 flex 로) */
  .zip-embed {
    flex: 1;
    height: auto;
    max-height: none;
    padding: 0 var(--space-16) var(--space-16);
  }

  /* 영수증 신청 : 업태·종목처럼 한 줄에 둘씩 오는 입력칸을 세로로 쌓는다 */
  .order-receipt__row--half {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-24);
  }

  /* 문구 팝업 : 머리글 좌우 여백도 문구 줄과 같은 8px (아래 .sug-modal__item 참고) */
  .sug-modal__table th {
    padding-left: 8px;
    padding-right: 8px;
  }
 

  /* 문구 팝업 : 위 전체화면 규칙이 본문 사방 패딩을 다시 덮어쓰므로, 고정 머리글을 위해 위쪽 안여백을 다시 0 으로 */
  .sug-modal {
    padding-top: 0;
  }

  /* 문구 팝업 : 모바일은 --space-14 가 8px 로 줄어 줄 높이가 38px 정도라 터치하기 좁다.
     터치 영역 권장 최소값(44px)을 보장하고, 한 줄짜리 문구는 세로 가운데로 맞춘다.
     가로 여백도 --space-8 이 4px 로 줄어 글자가 줄 끝에 붙으므로 8px 로 고정한다 (토큰 대신 px 를 쓰는 이유) */
  .sug-modal__item {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding-left: 8px;
    padding-right: 8px;
  }
}
