/* ============================================================
   SHOP MALL — 디자인 토큰
   컬러: 딥그린(#1F3A34) 앵커 + 브라스(#B8862B) 액센트 + 페이퍼 화이트(#FAF8F3)
   타입: Fraunces(디스플레이, 캐릭터 있는 세리프) + IBM Plex Sans(본문/UI)
   시그니처: 상품/섹션마다 카탈로그 인덱스 번호(No.01) 를 붙여 "훑어보는 카탈로그" 느낌
   ============================================================ */

:root {
  --bg: #FAF8F3;
  --surface: #FFFFFF;
  --ink: #1C1B18;
  --ink-soft: #5B5850;
  --line: #E4E0D4;
  --primary: #1F3A34;
  --primary-ink: #0F1E1A;
  --accent: #B8862B;
  --accent-soft: #F1E6CC;
  --danger: #A3372B;
  --radius: 10px;
  --shadow: 0 2px 10px rgba(31,58,52,0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "IBM Plex Sans", -apple-system, "Malgun Gothic", sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 16px;
  line-height: 1.6;
}

h1, h2, h3 {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--primary-ink);
}
h1 { font-size: 40px; }
h2 { font-size: 24px; margin-bottom: 20px; }

a { text-decoration: none; color: var(--ink); }

/* ---------- 헤더 ---------- */
.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  font-family: "Fraunces", serif;
  font-weight: 700;
  font-style: italic;
  font-size: 22px;
  color: var(--primary);
  letter-spacing: -0.01em;
}
.main-nav a {
  margin-left: 22px;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: color .15s, border-color .15s;
}
.main-nav a:hover { color: var(--primary); border-color: var(--accent); }
.auth-area a {
  margin-left: 16px;
  font-size: 13px;
  color: var(--ink-soft);
}
.auth-area a:hover { color: var(--primary); }

/* ---------- 본문 레이아웃 ---------- */
.site-main { max-width: 1100px; margin: 0 auto; padding: 0 24px 80px; }
.site-footer {
  background: var(--primary-ink);
  color: rgba(255,255,255,0.7);
  margin-top: 64px;
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 24px 32px;
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 40px;
}
@media (max-width: 640px) {
  .footer-inner { grid-template-columns: 1fr; }
}
.footer-brand {
  font-family: "Fraunces", serif;
  font-style: italic;
  font-size: 20px;
  color: #fff;
  margin-bottom: 12px;
}
.footer-desc { font-size: 13px; line-height: 1.7; margin: 0 0 16px; }
.footer-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.footer-pill {
  display: inline-block;
  font-size: 12px;
  padding: 6px 12px;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 999px;
  color: rgba(255,255,255,0.8);
}
.footer-col h4 {
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
  font-weight: 600;
}
.footer-info { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.footer-bottom {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 24px 32px;
  border-top: 1px solid rgba(255,255,255,0.12);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: rgba(255,255,255,0.5);
}

/* ---------- 히어로 캐러셀 ---------- */
.hero-carousel {
  position: relative;
  margin: 24px 0 48px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--primary);
}
.hero-slides { position: relative; height: 340px; }
.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity .4s ease;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: flex-end;
}
.hero-slide.active { opacity: 1; }
.hero-slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15,30,26,0) 30%, rgba(15,30,26,0.85) 100%);
}
.hero-slide .hero-text {
  position: relative;
  z-index: 1;
  padding: 32px 40px;
  color: #fff;
  max-width: 640px;
}
.hero-slide .hero-eyebrow {
  display: inline-block;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(255,255,255,0.12);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 12px;
}
.hero-slide h1 {
  color: #fff;
  font-size: 30px;
  margin-bottom: 8px;
}
.hero-slide p { color: rgba(255,255,255,0.85); margin: 0; font-size: 14px; }
.hero-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  background: rgba(255,255,255,0.9);
  color: var(--primary-ink);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
