/* ============================================================================
 * 파나메딕데브 장바구니 v3 — endedit(앤드에디트) https://endedit.com/product/cart.asp
 * 디자인·기능 이식 (2026-09-01, PD요청)
 *
 * 원본: endedit.com 라이브에서 그대로 받은 /static/shop-cart/cart-static-prototype.css
 *   (엔드에디트가 쓰는 4사이트 공용 "탈React 정적 프로토타입" 카트 화면의 실제 CSS).
 *   토큰(--wds-*)·클래스 구조(.ee-ct-*)는 그대로 유지하되:
 *     · 브랜드 색상만 엔드에디트 오렌지(#ff5c28) → 파나메딕 사이트컬러(보라 #523787)로 교체
 *     · 전역 리셋(*,body,button,a)이 페이지 전체에 새는 걸 막기 위해 전부 #cartV3 로 스코프
 *     · 4사이트 공용 셸(shop_header/footer) 자리지킴 스타일(.ee.sh-page/.sh-wrap/.proto-hdr 등)은
 *       파나메딕 자체 헤더/탑메뉴를 그대로 쓰므로 이식하지 않음
 * ========================================================================== */

#cartV3 {
  --wds-primary: #523787;
  --wds-primary-strong: #442d70;
  --wds-primary-heavy: #382459;
  --wds-primary-tint: #f2effa;

  --wds-text: rgb(23, 23, 23);
  --wds-text-neutral: rgba(46, 47, 51, 0.88);
  --wds-text-alt: rgba(55, 56, 60, 0.61);
  --wds-text-assistive: rgba(55, 56, 60, 0.28);
  --wds-inactive: rgba(55, 56, 60, 0.61);

  --wds-fill: rgba(112, 115, 124, 0.05);
  --wds-fill-strong: rgba(112, 115, 124, 0.16);
  --wds-line: rgba(112, 115, 124, 0.16);
  --wds-line-alt: rgba(112, 115, 124, 0.08);
  --wds-line-neutral: rgba(112, 115, 124, 0.16);

  --wds-surface: #fff;
  --wds-surface-alt: rgb(247, 247, 248);
  --wds-surface-inverse: rgb(23, 23, 25);

  --wds-cautionary: rgb(255, 146, 0);
  --wds-destructive: rgb(255, 66, 66);

  --wds-elev-inset-line: inset 0 0 0 1px rgba(112, 115, 124, 0.08);
  --wds-elev-popover: 0 0 60px rgba(23, 23, 23, 0.1);

  --wds-ease: cubic-bezier(0.16, 1, 0.3, 1);

  --font-core: 'Pretendard JP', 'Pretendard Variable', Pretendard, -apple-system,
    BlinkMacSystemFont, system-ui, 'Malgun Gothic', sans-serif;

  padding: 24px 0 40px;
}

#cartV3, #cartV3 * { box-sizing: border-box; }
#cartV3 button { font-family: var(--font-core); }
#cartV3 a { color: inherit; text-decoration: none; }

/* ── 상단 유틸(좋아요/견적서출력) — 엔드에디트 원본엔 없는 파나메딕 기존 기능,
 *   새 그리드 위에 얇은 줄로 유지한다(기능 이관, 삭제 아님) ── */
#cartV3 .ee-ct-util { display: flex; justify-content: flex-end; gap: 16px; padding-bottom: 10px; }
#cartV3 .ee-ct-util a { font-size: 13px; color: var(--wds-text-alt); cursor: pointer; }
#cartV3 .ee-ct-util a:hover { color: var(--wds-text-neutral); text-decoration: underline; }

/* ── 체크박스 ── */
#cartV3 .ee-ct-chk {
  flex: none; width: 22px; height: 22px; border-radius: 4px; border: 0; padding: 0;
  cursor: pointer; display: grid; place-items: center; color: #fff;
  background: var(--wds-surface); box-shadow: inset 0 0 0 1px var(--wds-line);
}
#cartV3 .ee-ct-chk.is-on { background: var(--wds-text); box-shadow: none; }

