/* ============================================
   부귀홍삼 브랜드 디자인 시스템
   ============================================ */
:root {
  /* Color Tokens */
  --color-primary: #7A1F2B;        /* 딥 버건디 - 홍삼 */
  --color-primary-dark: #5A1620;
  --color-primary-light: #9B3543;
  --color-accent: #B8935A;         /* 골드 */
  --color-accent-light: #D4B27E;
  --color-bg: #F5F1E8;             /* 한지 아이보리 */
  --color-bg-alt: #FAF7F0;
  --color-surface: #FFFFFF;
  --color-text: #1A1614;
  --color-text-sub: #6B625B;
  --color-text-mute: #A69E96;
  --color-border: #E5DFD3;
  --color-border-strong: #C9BFAE;
  --color-danger: #C0392B;
  --color-success: #2E7D5B;
  --color-warn: #D68A00;

  /* Spacing */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px;
  --s-5: 20px; --s-6: 24px; --s-8: 32px; --s-10: 40px;
  --s-12: 48px; --s-16: 64px; --s-20: 80px; --s-24: 96px;

  /* Type Scale */
  --f-11: 11px; --f-12: 12px; --f-13: 13px; --f-14: 14px;
  --f-15: 15px; --f-16: 16px; --f-18: 18px; --f-20: 20px;
  --f-24: 24px; --f-28: 28px; --f-32: 32px; --f-40: 40px;
  --f-48: 48px; --f-64: 64px;

  /* Radius */
  --r-sm: 4px; --r-md: 8px; --r-lg: 12px; --r-xl: 20px; --r-full: 999px;

  /* Shadow */
  --sh-1: 0 1px 2px rgba(26,22,20,.06);
  --sh-2: 0 2px 8px rgba(26,22,20,.08);
  --sh-3: 0 8px 24px rgba(26,22,20,.10);
  --sh-4: 0 16px 48px rgba(122,31,43,.12);

  --container: 1200px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-surface);
  -webkit-font-smoothing: antialiased;
}

.serif { font-family: 'Noto Serif KR', 'Nanum Myeongjo', serif; font-weight: 500; letter-spacing: -0.01em;}

a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
img { max-width: 100%; display: block; }
input, select, textarea { font: inherit; }

/* Layout */
.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--s-6); }

/* ---------- Header ---------- */
.header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky; top: 0; z-index: 100;
}
.header-top {
  border-bottom: 1px solid var(--color-border);
  font-size: var(--f-12);
  color: var(--color-text-sub);
}
.header-top-inner {
  display: flex; justify-content: space-between; align-items: center;
  height: 32px;
}
.header-top a { padding: 0 var(--s-3); border-right: 1px solid var(--color-border); }
.header-top a:last-child { border-right: none; padding-right: 0; }
.header-top .top-right { display: flex; }