.hero-arrow:hover { background: #fff; }
.hero-arrow.prev { left: 16px; }
.hero-arrow.next { right: 16px; }
.hero-dots {
  position: absolute;
  bottom: 16px;
  right: 24px;
  z-index: 2;
  display: flex;
  gap: 6px;
}
.hero-dots button {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  padding: 0;
  border: none;
  background: rgba(255,255,255,0.5);
}
.hero-dots button.active { background: var(--accent); }
.hero-empty {
  padding: 60px 40px;
  color: #fff;
  text-align: center;
}
.hero-empty h1 { color: #fff; }
.hero-empty p { color: rgba(255,255,255,0.8); }

/* ---------- 섹션 라벨 (카탈로그 인덱스 시그니처) ---------- */
.section-label {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 20px;
}
.section-label .idx {
  font-family: "Fraunces", serif;
  font-style: italic;
  color: var(--accent);
  font-size: 15px;
  letter-spacing: 0.02em;
}
section + section { margin-top: 56px; }

/* ---------- 카테고리 트리 ---------- */
.category-list ul { list-style: none; padding-left: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.category-list ul ul { flex-direction: column; padding: 10px 0 0 0; width: 100%; gap: 4px; }
.category-list > ul > li { display: flex; flex-direction: column; gap: 8px; }
.category-list a {
  display: inline-block;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  color: var(--ink);
  background: var(--surface);
  transition: border-color .15s, color .15s;
}
.category-list > ul > li > a { font-weight: 600; }
.category-list ul ul a {
  border: none;
  padding: 2px 0 2px 4px;
  color: var(--ink-soft);
  font-size: 13px;
}
.category-list a:hover { border-color: var(--accent); color: var(--primary); }

/* ---------- 상품/이벤트 그리드 (카탈로그 카드) ---------- */
.product-grid, .event-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}
.product-card, .event-card {
  display: block;
  background: var(--surface);
  padding: 16px;
  position: relative;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  transition: transform .15s, box-shadow .15s;
}
.product-card:hover, .event-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(31,58,52,0.14);
}
.product-card .cat-no, .event-card .cat-no {
  font-family: "Fraunces", serif;
  font-style: italic;
  font-size: 12px;
  color: var(--accent);
  display: block;
  margin-bottom: 8px;
}
.product-card img, .event-card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  background: var(--accent-soft);
  margin-bottom: 12px;
  border-radius: 6px;
}
.no-image {
  width: 100%;
  height: 160px;
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 12px;
  margin-bottom: 12px;
  border-radius: 6px;
}
.product-card h3, .event-card h3 {
  font-size: 15px;
  font-weight: 500;
  font-family: "IBM Plex Sans", sans-serif;
  color: var(--ink);
  margin-bottom: 6px;
}
.product-card p { margin: 0; }
.product-card .price {
  font-family: "Fraunces", serif;
  font-weight: 600;
  color: var(--primary);
  font-size: 16px;
}
.badge {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  margin-top: 8px;
}
.badge.ended { background: var(--line); color: var(--ink-soft); }

/* ---------- 필터바 / 페이지네이션 ---------- */
.filter-bar { display: flex; gap: 8px; margin-bottom: 24px; }
.pagination { margin-top: 24px; display: flex; gap: 6px; }
.pagination button {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-soft);
}
.pagination button.active { border-color: var(--primary); color: var(--primary); font-weight: 600; }

/* ---------- 상품 상세 ---------- */
.detail-grid {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 48px;
  margin-top: 8px;
}
@media (max-width: 720px) {
  .detail-grid { grid-template-columns: 1fr; }
}
.detail-media img, .detail-media .no-image {
  width: 100%;
  height: 380px;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.detail-info { display: flex; flex-direction: column; }
.detail-info h1 { margin-bottom: 10px; }
.price { font-family: "Fraunces", serif; font-size: 26px; font-weight: 600; color: var(--primary); margin: 0 0 16px; }
.detail-desc { color: var(--ink-soft); line-height: 1.75; margin: 0 0 16px; }
.stock-line { font-size: 13px; color: var(--ink-soft); margin-bottom: 20px; }

.qty-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  width: fit-content;
  margin-bottom: 24px;
}
.qty-stepper button {
  background: var(--surface);
  color: var(--ink);
  border: none;
  width: 38px;
  height: 38px;
  font-size: 16px;
  border-radius: 0;
  padding: 0;
}
.qty-stepper button:hover { background: var(--accent-soft); color: var(--primary); }
.qty-stepper input {
  border: none;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  width: 56px;
  height: 38px;
  text-align: center;
  padding: 0;
  -moz-appearance: textfield;
}
.qty-stepper input::-webkit-outer-spin-button,
.qty-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

