/* ==========================================================================
   핫딜 라이브 — mkt24.net 톤 디자인 시스템
   - 구조 출처: mkt24.net Next.js CSS chunks / 색은 ToLive 로고에서 추출 (블루 + 오렌지 + 라이트)
   - 4 영역 공통 토큰 (시청자 / 셀러 / 관리자 / 시청자 메인)
   ========================================================================== */

:root {
  /* === Brand: mkt24 추출 컬러 === */
  --mk-primary:        #0B5FD9;   /* 메인 블루 — 로고에서 추출 */
  --mk-primary-hover:  #0A4CB5;
  --mk-primary-deep:   #002468;   /* 로고 딥네이비 */
  --mk-primary-soft:   #E8F0FE;   /* 옅은 블루 배경 */
  --mk-primary-faint:  #F4F8FF;

  --mk-accent:         #FC5A18;   /* 로고 오렌지 — CTA / 강조 / NEW */
  --mk-accent-hover:   #E8480C;
  --mk-accent-deep:    #C93A05;
  --mk-accent-soft:    #FFD9C4;
  --mk-accent-faint:   #FFF0E8;
  --mk-accent-text:    #C93A05;   /* 흰 배경 위의 오렌지 글자. 대비 5.13 */
  --mk-on-accent:      #471500;   /* --mk-accent(밝은 오렌지) 배경 위의 글자. 대비 4.81 */
  /* 경고는 상태색이라 브랜드 오렌지와 분리해 호박색을 유지한다 */
  --mk-warn-soft:      #fffae6;
  --mk-warn-text:      #b58e00;

  --mk-danger:         #ef4444;   /* 빨강 — 할인 / LIVE */
  --mk-danger-soft:    #fee2e2;
  --mk-danger-deep:    #b91c1c;
  --mk-success:        #16a34a;
  --mk-info:           #2563eb;

  /* === Neutrals === */
  --mk-text:           #303440;   /* 메인 텍스트 (mkt24 사용) */
  --mk-text-soft:      #5b6072;
  --mk-muted:          #999999;
  --mk-faint:          #c4c4c4;
  --mk-border:         #dbdbdb;
  --mk-border-soft:    #ebedf0;
  --mk-bg:             #ffffff;
  /* ⚠️ 페이지 배경은 --mk-page 다 (2026-10-29). 종전에는 --mk-bg-soft 하나가
        '페이지 배경' 과 'hover·눌림 회색' 두 역할을 겸했다. 그래서 배경만
        흰색으로 바꾸면 hover 가 같이 사라지고, hover 를 살리면 배경이 회색으로
        돌아온다 — 지난 두 번의 '흰 배경' 수정이 이 파일에서 되돌려진 이유다.
        역할을 쪼갰으니 둘을 다시 합치지 말 것. */
  --mk-page:           #ffffff;   /* 페이지 배경 — 흰색 */
  --mk-bg-soft:        #f7f8fa;   /* hover·눌림 등 '반응' 전용 회색. 페이지 배경 아님 */
  --mk-bg-section:     #f0f2f5;

  /* === Spacing (8px grid) === */
  --mk-1: 4px;
  --mk-2: 8px;
  --mk-3: 12px;
  --mk-4: 16px;
  --mk-5: 20px;
  --mk-6: 24px;
  --mk-8: 32px;
  --mk-10: 40px;
  --mk-12: 48px;
  --mk-16: 64px;

  /* === Radius (mkt24 pill 다용) === */
  --mk-r-sm: 4px;
  --mk-r-md: 8px;
  --mk-r-lg: 12px;
  --mk-r-xl: 16px;
  --mk-r-2xl: 24px;
  --mk-r-pill: 999px;

  /* === Shadows (mkt24 매우 얕음) === */
  --mk-shadow-0: 0 0 0 1px var(--mk-border-soft);
  --mk-shadow-1: 0 1px 2px rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.03);
  --mk-shadow-2: 0 4px 12px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.04);
  --mk-shadow-3: 0 12px 28px rgba(0,0,0,0.1), 0 4px 10px rgba(0,0,0,0.05);
  --mk-shadow-bottom: 0 -1px 8px rgba(0,0,0,0.06);

  /* === Motion === */
  --mk-ease: cubic-bezier(0.4, 0, 0.2, 1);
  --mk-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --mk-dur-fast: 120ms;
  --mk-dur: 200ms;

  /* === Typography === */
  --mk-font: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, system-ui, 'Segoe UI Variable', 'Segoe UI', sans-serif;
  --mk-font-mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  /* mkt24 비율 (.75rem / .875rem / 1rem / 1.125rem 활용) */
  --mk-fs-xs: 11px;     /* 0.6875rem */
  --mk-fs-sm: 12px;     /* 0.75rem */
  --mk-fs-md: 13px;
  --mk-fs-base: 14px;   /* 0.875rem — mkt24 기본 */
  --mk-fs-lg: 16px;     /* 1rem */
  --mk-fs-xl: 18px;     /* 1.125rem */
  --mk-fs-2xl: 22px;
  --mk-fs-3xl: 28px;

  /* === Bottom tab bar height === */
  --mk-tabbar-h: 60px;
}

