/* BASIC css start */
/* ============================================================
   THE LAB CHEMICAL — 장바구니 (basket.css)
============================================================ */

#basket {
  padding-top: 0 !important;
  margin-top: 0 !important;
}
#basket .page-body {
  padding: 0 0 40px;
  max-width: 720px;
  margin: 0 auto;
}
#container:has(#basket),
#contents:has(#basket) {
  padding-top: 0 !important;
  margin-top: 0 !important;
}

/* ── 탭 (정기배송) ── */
.cart-tab-wrap {
  border-bottom: 1px solid var(--border, #e2e8f0);
  background: #fff;
  margin-bottom: 0;
}
.cart-tab {
  display: flex;
  list-style: none;
  margin: 0; padding: 0;
}
.cart-tab li { flex: 1; }
.cart-tab li a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 44px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted, #94a3b8);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
}
.cart-tab li a span {
  font-size: 11px;
  background: var(--bg-soft, #f8fafc);
  border-radius: 10px;
  padding: 1px 6px;
}
.cart-tab li.now a {
  color: var(--navy, #0C025B);
  border-bottom-color: var(--navy, #0C025B);
}

/* ── 툴바 ── */
.basket-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #fff;
  border-bottom: 1px solid var(--border, #e2e8f0);
}
.select-all-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text, #0f172a);
  cursor: pointer;
}
.basket-toolbar-actions {
  display: flex;
  gap: 6px;
}
.toolbar-btn {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-sub, #64748b);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 6px;
  text-decoration: none;
  background: #fff;
  transition: all .15s;
}
.toolbar-btn:active {
  border-color: var(--navy, #0C025B);
  color: var(--navy, #0C025B);
}

/* ── 빈 장바구니 ── */
.basket-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 24px;
  gap: 16px;
  background: #fff;
}
.basket-empty__icon {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--bg-soft, #f8fafc);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted, #94a3b8);
}
.basket-empty__text {
  font-size: 14px;
  color: var(--text-sub, #64748b);
  margin: 0;
}

/* ── 상품 리스트 ── */
.basket-list {
  list-style: none;
  margin: 0; padding: 0;
  background: #fff;
}

/* 카드 전체 */
.basket-item {
  padding: 16px;
  border-bottom: 1px solid var(--border, #e2e8f0);
  position: relative;
}
.basket-item:last-child { border-bottom: none; }
.basket-item > form {
  display: grid;
  grid-template-columns: 20px 76px 1fr;
  column-gap: 12px;
  align-items: start;
}

/* 체크박스 */
.basket-item__check {
  grid-column: 1;
  grid-row: 1;
  padding-top: 8px;
  display: flex;
  align-items: flex-start;
}

/* 이미지 - 좌측 고정 */
.basket-item__img {
  grid-column: 2;
  grid-row: 1;
  width: 76px; height: 76px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border, #e2e8f0);
  display: block;
  flex-shrink: 0;
}
.basket-item__img img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}

/* 정보 영역 - 우측 */
.basket-item__info {
  grid-column: 3;
  grid-row: 1;
  min-width: 0;
  padding-right: 24px; /* 삭제버튼 공간 */
}

/* 상품명 */
.basket-item__name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text, #0f172a);
  margin: 0 0 4px;
  line-height: 1.5;
  word-break: keep-all;
}
.basket-item__name a {
  color: inherit;
  text-decoration: none;
}

/* 배송 뱃지 */
.delivery-badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  margin: 0 0 4px;
  vertical-align: middle;
  width: fit-content;
}
.basket-item__name .delivery-badge {
  display: inline-flex;
  margin-right: 4px;
}
.delivery-badge--direct {
  background: rgba(12,2,91,.08);
  color: var(--navy, #0C025B);
}
.delivery-badge--vendor {
  background: rgba(167,139,250,.12);
  color: #7c3aed;
}

/* SKU / 옵션 */
.basket-item__option {
  font-size: 11px;
  color: var(--text-muted, #94a3b8);
  margin: 0 0 8px;
  line-height: 1.5;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* 가격 + 배송비 한 줄 */
.basket-item__meta {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.basket-item__price {
  font-size: 15px;
  font-weight: 700;
  color: var(--navy, #0C025B);
  letter-spacing: -.3px;
}
.basket-item__delivery {
  font-size: 11px;
  color: var(--text-muted, #94a3b8);
}
.basket-item__delivery a {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: inherit;
  text-decoration: none;
}

/* ── 수량 조절 ── */
.basket-item__qty {
  display: flex;
  align-items: center;
  gap: 0;
  height: 34px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  overflow: hidden;
  width: fit-content;
}
.qty-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  color: var(--text-sub, #64748b);
  text-decoration: none;
  transition: background .12s;
  flex-shrink: 0;
}
.qty-btn:active { background: var(--bg-soft, #f8fafc); }

#basket .amount-input,
#basket .txt-input.amount-input {
  width: 36px !important;
  height: 34px !important;
  border: none !important;
  border-left: 1px solid var(--border, #e2e8f0) !important;
  border-right: 1px solid var(--border, #e2e8f0) !important;
  border-radius: 0 !important;
  text-align: center !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  color: var(--text, #0f172a) !important;
  padding: 0 !important;
  background: #fff !important;
  box-shadow: none !important;
  outline: none !important;
}

.basket-item__opt-edit {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--navy, #0C025B);
  text-decoration: underline;
  text-underline-offset: 2px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  margin: 0;
}
.basket-item__opt-edit:hover {
  text-decoration: none;
}

/* 삭제 버튼 - 우상단 고정 */
.basket-item__del {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px; height: 26px;
  border-radius: 6px;
  color: var(--text-muted, #94a3b8);
  text-decoration: none;
  background: var(--bg-soft, #f8fafc);
  transition: background .12s, color .12s;
}
.basket-item__del:active {
  background: #fee2e2;
  color: #ef4444;
}

/* ── 소계 (공급사별) ── */
.price-subtotal {
  background: var(--bg-soft, #f8fafc);
  border-top: 1px solid var(--border, #e2e8f0);
  border-bottom: 1px solid var(--border, #e2e8f0);
  padding: 12px 16px;
  margin-bottom: 8px;
}
.price-subtotal__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-sub, #64748b);
  padding: 3px 0;
}
.price-subtotal__total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--text, #0f172a);
  padding-top: 8px;
  margin-top: 6px;
  border-top: 1px solid var(--border, #e2e8f0);
}

/* ── 총합계 ── */
.price-total {
  background: #fff;
  border-top: 2px solid var(--navy, #0C025B);
  border-bottom: 1px solid var(--border, #e2e8f0);
  padding: 16px;
  margin-top: 8px;
}
.price-total__breakdown {
  margin-bottom: 12px;
}
.price-total__row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-sub, #64748b);
  padding: 4px 0;
}
.price-total__row--discount span:last-child { color: #ef4444; }
.price-total__final {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--border, #e2e8f0);
}
.price-total__final > span {
  font-size: 14px;
  font-weight: 700;
  color: var(--text, #0f172a);
}
.price-total__amount {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
.price-total__amount strong {
  font-size: 20px;
  font-weight: 800;
  color: var(--navy, #0C025B);
}
.price-total__reserve {
  font-size: 11px;
  color: var(--text-muted, #94a3b8);
}

/* ── 배송 안내 ── */
.delivery-notice {
  padding: 12px 16px;
  font-size: 12px;
  color: var(--text-sub, #64748b);
  line-height: 1.6;
}
.delivery-notice strong { color: var(--text, #0f172a); }
.delivery-notice__sub { color: var(--text-muted, #94a3b8); margin: 2px 0 0; }

/* ── 주문 버튼 ── */
#basket .order-btn {
  padding: 12px 16px 16px;   /* 4 → 16 */
  display: flex;
  gap: 8px;
}
#basket .order-btn.use-gift.qorder-none,
#basket .order-btn.use-gift.use-qorder,
#basket .order-btn.gift-none.use-qorder {
  padding: 12px 16px 16px;   /* 기존 4 → 16 */
}
#basket .order-btn.gift-none.qorder-none .btn-order { width: 100%; }

.btn-order {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 52px;
  background: var(--navy, #0C025B);
  color: #fff !important;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: -.2px;
  transition: background .15s;
}
.btn-order:active { background: var(--navy-dk, #07013e); }

.btn-gift {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 52px;
  width: 52px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 12px;
  color: var(--text-sub, #64748b);
  text-decoration: none;
  background: #fff;
  flex-shrink: 0;
  transition: all .15s;
}
.btn-gift:active {
  border-color: var(--navy, #0C025B);
  color: var(--navy, #0C025B);
}

/* ── 간편결제 ── */
.cart-ft2 {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 0 16px 16px;
}
.naver-checkout { width: 100%; }

/* ── 밀어서 결제하기 ── */
#quick-swipepay .layer { z-index: 200; }
#quick-swipepay .layer-wrap {
  position: fixed;
  bottom: 0; left: 0;
  width: 100%;
  padding: 16px 16px 0;
  box-sizing: border-box;
  background: #fff;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -8px 32px rgba(12,2,91,.12);
  padding-bottom: env(safe-area-inset-bottom);
}
#quick-swipepay .swipepay-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  margin: 0 auto 12px;
  background: var(--bg-soft, #f8fafc);
  border: none;
  border-radius: 50%;
  color: var(--text-sub, #64748b);
  cursor: pointer;
}
#quick-swipepay .swipepay-addr {
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  margin-bottom: 10px;
}
#quick-swipepay .addr-lst {
  padding: 12px 14px;
  border-top: 1px solid var(--border, #e2e8f0);
}
#quick-swipepay .addr-lst:first-child { border-top: none; }
#quick-swipepay .addr-prd {
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
  font-size: 11px;
}
#quick-swipepay .prd-tit {
  font-size: 13px !important;
  font-weight: 700;
  color: var(--text, #0f172a) !important;
  margin: 0;
}
#quick-swipepay .prd-name {
  font-size: 11px;
  color: var(--text-muted, #94a3b8);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  margin: 0;
}
#quick-swipepay .addr-edit {
  position: absolute; top: -2px; right: 0;
  display: flex; align-items: center; justify-content: center;
  height: 24px; padding: 0 10px;
  font-size: 11px; font-weight: 600;
  color: var(--text-sub, #64748b);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 5px;
  text-decoration: none;
  background: #fff;
}
#quick-swipepay .addr-opt {
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-sub, #64748b);
  list-style: none;
  padding: 0;
}
#quick-swipepay .addr-opt li strong { color: var(--text, #0f172a); }
#quick-swipepay .swipepay-agree {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  margin-bottom: 10px;
  position: relative;
}
#quick-swipepay .swipepay-agree label { display: flex; align-items: center; gap: 6px; }
#quick-swipepay .view-terms {
  color: var(--text-muted, #94a3b8);
  text-decoration: underline;
  border: none;
  background: none;
  font-size: 11px;
  cursor: pointer;
  padding: 0;
}
#quick-swipepay .layer-terms {
  position: absolute;
  bottom: 28px; left: 0;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  background: #fff;
  box-sizing: border-box;
  box-shadow: var(--shadow-md);
  z-index: 10;
}
#quick-swipepay .terms-close {
  position: absolute; top: 10px; right: 10px;
  display: flex; align-items: center; justify-content: center;
  width: 24px; height: 24px;
  background: none; border: none; cursor: pointer;
  color: var(--text-muted, #94a3b8);
}
#quick-swipepay .terms-tit {
  font-size: 13px; font-weight: 700;
  margin-bottom: 8px;
  color: var(--text, #0f172a);
}
#quick-swipepay .layer-terms table { width: 100%; table-layout: fixed; }
#quick-swipepay .layer-terms th,
#quick-swipepay .layer-terms td {
  padding: 5px 6px;
  border: 1px solid var(--border, #e2e8f0);
  font-size: 11px;
  color: var(--text-sub, #64748b);
}
#quick-swipepay .layer-terms th {
  background: var(--bg-soft, #f8fafc);
  font-weight: 600;
}
#quick-swipepay .swipepay-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--border, #e2e8f0);
}
#quick-swipepay .swipepay-total strong {
  font-size: 13px;
  color: var(--text, #0f172a);
}
#quick-swipepay .swipepay-total strong span {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted, #94a3b8);
  margin-left: 4px;
}
#quick-swipepay .total-price strong {
  font-size: 18px;
  font-weight: 800;
  color: var(--navy, #0C025B);
}
#quick-swipepay .swipepay-wide {
  position: relative;
  width: 100%;
  height: 52px;
  border-radius: 52px;
  overflow: hidden;
  background: var(--navy, #0C025B);
  margin-bottom: 8px;
}
#quick-swipepay .swipepay-wide .swipepay-text {
  position: absolute;
  top: 50%; left: 0;
  width: 100%;
  text-align: center;
  transform: translateY(-50%);
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  pointer-events: none;
  user-select: none;
}
#quick-swipepay .swipepay-wide .swipepay-slider {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px; height: 52px;
  border-radius: 52px;
  background: rgba(255,255,255,.15);
  color: #fff;
}
#quick-swipepay .swipepay-wide .swipepay-completed {
  opacity: 0;
  position: absolute;
  inset: 0;
  background: var(--navy-dk, #07013e);
  border-radius: 52px;
  pointer-events: none;
}
#quick-swipepay .swipepay-order {
  display: flex;
  justify-content: center;
  padding: 6px 0 12px;
}
#quick-swipepay .swipepay-order a {
  font-size: 11px;
  color: var(--text-muted, #94a3b8);
  text-decoration: underline;
}

/* 공급사가 1개일 때는 소계 숨김 (총합계와 중복이므로) */
#basket .basket-list + .price-subtotal:last-of-type {
  display: none;
}
/* 공급사가 2개 이상이면 다시 표시 */
#basket .basket-list ~ .basket-list ~ .price-subtotal,
#basket .basket-list + .price-subtotal:not(:last-of-type) {
  display: block;
}
/* BASIC css end */