#actionArea #addCartBtn, #actionArea #buyNowBtn {
  width: 100%;
  max-width: 320px;
  padding: 14px;
  font-size: 15px;
}

.guest-order-form {
  margin-top: 20px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 340px;
}
.guest-order-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--ink-soft);
}

.review-summary { font-family: "Fraunces", serif; font-size: 18px; color: var(--primary); margin-bottom: 16px; }
#reviewForm {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 8px;
}
#reviewForm select { width: fit-content; }
.review-item {
  border-top: 1px solid var(--line);
  padding: 16px 0;
}
.review-item .stars { color: var(--accent); letter-spacing: 1px; margin-right: 6px; }
.review-item strong { font-family: "Fraunces", serif; }
.review-item p { margin: 6px 0 0; color: var(--ink-soft); }

/* ---------- 장바구니 ---------- */
.cart-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.cart-item img { width: 64px; height: 64px; object-fit: cover; background: var(--accent-soft); }
.cart-item span { font-size: 14px; }
#cartSummary {
  font-family: "Fraunces", serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--primary);
  margin: 20px 0;
  text-align: right;
}

/* ---------- 폼 (로그인/회원가입/주문서) ---------- */
.auth-form, .checkout-form { max-width: 420px; margin: 40px auto; }
.auth-form h1, .checkout-form h1 { margin-bottom: 24px; }
.auth-form form, .checkout-form form { display: flex; flex-direction: column; gap: 14px; }
.auth-form label, .checkout-form label {
  font-size: 13px;
  color: var(--ink-soft);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.error-text { color: var(--danger); font-size: 13px; margin-top: 8px; }

/* ---------- 결제 진행 페이지 (kspay_wh_order.jsp) ---------- */
.kspay-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.checkout-box {
  max-width: 400px;
  width: 100%;
  margin: 0;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px 36px;
}
.kspay-brand {
  font-family: "Fraunces", serif;
  font-style: italic;
  font-weight: 700;
  color: var(--primary);
  font-size: 18px;
  margin-bottom: 24px;
}
.checkout-box h2 { font-size: 22px; margin-bottom: 20px; }
.kspay-summary {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 16px 18px;
  margin-bottom: 24px;
  font-size: 14px;
  color: var(--ink-soft);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.kspay-summary p { margin: 0; display: flex; justify-content: space-between; gap: 12px; }
.kspay-summary p:last-child { font-family: "Fraunces", serif; font-size: 17px; font-weight: 600; color: var(--primary); padding-top: 8px; border-top: 1px dashed var(--line); margin-top: 4px; }
.kspay-field-row { margin-bottom: 16px; }
.kspay-select { width: 100%; }
.checkout-box button#payBtn { width: 100%; padding: 14px; font-size: 15px; margin-top: 4px; }
.checkout-box .notice { text-align: center; margin-top: 16px; color: var(--ink-soft); font-size: 13px; }

/* ---------- 리뷰 폼(별점 select) 텍스트영역 높이 ---------- */
#reviewForm textarea { min-height: 70px; resize: vertical; }

/* ---------- 공통 컨트롤 ---------- */
button {
  border: 1px solid var(--primary);
  background: var(--primary);
  color: #fff;
  padding: 10px 18px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 14px;
  font-family: "IBM Plex Sans", sans-serif;
  transition: background .15s, color .15s;
}
button:hover { background: var(--primary-ink); }
button:disabled { background: var(--line); border-color: var(--line); color: var(--ink-soft); cursor: not-allowed; }

input, select, textarea {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 14px;
  background: var(--surface);
  color: var(--ink);
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}