/* === Reset & base === */
html { -webkit-text-size-adjust: 100%; }
body.mk-body {
  margin: 0;
  background: var(--mk-page);
  font-family: var(--mk-font);
  font-size: var(--mk-fs-base);
  color: var(--mk-text);
  letter-spacing: -0.02em;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.mk-body * { box-sizing: border-box; }
.mk-body a { color: var(--mk-text); text-decoration: none; }
.mk-body a:hover { color: var(--mk-primary); }
.mk-body img, .mk-body video, .mk-body svg { max-width: 100%; height: auto; display: block; }
.mk-body ::selection { background: var(--mk-primary); color: white; }

/* === Container === */
.mk-container {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px;
}
@media (min-width: 1024px) {
  .mk-container { max-width: 1024px; padding: 0 24px; }
}

/* === Top app bar (sticky) === */
.mk-appbar {
  position: sticky; top: 0;
  background: white;
  border-bottom: 1px solid var(--mk-border-soft);
  z-index: 50;
  box-shadow: 0 1px 0 rgba(0,0,0,0.02);
}
.mk-appbar-inner {
  max-width: 720px;
  margin: 0 auto;
  height: 52px;
  display: flex; align-items: center; gap: 12px;
  padding: 0 14px;
}
.mk-appbar .mk-back {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; background: transparent; border-radius: var(--mk-r-md);
  color: var(--mk-text); font-size: 18px; cursor: pointer;
}
.mk-appbar .mk-back:hover { background: var(--mk-bg-section); }
.mk-appbar .mk-title {
  flex: 1;
  font-size: 15px; font-weight: 700;
  color: var(--mk-text);
  letter-spacing: -0.025em;
  text-align: center;
  margin: 0;
}
.mk-appbar .mk-actions {
  display: inline-flex; align-items: center; gap: 4px;
}
.mk-appbar .mk-icon-btn {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; background: transparent; border-radius: var(--mk-r-md);
  color: var(--mk-text); font-size: 16px;
  cursor: pointer; position: relative;
}
.mk-appbar .mk-icon-btn:hover { background: var(--mk-bg-section); }
.mk-appbar .mk-icon-btn .mk-dot {
  position: absolute; top: 8px; right: 8px;
  width: 7px; height: 7px;
  background: var(--mk-danger);
  border-radius: 50%; border: 1.5px solid white;
}

/* === Bottom Tab bar (5탭 fixed) === */
.mk-tabbar {
  position: fixed; left: 0; right: 0; bottom: 0;
  background: white;
  border-top: 1px solid var(--mk-border-soft);
  box-shadow: var(--mk-shadow-bottom);
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom);
}
.mk-tabbar-inner {
  max-width: 720px;
  margin: 0 auto;
  height: var(--mk-tabbar-h);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
}
.mk-tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px;
  text-decoration: none;
  color: var(--mk-muted);
  font-size: 10.5px; font-weight: 500;
  letter-spacing: -0.02em;
  background: transparent;
  border: 0;
  cursor: pointer;
  transition: color var(--mk-dur);
  position: relative;
}
.mk-tab i { font-size: 19px; }
.mk-tab:hover { color: var(--mk-text-soft); }
.mk-tab.active { color: var(--mk-primary); font-weight: 700; }
.mk-tab.active::before {
  content: ''; position: absolute; top: 0; left: 50%;
  transform: translateX(-50%);
  width: 24px; height: 3px;
  background: var(--mk-primary);
  border-radius: 0 0 4px 4px;
}
/* tabbar 가 있는 페이지는 본문 하단에 여유 */
.mk-has-tabbar { padding-bottom: calc(var(--mk-tabbar-h) + env(safe-area-inset-bottom) + 8px); }

