/* fluxshop 구매 화면 v2 — 공통 기반 (시안 visual/mock/pf.css 1·2·3 절에서 분리)
   스코프 .fhs-pf. 색 값은 아래 토큰 정의 블록에만 둔다(그 밖은 var(--pf-*) 만).
   v2 일 때만 Fluxshop_Purchase_UI 가 싣는다. 화면별 부품은 purchase-{cart,drawer,detail,checkout}.css. */

/* 1. 토큰 — 사이트가 정한 색을 받고, 없으면 시안 값으로 폴백 (이 블록이 색 리터럴의 유일한 자리)
   강조색 = 사이트 대표(브랜드) 색: 토대(FHC_Brand)가 :root 에 내보내는 --fh-brand(-deep/-contrast) → 허브 테마 --fx-brand → 시안 청록.
   --fhs-primary 는 읽지 않는다: 기본 스킨(skin.css)이 항상 #111111 로 다시 정의해 「지정 안 함」과 구분할 수 없다(검정이 기본값이 되는 문제). */
.fhs-pf {
	--pf-primary: var(--fh-brand, var(--fx-brand, #0E6B5C));
	--pf-primary-hover: var(--fh-brand-deep, var(--fx-brand-hover, #0B5A4D));
	--pf-on-primary: var(--fh-brand-contrast, var(--fx-brand-ink, #FFFFFF));
	--pf-sale: var(--fhs-accent, #D6303A);
	--pf-danger: var(--fhs-danger, #C2352B);
	--pf-text: var(--fhs-text, #1B1D21);
	--pf-text-2: var(--fhs-text-sub, #4A4F57);
	--pf-text-3: var(--fhs-text-muted, #6B717B);
	--pf-canvas: var(--fhs-pf-canvas, #F3F5F7);
	--pf-sheet: var(--fhs-white, #FFFFFF);
	--pf-fill: #F1F3F5;
	--pf-line: #E6E8EC;
	--pf-line-strong: #8E959E;
	--pf-disabled: #A3A9B1;
	--pf-font: "Pretendard Variable", Pretendard, "Noto Sans KR", "Malgun Gothic", sans-serif;
	--pf-shadow-pop: 0 8px 32px rgba(17, 20, 24, .16);
	--pf-shadow-bar: 0 -2px 10px rgba(17, 20, 24, .06);
	--pf-overlay: rgba(17, 20, 24, .45);
}

/* 2. 기본 */
.fhs-pf, .fhs-pf *, .fhs-pf *::before, .fhs-pf *::after { box-sizing: border-box; }
.fhs-pf {
	color: var(--pf-text);
	font-family: var(--pf-font);
	font-size: 16px;
	line-height: 1.5;
	font-variant-numeric: tabular-nums;
	word-break: keep-all;
	overflow-wrap: anywhere;
	-webkit-text-size-adjust: 100%;
}
.fhs-pf :where(h1, h2, h3, p, dl, dd, ul) { margin: 0; padding: 0; }
.fhs-pf :where(ul) { list-style: none; }
.fhs-pf :where(button) { font-family: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.fhs-pf :where(a) { color: inherit; text-decoration: none; }
.fhs-pf :where(svg) { display: block; flex: none; }
.fhs-pf :focus-visible { outline: 2px solid var(--pf-primary); outline-offset: 2px; }
.fhs-pf [hidden] { display: none !important; }
.fhs-pf-won { font-size: .8em; font-weight: 600; }
.fhs-pf-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.fhs-pf-sheet { background: var(--pf-sheet); border-radius: 12px; }
.fhs-pf-cap { font-size: 13px; line-height: 1.5; font-weight: 400; color: var(--pf-text-3); }
.fhs-pf-cap--danger { color: var(--pf-danger); }

/* 3. 공통 부품 */
/* 체크박스: 20 상자 + 44 영역. 체크 표시는 ::after 로 그려 색 값을 토큰으로만 쓴다 */
.fhs-pf-chk { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; cursor: pointer; font-size: 16px; font-weight: 500; }
.fhs-pf-chk input, .fhs-pf-radio input {
	appearance: none; -webkit-appearance: none; position: relative;
	width: 20px; height: 20px; margin: 0; flex: none;
	border: 1px solid var(--pf-line-strong); border-radius: 4px; background: var(--pf-sheet); cursor: pointer;
}
.fhs-pf-chk input:checked { background-color: var(--pf-primary); border-color: var(--pf-primary); }
.fhs-pf-chk input:checked::after {
	content: ""; position: absolute; left: 6px; top: 2px; width: 5px; height: 10px;
	border: solid var(--pf-on-primary); border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.fhs-pf-chk input:disabled { background-color: var(--pf-fill); border-color: var(--pf-line); cursor: default; }
/* 1.39.1: 체크·라디오 표시를 외부 input 규칙(옛 fluxshop.css 의 투명 덮개 규칙, 테마의 input 규칙)에 맡기지 않는다 —
   상자 모양·선택색·체크 표시를 여기서 !important 로 고정한다. 색은 토큰만(--pf-primary / --pf-on-primary / --pf-sheet). */
html body .fhs-pf-chk input[type="checkbox"], html body .fhs-pf-chk input[type="radio"] {
	-webkit-appearance: none !important; appearance: none !important; position: relative !important; inset: auto !important;
	display: inline-block !important; box-sizing: border-box !important; flex: none; width: 20px !important; height: 20px !important; min-height: 0 !important; margin: 0 !important; padding: 0 !important;
	opacity: 1 !important; border: 1px solid var(--pf-line-strong) !important; border-radius: 4px !important; background-color: var(--pf-sheet) !important; background-image: none !important; box-shadow: none; cursor: pointer;
}
html body .fhs-pf-chk input[type="radio"] { border-radius: 50% !important; }
html body .fhs-pf-chk input[type="checkbox"]:checked, html body .fhs-pf-chk input[type="radio"]:checked { background-color: var(--pf-primary) !important; border-color: var(--pf-primary) !important; }
html body .fhs-pf-chk input[type="checkbox"]:checked::after {
	content: "" !important; display: block !important; position: absolute !important; box-sizing: content-box; left: 6px; top: 2px; width: 5px; height: 10px;
	border: solid var(--pf-on-primary); border-width: 0 2px 2px 0; background: none; transform: rotate(45deg);
}
html body .fhs-pf-chk input[type="radio"]:checked { box-shadow: inset 0 0 0 4px var(--pf-sheet) !important; }
html body .fhs-pf-chk input[type="radio"]:checked::after { display: none !important; }
html body .fhs-pf-chk input[type="checkbox"]:focus-visible, html body .fhs-pf-chk input[type="radio"]:focus-visible { outline: 2px solid var(--pf-primary); outline-offset: 2px; }
html body .fhs-pf-chk input:disabled { background-color: var(--pf-fill) !important; border-color: var(--pf-line) !important; cursor: default; }
.fhs-pf-textbtn { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0 8px; font-size: 14px; font-weight: 600; color: var(--pf-text-2); }
.fhs-pf-textbtn:hover { color: var(--pf-text); }
.fhs-pf-sep { width: 1px; height: 12px; background: var(--pf-line); }
/* 채운 버튼은 화면당 1개 */
.fhs-pf-cta { display: flex; align-items: center; justify-content: center; width: 100%; height: 56px; padding: 0 16px; border-radius: 8px; background: var(--pf-primary); color: var(--pf-on-primary); font-size: 18px; font-weight: 600; transition: background-color .2s ease; }
.fhs-pf-cta:hover { background: var(--pf-primary-hover); }
.fhs-pf-cta:disabled, .fhs-pf-cta.is-disabled { background: var(--pf-line); color: var(--pf-text-3); cursor: default; }
.fhs-pf-btn { display: inline-flex; align-items: center; justify-content: center; height: 56px; padding: 0 16px; border: 1px solid var(--pf-line-strong); border-radius: 8px; background: var(--pf-sheet); color: var(--pf-text); font-size: 18px; font-weight: 600; transition: border-color .2s ease; }
.fhs-pf-btn:hover { border-color: var(--pf-text); }
.fhs-pf-btn--sm { height: 48px; border-radius: 6px; font-size: 15px; white-space: nowrap; }

/* 스테퍼: 84x28 (버튼 28, 글자 14). ::after 투명 확장으로 터치 영역 유지.
   껍데기는 .fhs-pf-stepper(또는 div.fhs-cart-qty). 장바구니는 fluxshop.js 가 버튼 자체의 .fhs-cart-qty[data-key][data-delta] 클릭을 읽으므로
   껍데기에 .fhs-cart-qty 를 쓰면 안 되고 버튼이 그 클래스를 가진다(button.fhs-cart-qty). */
.fhs-pf .fhs-pf-stepper, .fhs-pf div.fhs-cart-qty { display: inline-flex; align-items: center; width: 84px; height: 28px; border-radius: 6px; background: var(--pf-fill); }
.fhs-pf .fhs-pf-stepper button, .fhs-pf div.fhs-cart-qty button, .fhs-pf button.fhs-cart-qty { position: relative; display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 0; background: none; color: var(--pf-text); font-size: 14px; }
.fhs-pf .fhs-pf-stepper button::after, .fhs-pf div.fhs-cart-qty button::after, .fhs-pf button.fhs-cart-qty::after { content: ""; position: absolute; inset: -8px -4px; }
.fhs-pf .fhs-cart-qtyinput { width: 28px; height: 28px; padding: 0; border: 0; border-radius: 0; background: none; text-align: center; font: 600 14px var(--pf-font); color: var(--pf-text); font-variant-numeric: tabular-nums; }
.fhs-pf-ico { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* 썸네일: 장바구니 줄은 정사각 64(모바일 56) */
.fhs-pf-thumb { display: block; flex: none; background: var(--pf-fill); border-radius: 6px; }
.fhs-pf .fhs-cart-row .fhs-pf-thumb { grid-area: img; width: 64px; height: 64px; }

/* 가격 위계: 할인율 > 판매가 > 정가(취소선) */
.fhs-pf-price { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; }
.fhs-pf-price__now { display: flex; align-items: baseline; gap: 6px; }
.fhs-pf-price__rate { font-size: 16px; line-height: 1.4; font-weight: 700; color: var(--pf-sale); }
.fhs-pf-price__sell { font-size: 18px; line-height: 1.4; font-weight: 700; }
.fhs-pf-price__sell .fhs-pf-won { font-size: 14px; }
.fhs-pf-price__reg { font-size: 14px; line-height: 1.4; font-weight: 400; color: var(--pf-text-3); text-decoration: line-through; }
.fhs-pf-bundle { margin-top: 4px; font-size: 13px; line-height: 1.5; font-weight: 600; color: var(--pf-sale); }

/* 무료배송 계량줄 */
.fhs-pf-freeship { margin: 8px 0 4px; }
.fhs-pf-freeship__text { display: flex; justify-content: space-between; align-items: baseline; height: 20px; font-size: 14px; line-height: 20px; font-weight: 500; color: var(--pf-text-2); }
.fhs-pf-freeship__text b { font-weight: 700; color: var(--pf-primary); }
.fhs-pf-freeship__basis { font-size: 13px; font-weight: 400; color: var(--pf-text-3); }
.fhs-pf-freeship__bar { height: 4px; margin-top: 6px; border-radius: 2px; background: var(--pf-line); overflow: hidden; }
.fhs-pf-freeship__bar i { display: block; height: 100%; width: clamp(4%, var(--r, 50%), 100%); background: var(--pf-primary); transition: width .3s ease-out; }
.fhs-pf-freeship__note { margin-top: 6px; font-size: 13px; font-weight: 400; color: var(--pf-text-3); }
.fhs-pf-freeship--bar { margin: 0 0 8px; }
.fhs-pf-freeship--bar .fhs-pf-freeship__bar { height: 3px; }
.fhs-pf-freeship--bar .fhs-pf-freeship__note, .fhs-pf-freeship--bar .fhs-pf-freeship__basis { display: none; }

/* 결제금액 사다리. 「1+1 혜택」 같은 줄은 별도 차감이라 들여쓰지 않는다(--sub 도 들여쓰기 0) */
.fhs-pf-ladder__row { display: flex; justify-content: space-between; align-items: center; min-height: 32px; font-size: 15px; }
.fhs-pf-ladder__row dt, .fhs-pf-ladder__row > span:first-child { font-weight: 400; color: var(--pf-text-2); }
.fhs-pf-ladder__row dd, .fhs-pf-ladder__row > span:last-child { font-weight: 600; color: var(--pf-text); }
.fhs-pf-ladder__row--sub dt, .fhs-pf-ladder__row--sub > span:first-child { padding-left: 0; }
.fhs-pf-ladder__row--minus dd, .fhs-pf-ladder__row--minus > span:last-child { color: var(--pf-sale); }
.fhs-pf-ladder__total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--pf-line); }
.fhs-pf-ladder__total > span:first-child { font-size: 16px; font-weight: 600; }
.fhs-pf-ladder__total strong { font-size: 26px; line-height: 1.3; font-weight: 700; }
.fhs-pf-ladder__total strong .fhs-pf-won { font-size: 18px; }
.fhs-pf-ladder[aria-busy=true] dd, .fhs-pf-ladder[aria-busy=true] strong { opacity: .4; }

@media (max-width: 767px) {
	.fhs-pf-sheet { border-radius: 0; }
	.fhs-pf .fhs-cart-row .fhs-pf-thumb { width: 56px; height: 56px; }
	.fhs-pf-ladder__row { min-height: 30px; }
}
@media (prefers-reduced-motion: reduce) {
	.fhs-pf *, .fhs-pf *::before, .fhs-pf *::after { animation: none !important; transition: none !important; }
}

/* 4. 링크로 그려지는 버튼 — 테마·스킨의 링크 색 규칙(a, a:hover, .entry-content a …)이 글자색을 덮어 대비가 깨지는 것을 막는다(검수 D1). 상태별로 고정 */
html body .fhs-pf a.fhs-pf-cta, html body .fhs-pf a.fhs-pf-cta:link, html body .fhs-pf a.fhs-pf-cta:visited,
html body .fhs-pf a.fhs-pf-cta:hover, html body .fhs-pf a.fhs-pf-cta:focus, html body .fhs-pf a.fhs-pf-cta:active { color: var(--pf-on-primary); text-decoration: none; }
html body .fhs-pf a.fhs-pf-cta:hover, html body .fhs-pf a.fhs-pf-cta:focus { background: var(--pf-primary-hover); }
html body .fhs-pf a.fhs-pf-btn, html body .fhs-pf a.fhs-pf-btn:link, html body .fhs-pf a.fhs-pf-btn:visited,
html body .fhs-pf a.fhs-pf-btn:hover, html body .fhs-pf a.fhs-pf-btn:focus, html body .fhs-pf a.fhs-pf-btn:active { color: var(--pf-text); text-decoration: none; }