/* ── 수량 스테퍼 ── */
#cartV3 .ee-ct-qty { display: inline-flex; align-items: center; border-radius: 4px; box-shadow: inset 0 0 0 1px var(--wds-line); opacity: 1; }
#cartV3 .ee-ct-qty-b {
  width: 34px; height: 34px; border: 0; background: transparent; cursor: pointer;
  display: grid; place-items: center; color: var(--wds-text-neutral);
}
#cartV3 .ee-ct-qty-s { font-size: 16px; line-height: 1; }
#cartV3 .ee-ct-qty-n { min-width: 30px; text-align: center; font-size: 15px; font-weight: 600; }

/* ── 제목줄 ── */
#cartV3 .ee-ct-hd { display: flex; align-items: baseline; gap: 10px; padding-bottom: 18px; border-bottom: 1px solid var(--wds-text); }
#cartV3 .ee-ct-h1 { margin: 0; font-size: 28px; line-height: 38px; letter-spacing: -0.0236em; font-weight: 800; }
#cartV3 .ee-ct-cnt { font-size: 15px; color: var(--wds-text-alt); }

#cartV3 .ee-ct-skel { min-height: 300px; }

/* ── 빈 장바구니 ── */
#cartV3 .ee-ct-empty { display: grid; place-items: center; gap: 10px; padding: 80px 0; color: var(--wds-text-alt); }
#cartV3 .ee-ct-empty-t { font-size: 16px; font-weight: 600; color: var(--wds-text-neutral); }
#cartV3 .ee-ct-empty-a {
  margin-top: 8px; height: 48px; padding: 0 20px; border-radius: 4px;
  display: grid; place-items: center; box-sizing: border-box;
  background: var(--wds-primary); color: #fff; font-size: 16px; font-weight: 700; text-decoration: none;
}

/* ── 본문 2단 ── */
#cartV3 .ee-ct-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 40px; align-items: start; padding-top: 24px; }
#cartV3 .ee-ct-side { position: sticky; top: 24px; }
/* 2026-09-01(추가) : 결제요약 카드(.ee-ct-side)가 스크롤해도 안 움직이던 문제 —
   #cartV3 를 감싸는 레거시 공용 래퍼 .sub_contents(commonTotal.css)가 overflow:hidden
   이라 position:sticky 가 조상 체인에서 막혀 있었다. 이 파일은 장바구니(cart.asp)에만
   로드되므로 여기서만 풀어도 다른 페이지(.sub_contents 의 float clearfix 용도)엔 무영향.
   되돌리기 : 이 규칙만 지운다. */
.sub_contents { overflow: visible; }

/* ── 전체선택 줄 ── */
#cartV3 .ee-ct-all { display: flex; align-items: center; gap: 10px; padding-bottom: 12px; box-shadow: inset 0 -1px 0 var(--wds-line-neutral); }
#cartV3 .ee-ct-all-t { font-size: 14px; color: var(--wds-text-neutral); }
#cartV3 .ee-ct-clear {
  margin-left: auto; border: 0; background: transparent; padding: 0; cursor: pointer;
  font-family: var(--font-core); font-size: 14px; color: var(--wds-text-alt);
}

/* ── 상품 줄 ── */
#cartV3 .ee-ct-it { display: flex; gap: 12px; padding: 20px 0; box-shadow: inset 0 -1px 0 var(--wds-line-alt); }
#cartV3 .ee-ct-it-chk { padding-top: 2px; }
#cartV3 .ee-ct-it-img {
  flex: none; position: relative; width: 104px; aspect-ratio: 3 / 4; border-radius: 2px;
  overflow: hidden; display: block; background: var(--wds-fill); box-shadow: var(--wds-elev-inset-line);
}
#cartV3 .ee-ct-it-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
#cartV3 .ee-ct-it-bd { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
#cartV3 .ee-ct-it-top { display: flex; align-items: flex-start; gap: 8px; }
#cartV3 .ee-ct-it-t {
  flex: 1; min-width: 0; font-size: 15px; line-height: 22px; color: var(--wds-text); text-decoration: none;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
