/* =================================================================
 * cart.css — 장바구니
 * ================================================================= */

/* ---- 장바구니 화면 (피그마 Cart 1920 · Cart-mobile 850, WBS 2.4.7) ----
   PC : 상품 목록 630 + 간격 66 + 합계 상자 615 (= 1311). 배너 아래 목록 153 · 합계 상자 143 */

.cart-layout {
	display: grid;
	grid-template-columns: 630fr 615fr;
	column-gap: 66px;
	align-items: start;
	max-width: 1311px;
	margin: 143px auto 0;
}
.cart-layout[hidden] { display: none; }

/* 상품 줄 : 높이 315, 위아래 구분선, 사진 245 (왼쪽 30 · 위 35) */
.cart-list { margin: 10px 0 0; padding: 0; list-style: none; border-top: 1px solid #c4c4c4; }
.cart-item {
	display: grid;
	grid-template-columns: 245px 1fr;
	column-gap: 26px;
	padding: 35px 21px 35px 30px;
	border-bottom: 1px solid #c4c4c4;
}
.cart-item.is-busy { opacity: .5; pointer-events: none; }
.cart-item--off { opacity: .55; }
.cart-item__media { width: 245px; aspect-ratio: 1; overflow: hidden; background: var(--surface); }
.cart-item__media img { width: 100%; height: 100%; object-fit: cover; }
.cart-item__info { display: flex; flex-direction: column; min-width: 0; }
.cart-item__title { max-width: 300px; font-family: var(--font-body); font-size: 20px; line-height: normal; color: var(--efilow-ink); text-transform: capitalize; }
.cart-item__stock { margin: 6px 0 0; font-family: var(--font-body); font-size: 13px; line-height: 1.4; }
.cart-item__stock:empty { display: none; }
.cart-item__stock.is-bad { color: var(--danger); }
.cart-item__stock.is-low { color: #8a6d1f; }

/* 수량 109×50 · 찜 50×50 (주황 테두리 · 모서리 26 · 간격 16) */
.cart-item__controls { display: flex; align-items: center; gap: 16px; margin-top: 43px; }
.cart-qty {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 109px;
	height: 50px;
	border: 1px solid var(--brand);
	border-radius: 26px;
	background: #fff;
}
.cart-qty button { width: 34px; height: 100%; padding: 0; border: 0; background: none; font-family: var(--font-body); font-size: 18px; color: var(--brand); cursor: pointer; }
.cart-qty input { width: 30px; border: 0; background: none; font-family: var(--font-body); font-size: 18px; color: var(--brand); text-align: center; -moz-appearance: textfield; }
.cart-qty input::-webkit-outer-spin-button, .cart-qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.cart-like {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 50px;
	height: 50px;
	padding: 0;
	border: 1px solid var(--brand);
	border-radius: 26px;
	background: #fff;
	cursor: pointer;
}
.cart-like svg { width: 20px; height: 20px; fill: none; stroke: var(--brand); stroke-width: 1.8; }
.cart-like img { display: none; width: 20px; height: 20px; }
.cart-like.is-liked svg { display: none; }
.cart-like.is-liked img { display: block; }

/* 가격 : 오른쪽 아래, 할인 전 20 취소선 + 판매가 30 굵게 주황 */
.cart-item__price { margin: auto 0 0; padding-top: 16px; font-family: var(--font-body); font-size: 20px; line-height: normal; color: var(--efilow-ink); text-align: right; }
.cart-item__price b { font-weight: 700; font-size: 30px; color: var(--brand); }

/* 합계 상자 615×650 : 흰 바탕 · 주황 테두리 · 모서리 33, 안쪽 74 */
.cart-summary {
	display: flex;
	flex-direction: column;
	padding: 53px 73px 45px 74px;
	border: 1px solid var(--brand);
	border-radius: 33px;
	background: #fff;
	font-family: var(--font-body);
}
.cart-summary__row { display: flex; justify-content: space-between; align-items: baseline; font-size: 20px; line-height: normal; color: var(--efilow-ink); text-transform: capitalize; }
.cart-summary__row + .cart-summary__row { margin-top: 26px; }
.cart-summary__row[hidden] { display: none; }
.cart-summary__line { width: calc(100% + 32px); margin: 60px -16px 0; border: 0; border-top: 1px solid #c4c4c4; }
.cart-summary__row--total { margin-top: 45px !important; }
.cart-summary__row--total span:last-child { font-weight: 700; font-size: 30px; color: var(--brand); }
.cart-summary__saved { margin: 48px 0 0; font-weight: 600; font-size: 20px; color: var(--brand); text-align: center; text-transform: capitalize; }
.cart-summary__saved[hidden] { display: none; }
.cart-summary__checkout,
.cart-summary__continue {
	display: flex;
	align-items: center;
	justify-content: center;
	width: calc(100% + 32px);
	height: 50px;
	margin-inline: -16px;
	border: 1px solid var(--brand);
	border-radius: 26px;
	font-size: 18px;
	transition: background-color .2s var(--ease), color .2s var(--ease);
}
.cart-summary__checkout { margin-top: 35px; background: var(--brand); color: #fff; }
.cart-summary__checkout:hover { background: var(--brand-hover); }
.cart-summary__checkout.is-disabled { pointer-events: none; opacity: .5; cursor: not-allowed; }
.cart-summary__continue { margin-top: 9px; background: #fff; color: var(--brand); }
.cart-summary__continue:hover { background: var(--brand); color: #fff; }
.cart-summary__free { margin: 22px 0 0; font-weight: 600; font-size: 20px; color: var(--brand); text-transform: capitalize; }
.cart-summary__free[hidden] { display: none; }
.cart-summary__note { margin: 16px 0 0; font-size: 15px; color: var(--fg-subtle); text-transform: capitalize; }

@media (max-width: 1199px) and (min-width: 900px) {
	.cart-layout { column-gap: 32px; }
	.cart-item { grid-template-columns: 160px 1fr; }
	.cart-item__media { width: 160px; }
	.cart-summary { padding-inline: 40px; }
}

/* 모바일 (기획안 Cart-mobile 850 폭) : 목록 아래 합계 상자 */
@media (max-width: 899px) {
	.cart-layout { display: block; margin-top: calc(120 * 100vw / 850); }
	.cart-list { margin: 0 calc(-16 * 100vw / 850); }
	.cart-item { grid-template-columns: calc(235 * 100vw / 850) 1fr; column-gap: calc(26 * 100vw / 850); padding: calc(30 * 100vw / 850) calc(20 * 100vw / 850); }
	.cart-item__media { width: 100%; }
	.cart-item__title { font-size: max(13px, calc(20 * 100vw / 850)); }
	.cart-item__controls { gap: 10px; margin-top: calc(30 * 100vw / 850); }
	.cart-qty { width: max(100px, calc(109 * 100vw / 850)); height: max(38px, calc(50 * 100vw / 850)); }
	.cart-like { width: max(36px, calc(50 * 100vw / 850)); height: max(36px, calc(50 * 100vw / 850)); }
	.cart-qty button, .cart-qty input { font-size: 14px; }
	.cart-item__price { font-size: max(12px, calc(20 * 100vw / 850)); }
	.cart-item__price b { font-size: max(18px, calc(30 * 100vw / 850)); }
	.cart-summary { margin-top: calc(80 * 100vw / 850); padding: 28px 24px 24px; border-radius: calc(33 * 100vw / 850); }
	.cart-summary__row { font-size: max(13px, calc(20 * 100vw / 850)); }
	.cart-summary__row + .cart-summary__row { margin-top: 14px; }
	.cart-summary__line { margin-top: 28px; }
	.cart-summary__row--total { margin-top: 24px !important; }
	.cart-summary__row--total span:last-child { font-size: max(20px, calc(30 * 100vw / 850)); }
	.cart-summary__saved { margin-top: 24px; font-size: max(13px, calc(20 * 100vw / 850)); }
	.cart-summary__checkout, .cart-summary__continue { height: max(38px, calc(50 * 100vw / 850)); font-size: 14px; }
	.cart-summary__checkout { margin-top: 18px; }
	.cart-summary__free { margin-top: 14px; font-size: max(13px, calc(20 * 100vw / 850)); }
	.cart-summary__note { font-size: 11px; }
}

/* ---- 주문서 ---- */

.checkout__section {
	font-family: var(--font-point);
	font-weight: 800;
	font-size: 28px;
	margin-block: 40px 22px;
}
@media (max-width: 899px) { .checkout__section { font-size: 20px; margin-block: 28px 14px; } }
.checkout__section:first-child { margin-block-start: 0; }

.checkout-hero { margin-bottom: 80px; }
@media (max-width: 899px) { .checkout-hero { margin-bottom: 36px; } }

.pay-methods { display: flex; flex-wrap: wrap; gap: var(--sp-xs); }

.summary__title { margin: 0; font-family: var(--font-point); font-weight: 800; font-size: 28px; }
.summary__items { display: grid; gap: 10px; margin: 0; padding: 0 0 18px; list-style: none; border-bottom: 1px solid #c4c4c4; }
.summary__items li { display: flex; justify-content: space-between; gap: var(--sp-sm); font-size: 16px; color: var(--efilow-ink); }

/* ---- 주문 완료 (기획안에 없음 · 장바구니 합계 상자와 같은 줄 모양, WBS 2.4.11) ---- */
.order-done { display: grid; gap: 18px; font-family: var(--font-body); }
.order-done__items { margin-block: 6px; padding-block: 18px; border-top: 1px solid #c4c4c4; }
.order-done .summary__row > :first-child { color: var(--fg-subtle); }
.order-done .summary__row--total > :first-child { color: var(--efilow-ink); }
