/* ============================================================
   쇼핑몰 공통 스타일
   색상/폰트는 :root 변수만 바꾸면 전체가 바뀝니다.
   ============================================================ */

:root {
  --bg: #ffffff;
  --fg: #222222;
  --muted: #888888;
  --line: #e5e5e5;
  --line-strong: #222222;
  --point: #c9302c;      /* 세일가 / 강조 색 */
  --btn-bg: #222222;
  --btn-fg: #ffffff;
  --max: 1200px;
  --font: 'Noto Sans KR', 'Malgun Gothic', '맑은 고딕', sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

img { max-width: 100%; display: block; border: 0; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; margin: 0; padding: 0; }
button { font-family: inherit; cursor: pointer; }
table { border-collapse: collapse; width: 100%; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 16px; }

/* ---------- 상단 유틸바 ---------- */
.utilbar { border-bottom: 1px solid var(--line); font-size: 12px; }
.utilbar .wrap { display: flex; justify-content: flex-end; gap: 16px; height: 36px; align-items: center; }
.utilbar a { color: var(--muted); }
.utilbar a:hover { color: var(--fg); }

/* ---------- 헤더 ---------- */
.header { border-bottom: 1px solid var(--line); }
.header .logo {
  text-align: center;
  padding: 28px 0 22px;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 6px;
}
.gnb { border-top: 1px solid var(--line); }
.gnb ul {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 28px;
  height: 48px;
  align-items: center;
}
.gnb a { font-size: 13px; letter-spacing: 1px; font-weight: 500; }
.gnb a:hover, .gnb a.on { border-bottom: 2px solid var(--fg); }
.gnb .hot { color: var(--point); }

/* ---------- 메인 비주얼 ---------- */
.hero {
  height: 480px;
  background: linear-gradient(135deg, #f3efe9 0%, #e6e0d8 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 12px;
}
.hero h2 { font-size: 34px; font-weight: 300; letter-spacing: 4px; margin: 0; }
.hero p { color: #6d6459; margin: 0; letter-spacing: 1px; }

/* ---------- 섹션 제목 ---------- */
.sec { padding: 64px 0; }
.sec-title { text-align: center; margin-bottom: 36px; }
.sec-title h3 { font-size: 20px; letter-spacing: 3px; font-weight: 500; margin: 0 0 6px; }
.sec-title p { color: var(--muted); font-size: 12px; margin: 0; }

/* ---------- 상품 그리드 ---------- */
.prd-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px 20px;
}
.prd-item { position: relative; }
.prd-thumb {
  position: relative;
  overflow: hidden;
  background: #f5f5f5;
  aspect-ratio: 3 / 4;
}
.prd-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.prd-item:hover .prd-thumb img { transform: scale(1.04); }
.prd-badges {
  position: absolute; top: 8px; left: 8px;
  display: flex; flex-wrap: wrap; gap: 4px; max-width: calc(100% - 16px);
}
.prd-badge {
  background: var(--fg); color: #fff;
  font-size: 10px; letter-spacing: .5px; line-height: 1.5;
  padding: 3px 7px; white-space: nowrap;
}
.prd-badge.sale { background: var(--point); }
.prd-badge.ship { background: #1a7f9c; }      /* 내일도착 · 무료배송 */
.prd-badge.sold { background: #9aa0a6; }      /* 품절 */
.prd-info { padding-top: 12px; text-align: center; }
.prd-name { font-size: 13px; margin: 0 0 4px; }
.prd-sub { font-size: 11px; color: var(--muted); margin: 0 0 8px; }
.prd-price { font-size: 13px; }
.prd-price .was { color: #bbb; text-decoration: line-through; margin-right: 6px; font-size: 12px; }
.prd-price .now { color: var(--point); font-weight: 700; }
.prd-colors { display: flex; justify-content: center; gap: 4px; margin-top: 8px; }
.prd-colors span { font-size: 10px; color: #aaa; }

/* ---------- 리스트 페이지 ---------- */
.page-head { text-align: center; padding: 48px 0 8px; }
.page-head h2 { font-size: 22px; letter-spacing: 3px; font-weight: 500; margin: 0; }
.breadcrumb { text-align: center; font-size: 11px; color: var(--muted); padding-bottom: 28px; }

.listbar {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; color: var(--muted);
  border-top: 1px solid var(--line); padding-top: 16px; margin-bottom: 20px;
}
.sortbar { display: flex; gap: 14px; }
.sortbar button { background: none; border: 0; color: var(--muted); font-size: 12px; padding: 0; }
.sortbar button.on { color: var(--fg); font-weight: 700; }

.paging { display: flex; justify-content: center; gap: 6px; margin-top: 56px; }
.paging a, .paging span {
  min-width: 30px; height: 30px; line-height: 28px; text-align: center;
  border: 1px solid var(--line); font-size: 12px; color: var(--muted);
}
.paging .on { border-color: var(--fg); color: var(--fg); font-weight: 700; }

/* ---------- 상세 페이지 ---------- */
.detail-top { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; padding: 48px 0 64px; }
.gallery .main { background: #f5f5f5; aspect-ratio: 3 / 4; }
.gallery .main img { width: 100%; height: 100%; object-fit: cover; }
.gallery .thumbs { display: flex; gap: 8px; margin-top: 10px; }
.gallery .thumbs button { width: 70px; aspect-ratio: 3/4; padding: 0; border: 1px solid var(--line); background: #f5f5f5; }
.gallery .thumbs button.on { border-color: var(--fg); }
.gallery .thumbs img { width: 100%; height: 100%; object-fit: cover; }

.detail-badges { position: static; margin-bottom: 10px; max-width: none; }
.detail-info h1 { font-size: 22px; font-weight: 500; margin: 0 0 6px; }
.detail-info .sub { color: var(--muted); font-size: 13px; margin: 0 0 20px; }
.detail-price { border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line); padding: 18px 0; margin-bottom: 4px; }
.detail-price .was { color: #bbb; text-decoration: line-through; font-size: 14px; }
.detail-price .now { color: var(--point); font-size: 24px; font-weight: 700; margin-left: 8px; }
.detail-price .off { background: var(--point); color: #fff; font-size: 11px; padding: 2px 6px; margin-left: 8px; vertical-align: 4px; }

.spec-rows { font-size: 13px; }
.spec-rows tr { border-bottom: 1px solid #f2f2f2; }
.spec-rows th { text-align: left; color: var(--muted); font-weight: 400; padding: 9px 0; width: 110px; vertical-align: top; }
.spec-rows td { padding: 9px 0; }

.opt-box { margin: 24px 0; }
.opt-box label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.opt-box select {
  width: 100%; height: 40px; padding: 0 10px; margin-bottom: 12px;
  border: 1px solid var(--line); background: #fff; font-family: inherit; font-size: 13px;
}

.cart-lines { border-top: 1px solid var(--line); padding-top: 14px; }
.cart-line { display: flex; align-items: center; gap: 10px; background: #fafafa; padding: 10px; margin-bottom: 8px; font-size: 12px; }
.cart-line .nm { flex: 1; }
.cart-line .del { background: none; border: 0; color: #bbb; font-size: 16px; line-height: 1; }
.qty { display: inline-flex; border: 1px solid var(--line); background: #fff; }
.qty button { width: 26px; height: 26px; border: 0; background: none; font-size: 14px; line-height: 1; }
.qty span { width: 34px; height: 26px; line-height: 26px; text-align: center; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }

.total-row { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px solid var(--line-strong); margin-top: 16px; padding-top: 16px; }
.total-row .lbl { font-size: 13px; color: var(--muted); }
.total-row .amt { font-size: 24px; font-weight: 700; }

.btns { display: flex; gap: 8px; margin-top: 18px; }
.btn {
  flex: 1; height: 52px; border: 1px solid var(--line-strong);
  background: #fff; color: var(--fg); font-size: 14px; letter-spacing: 1px;
}
.btn.primary { background: var(--btn-bg); color: var(--btn-fg); }
.btn.wish { flex: 0 0 52px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.note { font-size: 11px; color: var(--muted); margin-top: 10px; }

/* ---------- 상세 탭 ---------- */
.tabs { display: flex; border: 1px solid var(--line); border-right: 0; margin-top: 20px; }
.tabs button {
  flex: 1; height: 48px; background: #fafafa; border: 0; border-right: 1px solid var(--line);
  font-size: 13px; color: var(--muted);
}
.tabs button.on { background: #fff; color: var(--fg); font-weight: 700; border-bottom: 2px solid var(--fg); }
.tabpanel { padding: 48px 0; display: none; }
.tabpanel.on { display: block; }
.detail-body { max-width: 780px; margin: 0 auto; text-align: center; }
.detail-body p { margin: 0 0 32px; color: #555; line-height: 2; }
.detail-body img { margin: 0 auto 32px; }

.size-table { max-width: 620px; margin: 0 auto 40px; font-size: 13px; text-align: center; }
.size-table th, .size-table td { border: 1px solid var(--line); padding: 10px; }
.size-table th { background: #fafafa; font-weight: 500; }

.empty { text-align: center; color: var(--muted); padding: 80px 0; font-size: 13px; }

/* ---------- 리뷰 ---------- */
.rv-wrap { max-width: 860px; margin: 0 auto; }
.rv-head { border-bottom: 1px solid var(--line); padding-bottom: 20px; margin-bottom: 28px; }
.rv-avg { display: flex; align-items: baseline; gap: 10px; justify-content: center; }
.rv-avg strong { font-size: 32px; font-weight: 700; }
.rv-avg-stars { color: #f0a500; font-size: 16px; letter-spacing: 2px; }
.rv-total { color: var(--muted); font-size: 12px; }

.rv-login {
  text-align: center; background: #fafafa; border: 1px solid var(--line);
  padding: 22px; font-size: 13px; color: var(--muted); margin-bottom: 28px;
}
.rv-login a { margin-left: 10px; color: var(--fg); font-weight: 700; text-decoration: underline; }

.rv-form { border: 1px solid var(--line); padding: 20px; margin-bottom: 32px; }
.rv-form-title { margin: 0 0 12px; font-size: 13px; font-weight: 700; }
.rv-stars { display: flex; gap: 2px; margin-bottom: 12px; }
.rv-stars button {
  background: none; border: 0; padding: 0 2px; font-size: 24px; line-height: 1; color: #ddd;
}
.rv-stars button.on { color: #f0a500; }
.rv-form textarea {
  width: 100%; border: 1px solid var(--line); padding: 12px; font-family: inherit;
  font-size: 13px; line-height: 1.7; resize: vertical;
}
.rv-form textarea:focus { outline: none; border-color: var(--fg); }
.rv-form-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.rv-count { font-size: 11px; color: #bbb; }
.rv-submit { flex: 0 0 110px; height: 40px; font-size: 13px; }
.rv-msg { color: var(--point); font-size: 12px; margin: 10px 0 0; min-height: 1em; }

.rv-list { border-top: 1px solid var(--line); }
.rv-item { border-bottom: 1px solid var(--line); padding: 20px 4px; }
.rv-item.mine { background: #fcfcfc; }
.rv-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 12px; }
.rv-star { color: #f0a500; letter-spacing: 1px; }
.rv-name { font-weight: 700; }
.rv-date { color: #bbb; }
.rv-badge { margin-left: auto; background: #f2f2f2; color: var(--muted); font-size: 10px; padding: 2px 7px; border-radius: 10px; }
.rv-hint { font-size: 11px; color: #aaa; margin: 8px 0 0; line-height: 1.7; }
.rv-hint b { color: #888; font-weight: 500; }
.rv-body { margin: 0; font-size: 13px; line-height: 1.8; color: #444; white-space: pre-line; }

/* ---------- 회원 폼 (로그인/가입/마이페이지) ---------- */
.auth { max-width: 420px; margin: 0 auto; padding: 56px 0 40px; }
.auth h2 { text-align: center; font-size: 20px; letter-spacing: 3px; font-weight: 500; margin: 0 0 8px; }
.auth .lead { text-align: center; color: var(--muted); font-size: 12px; margin: 0 0 32px; }
.auth label { display: block; font-size: 12px; color: var(--muted); margin: 0 0 6px; }
.auth input[type=text], .auth input[type=password], .auth input[type=email], .auth input[type=tel] {
  width: 100%; height: 46px; padding: 0 12px; margin-bottom: 4px;
  border: 1px solid var(--line); font-size: 14px; font-family: inherit; background: #fff;
}
.auth input:focus { outline: none; border-color: var(--fg); }
.auth .field { margin-bottom: 16px; }
.auth .hint { font-size: 11px; color: #aaa; margin: 4px 0 0; min-height: 1em; }
.auth .hint.ok { color: #1a7f37; }
.auth .hint.bad { color: var(--point); }
.auth .id-row { display: flex; gap: 8px; }
.auth .id-row input { flex: 1; }
.auth .id-row button { flex: 0 0 92px; height: 46px; border: 1px solid var(--line-strong); background: #fff; font-size: 12px; }
.auth .agree { display: flex; align-items: flex-start; gap: 8px; font-size: 12px; color: #666; margin: 8px 0 20px; }
.auth .btn { width: 100%; }
.auth .links { display: flex; justify-content: center; gap: 14px; margin-top: 20px; font-size: 12px; color: var(--muted); }
.auth .links a { text-decoration: underline; }
.auth .msg { background: #fdecec; color: #c0392b; font-size: 12px; padding: 10px 12px; margin-bottom: 16px; display: none; }
.auth .msg.on { display: block; }
.auth .msg.good { background: #eaf7ee; color: #1a7f37; }
.auth .note { font-size: 11px; color: #aaa; text-align: center; margin-top: 24px; line-height: 1.8; }

.mypage-sec { border-top: 1px solid var(--line); margin-top: 32px; padding-top: 28px; }
.mypage-sec h3 { font-size: 14px; margin: 0 0 16px; }
.leave-box { border: 1px solid #f0d7d7; background: #fffafa; padding: 18px; }
.leave-box p { margin: 0 0 12px; font-size: 12px; color: #a05252; line-height: 1.8; }

/* ---------- 장바구니 페이지 ---------- */
.cart-table { font-size: 13px; }
.cart-table th { border-top: 2px solid var(--fg); border-bottom: 1px solid var(--line); padding: 14px 8px; font-weight: 500; }
.cart-table td { border-bottom: 1px solid var(--line); padding: 18px 8px; text-align: center; }
.cart-table .pinfo { display: flex; gap: 14px; text-align: left; align-items: center; }
.cart-table .pinfo img { width: 72px; aspect-ratio: 3/4; object-fit: cover; }
.cart-sum { border: 1px solid var(--line); background: #fafafa; padding: 24px; margin-top: 24px; display: flex; justify-content: center; gap: 40px; align-items: center; }
.cart-sum div { text-align: center; }
.cart-sum .k { font-size: 12px; color: var(--muted); }
.cart-sum .v { font-size: 20px; font-weight: 700; }
.cart-sum .op { font-size: 20px; color: var(--muted); }

/* ---------- 푸터 ---------- */
.footer { border-top: 1px solid var(--line); margin-top: 80px; padding: 40px 0 60px; font-size: 12px; color: var(--muted); }
.footer .fnav { display: flex; gap: 18px; margin-bottom: 20px; }
.footer .fnav a { color: var(--fg); }
.footer dl { display: flex; gap: 8px; margin: 0 0 4px; }
.footer dt { color: #aaa; }
.footer .copy { margin-top: 18px; color: #bbb; }

/* ---------- 모바일 ---------- */
@media (max-width: 1024px) {
  .prd-list { grid-template-columns: repeat(3, 1fr); gap: 32px 16px; }
  .detail-top { grid-template-columns: 1fr; gap: 32px; }
}
@media (max-width: 640px) {
  .prd-list { grid-template-columns: repeat(2, 1fr); gap: 28px 12px; }
  .header .logo { padding: 20px 0 16px; font-size: 22px; letter-spacing: 4px; }
  .gnb ul { gap: 16px; height: auto; padding: 12px 0; }
  .hero { height: 320px; }
  .hero h2 { font-size: 24px; }
  .sec { padding: 40px 0; }
  .cart-sum { flex-direction: column; gap: 12px; }
  .cart-table .pinfo { flex-direction: column; align-items: flex-start; }
}
