/* ═══════════════════════════════════════════════════════════════════════
 *  W-HOSTING 공통 디자인 시스템 v2 — Coupang 스타일 + 통일감
 * ═══════════════════════════════════════════════════════════════════════ */

:root {
  /* 브랜드 컬러 */
  --wh-primary:       #5B4CF5;
  --wh-primary-dark:  #4338CA;
  --wh-primary-light: #EEF2FF;
  --wh-purple:        #8B5CF6;
  --wh-accent:        #06B6D4;

  /* 강조/상태 */
  --wh-red:    #E11900;   /* Coupang 가격 빨강 */
  --wh-red-bg: #FEE2E2;
  --wh-orange: #F97316;
  --wh-amber:  #F59E0B;
  --wh-green:  #10B981;
  --wh-blue:   #3B82F6;

  /* 텍스트 톤 */
  --wh-t1: #111827;   /* 본문 */
  --wh-t2: #374151;   /* 부 */
  --wh-t3: #6B7280;   /* 약 */
  --wh-t4: #9CA3AF;   /* 매우약 */
  --wh-t5: #D1D5DB;   /* 비활성 */

  /* 배경/경계 */
  --wh-bg:        #F8FAFC;
  --wh-bg-soft:   #F1F5F9;
  --wh-surface:   #FFFFFF;
  --wh-border:    #E5E7EB;
  --wh-border-2:  #D1D5DB;
  --wh-divider:   #F3F4F6;

  /* 타이포 — Pretendard / Noto Sans KR */
  --wh-font: 'Pretendard', 'Noto Sans KR', -apple-system, BlinkMacSystemFont,
             'Apple SD Gothic Neo', 'Malgun Gothic', system-ui, sans-serif;

  --wh-fs-11: 11px;
  --wh-fs-12: 12px;
  --wh-fs-13: 13px;
  --wh-fs-14: 14px;
  --wh-fs-15: 15px;
  --wh-fs-16: 16px;
  --wh-fs-18: 18px;
  --wh-fs-20: 20px;
  --wh-fs-24: 24px;
  --wh-fs-28: 28px;
  --wh-fs-32: 32px;

  /* 라운드 */
  --wh-r-xs: 4px;
  --wh-r-sm: 6px;
  --wh-r:    8px;
  --wh-r-md: 10px;
  --wh-r-lg: 14px;
  --wh-r-xl: 20px;

  /* 그림자 */
  --wh-sh-sm:  0 1px 2px rgba(0,0,0,.04);
  --wh-sh:     0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --wh-sh-md:  0 4px 12px rgba(0,0,0,.08);
  --wh-sh-lg:  0 12px 32px rgba(0,0,0,.12);
  --wh-sh-p:   0 6px 18px rgba(91,76,245,.30);

  /* 트랜지션 */
  --wh-tr: .16s ease;
}

/* ── Reset 일부 ─────────────────────────────────────────────────────── */
.wh-scope * { box-sizing: border-box; }
.wh-scope { font-family: var(--wh-font); color: var(--wh-t1); -webkit-font-smoothing: antialiased; }

/* ── 컨테이너 ──────────────────────────────────────────────────────── */
.wh-container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.wh-container-sm { max-width: 720px; margin: 0 auto; padding: 0 24px; }

/* ── 카드 ──────────────────────────────────────────────────────────── */
.wh-card {
  background: var(--wh-surface);
  border-radius: var(--wh-r-md);
  box-shadow: var(--wh-sh-sm);
  padding: 18px;
}
.wh-card.hoverable { transition: box-shadow var(--wh-tr), transform var(--wh-tr); cursor: pointer; }
.wh-card.hoverable:hover { box-shadow: var(--wh-sh-md); transform: translateY(-2px); }

