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

/* ---- 버튼 (WBS 2.4.11 : 피그마 기획안 버튼으로 통일) ----
   기본 = 검은 알약 (기획안 Save Changes · Send Message) · 결제처럼 주요 구매 동작 = 주황 (기획안 Checkout)
   보조 = 주황 테두리 (기획안 Continue Shopping · Buy Now) · 작은 동작 = 회색 (기획안 Change · Edit) */

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--sp-xs);
	height: 50px;
	padding-inline: 28px;
	border: 1px solid transparent;
	border-radius: 60px;
	font-family: var(--font-body);
	font-size: 18px;
	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: #000; color: #fff; }
.btn--primary:hover { opacity: .85; }

.btn--brand { background: var(--brand); color: #fff; }
.btn--brand:hover { background: var(--brand-hover); }

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

.btn--ghost { background: #d9d9d9; color: #14160d; }
.btn--ghost:hover { opacity: .85; }

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

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

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

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

/* ---- 상품 카드 ---- */

.product-grid {
	display: grid;
	gap: var(--sp-md);
	grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 900px) {
	.product-grid { grid-template-columns: repeat(var(--cols, 4), 1fr); }
}

.product-card { display: flex; flex-direction: column; }

.product-card__media {
	position: relative;
	display: block;
	aspect-ratio: 1 / 1;
	border-radius: var(--radius);
	overflow: hidden;
	background: var(--surface);
}
.product-card__media img {
	width: 100%; height: 100%;
	object-fit: cover;
	transition: transform .5s var(--ease);
}
.product-card:hover .product-card__media img { transform: scale(1.04); }

.product-card__body { padding-block-start: var(--sp-sm); display: grid; gap: 4px; }
.product-card__title { font-family: var(--font-body); font-weight: 400; font-size: var(--fs-sm); line-height: 1.5; }
.product-card__price { margin: 0; font-size: var(--fs-sm); color: var(--fg-muted); }

/* 품절 뱃지 */
.product-card__badge {
	position: absolute;
	top: 10px; inset-inline-start: 10px;
	padding: 4px 10px;
	background: rgb(0 0 0 / .6);
	color: #fff;
	border-radius: 999px;
	font-size: var(--fs-xs);
}

/* ---- 컬렉션 카드 ---- */

.collection-grid {
	display: grid;
	gap: var(--sp-md);
	grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 900px) { .collection-grid { grid-template-columns: repeat(4, 1fr); } }

.collection-card__media {
	display: block;
	aspect-ratio: 4 / 5;
	border-radius: var(--radius);
	overflow: hidden;
	background: var(--surface);
}
.collection-card__media img {
	width: 100%; height: 100%;
	object-fit: cover;
	transition: transform .5s var(--ease);
}
.collection-card:hover .collection-card__media img { transform: scale(1.04); }
.collection-card__title { display: block; margin-block-start: 12px; font-size: var(--fs-sm); font-weight: 700; }

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

.field { display: grid; gap: 14px; margin-block-end: 22px; }
.field__label { font-family: var(--font-body); font-size: 20px; color: var(--fg-subtle); }
.field__label .req { color: var(--brand); }

.input,
.textarea,
.select {
	width: 100%;
	height: 62px;
	padding-inline: 21px;
	border: 1px solid transparent;
	border-radius: 0;
	background: #fafafa;
	font-family: var(--font-body);
	font-size: 20px;
	color: #171717;
	transition: border-color .2s var(--ease);
}
.input::placeholder, .textarea::placeholder { color: #a9a9a9; }
.textarea { height: auto; min-height: 150px; padding-block: 16px; 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='%238b8b8b'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 21px center; padding-inline-end: 48px; }

.input:focus, .textarea:focus, .select:focus {
	outline: none;
	border-color: var(--brand);
}
/* 한 줄에 여러 칸 (주문서의 City / State / ZIP) — 좁은 화면에서는 세로로 쌓는다 */
.field-grid { display: grid; gap: 0 14px; grid-template-columns: 2fr 1.5fr 1fr; }
.field-grid .field { align-content: end; }   /* 칸 이름이 두 줄이 되어도 입력칸은 한 줄로 맞춘다 */
@media (max-width: 600px) { .field-grid { grid-template-columns: minmax(0, 1fr); } }

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

.field__help { font-size: 15px; color: var(--fg-subtle); }
.field__error { font-size: 15px; color: var(--danger); }

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

/* ---- 카드(폼 감싸기) : 기획안 주황 테두리 상자 · 모서리 33 ---- */

.card {
	background: #fff;
	border: 1px solid var(--brand);
	border-radius: 33px;
	padding: clamp(24px, 4vw, 53px) clamp(20px, 4.5vw, 64px);
}

@media (max-width: 899px) {
	.btn { height: 46px; padding-inline: 20px; font-size: 16px; }
	.btn--sm { height: 38px; font-size: 14px; }
	.field { gap: 8px; margin-block-end: 16px; }
	.field__label { font-size: 14px; }
	.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; }

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

.options { display: grid; gap: 10px; }
.options__label { font-size: var(--fs-sm); color: var(--fg-muted); }
.options__list { display: flex; flex-wrap: wrap; gap: var(--sp-xs); }
.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 { font-family: var(--font-point); font-weight: 800; font-size: 30px; }
.empty__text { margin: 0; color: var(--fg-muted); }

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

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

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

/* 기획안 쇼핑 가이드 제목 : 작은 소제목 20 + Abhaya 제목 45 */
.page-head {
	display: grid;
	gap: 11px;
	margin-block: 100px 60px;
	text-align: center;
}
.page-head__sub { order: -1; margin: 0; font-family: var(--font-body); font-size: 20px; line-height: 24px; color: var(--efilow-ink); }
.page-head__title { margin: 0; font-family: var(--font-point); font-weight: 800; font-size: 45px; line-height: normal; color: #000; }
.page-head__desc { margin: 6px 0 0; font-family: var(--font-body); font-size: 18px; color: var(--fg-muted); }
@media (max-width: 899px) {
	.page-head { gap: 6px; margin-block: calc(100 * 100vw / 850) 32px; }
	.page-head__sub { font-size: max(12px, calc(20 * 100vw / 850)); }
	.page-head__title { font-size: max(26px, calc(45 * 100vw / 850)); }
	.page-head__desc { font-size: 14px; }
}

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

.breadcrumb { display: flex; flex-wrap: wrap; gap: 6px; font-size: var(--fs-xs); color: var(--fg-subtle); padding-block: var(--sp-sm); }
.breadcrumb a:hover { color: var(--fg); }

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

.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: 17px;
	color: var(--fg-muted);
}
.form-alt a { color: var(--brand); text-decoration: underline; }


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

/* =================================================================
 * 상품 카드 (피그마 기획안 · 카드 314×442) — 상품 목록(shop.html) · 메인 베스트셀러(index.html) 공통
 * 표시 · 담기 · 찜 동작은 js/common.js 의 shopCard* 함수
 * ================================================================= */

.shop-grid {
	display: grid;
	max-width: 1280px;               /* 기획안 카드 4개 + 간격 = 1280 */
	margin-inline: auto;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	column-gap: 8px;
	row-gap: 40px;
	margin-block: 0;
	padding: 0;
	list-style: none;
}
@media (min-width: 900px)  { .shop-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1150px) { .shop-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* 카드 : 회색 바탕 · 모서리 33. 사진은 카드 폭의 약 78% (314 중 244), 위 47 · 양옆 35 여백 */
.shop-card {
	position: relative;
	display: flex;
	flex-direction: column;
	padding: 14.97% 11.15% 56px;   /* 47/314 · 35/314 (퍼센트 여백은 카드 폭 기준) */
	border-radius: 33px;
	background: var(--surface);
}

.shop-card__visual { position: relative; }
.shop-card__media {
	display: block;
	aspect-ratio: 244 / 243;
	overflow: hidden;
	background: #c4c4c4;
}
.shop-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .5s var(--ease);
}
.shop-card:hover .shop-card__media img { transform: scale(1.04); }

/* 담기 버튼 : 142×52 · 모서리 8 · 주황 · 사진 아래쪽에 걸쳐 가운데. 마우스를 올리면 나타난다 */
.shop-card__add {
	position: absolute;
	left: 50%;
	bottom: -11px;
	transform: translateX(-50%);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 142px;
	height: 52px;
	padding-inline: 12px;
	border: 0;
	border-radius: 8px;
	background: var(--brand);
	font-family: var(--font-body);
	font-size: 18px;
	color: #fff;
	white-space: nowrap;
	cursor: pointer;
	opacity: 0;
	transition: opacity .2s var(--ease), background-color .2s var(--ease);
}
.shop-card__add:hover { background: var(--brand-hover); }
.shop-card:hover .shop-card__add,
.shop-card:focus-within .shop-card__add { opacity: 1; }
.shop-card__add:disabled { background: var(--fg-subtle); cursor: default; }
/* 터치 화면은 마우스를 올릴 수 없으니 늘 보인다 */
@media (hover: none) { .shop-card__add { opacity: 1; } }

/* 상품명(왼쪽, 주황) · 가격(오른쪽) 한 줄 */
.shop-card__info {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 8px;
	margin-block-start: 15px;
}
.shop-card__title {
	flex: 1 1 auto;
	min-width: 0;
	max-width: 158px;
	font-family: var(--font-point);
	font-weight: 800;
	font-size: 20px;
	line-height: normal;
	color: var(--brand);
	text-transform: capitalize;
}
.shop-card__price {
	flex: none;
	margin: 7px 0 0;
	font-family: var(--font-body);
	font-size: 15px;
	line-height: normal;
	color: var(--efilow-ink);
	text-align: right;
}
.shop-card__price s { font-size: 12px; }
.shop-card__price b { font-weight: 700; }
.shop-card__from { margin-inline-start: 2px; }

/* 태그 : 누르면 그 태그로 검색 */
.shop-card__tags {
	margin: 15px 0 0;
	font-family: var(--font-body);
	font-size: 15px;
	line-height: normal;
	color: var(--fg);
}
.shop-card__tags:empty { display: none; }
.shop-card__tags a:hover { color: var(--brand); }

/* 찜 하트 : 카드 오른쪽 아래 20×20. 찜하면 기획안의 빨간 하트, 아니면 빈 하트 */
.shop-card__like {
	position: absolute;
	right: 11.15%;
	bottom: 26px;
	width: 20px;
	height: 20px;
	cursor: pointer;
}
.shop-card__like input { position: absolute; opacity: 0; width: 0; height: 0; }
.shop-card__like::after { content: ""; position: absolute; inset: -12px; }   /* 손가락으로 누르기 쉽게 (보이는 크기는 그대로) */
.shop-card__like svg {
	width: 20px;
	height: 20px;
	fill: none;
	stroke: var(--efilow-ink);
	stroke-width: 1.8;
}
.shop-card__like img { display: none; width: 20px; height: 20px; }
.shop-card__like:hover svg { stroke: var(--danger); }
.shop-card__like input:checked ~ svg { display: none; }
.shop-card__like input:checked ~ img { display: block; }
.shop-card__like input:focus-visible ~ svg { outline: 2px solid var(--brand); outline-offset: 2px; }

@media (max-width: 599px) {
	.shop-card { border-radius: 22px; padding-block-end: 44px; }
	.shop-card__add { min-width: 0; width: 90%; height: 40px; font-size: 14px; bottom: -8px; }
	.shop-card__info { flex-direction: column; gap: 4px; margin-block-start: 12px; }
	.shop-card__title { max-width: none; font-size: 16px; }
	.shop-card__price { margin: 0; text-align: left; font-size: 14px; }
	.shop-card__tags { margin-block-start: 8px; font-size: 12px; }
	.shop-card__like { bottom: 18px; }
}

/* =================================================================
 * 브랜드 가치 (피그마 Eighth-Section) — 메인 · 상품 상세 공통
 * ================================================================= */

/* 폭 1245, 한 칸 415 */
.home-values { margin-block-start: 120px; padding-block-end: 44px; }      /* 기획안 : 가치 제목 위 → 푸터 371 (푸터 위 여백 120 포함) */
.home-values__title {
	margin: 0;
	font-family: var(--font-point);
	font-weight: 800;
	font-size: 45px;
	line-height: normal;
	color: #000;
	text-align: center;
	text-transform: capitalize;
}
.home-values__list {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	max-width: 1245px;
	margin: 56px auto 0;
	padding: 0;
	list-style: none;
}
.home-values__item {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
}
/* 칸 양옆 세로선 66 (기획안 Divider · #9C9A9A). 아이콘 아래(29)부터 */
.home-values__item::before,
.home-values__item::after {
	content: "";
	position: absolute;
	top: 29px;
	width: 1px;
	height: 66px;
	background: #9c9a9a;
}
.home-values__item::before { left: 0; }
.home-values__item::after { right: 0; }
.home-values__item + .home-values__item::before { display: none; }   /* 가운데 선은 한 줄만 */
.home-values__item img { width: 40px; height: 34.85px; object-fit: cover; }
.home-values__item h3 {
	margin: 8px 0 0;
	font-family: var(--font-point);
	font-weight: 800;
	font-size: 25px;
	line-height: 30px;
	color: var(--fg);
}
.home-values__item p {
	margin: 5px 0 0;
	max-width: 327px;
	font-family: var(--font-body);
	font-size: 14px;
	line-height: 20px;
	color: var(--fg);
}

@media (max-width: 899px) {
	/* 가치 : 세로로 쌓고 선은 없다. 아이콘 간격 185 */
	.home-values { margin-block: calc(110 * 100vw / 850) calc(111 * 100vw / 850 - var(--sp-section)); padding-block-end: 0; }
	.home-values__title { font-size: max(24px, calc(45 * 100vw / 850)); }
	.home-values__list { grid-template-columns: 1fr; row-gap: calc(80 * 100vw / 850); margin-top: calc(70 * 100vw / 850); }
	.home-values__item::before, .home-values__item::after { display: none; }
	.home-values__item h3 { font-size: max(18px, calc(25 * 100vw / 850)); }
	.home-values__item p { font-size: max(12px, calc(14 * 100vw / 850)); }
}

/* =================================================================
 * 주황 그라데이션 배너 1303×300 (피그마 Second-Section) — 상품 목록 · 문의 · 장바구니 공통
 * ================================================================= */

.shop-hero {
	display: grid;
	place-content: center;
	gap: 0;
	min-height: 300px;
	margin-block-start: 16px;
	padding: var(--sp-md);
	border-radius: 45px;
	background-image: linear-gradient(96.57deg, rgba(255, 252, 241, 0.8) 0%, rgba(255, 140, 31, 0.8) 98.709%);
	text-align: center;
}
/* 기획안 헤더(118)를 쓰는 넓은 화면에서는 배너가 헤더 바로 아래 (Shop · Cart 등 y 118) */
@media (min-width: 1280px) { .shop-hero { margin-block-start: 0; } }
.shop-hero__sub {
	margin: 0;
	font-family: var(--font-body);
	font-size: 20px;
	line-height: 24px;
	color: var(--efilow-ink);
}
.shop-hero__title {
	margin: 11px 0 0;
	font-family: var(--font-point);
	font-weight: 800;
	font-size: 45px;
	line-height: normal;
	color: #000;
	text-transform: capitalize;
}

@media (max-width: 599px) {
	.shop-hero { min-height: 0; aspect-ratio: 700 / 450; border-radius: 28px; }
	.shop-hero__sub { font-size: 15px; line-height: 20px; }
	.shop-hero__title { font-size: 32px; margin-block-start: 6px; }
}