.header-main {
  display: flex; align-items: center; gap: var(--s-8);
  padding: var(--s-6) 0;
}
.logo {
  font-family: 'Noto Serif KR', serif;
  font-size: var(--f-28); font-weight: 700;
  color: var(--color-primary);
  letter-spacing: -0.02em;
  display: flex; align-items: center; gap: var(--s-2);
}
.logo::before {
  content: '';
  width: 32px; height: 32px;
  background: var(--color-primary);
  border-radius: 50%;
  display: inline-block;
  position: relative;
}
.search {
  flex: 1; max-width: 480px;
  position: relative;
}
.search input {
  width: 100%;
  height: 44px;
  padding: 0 44px 0 var(--s-4);
  border: 2px solid var(--color-primary);
  border-radius: var(--r-full);
  font-size: var(--f-14);
  background: var(--color-surface);
}
.search input:focus { outline: none; }
.search button {
  position: absolute; right: 6px; top: 6px;
  width: 32px; height: 32px;
  background: var(--color-primary); color: white;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.header-icons { display: flex; align-items: center; gap: var(--s-5); margin-left: auto; }
.header-icons .ico-btn {
  display: flex; flex-direction: column; align-items: center;
  gap: 2px; font-size: var(--f-11); color: var(--color-text-sub);
  position: relative;
}
.header-icons .ico { font-size: 20px; }
.header-icons .badge {
  position: absolute; top: -4px; right: -8px;
  background: var(--color-primary); color: white;
  font-size: 10px; padding: 1px 5px; border-radius: 8px;
  min-width: 16px; text-align: center;
}

/* Nav */
.nav {
  border-top: 1px solid var(--color-border);
}
.nav-inner {
  display: flex; align-items: center; gap: var(--s-8);
  height: 48px;
}
.nav-cat {
  display: flex; align-items: center; gap: var(--s-2);
  font-weight: 600; color: var(--color-primary);
  padding: 0 var(--s-4);
  height: 100%;
  border-right: 1px solid var(--color-border);
}
.nav-list { display: flex; gap: var(--s-8); font-size: var(--f-14); }
.nav-list a { padding: var(--s-2) 0; font-weight: 500; position: relative; }
.nav-list a.active { color: var(--color-primary); font-weight: 700; }
.nav-list a.active::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -14px;
  height: 2px; background: var(--color-primary);
}
.nav-list .new { color: var(--color-primary); font-weight: 700; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  height: 48px; padding: 0 var(--s-6);
  border-radius: var(--r-md);
  font-size: var(--f-15); font-weight: 600;
  transition: all .15s ease;
  border: 1px solid transparent;
}
.btn-primary { background: var(--color-primary); color: white; }
.btn-primary:hover { background: var(--color-primary-dark); }
.btn-outline { background: white; color: var(--color-primary); border-color: var(--color-primary); }
.btn-outline:hover { background: var(--color-bg); }
.btn-ghost { background: var(--color-bg-alt); color: var(--color-text); }
.btn-lg { height: 56px; font-size: var(--f-16); padding: 0 var(--s-8); }
.btn-sm { height: 36px; font-size: var(--f-13); padding: 0 var(--s-4); }
.btn-block { width: 100%; }

/* ---------- Card ---------- */
.card {
  background: var(--color-surface);
  border-radius: var(--r-md);
  overflow: hidden;
  transition: all .2s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--sh-2); }

/* ---------- Product Card ---------- */
.product-card { cursor: pointer; }
.product-card .thumb {
  width: 100%; aspect-ratio: 1;
  background: var(--color-bg-alt);
  border-radius: var(--r-md);
  overflow: hidden;
  position: relative;
}
.product-card .thumb .placeholder {
  width: 100%; height: 100%;
  background: repeating-linear-gradient(45deg, var(--color-bg) 0, var(--color-bg) 12px, var(--color-bg-alt) 12px, var(--color-bg-alt) 24px);
  display: flex; align-items: center; justify-content: center;
  color: var(--color-text-mute);
  font-family: 'SF Mono', Menlo, monospace;
  font-size: var(--f-12);
  text-align: center; padding: var(--s-4);
}
.product-card .thumb .product-thumb-image {
  width: 100%; height: 100%; display: block;
  object-fit: contain; background: #F3EBDD;
}
.product-card .thumb .badge-tl {
  position: absolute; top: var(--s-3); left: var(--s-3);
  background: var(--color-primary); color: white;
  font-size: var(--f-11); font-weight: 700;
  padding: 4px 8px; border-radius: var(--r-sm);
}
.product-card .thumb .wish {
  position: absolute; top: var(--s-3); right: var(--s-3);
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255,255,255,.9);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
}
.product-card .info { padding: var(--s-4) var(--s-2) 0; }
.product-card .brand { font-size: var(--f-12); color: var(--color-text-sub); margin-bottom: 4px; }
.product-card .name {
  font-size: var(--f-14); font-weight: 500;
  line-height: 1.4; margin-bottom: var(--s-2);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; min-height: 2.8em;
}
.product-card .price-row { display: flex; align-items: baseline; gap: var(--s-2); margin-bottom: var(--s-2); }
.product-card .discount { font-size: var(--f-16); font-weight: 700; color: var(--color-primary); }
.product-card .price { font-size: var(--f-18); font-weight: 700; }
.product-card .price-original { font-size: var(--f-12); color: var(--color-text-mute); text-decoration: line-through; }
.product-card .meta { display: flex; align-items: center; gap: var(--s-2); font-size: var(--f-12); color: var(--color-text-sub); }
.product-card .stars { color: var(--color-warn); }