#cartV3 .ee-ct-it-x {
  flex: none; width: 28px; height: 28px; border: 0; background: transparent; cursor: pointer;
  display: grid; place-items: center; color: var(--wds-text-assistive);
}
#cartV3 .ee-ct-it-sub { font-size: 13px; color: var(--wds-text-alt); }

/* ── 옵션 드롭다운 ── */
#cartV3 .ee-ct-opt { position: relative; display: inline-flex; width: 200px; max-width: 100%; }
#cartV3 .ee-ct-opt-trigger {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px 0 12px;
  border: 0; border-radius: 4px; box-shadow: inset 0 0 0 1px var(--wds-line);
  background: var(--wds-surface); cursor: pointer; width: 100%; max-width: 100%;
  transition: background .15s var(--wds-ease);
}
#cartV3 .ee-ct-opt-trigger:hover:not(:disabled) { background: var(--wds-fill); }
#cartV3 .ee-ct-opt-trigger:disabled { cursor: default; opacity: .6; }
#cartV3 .ee-ct-opt.is-open .ee-ct-opt-trigger { background: var(--wds-fill); }
#cartV3 .ee-ct-opt-label {
  flex: 1; min-width: 0; text-align: left;
  font-family: var(--font-core); font-size: 14px; font-weight: 600; color: var(--wds-text-neutral);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
#cartV3 .ee-ct-opt-chev { flex: none; color: var(--wds-text-alt); transition: transform .18s var(--wds-ease); }
#cartV3 .ee-ct-opt.is-open .ee-ct-opt-chev { transform: rotate(180deg); color: var(--wds-text); }
#cartV3 .ee-ct-opt.is-busy { opacity: .6; }

#cartV3 .ee-ct-opt-panel {
  position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; min-width: 200px; max-width: 300px;
  max-height: 264px; overflow-y: auto; padding: 6px; border-radius: 12px;
  background: var(--wds-surface); box-shadow: var(--wds-elev-popover);
  animation: eeCtOptIn .14s var(--wds-ease);
}
@keyframes eeCtOptIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
#cartV3 .ee-ct-opt-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%;
  height: 40px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; cursor: pointer;
  font-family: var(--font-core); font-size: 15px; font-weight: 500; color: var(--wds-text-neutral); text-align: left;
}
#cartV3 .ee-ct-opt-item:hover:not(:disabled) { background: var(--wds-fill); }
#cartV3 .ee-ct-opt-item.is-sel { background: var(--wds-fill); color: var(--wds-text); font-weight: 700; }
#cartV3 .ee-ct-opt-item.is-sel svg { color: var(--wds-primary); flex: none; }
#cartV3 .ee-ct-opt-item-t em { font-style: normal; font-size: 13px; color: var(--wds-text-alt); font-weight: 500; }
#cartV3 .ee-ct-opt-item.is-oos { color: var(--wds-text-assistive); cursor: default; }
#cartV3 .ee-ct-opt-item.is-oos:hover { background: transparent; }
#cartV3 .ee-ct-opt-oos {
  flex: none; font-size: 11px; font-weight: 700; color: var(--wds-destructive);
  padding: 2px 6px; border-radius: 4px; background: rgba(255, 66, 66, 0.08);
}
#cartV3 .ee-ct-it-qr { display: flex; align-items: center; gap: 12px; margin-top: auto; padding-top: 6px; }
#cartV3 .ee-ct-it-p { margin-left: auto; font-size: 17px; font-weight: 800; letter-spacing: -0.012em; }