/* === Section header === */
.mk-section { padding: 16px 14px 8px; }
.mk-section-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.mk-section-title {
  font-size: 16px; font-weight: 800;
  color: var(--mk-text);
  letter-spacing: -0.03em;
  margin: 0;
  display: inline-flex; align-items: center; gap: 8px;
}
.mk-section-title .mk-section-ic {
  width: 22px; height: 22px;
  background: var(--mk-primary-soft);
  color: var(--mk-primary-deep);
  border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px;
}
.mk-section-title.mk-live .mk-section-ic { background: var(--mk-danger-soft); color: var(--mk-danger); }
.mk-section-title.mk-warn .mk-section-ic { background: var(--mk-warn-soft); color: var(--mk-warn-text); }
.mk-section-more {
  color: var(--mk-text-soft);
  font-size: 12px; font-weight: 600;
  text-decoration: none;
  display: inline-flex; align-items: center; gap: 4px;
}
.mk-section-more:hover { color: var(--mk-primary); }

/* === Card === */
.mk-card {
  background: white;
  border: 1px solid var(--mk-border-soft);
  border-radius: var(--mk-r-xl);
  overflow: hidden;
  transition: transform var(--mk-dur) var(--mk-ease-out), box-shadow var(--mk-dur);
}
.mk-card:hover, .mk-card:active { transform: translateY(-2px); box-shadow: var(--mk-shadow-2); }
.mk-card-body { padding: 14px; }

/* === Product / live card grid (2-col) === */
.mk-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.mk-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 360px) { .mk-grid-3 { grid-template-columns: repeat(2, 1fr); } }
.mk-grid-cards { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 480px) { .mk-grid-cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 800px) { .mk-grid-cards { grid-template-columns: repeat(3, 1fr); } }

/* === Live / product card === */
.mk-live-card {
  background: white;
  border-radius: var(--mk-r-xl);
  overflow: hidden;
  border: 1px solid var(--mk-border-soft);
  position: relative;
  display: block;
  transition: transform var(--mk-dur) var(--mk-ease-out), box-shadow var(--mk-dur);
}
.mk-live-card:hover, .mk-live-card:active {
  transform: translateY(-2px);
  box-shadow: var(--mk-shadow-2);
}
.mk-live-card .mk-thumb {
  aspect-ratio: 1 / 1;
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  position: relative;
  overflow: hidden;
}
.mk-live-card .mk-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform var(--mk-dur);
}
.mk-live-card:hover .mk-thumb img { transform: scale(1.05); }
.mk-live-card .mk-thumb::after {
  content: ''; position: absolute; inset: auto 0 0 0; height: 50%;
  background: linear-gradient(0deg, rgba(0,0,0,0.45) 0%, transparent 100%);
  pointer-events: none;
}
.mk-live-card .mk-info {
  padding: 10px 12px 12px;
}
.mk-live-card .mk-card-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--mk-text);
  line-height: 1.4;
  letter-spacing: -0.02em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0 0 4px;
  min-height: 38px;
}
.mk-live-card .mk-meta {
  font-size: 11.5px;
  color: var(--mk-muted);
  display: flex; align-items: center; gap: 6px;
  font-variant-numeric: tabular-nums;
}
.mk-live-card .mk-meta i { font-size: 10px; }

/* === Badges (mkt24 동일 톤) === */
.mk-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px;
  border-radius: var(--mk-r-pill);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.4;
}
.mk-badge-live {
  background: var(--mk-danger);
  color: white;
  position: absolute; top: 8px; left: 8px;
  z-index: 2;
  padding: 4px 10px 4px 9px;
  box-shadow: 0 4px 10px rgba(239,68,68,0.4);
}
.mk-badge-live::before {
  content: ''; width: 6px; height: 6px;
  background: white; border-radius: 50%;
  animation: mkBlink 1.4s ease infinite;
}
@keyframes mkBlink { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }
.mk-badge-sched {
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(8px);
  color: var(--mk-primary-deep);
  position: absolute; top: 8px; left: 8px;
  z-index: 2;
  padding: 4px 10px;
  font-weight: 700;
  border: 1px solid var(--mk-primary-soft);
  font-variant-numeric: tabular-nums;
}
.mk-badge-sale {
  background: var(--mk-danger);
  color: white;
  padding: 2px 7px;
  font-size: 11px;
  border-radius: var(--mk-r-sm);
}
.mk-badge-new   { background: var(--mk-primary); color: white; padding: 2px 7px; font-size: 10.5px; border-radius: var(--mk-r-sm); }
.mk-badge-hot   { background: var(--mk-accent); color: var(--mk-on-accent); padding: 2px 7px; font-size: 10.5px; border-radius: var(--mk-r-sm); }
.mk-badge-store { background: var(--mk-bg-section); color: var(--mk-text-soft); padding: 2px 8px; font-size: 10.5px; border-radius: var(--mk-r-sm); }

