/* ============================================
   체리샵.COM — Global Stylesheet
   ============================================ */

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; overflow-x: hidden; }
body {
  font-family: 'Pretendard Variable', 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  word-break: break-word;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; }
ul, ol { list-style: none; }

/* --- Tokens --- */
:root {
  --primary: #D94452;
  --primary-hover: #C13B48;
  --primary-light: rgba(217,68,82,0.08);
  --bg: #F4F5F7;
  --surface: #FFFFFF;
  --border: #E5E7EB;
  --text: #1F2028;
  --text-sub: #6B7280;
  --text-muted: #9CA3AF;
  --text-faint: #D1D5DB;
  --stat-bg: #F9FAFB;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.04);
  --shadow-hover: 0 2px 8px rgba(0,0,0,0.07);
  --header-h: 52px;
  --sidebar-w: 300px;
  --max-w: 1200px;
  --gap: 16px;
}

/* ============================================
   UNIFIED TEXT
   4 classes only — use everywhere
   ============================================ */
.t-title { font-size: 15px; font-weight: 700; color: var(--text); line-height: 1.4; }
.t-body  { font-size: 14px; font-weight: 400; color: var(--text-sub); line-height: 1.5; }
.t-sub   { font-size: 13px; font-weight: 500; color: var(--text-muted); }
.t-small { font-size: 12px; font-weight: 400; color: var(--text-muted); }

/* clamp helper */
.t-clamp2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ============================================
   LAYOUT
   ============================================ */
.wrap { width: 100%; max-width: var(--max-w); margin: 0 auto; padding: 0 20px; }
.body  { margin-top: calc(var(--header-h) + 20px); padding-bottom: 40px; flex: 1; }
.body.--has-subnav { margin-top: calc(var(--header-h) + 48px + 20px); }
.cols  { display: flex; gap: var(--gap); align-items: flex-start; max-width: 100%; }
.sidebar {
  width: var(--sidebar-w); min-width: var(--sidebar-w);
  display: flex; flex-direction: column; gap: var(--gap);
  position: sticky; top: calc(var(--header-h) + 20px);
}
.body.--has-subnav .sidebar { top: calc(var(--header-h) + 48px + 20px); }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--gap); width: 100%; }

/* ============================================
   CARD
   ============================================ */
.card {
  background: var(--surface);
  border-radius: var(--radius);
}
.card-head {
  display: flex; align-items: center;
  height: 44px; padding: 0 16px;
  border-bottom: 1px solid var(--border);
}
.card-head svg { width: 15px; height: 15px; margin-right: 6px; flex-shrink: 0; }
.card-head .t-more { margin-left: auto; font-size: 12px; color: var(--text-muted); }
.card-inner { padding: 16px; }

/* ============================================
   STAT GRID (3-col)
   ============================================ */
.stat-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.stat-item { text-align: center; padding: 10px 0; background: #f3f4f6; border-radius: var(--radius); }

/* ============================================
   SECTION TITLE
   ============================================ */
.sec-title { display: flex; align-items: center; margin-bottom: 12px; }
.sec-title svg { width: 16px; height: 16px; margin-right: 6px; }
.sec-title h2 { font-size: 16px; font-weight: 700; color: var(--text); }

/* ============================================
   PRODUCT CARD (popular grid)
   ============================================ */
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: var(--gap); }
.grid-2 { display: grid; grid-template-columns: repeat(2,1fr); gap: var(--gap); }
.grid-2x2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }

.p-card { display: flex; flex-direction: column; padding: 16px; }
.p-img { margin: -16px -16px 12px -16px; overflow: hidden; border-radius: var(--radius) var(--radius) 0 0; }
.p-img img { width: 100%; height: 160px; object-fit: cover; display: block; }
.p-rank-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.p-rank { font-size: 21px; font-weight: 900; line-height: 1; color: var(--text-faint); }
.p-rank.--gold { color: #F59E0B; }
.p-rank.--silver { color: #9CA3AF; }
.p-rank.--bronze { color: #CD7F32; }
.p-price { margin-top: 10px; font-size: 14px; font-weight: 700; color: var(--text); }

/* ============================================
   BANNER SLIDER
   ============================================ */
.banner-slider {
  position: relative; overflow: hidden; border-radius: var(--radius);
  margin-bottom: 20px; cursor: grab; user-select: none;
}
.banner-slider:active { cursor: grabbing; }
.banner-track { display: flex; width: 100%; }
.banner-slide { flex: 0 0 100%; min-width: 100%; }
.banner-slide img { width: 100%; height: auto; display: block; border-radius: var(--radius); }
.banner-dots {
  position: absolute; bottom: 10px; left: 50%;
  transform: translateX(-50%); display: flex; gap: 6px;
}
.banner-dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: rgba(217,68,82,0.4); cursor: pointer;
}
.banner-dot.--on { background: #D94452; }

/* ============================================
   MODAL
   ============================================ */
.modal-overlay {
  display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4); z-index: 999;
  align-items: center; justify-content: center;
}
.modal-overlay.--on { display: flex; }
.modal-box {
  background: var(--surface); border-radius: var(--radius);
  padding: 24px; width: 320px; max-width: 90vw;
  box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

/* ============================================
   CUSTOM DROPDOWN (상품 라벨)
   ============================================ */
.cdrop { position: relative; }
.cdrop-sel {
  display: flex; align-items: center; justify-content: space-between;
  background: #f3f4f6; color: var(--text);
  padding: 10px 12px; border-radius: var(--radius);
  font-size: 14px; font-weight: 500; cursor: pointer;
}
.cdrop-sel svg { flex-shrink: 0; transition: transform 0.2s; }
.cdrop.--open .cdrop-sel svg { transform: rotate(180deg); }
.cdrop-list {
  display: none; position: absolute; left: 0; right: 0; top: 100%;
  margin-top: 4px; background: #f3f4f6; border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; z-index: 50;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.cdrop.--open .cdrop-list { display: block; }
.cdrop-item {
  padding: 10px 12px; font-size: 14px; color: var(--text);
  cursor: pointer; border-bottom: 1px solid var(--border);
}
.cdrop-item:last-child { border-bottom: none; }
.cdrop-item:hover { background: var(--primary-light); color: var(--primary); }
.cdrop-item.--on { background: var(--primary-light); color: var(--primary); font-weight: 600; }

/* ============================================
   BADGE
   ============================================ */
.badge {
  display: inline-flex; align-items: center;
  font-size: 11px; font-weight: 600;
  padding: 2px 7px; border-radius: var(--radius);
}
.badge.--hot  { color: #EF4444; background: rgba(239,68,68,0.08); }
.badge.--safe { color: #10B981; background: rgba(16,185,129,0.08); }

/* ============================================
   REVIEW CARD
   ============================================ */
.r-card { padding: 16px; }
.r-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }

/* --- Review Table --- */
.rv-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.rv-table th, .rv-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); }
.rv-table thead th { background: var(--surface); font-weight: 600; font-size: 13px; color: var(--text); }
.rv-table tbody tr:hover { background: var(--stat-bg); }
.rv-table .rv-num { width: 70px; text-align: center; color: var(--text); }
.rv-table .rv-product { width: 180px; color: var(--text); }
.rv-table .rv-title a { color: var(--text); }
.rv-table .rv-title a:hover { color: var(--primary); }
.rv-table .rv-user { width: 120px; color: var(--text); }
.rv-table .rv-date { width: 120px; color: var(--text); }
@media (max-width: 600px) {
  .rv-table .rv-num, .rv-table .rv-product { display: none; }
  .rv-table th, .rv-table td { padding: 10px 12px; }
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; font-size: 14px; font-weight: 600;
  border-radius: var(--radius); height: 38px; padding: 0 16px;
  cursor: pointer; border: none;
}
.btn.--sm  { height: 34px; font-size: 13px; }
.btn.--primary { background: var(--primary); color: #fff; }
.btn.--primary:hover { background: var(--primary-hover); }
.btn.--outline { background: transparent; color: var(--text-sub); border: 1px solid var(--border); }
.btn.--outline:hover { background: var(--stat-bg); }
.btn.--ghost { background: #f3f4f6; color: var(--text-sub); }
.btn.--ghost:hover { background: #f8f9fb; }
.btn.--full { width: 100%; }

/* --- Form Input --- */
.input {
  width: 100%; height: 40px; padding: 0 12px;
  font-size: 14px; color: var(--text);
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); outline: none;
  font-family: inherit;
}
.input:focus { border-color: var(--primary); }
textarea.input { height: auto; padding: 10px 12px; }
select.input { cursor: pointer; }

/* ============================================
   USER INFO
   ============================================ */
.user-login-btns { display: flex; gap: 8px; padding: 16px; }
.user-id-row { display: flex; align-items: center; gap: 8px; }
.user-actions { display: flex; flex-direction: column; gap: 8px; padding: 0 16px 16px; }
.user-actions > .btn { width: 100%; }

/* progress bar */
.prog { margin-top: 12px; }
.prog-label { display: flex; justify-content: space-between; margin-bottom: 4px; }
.prog-bar { height: 8px; background: #f3f4f6; border-radius: 99px; overflow: hidden; }
.prog-fill { height: 100%; background: var(--primary); border-radius: 99px; transition: width 0.6s ease; min-width: 4px; }

/* ============================================
   LINK BOX (공지방, 고객센터)
   ============================================ */
.link-box {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 8px; padding: 18px 12px; text-align: center;
}
.link-box svg { width: 22px; height: 22px; }
.link-box:hover svg { color: var(--primary); }
.link-box:hover .t-title { color: var(--primary); }

/* ============================================
   FAQ
   ============================================ */
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item:last-child { border-bottom: none; }
.faq-q {
  display: flex; align-items: center; width: 100%;
  padding: 14px 16px; text-align: left; gap: 8px;
}
.faq-q-label { font-size: 12px; font-weight: 700; color: var(--primary); flex-shrink: 0; }
.faq-icon { margin-left: auto; width: 16px; height: 16px; color: var(--text-muted); flex-shrink: 0; }
.faq-icon-close { display: none; }
.faq-item.--open .faq-icon-open { display: none; }
.faq-item.--open .faq-icon-close { display: block; }
.faq-a { display: none; padding: 0 16px 14px 16px; gap: 8px; align-items: flex-start; }
.faq-item.--open .faq-a { display: flex; }
.faq-a-label { font-size: 12px; font-weight: 700; color: #10B981; flex-shrink: 0; }

/* ============================================
   HEADER
   ============================================ */
.hdr {
  position: fixed; top: 0; left: 0; width: 100%;
  height: var(--header-h); background: var(--surface);
  border-bottom: 1px solid var(--border); z-index: 100;
}
.hdr-inner {
  display: flex; align-items: center; height: 100%;
  max-width: var(--max-w); margin: 0 auto; padding: 0 20px;
}
.hdr-logo { font-size: 18px; font-weight: 900; color: var(--primary); letter-spacing: -0.3px; flex-shrink: 0; }
.hdr-logo span { color: var(--text); font-weight: 400; font-size: 14px; margin-left: 1px; }
.hdr-nav { display: flex; align-items: center; margin-left: 32px; height: 100%; }
.hdr-nav a {
  display: flex; align-items: center; height: 100%;
  padding: 0 14px; font-size: 14px; font-weight: 500; color: var(--text-sub);
}
.hdr-nav a:hover { color: var(--text); }
.hdr-right { display: flex; align-items: center; margin-left: auto; gap: 6px; }

/* user dropdown */
.hdr-user { position: relative; }
.hdr-user-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px; font-size: 14px; font-weight: 500;
  color: var(--text); border-radius: var(--radius);
}
.hdr-user-btn:hover { background: var(--stat-bg); }
.hdr-user-btn .u-pt { font-size: 13px; color: var(--primary); font-weight: 600; }
.hdr-drop {
  display: none; position: absolute; top: 100%; right: 0; margin-top: 4px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  min-width: 160px; z-index: 200; padding: 4px;
}
.hdr-drop.--open { display: block; }
.hdr-drop a { display: block; padding: 10px 14px; font-size: 14px; color: var(--text-sub); border-radius: var(--radius); }
.hdr-drop a:hover { background: var(--stat-bg); color: var(--text); }

/* ============================================
   SUB-NAV (shop categories)
   ============================================ */
.subnav {
  position: fixed; top: var(--header-h); left: 0; width: 100%;
  height: 48px; background: var(--surface);
  border-bottom: 1px solid var(--border); z-index: 99;
}
.subnav-inner {
  display: flex; align-items: center; height: 48px;
  max-width: var(--max-w); margin: 0 auto; padding: 0 20px;
  overflow-x: auto; gap: 6px;
}
.subnav-inner::-webkit-scrollbar { display: none; }

/* Hide scrollbar utility */
.hide-scroll { scrollbar-width: none; -ms-overflow-style: none; }
.hide-scroll::-webkit-scrollbar { display: none; }
.subnav-inner a {
  flex-shrink: 0; padding: 6px 14px; border-radius: var(--radius);
  font-size: 14px; font-weight: 500; color: var(--text-sub);
}
.subnav-inner a:hover { background: var(--stat-bg); color: var(--text-sub); }
.subnav-inner a.--active { background: var(--primary); color: #fff; font-weight: 600; }

/* ============================================
   FOOTER
   ============================================ */
.ftr { background: #1F2028; border-top: 1px solid var(--border); padding: 32px 0; }
.ftr-inner {
  max-width: var(--max-w); margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; justify-content: space-between;
}
.ftr-logo { font-size: 16px; font-weight: 800; color: #fff; opacity: .6; }
.ftr-links { display: flex; align-items: center; gap: 16px; }
.ftr-links a { color: rgba(255,255,255,0.4); }
.ftr-links a:hover { color: rgba(255,255,255,0.7); }
.ftr-links svg { width: 20px; height: 20px; }

/* ============================================
   MOBILE BOTTOM NAV
   ============================================ */
.bnav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0;
  height: 56px; background: var(--surface);
  border-top: 1px solid var(--border); z-index: 100;
  padding-bottom: env(safe-area-inset-bottom);
}
.bnav-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 2px; font-size: 11px; font-weight: 500;
  color: var(--text-muted);
}
.bnav-item.--active { color: var(--primary); }
.bnav-item.--active svg { stroke-width: 2.2; }

.bnav-menu { position: relative; }
.bnav-menu-btn {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 2px; font-size: 11px; font-weight: 500;
  color: var(--text-muted); width: 100%; height: 100%;
}
.bnav-drop {
  display: none; position: absolute; bottom: 100%;
  right: 0; margin-bottom: 8px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: 0 -4px 16px rgba(0,0,0,0.1);
  min-width: 180px; padding: 4px; z-index: 200;
}
.bnav-drop.--open { display: block; }
.bnav-drop-title {
  padding: 10px 14px 6px; font-size: 12px; font-weight: 700;
  color: var(--text-muted); border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.bnav-drop a {
  display: block; padding: 10px 14px;
  font-size: 14px; color: var(--text-sub); border-radius: var(--radius);
}
.bnav-drop a:hover { background: var(--stat-bg); color: var(--text); }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
  .sidebar { display: none; }
  .cols { flex-direction: column; gap: 0; }
  .main { width: 100%; max-width: 100%; }
  .grid-3 { grid-template-columns: repeat(2,1fr); }
  .bnav { display: flex; }
  .body { padding-bottom: 72px; }
  .ftr { padding-bottom: 72px; }
}
@media (max-width: 600px) {
  :root { --header-h: 48px; }
  .hdr-nav { display: none; }
  .wrap { padding: 0 16px; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .grid-2x2 { grid-template-columns: 1fr; }
}