/* ── 요약 패널 ── */
#cartV3 .ee-ct-sum { display: flex; flex-direction: column; gap: 12px; padding: 20px; border-radius: 4px; background: var(--wds-surface-alt); }
#cartV3 .ee-ct-sum-row { display: flex; align-items: baseline; font-size: 15px; }
#cartV3 .ee-ct-sum-k { flex: 1; color: var(--wds-text-alt); }
#cartV3 .ee-ct-sum-v { font-weight: 600; color: var(--wds-text-neutral); }
#cartV3 .ee-ct-sum-tot { display: flex; align-items: baseline; padding-top: 12px; box-shadow: inset 0 1px 0 var(--wds-line); }
#cartV3 .ee-ct-sum-tot-k { flex: 1; font-size: 15px; font-weight: 700; }
#cartV3 .ee-ct-sum-tot-v { font-size: 24px; font-weight: 800; letter-spacing: -0.0194em; }
#cartV3 .ee-ct-sum-pt { font-size: 13px; color: var(--wds-text-alt); text-align: right; }
#cartV3 .ee-ct-sum-acts { display: flex; flex-direction: column; gap: 8px; padding-top: 6px; }
#cartV3 .ee-ct-order {
  height: 52px; border-radius: 4px; border: 0; cursor: pointer;
  background: var(--wds-primary); color: #fff; font-family: var(--font-core); font-size: 16px; font-weight: 700;
}
#cartV3 .ee-ct-order:hover:not(:disabled) { background: var(--wds-primary-strong); }
#cartV3 .ee-ct-order:disabled { opacity: .5; cursor: default; }

/* ── 삭제 확인 모달 ── */
#ee-ct-confirm-slot .ee-ct-cf-dim {
  position: fixed; inset: 0; z-index: 80;
  display: flex; align-items: center; justify-content: center;
  padding: 20px 16px; background: rgba(23, 23, 25, 0.52);
}
#ee-ct-confirm-slot .ee-ct-cf {
  width: 100%; max-width: 420px; background: #fff; border-radius: 12px; padding: 24px;
  display: flex; flex-direction: column; gap: 18px; font-family: var(--font-core, 'Pretendard Variable', sans-serif);
}
#ee-ct-confirm-slot .ee-ct-cf-t { font-size: 16px; line-height: 24px; font-weight: 600; text-align: center; color: #171717; }
#ee-ct-confirm-slot .ee-ct-cf-acts { display: flex; gap: 8px; }
#ee-ct-confirm-slot .ee-ct-cf-no,
#ee-ct-confirm-slot .ee-ct-cf-yes {
  flex: 1; height: 44px; border-radius: 4px; border: 0; cursor: pointer;
  font-family: inherit; font-size: 15px; font-weight: 700;
}
#ee-ct-confirm-slot .ee-ct-cf-no { background: rgba(112, 115, 124, 0.1); color: #171717; }
#ee-ct-confirm-slot .ee-ct-cf-yes { background: rgb(255, 66, 66); color: #fff; }

.ee-ct-hidden { display: none; }

@media (max-width: 768px) {
  #cartV3 .ee-ct-h1 { font-size: 22px; line-height: 30px; }
  #cartV3 .ee-ct-empty { padding: 56px 0; }
  #cartV3 .ee-ct-empty-a { height: 44px; }
  #cartV3 .ee-ct-grid { grid-template-columns: 1fr; gap: 20px; padding-top: 12px; }
  #cartV3 .ee-ct-side { position: static; }
  #cartV3 .ee-ct-it { padding: 16px 0; }
  #cartV3 .ee-ct-it-img { width: 84px; }
  #cartV3 .ee-ct-it-t { font-size: 14px; }
  #cartV3 .ee-ct-it-p { font-size: 16px; }
  #cartV3 .ee-ct-opt { width: 100%; }
  #cartV3 .ee-ct-opt-panel { left: 0; right: 0; min-width: 0; max-width: none; }
}