/* ── 버튼 ──────────────────────────────────────────────────────────── */
.wh-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border: 1.5px solid var(--wh-border); border-radius: var(--wh-r);
  font-family: inherit; font-size: var(--wh-fs-13); font-weight: 600;
  color: var(--wh-t2); background: var(--wh-surface); cursor: pointer;
  transition: var(--wh-tr); text-decoration: none; line-height: 1;
}
.wh-btn:hover { background: var(--wh-bg-soft); }
.wh-btn-primary { background: var(--wh-primary); color: #fff; border-color: var(--wh-primary); box-shadow: var(--wh-sh-p); }
.wh-btn-primary:hover { background: var(--wh-primary-dark); border-color: var(--wh-primary-dark); }
.wh-btn-danger { background: var(--wh-red); color: #fff; border-color: var(--wh-red); }
.wh-btn-danger:hover { background: #B91C1C; }
.wh-btn-ghost { border: none; background: transparent; }
.wh-btn-ghost:hover { background: var(--wh-bg-soft); }
.wh-btn-lg { padding: 13px 22px; font-size: var(--wh-fs-15); }
.wh-btn-sm { padding: 6px 11px; font-size: var(--wh-fs-12); }
.wh-btn-block { width: 100%; }

/* ── 입력 ──────────────────────────────────────────────────────────── */
.wh-input {
  width: 100%; padding: 10px 14px; border: 1.5px solid var(--wh-border);
  border-radius: var(--wh-r); font-size: var(--wh-fs-14); font-family: inherit;
  background: var(--wh-surface); color: var(--wh-t1); transition: var(--wh-tr);
}
.wh-input:focus { outline: none; border-color: var(--wh-primary); box-shadow: 0 0 0 3px rgba(91,76,245,.12); }
.wh-input::placeholder { color: var(--wh-t4); }
.wh-label { display: block; font-size: var(--wh-fs-12); font-weight: 600; color: var(--wh-t2); margin-bottom: 5px; }

/* ── 배지 ──────────────────────────────────────────────────────────── */
.wh-badge {
  display: inline-flex; align-items: center; padding: 2px 8px;
  border-radius: var(--wh-r-xs); font-size: var(--wh-fs-11); font-weight: 700;
  letter-spacing: .02em;
}
.wh-badge-primary { background: var(--wh-primary-light); color: var(--wh-primary); }
.wh-badge-red { background: var(--wh-red-bg); color: var(--wh-red); }
.wh-badge-green { background: #D1FAE5; color: #065F46; }
.wh-badge-amber { background: #FEF3C7; color: #92400E; }
.wh-badge-gray { background: var(--wh-bg-soft); color: var(--wh-t3); }
.wh-badge-rocket { background: linear-gradient(135deg, #5B4CF5, #8B5CF6); color: #fff; }
.wh-badge-free { background: #DBEAFE; color: var(--wh-blue); }

/* ─────────────────────────────────────────────────────────────────────
 *  COUPANG 스타일 마켓 컴포넌트
 * ───────────────────────────────────────────────────────────────────── */

/* 글로벌 헤더 */
.wh-mkt-header {
  background: #fff; border-bottom: 1px solid var(--wh-divider);
  position: sticky; top: 0; z-index: 50;
}
.wh-mkt-header .top {
  background: #F8FAFC; padding: 6px 0; font-size: var(--wh-fs-12); color: var(--wh-t3);
  border-bottom: 1px solid var(--wh-divider);
}
.wh-mkt-header .top .wh-container { display: flex; justify-content: flex-end; gap: 14px; }
.wh-mkt-header .top a { color: var(--wh-t3); text-decoration: none; }
.wh-mkt-header .top a:hover { color: var(--wh-primary); }
.wh-mkt-header .main {
  padding: 16px 0; display: flex; align-items: center; gap: 24px;
}
.wh-mkt-logo {
  font-size: 24px; font-weight: 900; color: var(--wh-primary);
  text-decoration: none; flex-shrink: 0; letter-spacing: -.04em;
}
.wh-mkt-logo span { color: var(--wh-purple); }
.wh-mkt-search {
  flex: 1; max-width: 700px; position: relative;
}
.wh-mkt-search input {
  width: 100%; padding: 14px 60px 14px 20px;
  border: 2.5px solid var(--wh-primary); border-radius: 999px;
  font-size: var(--wh-fs-15); font-family: inherit; outline: none; background: #fff;
}
.wh-mkt-search button {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 42px; height: 42px; border: 0; border-radius: 50%;
  background: var(--wh-primary); color: #fff; cursor: pointer; font-size: 16px;
}
.wh-mkt-search button:hover { background: var(--wh-primary-dark); }
.wh-mkt-actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.wh-mkt-action {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 12px; border-radius: var(--wh-r); cursor: pointer;
  text-decoration: none; color: var(--wh-t2); font-size: var(--wh-fs-11);
}
.wh-mkt-action i { font-size: 18px; color: var(--wh-t3); }
.wh-mkt-action:hover { background: var(--wh-bg-soft); }

/* 카테고리 스트립 */
.wh-mkt-cats {
  background: #fff; border-bottom: 1px solid var(--wh-divider);
  padding: 10px 0; overflow-x: auto;
}
.wh-mkt-cats .wh-container { display: flex; gap: 6px; flex-wrap: nowrap; }
.wh-mkt-cat {
  padding: 8px 16px; border-radius: 999px; font-size: var(--wh-fs-13);
  font-weight: 600; color: var(--wh-t2); text-decoration: none; white-space: nowrap;
  transition: var(--wh-tr); border: 1px solid transparent;
}
.wh-mkt-cat:hover { background: var(--wh-primary-light); color: var(--wh-primary); }
.wh-mkt-cat.active { background: var(--wh-primary); color: #fff; }

/* 히어로 배너 */
.wh-mkt-banner {
  background: linear-gradient(135deg, #5B4CF5 0%, #8B5CF6 50%, #06B6D4 100%);
  color: #fff; padding: 36px 24px; border-radius: var(--wh-r-lg);
  margin: 20px 0; display: flex; justify-content: space-between; align-items: center;
  box-shadow: var(--wh-sh-md);
}
.wh-mkt-banner h2 { font-size: var(--wh-fs-28); font-weight: 800; margin-bottom: 8px; letter-spacing: -.02em; }
.wh-mkt-banner p { font-size: var(--wh-fs-14); opacity: .9; }

/* 섹션 헤더 */
.wh-section-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  margin: 28px 0 14px;
}
.wh-section-head h3 {
  font-size: var(--wh-fs-20); font-weight: 800; color: var(--wh-t1); letter-spacing: -.02em;
}
.wh-section-head .more { font-size: var(--wh-fs-13); color: var(--wh-t3); text-decoration: none; }
.wh-section-head .more:hover { color: var(--wh-primary); }

/* 상품 그리드 (Coupang 5열) */
.wh-product-grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(5, 1fr);
}
@media (max-width: 1100px) { .wh-product-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 880px)  { .wh-product-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px)  { .wh-product-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; } }

.wh-product {
  background: #fff; border: 1px solid var(--wh-divider); border-radius: var(--wh-r);
  overflow: hidden; cursor: pointer; transition: var(--wh-tr); text-decoration: none; color: inherit;
  display: flex; flex-direction: column;
}
.wh-product:hover {
  border-color: var(--wh-primary); box-shadow: var(--wh-sh-md); transform: translateY(-3px);
}
.wh-product-img {
  position: relative; aspect-ratio: 1; background: #F1F5F9;
  display: flex; align-items: center; justify-content: center;
  font-size: 56px; color: var(--wh-t4); overflow: hidden;
}
.wh-product-img.cat-wp_theme       { background: linear-gradient(135deg,#FBBF24,#F97316); color: #fff; }
.wh-product-img.cat-wp_plugin      { background: linear-gradient(135deg,#10B981,#06B6D4); color: #fff; }
.wh-product-img.cat-nextjs_template{ background: linear-gradient(135deg,#1F2937,#4B5563); color: #fff; }
.wh-product-img.cat-laravel_pkg    { background: linear-gradient(135deg,#EF4444,#F97316); color: #fff; }
.wh-product-img.cat-design         { background: linear-gradient(135deg,#EC4899,#8B5CF6); color: #fff; }
.wh-product-img.cat-other          { background: linear-gradient(135deg,#6366F1,#8B5CF6); color: #fff; }
.wh-product-img .badges-tl {
  position: absolute; top: 8px; left: 8px; display: flex; flex-direction: column; gap: 4px;
}
.wh-product-img .badges-tr {
  position: absolute; top: 8px; right: 8px;
}

.wh-product-body { padding: 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.wh-product-title {
  font-size: var(--wh-fs-13); line-height: 1.4; color: var(--wh-t1);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; min-height: 36px;
}
.wh-product-rating { font-size: var(--wh-fs-11); color: var(--wh-t3); }
.wh-product-rating .star { color: #FBBF24; }
.wh-product-price-row { margin-top: auto; padding-top: 4px; }
.wh-product-discount { font-size: var(--wh-fs-12); color: var(--wh-red); font-weight: 700; }
.wh-product-price {
  font-size: var(--wh-fs-18); font-weight: 800; color: var(--wh-t1);
  letter-spacing: -.02em; line-height: 1.2;
}
.wh-product-original {
  font-size: var(--wh-fs-12); color: var(--wh-t4); text-decoration: line-through;
}
.wh-product-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }

/* 무료 라벨 (가격 0원) */
.wh-product-price.free { color: var(--wh-blue); font-size: var(--wh-fs-16); }

/* 빈 상태 */
.wh-empty {
  text-align: center; padding: 80px 24px; color: var(--wh-t4);
  background: #fff; border-radius: var(--wh-r-md); margin: 24px 0;
}
.wh-empty i { font-size: 48px; color: var(--wh-t5); margin-bottom: 12px; }
.wh-empty h4 { font-size: var(--wh-fs-16); color: var(--wh-t2); margin-bottom: 6px; }

/* 사이드 필터 */
.wh-mkt-layout { display: grid; grid-template-columns: 220px 1fr; gap: 24px; align-items: start; }
@media (max-width: 880px) { .wh-mkt-layout { grid-template-columns: 1fr; } }

.wh-filter {
  background: #fff; border-radius: var(--wh-r-md); padding: 16px;
  position: sticky; top: 130px; box-shadow: var(--wh-sh-sm);
}
.wh-filter-group { margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--wh-divider); }
.wh-filter-group:last-child { border: 0; margin-bottom: 0; padding-bottom: 0; }
.wh-filter-title { font-size: var(--wh-fs-12); font-weight: 800; color: var(--wh-t2); margin-bottom: 10px; text-transform: uppercase; letter-spacing: .04em; }
.wh-filter-item {
  display: flex; align-items: center; padding: 5px 0;
  font-size: var(--wh-fs-13); color: var(--wh-t2); cursor: pointer; text-decoration: none;
}
.wh-filter-item:hover { color: var(--wh-primary); }
.wh-filter-item.active { color: var(--wh-primary); font-weight: 700; }
.wh-filter-item .count { margin-left: auto; color: var(--wh-t4); font-size: var(--wh-fs-11); }

/* 페이지네이션 */
.wh-pager { display: flex; justify-content: center; gap: 4px; margin: 32px 0; }
.wh-pager a, .wh-pager span {
  min-width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center;
  padding: 0 10px; border: 1px solid var(--wh-border); border-radius: var(--wh-r-sm);
  text-decoration: none; color: var(--wh-t2); font-size: var(--wh-fs-13);
}
.wh-pager a:hover { background: var(--wh-bg-soft); }
.wh-pager .on { background: var(--wh-primary); color: #fff; border-color: var(--wh-primary); font-weight: 700; }

/* 기타 유틸 */
.wh-tag-pill {
  display: inline-block; padding: 2px 8px; background: var(--wh-bg-soft);
  color: var(--wh-t3); border-radius: 4px; font-size: var(--wh-fs-11);
}
.wh-divider { height: 1px; background: var(--wh-divider); margin: 16px 0; }
.wh-text-c { text-align: center; }
.wh-mt-1 { margin-top: 6px; }   .wh-mt-2 { margin-top: 12px; }   .wh-mt-3 { margin-top: 18px; }   .wh-mt-4 { margin-top: 24px; }
.wh-mb-1 { margin-bottom: 6px; }.wh-mb-2 { margin-bottom: 12px; }.wh-mb-3 { margin-bottom: 18px; }.wh-mb-4 { margin-bottom: 24px; }
.wh-flex { display: flex; }
.wh-flex-col { display: flex; flex-direction: column; }
.wh-gap-1 { gap: 6px; }   .wh-gap-2 { gap: 12px; }   .wh-gap-3 { gap: 18px; }
.wh-justify-between { justify-content: space-between; }
.wh-items-center { align-items: center; }

/* 상세 페이지 */
.wh-detail-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 32px; align-items: start; }
@media (max-width: 880px) { .wh-detail-grid { grid-template-columns: 1fr; } }
.wh-detail-cover {
  aspect-ratio: 4/3; border-radius: var(--wh-r-md); overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  font-size: 120px; color: #fff;
}
.wh-detail-info { padding: 4px 0; }
.wh-detail-info h1 {
  font-size: var(--wh-fs-24); font-weight: 800; color: var(--wh-t1);
  letter-spacing: -.02em; line-height: 1.3;
}
.wh-detail-price-box {
  background: #FAFBFC; border-radius: var(--wh-r-md); padding: 18px;
  margin: 16px 0; border: 1px solid var(--wh-divider);
}
.wh-detail-price {
  font-size: var(--wh-fs-32); font-weight: 900; color: var(--wh-t1); line-height: 1;
}
.wh-detail-price .unit { font-size: var(--wh-fs-18); font-weight: 700; }
.wh-detail-meta-row { display: flex; gap: 16px; padding: 8px 0; font-size: var(--wh-fs-13); color: var(--wh-t3); }
.wh-detail-meta-row strong { color: var(--wh-t1); }

/* 토스트 */
.wh-toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: rgba(17, 24, 39, .95); color: #fff; padding: 12px 20px;
  border-radius: var(--wh-r); font-size: var(--wh-fs-14); z-index: 9999;
  opacity: 0; transition: opacity .25s; pointer-events: none;
  box-shadow: var(--wh-sh-lg);
}
.wh-toast.show { opacity: 1; }
