/* =================================================================
 * components.css — 여러 페이지에서 공통으로 쓰는 조각들
 * 버튼 · 상품 카드 · 폼 · 배지 · 빈 상태 · 알림
 * ================================================================= */

/* ---- 버튼 (WBS 3.1.2 : haruharu wonder 피그마 버튼, home.css 의 h-btn 과 같은 모양) ----
   알약 모양 · Bold 13 · 자간 1.6px
   주요 동작 = 코랄 (primary · brand) · 보조 = 흰 바탕 Ink 테두리 (outline · ghost) · 진한 버튼 = Ink (dark) */

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--sp-xs);
	height: 52px;
	padding-inline: 28px;
	border: 1px solid transparent;
	border-radius: var(--radius-pill);
	font-family: var(--font-body);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 1.6px;
	text-transform: uppercase;
	line-height: 1;
	cursor: pointer;
	white-space: nowrap;
	transition: background-color .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease), opacity .2s var(--ease);
}

.btn--primary{ background: var(--coral); border-color: var(--coral); color: #fff; }
.btn--primary:hover{ background: var(--coral-hover); border-color: var(--coral-hover); }

.btn--outline{ background: #fff; color: var(--ink); border-color: var(--ink); }
.btn--outline:hover{ background: var(--ink); color: #fff; }

.btn--block { width: 100%; }
.btn--sm { height: 40px; padding-inline: 18px; font-size: 12px; }

.btn:disabled,
.btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }

/* ---- 아이콘 ---- */

.icon { width: 21px; height: 21px; flex: none; }
.icon--sm { width: 17px; height: 17px; }

/* ---- 폼 (기획안 내 계정 · 문의 입력칸 : 연회색 #fafafa · 높이 62 · 칸 이름 회색 20) ---- */

.field { display: grid; gap: 8px; margin-block-end: 16px; }
.field__label { font-family: var(--font-body); font-size: 13px; color: var(--ink); }
.field__label .req { color: var(--ink); }

.input,
.textarea,
.select {
	width: 100%;
	height: 48px;
	padding-inline: 20px;
	border: 1px solid #e4e7ea;
	border-radius: 24px;   /* 피그마 입력칸 : 알약 모양 (뉴스레터 Your email) · WBS 4.1.6 */
	background: #fff;
	font-family: var(--font-body);
	font-size: 15px;
	color: var(--ink);
	transition: border-color .2s var(--ease);
}
.input::placeholder, .textarea::placeholder { color: #a9a9a9; }
.textarea { height: auto; min-height: 140px; padding-block: 14px; border-radius: 18px; resize: vertical; line-height: 1.6; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='12'%3E%3Cpath d='M0 0h14L7 12z' fill='%231d1d1f'/%3E%3C/svg%3E"); background-size: 8px 6px; background-repeat: no-repeat; background-position: right 20px center; padding-inline-end: 40px; }

.input:focus, .textarea:focus, .select:focus {
	outline: none;
	border-color: var(--ink);
}
/* 한 줄에 여러 칸 (주문서의 City / State / ZIP) — 좁은 화면에서는 세로로 쌓는다 */

   /* 칸 이름이 두 줄이 되어도 입력칸은 한 줄로 맞춘다 */

/* 보여주기만 하는 칸 */
.input[readonly] { background: var(--mist); color: var(--fg-muted); cursor: default; }
.input[readonly]:focus { border-color: #e4e7ea; }

.field__help { font-size: 12px; color: #5a5a5a; }
.field__error { font-size: 13px; color: var(--danger); }

.checkbox { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--ink); cursor: pointer; }
.checkbox input { flex: none; width: 20px; height: 20px; margin: 0; accent-color: var(--ink); }
/* 동의 문구 안의 링크(개인정보 처리방침 등) */
.checkbox a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }

/* ---- 카드(폼 감싸기) : 피그마 카드처럼 옅은 선 · 둥근 모서리 24 (WBS 4.1.6) ---- */

.card {
	background: #fff;
	border: 1px solid #e4e7ea;
	border-radius: 24px;
	padding: clamp(24px, 3vw, 40px);
}

@media (max-width: 899px) {
	.btn { height: 48px; padding-inline: 20px; font-size: 15px; }
	.btn--sm { height: 38px; font-size: 13px; }
	.input, .textarea, .select { height: 48px; padding-inline: 14px; font-size: 16px; }
	.select { background-position: right 14px center; padding-inline-end: 40px; }
	.textarea { padding-block: 12px; }
	.field__help, .field__error { font-size: 13px; }
	.checkbox { font-size: 15px; }
	.card { border-radius: 22px; }
}

/* ---- 수량 조절 ---- */

.qty {
	display: inline-flex;
	align-items: center;
	border: 1px solid var(--border);
	border-radius: 999px;
	overflow: hidden;
}
.qty button { width: 42px; height: 48px; border: 0; background: none; cursor: pointer; font-size: var(--fs-base); }
.qty input {
	width: 46px; height: 48px;
	border: 0; text-align: center;
	font-family: var(--font-body); font-size: var(--fs-sm);
	appearance: textfield; -moz-appearance: textfield;
}
.qty input::-webkit-outer-spin-button,
.qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ---- 옵션 선택(색상 등) ---- */

.option { position: relative; }
.option input { position: absolute; opacity: 0; pointer-events: none; }
.option span {
	display: inline-flex;
	align-items: center;
	height: 40px;
	padding-inline: var(--sp-sm);
	border: 1px solid var(--border);
	border-radius: 999px;
	font-size: var(--fs-sm);
	cursor: pointer;
	transition: border-color .2s var(--ease), background-color .2s var(--ease), color .2s var(--ease);
}
.option input:checked + span { background: var(--fg); border-color: var(--fg); color: #fff; }
.option input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---- 빈 상태 ---- */

.empty {
	display: grid;
	justify-items: center;
	gap: var(--sp-md);
	padding-block: var(--sp-xl);
	text-align: center;
}
.empty__title { margin: 0; font-family: var(--font-point); font-weight: var(--fw-point); font-size: 28px; color: var(--ink); }
.empty__text { margin: 0; color: var(--fg-muted); }

/* ---- 알림(성공/오류) ---- */

.notice {
	padding: 16px 21px;
	border-radius: 14px;
	font-family: var(--font-body);
	font-size: 14px;
	line-height: 1.6;
	margin-block-end: 20px;
}
.notice--success { background: #e8f3ea; color: #1d6b2e; }
.notice--error { background: #fdeceb; color: #8b0000; }

/* ---- 페이지 헤더(제목 영역) ---- */

/* 피그마에 없는 화면의 제목 (WBS 3.1.2) : 코랄 대문자 소제목(home.css h-eyebrow 와 같게) + Gill Sans Light 44 (모바일 32) */
.page-head {
	display: grid;
	gap: 12px;
	margin-block: 64px 40px;
	text-align: center;
}
.page-head__sub { order: -1; margin: 0; font-family: var(--font-body); font-size: 12px; font-weight: 700; line-height: 1.4; letter-spacing: 3px; text-transform: uppercase; color: var(--coral); }
.page-head__title { margin: 0; font-family: var(--font-point); font-weight: var(--fw-point); font-size: 44px; line-height: 1.15; letter-spacing: 0; color: var(--ink); }
.page-head__desc { margin: 4px 0 0; font-family: var(--font-body); font-size: 15px; line-height: 1.7; color: #3a3a3a; }
@media (max-width: 899px) {
	.page-head { gap: 8px; margin-block: 40px 28px; }
	.page-head__title { font-size: 32px; }
	.page-head__desc { font-size: 14px; }
}

/* ---- 빵부스러기 ---- */

/* ---- 토스트 ---- */

.toast {
	position: fixed;
	inset-block-end: var(--sp-md);
	inset-inline: 0;
	z-index: 200;
	display: flex;
	justify-content: center;
	pointer-events: none;
}
.toast__inner {
	background: var(--fg); color: #fff;
	padding: 12px 20px;
	border-radius: 999px;
	font-size: var(--fs-sm);
	opacity: 0; transform: translateY(8px);
	transition: opacity .25s var(--ease), transform .25s var(--ease);
}
.toast.is-visible .toast__inner { opacity: 1; transform: translateY(0); }

/* ---- 폼 하단 안내 링크 ---- */

.form-alt {
	margin-block-start: var(--sp-md);
	text-align: center;
	font-family: var(--font-body);
	font-size: 14px;
	color: #3a3a3a;
}
.form-alt a { color: var(--ink); text-decoration: underline; }

/* ── 별점 ──────────────────────────────────────────────────────────────
   목록 카드와 상품 화면에서 함께 쓴다. 별 자체는 글자(★☆)라 폰트를 탄다.
   -------------------------------------------------------------------- */
.rating {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-size: 13px;
	color: var(--fg-muted, #6b6b6b);
	line-height: 1;
}