/* ---------- Section ---------- */
.section { padding: var(--s-16) 0; }
.section-title {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-bottom: var(--s-8);
}
.section-title h2 {
  font-family: 'Noto Serif KR', serif;
  font-size: var(--f-28); font-weight: 700;
  letter-spacing: -0.02em;
}
.section-title .sub { font-size: var(--f-14); color: var(--color-text-sub); margin-top: 4px; }
.section-title a.more { font-size: var(--f-13); color: var(--color-text-sub); }

/* ---------- Footer ---------- */
.footer {
  background: #2A2320; color: #C9BFAE;
  padding: var(--s-12) 0 var(--s-8);
  font-size: var(--f-13);
  margin-top: var(--s-16);
}
.footer-top { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: var(--s-10); margin-bottom: var(--s-10); }
.footer h4 { color: white; font-size: var(--f-14); margin-bottom: var(--s-4); font-weight: 600; }
.footer ul { list-style: none; }
.footer ul li { margin-bottom: var(--s-2); }
.footer ul a { color: #A69E96; }
.footer ul a:hover { color: white; }
.footer-bottom { border-top: 1px solid #4A413B; padding-top: var(--s-6); color: #8A8078; font-size: var(--f-12); line-height: 1.7; }
.footer-bottom strong { color: white; }

/* ---------- Utility ---------- */
.tag { display: inline-block; padding: 4px 10px; border-radius: var(--r-full); font-size: var(--f-12); font-weight: 500; }
.tag-primary { background: var(--color-primary); color: white; }
.tag-soft { background: var(--color-bg); color: var(--color-primary); }
.tag-outline { border: 1px solid var(--color-border-strong); color: var(--color-text-sub); }

.divider { height: 1px; background: var(--color-border); margin: var(--s-8) 0; }
.divider-thick { height: 8px; background: var(--color-bg-alt); margin: var(--s-8) 0; }

.text-mute { color: var(--color-text-mute); }
.text-sub { color: var(--color-text-sub); }
.text-primary { color: var(--color-primary); }
.text-danger { color: var(--color-danger); }
.text-success { color: var(--color-success); }

.grid { display: grid; gap: var(--s-6); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }

/* ============================================
   추석 예약 프로모션 컴포넌트
   ============================================ */
.chuseok-top-banner {
  background: linear-gradient(90deg, #5A1620 0%, #7A1F2B 50%, #B8935A 100%);
  color: white;
  font-size: var(--f-13);
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.chuseok-top-inner {
  display: flex; align-items: center; gap: var(--s-4);
  height: 40px;
}
.chuseok-badge {
  background: white;
  color: var(--color-primary);
  font-size: var(--f-11);
  font-weight: 800;
  letter-spacing: 1px;
  padding: 4px 10px;
  border-radius: var(--r-sm);
}
.chuseok-msg { flex: 1; }
.chuseok-msg strong { color: #FFD8A8; }
.chuseok-countdown {
  display: flex; align-items: center; gap: var(--s-2);
  font-size: var(--f-13);
  font-variant-numeric: tabular-nums;
}
.chuseok-countdown .cd-lbl { color: rgba(255,255,255,.7); margin-right: 4px; font-size: var(--f-12); }
.chuseok-countdown .cd-val {
  background: rgba(0,0,0,.35);
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 700;
  min-width: 28px;
  text-align: center;
  font-family: 'Noto Serif KR', serif;
  color: #FFD8A8;
}

/* ---------- 상세페이지 프로모 카드 ---------- */
.chuseok-price-card {
  background: linear-gradient(180deg, #FFF8EC 0%, #F8ECD3 100%);
  border: 1px solid var(--color-accent);
  border-radius: var(--r-md);
  padding: var(--s-5);
  margin: var(--s-5) 0;
  position: relative;
  overflow: hidden;
}
.chuseok-price-card::before {
  content: '';
  position: absolute;
  top: -20px; right: -20px;
  width: 100px; height: 100px;
  background: radial-gradient(circle, rgba(184,147,90,.2) 0%, transparent 70%);
  border-radius: 50%;
}
.chuseok-price-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: var(--s-4);
  position: relative; z-index: 1;
}
.chuseok-tag {
  background: var(--color-primary);
  color: white;
  font-size: var(--f-11);
  font-weight: 700;
  padding: 5px 10px;
  border-radius: var(--r-sm);
  letter-spacing: 1px;
}
.chuseok-mini-cd {
  font-size: var(--f-12);
  color: var(--color-primary);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  background: rgba(255,255,255,.6);
  padding: 4px 10px;
  border-radius: var(--r-sm);
}
.chuseok-price-body {
  background: white;
  border-radius: var(--r-sm);
  padding: var(--s-4);
  margin-bottom: var(--s-4);
  position: relative; z-index: 1;
}
.chuseok-price-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 6px 0;
  font-size: var(--f-13);
}
.chuseok-price-row.highlight { border-top: 1px dashed var(--color-border); padding-top: var(--s-3); margin-top: var(--s-2); }
.chuseok-price-lbl { color: var(--color-text-sub); }
.chuseok-price-lbl em { color: var(--color-primary); font-weight: 700; font-style: normal; margin-left: 4px; }
.chuseok-price-normal { color: var(--color-text-mute); text-decoration: line-through; font-size: var(--f-13); }
.chuseok-price-final {
  font-size: var(--f-24);
  font-weight: 800;
  color: var(--color-primary);
  letter-spacing: -0.02em;
  font-family: 'Noto Serif KR', serif;
}
.chuseok-saved {
  background: var(--color-primary);
  color: white;
  font-size: var(--f-12);
  padding: 6px 10px;
  border-radius: var(--r-sm);
  text-align: center;
  margin-top: var(--s-3);
}
.chuseok-saved strong { font-weight: 800; }

.chuseok-progress {
  background: rgba(255,255,255,.6);
  border-radius: var(--r-sm);
  padding: var(--s-3) var(--s-4);
  margin-bottom: var(--s-4);
  position: relative; z-index: 1;
}
.chuseok-progress-info {
  display: flex; justify-content: space-between;
  font-size: var(--f-12);
  color: var(--color-text-sub);
  margin-bottom: 6px;
}
.chuseok-progress-info strong { color: var(--color-primary); font-size: var(--f-13); }
.chuseok-progress-bar {
  height: 8px;
  background: var(--color-border);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 6px;
}
.chuseok-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-accent) 100%);
  transition: width .5s ease;
}
.chuseok-progress-tip {
  display: flex; align-items: center; gap: 6px;
  font-size: var(--f-11);
  color: var(--color-primary);
  font-weight: 600;
}
.hot-dot {
  width: 8px; height: 8px;
  background: #FF3B3B;
  border-radius: 50%;
  display: inline-block;
  animation: hot-pulse 1.4s infinite ease-out;
}
@keyframes hot-pulse {
  0% { box-shadow: 0 0 0 0 rgba(255,59,59,.7); }
  70% { box-shadow: 0 0 0 6px rgba(255,59,59,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,59,59,0); }
}

.chuseok-benefit-list {
  position: relative; z-index: 1;
}
.chuseok-benefit-item {
  display: flex; align-items: center; gap: var(--s-2);
  font-size: var(--f-12);
  color: var(--color-text);
  padding: 4px 0;
}
.chuseok-benefit-item .ck {
  color: var(--color-primary);
  font-weight: 800;
  font-size: 14px;
}

/* ---------- 상품카드 인라인 배지 ---------- */
.chuseok-inline-badge {
  display: inline-block;
  background: var(--color-primary);
  color: white;
  font-size: var(--f-11);
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--r-sm);
  margin-top: 4px;
}