/* === Price (할인전/할인후/할인율) === */
.mk-price-wrap { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.mk-price-disc {
  color: var(--mk-danger);
  font-weight: 800;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.mk-price-orig {
  color: var(--mk-muted);
  text-decoration: line-through;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}
.mk-price-now {
  color: var(--mk-text);
  font-weight: 800;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.025em;
}
.mk-price-unit { color: var(--mk-muted); font-size: 11px; font-weight: 600; }

/* === Buttons === */
.mk-btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.02em;
  padding: 11px 18px;
  border-radius: var(--mk-r-md);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  min-height: 44px;
  transition: background var(--mk-dur), border-color var(--mk-dur), transform var(--mk-dur-fast);
  user-select: none;
}
.mk-btn:active { transform: translateY(1px); }
.mk-btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.mk-btn-primary {
  background: var(--mk-primary);
  color: white;
  box-shadow: 0 2px 6px rgba(11,95,217,0.25);
}
.mk-btn-primary:hover { background: var(--mk-primary-hover); }
.mk-btn-accent {
  background: var(--mk-accent);
  color: var(--mk-on-accent);
  box-shadow: 0 2px 6px rgba(255,211,51,0.4);
}
.mk-btn-accent:hover { background: var(--mk-accent-hover); }
.mk-btn-danger { background: var(--mk-danger); color: white; }
.mk-btn-danger:hover { background: var(--mk-danger-deep); }
.mk-btn-soft {
  background: var(--mk-primary-soft);
  color: var(--mk-primary-deep);
}
.mk-btn-soft:hover { background: #d6ebe8; }
.mk-btn-ghost {
  background: white;
  border-color: var(--mk-border);
  color: var(--mk-text-soft);
}
.mk-btn-ghost:hover { background: var(--mk-bg-soft); color: var(--mk-text); }
.mk-btn-block { width: 100%; }
.mk-btn-sm    { font-size: 12.5px; padding: 8px 12px; min-height: 36px; }
.mk-btn-lg    { font-size: 15px; padding: 14px 22px; min-height: 50px; border-radius: var(--mk-r-lg); }
.mk-btn-pill  { border-radius: var(--mk-r-pill); }

/* === Chip / category filter === */
.mk-chips {
  display: flex; gap: 6px;
  padding: 12px 14px 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.mk-chips::-webkit-scrollbar { display: none; }
.mk-chip {
  flex-shrink: 0;
  display: inline-flex; align-items: center; gap: 4px;
  padding: 7px 14px;
  border-radius: var(--mk-r-pill);
  background: white;
  border: 1px solid var(--mk-border);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--mk-text-soft);
  letter-spacing: -0.02em;
  text-decoration: none;
  cursor: pointer;
  min-height: 32px;
  transition: all var(--mk-dur);
}
.mk-chip:hover { color: var(--mk-text); border-color: var(--mk-text-soft); }
.mk-chip.active {
  background: var(--mk-primary);
  color: white;
  border-color: var(--mk-primary);
  box-shadow: 0 2px 6px rgba(11,95,217,0.3);
}
.mk-chip i { font-size: 10.5px; opacity: 0.85; }

/* === Banner === */
.mk-banner {
  margin: 12px 14px;
  background: linear-gradient(135deg, var(--mk-primary) 0%, var(--mk-primary-deep) 100%);
  border-radius: var(--mk-r-xl);
  padding: 18px 20px;
  color: white;
  position: relative;
  overflow: hidden;
}
.mk-banner::before {
  content: ''; position: absolute;
  right: -30px; top: -30px;
  width: 140px; height: 140px;
  background: rgba(255,211,51,0.18);
  border-radius: 50%;
  filter: blur(6px);
}
.mk-banner .mk-banner-eyebrow {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.85;
  display: flex; align-items: center; gap: 6px;
}
.mk-banner .mk-banner-title {
  font-size: 17px;
  font-weight: 800;
  margin: 6px 0 8px;
  letter-spacing: -0.03em;
  position: relative; z-index: 1;
}
.mk-banner .mk-banner-sub {
  font-size: 12.5px;
  opacity: 0.85;
  position: relative; z-index: 1;
}

/* === Form === */
.mk-field { margin-bottom: 14px; }
.mk-label { display: block; font-size: 12.5px; font-weight: 700; color: var(--mk-text-soft); margin-bottom: 6px; letter-spacing: -0.02em; }
.mk-input,
.mk-select,
.mk-textarea {
  display: block;
  width: 100%;
  background: white;
  border: 1px solid var(--mk-border);
  border-radius: var(--mk-r-md);
  padding: 12px 14px;
  font-family: inherit;
  font-size: 14px;
  color: var(--mk-text);
  letter-spacing: -0.02em;
  transition: border-color var(--mk-dur), box-shadow var(--mk-dur);
  min-height: 46px;
}
.mk-input:focus,
.mk-select:focus,
.mk-textarea:focus {
  outline: none;
  border-color: var(--mk-primary);
  box-shadow: 0 0 0 3px rgba(11,95,217,0.15);
}
.mk-input::placeholder, .mk-textarea::placeholder { color: var(--mk-faint); }

/* === Empty state === */
.mk-empty {
  text-align: center;
  padding: 48px 24px;
  background: white;
  border: 1px dashed var(--mk-border);
  border-radius: var(--mk-r-xl);
  margin: 12px 14px;
}
.mk-empty .mk-empty-ic {
  font-size: 38px;
  color: var(--mk-faint);
  margin-bottom: 8px;
}
.mk-empty .mk-empty-title {
  font-size: 14.5px; font-weight: 700; color: var(--mk-text-soft);
  margin-bottom: 4px;
  letter-spacing: -0.02em;
}
.mk-empty .mk-empty-sub {
  font-size: 12px; color: var(--mk-muted);
}

/* === KV row (주문 정보 등) === */
.mk-kv {
  display: flex; justify-content: space-between; align-items: center;
  padding: 11px 0;
  gap: 12px;
  border-bottom: 1px solid var(--mk-border-soft);
}
.mk-kv:last-child { border-bottom: 0; }
.mk-kv .mk-k { color: var(--mk-text-soft); font-size: 12.5px; flex-shrink: 0; }
.mk-kv .mk-v { color: var(--mk-text); font-size: 13px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }

/* === Skeleton === */
.mk-skel {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  border-radius: var(--mk-r-sm);
  animation: mkSkelShift 1.4s ease infinite;
}
@keyframes mkSkelShift { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* === Scrollbar === */
.mk-body * { scrollbar-width: thin; scrollbar-color: var(--mk-border) transparent; }
.mk-body *::-webkit-scrollbar { width: 6px; height: 6px; }
.mk-body *::-webkit-scrollbar-track { background: transparent; }
.mk-body *::-webkit-scrollbar-thumb { background: var(--mk-border); border-radius: 999px; }

/* === Utility === */
.mk-row { display: flex; gap: 12px; align-items: center; }
.mk-row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.mk-stack { display: flex; flex-direction: column; gap: 12px; }
.mk-mono { font-family: var(--mk-font-mono); font-variant-numeric: tabular-nums; }
.mk-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mk-clip-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mk-text-muted { color: var(--mk-muted); }
.mk-text-soft  { color: var(--mk-text-soft); }
.mk-text-primary { color: var(--mk-primary); }
.mk-text-danger { color: var(--mk-danger); }
.mk-text-accent { color: var(--mk-accent-text); }
.mk-bg-soft { background: var(--mk-bg-soft); }
.mk-bg-section { background: var(--mk-bg-section); }

/* === Mobile zoom 차단 (iOS) — 16px 미만 input 자동 zoom 방지 === */
@media (max-width: 768px) {
  .mk-body input,
  .mk-body select,
  .mk-body textarea {
    font-size: 16px !important;
  }
}