/* Placeholder image helper */
.ph {
  background: repeating-linear-gradient(45deg, #EFE9DA 0, #EFE9DA 12px, #F5F1E8 12px, #F5F1E8 24px);
  display: flex; align-items: center; justify-content: center;
  color: var(--color-text-mute);
  font-family: 'SF Mono', Menlo, monospace;
  font-size: var(--f-12);
  text-align: center;
}
.ph-dark {
  background: repeating-linear-gradient(45deg, #4A413B 0, #4A413B 12px, #3A322D 12px, #3A322D 24px);
  color: #A69E96;
}

/* ============================================
   MOBILE RESPONSIVE (~ 767px)
   ============================================ */
@media (max-width: 767px) {
  html, body { font-size: 14px; }
  .container { padding: 0 var(--s-4); }

  /* ---------- Header ---------- */
  .header-top { display: none; }
  .header-main {
    padding: var(--s-3) 0 !important;
    gap: var(--s-3) !important;
    flex-wrap: wrap;
  }
  .logo {
    font-size: var(--f-20) !important;
    flex: 1;
  }
  .logo::before {
    width: 24px !important;
    height: 24px !important;
  }
  .search {
    order: 3;
    max-width: 100% !important;
    width: 100%;
    flex-basis: 100%;
  }
  .search input {
    height: 40px;
    font-size: var(--f-13);
  }
  .header-icons { gap: var(--s-3) !important; margin-left: 0 !important; }
  .header-icons .ico-btn span:last-child { display: none; }
  .header-icons .ico-btn .ico { font-size: 18px; }

  /* Nav - 가로 스크롤 */
  .nav-inner {
    gap: var(--s-4) !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    height: 44px !important;
  }
  .nav-inner::-webkit-scrollbar { display: none; }
  .nav-cat { display: none !important; }
  .nav-list {
    gap: var(--s-5) !important;
    flex-shrink: 0;
  }
  .nav-list a {
    white-space: nowrap;
    font-size: var(--f-13) !important;
  }
  .nav-list a.active::after { bottom: -12px !important; }

  /* ---------- Section ---------- */
  .section { padding: var(--s-10) 0 !important; }
  .section-title { margin-bottom: var(--s-5) !important; }
  .section-title h2 { font-size: var(--f-20) !important; }
  .section-title .sub { font-size: var(--f-12) !important; }

  /* ---------- Grid ---------- */
  .grid-2, .grid-3, .grid-4, .grid-5 {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: var(--s-3) !important;
  }

  /* ---------- Product Card ---------- */
  .product-card .info { padding: var(--s-3) 0 0 !important; }
  .product-card .brand { font-size: var(--f-11) !important; }
  .product-card .name {
    font-size: var(--f-13) !important;
    min-height: 2.6em !important;
  }
  .product-card .discount { font-size: var(--f-14) !important; }
  .product-card .price { font-size: var(--f-15) !important; }
  .product-card .price-original { font-size: var(--f-11) !important; }
  .product-card .meta { font-size: var(--f-11) !important; }
  .product-card .thumb .badge-tl {
    font-size: 10px;
    padding: 3px 6px;
  }
  .product-card .thumb .wish {
    width: 28px; height: 28px;
  }

  /* ---------- Buttons ---------- */
  .btn-lg { height: 48px; font-size: var(--f-14); padding: 0 var(--s-5); }

  /* ---------- Footer ---------- */
  .footer { padding: var(--s-10) 0 var(--s-6); margin-top: var(--s-10); }
  .footer-top {
    grid-template-columns: 1fr !important;
    gap: var(--s-6) !important;
    margin-bottom: var(--s-6) !important;
  }
  .footer h4 {
    padding-bottom: var(--s-2);
    border-bottom: 1px solid #4A413B;
    margin-bottom: var(--s-3) !important;
  }

  /* ---------- 추석 프로모 상단 배너 ---------- */
  .chuseok-top-banner {
    font-size: var(--f-11);
  }
  .chuseok-top-inner {
    height: auto !important;
    padding: 8px var(--s-4);
    flex-wrap: wrap;
    gap: 8px !important;
  }
  .chuseok-badge {
    font-size: 10px;
    padding: 3px 8px;
  }
  .chuseok-msg {
    flex-basis: 100%;
    order: 3;
    font-size: 11px;
    line-height: 1.4;
  }
  .chuseok-countdown { font-size: 11px !important; }
  .chuseok-countdown .cd-lbl { display: none; }
  .chuseok-countdown .cd-val {
    padding: 1px 5px !important;
    min-width: 22px !important;
    font-size: 11px !important;
  }

  /* ---------- 추석 프로모 카드 (상세페이지) ---------- */
  .chuseok-price-card { padding: var(--s-4) !important; }
  .chuseok-price-final { font-size: var(--f-20) !important; }

  /* Mobile Sticky CTA용 하단 여백 확보 */
  body.has-mobile-cta { padding-bottom: 72px; }
}

/* ============================================
   TABLET (768~1023px)
   ============================================ */
@media (min-width: 768px) and (max-width: 1023px) {
  .container { padding: 0 var(--s-5); }
  .grid-5 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(3, 1fr); }
  .header-icons .ico-btn span:last-child { font-size: 10px; }
}
