/* 총총파트너스 design system — monochrome + single copper accent, spec-forward */
:root {
  --bg: #FFFFFF;
  --surface: #FFFFFF;
  --surface-2: #FAFAF9;
  --ink: #0A0A0A;
  --ink-2: #52525B;
  --ink-3: #A1A1AA;
  --line: #ECECEA;
  --line-strong: #DEDEDB;
  --accent: #C2410C;
  --accent-strong: #9A3412;
  --accent-wash: #FDF3EE;
  --danger: #B42318;

  --radius: 16px;
  --radius-sm: 10px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(10,10,10,0.04);
  --shadow-md: 0 4px 16px -4px rgba(10,10,10,0.08), 0 1px 3px rgba(10,10,10,0.04);
  --shadow-lg: 0 12px 32px -8px rgba(10,10,10,0.12), 0 2px 6px rgba(10,10,10,0.05);

  --font-sans: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', 'Cascadia Code', 'Menlo', 'Consolas', monospace;

  --maxw: 1280px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -0.02em; }
::selection { background: var(--accent); color: #fff; }

/* ---------- layout ---------- */
.page { max-width: var(--maxw); margin: 0 auto; padding: 40px 24px 80px; }
.page-narrow { max-width: 420px; margin: 0 auto; padding: 0 20px; min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; }
.page-narrow.wide { max-width: 480px; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  height: 60px; padding: 0 24px;
  background: rgba(255,255,255,0.72);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { width: 100%; max-width: var(--maxw); margin: 0 auto; display: flex; align-items: center; justify-content: space-between; }
.nav-brand { font-weight: 750; font-size: 17px; letter-spacing: -0.03em; color: var(--ink); }
.nav-brand b { color: var(--accent); font-weight: 750; }
.nav-links { display: flex; align-items: center; gap: 20px; }
.nav-links a { color: var(--ink-2); font-size: 14px; font-weight: 500; transition: color .15s; }
.nav-links a:hover { color: var(--ink); }

/* ---------- cart icon ---------- */
.cart-link { position: relative; display: inline-flex; align-items: center; color: var(--ink-2); transition: color .15s; }
.cart-link:hover { color: var(--accent); }
.cart-ico { display: block; }
.cart-badge {
  position: absolute; top: -6px; right: -9px;
  min-width: 17px; height: 17px; padding: 0 4px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff; font-family: var(--font-mono);
  font-size: 10px; font-weight: 700; line-height: 1; border-radius: var(--radius-pill);
}

/* ---------- mypage 회사정보 그리드 ---------- */
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 28px; font-size: 14px; }
.info-grid > div { display: flex; flex-direction: column; gap: 3px; }
.info-label { font-size: 12px; color: var(--ink-3); }
@media (max-width: 640px) { .info-grid { grid-template-columns: 1fr; } }

/* ---------- hero / section head ---------- */
.hero { max-width: var(--maxw); margin: 0 auto; padding: 64px 24px 24px; }
.hero-eyebrow { display: inline-block; font-size: 12px; font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); margin-bottom: 14px; }
.hero h1 { font-size: clamp(32px, 5vw, 54px); font-weight: 800; line-height: 1.04; letter-spacing: -0.035em; }
.hero p { margin: 18px 0 0; color: var(--ink-2); font-size: 17px; max-width: 48ch; }

/* hero 2단: 왼쪽 카피 + 오른쪽 공지 카드 */
.hero-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 400px); gap: 40px; align-items: start; }
.notice-card {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface-2); box-shadow: var(--shadow-md); overflow: hidden;
}
.notice-head {
  padding: 12px 16px; font-size: 13px; font-weight: 700; letter-spacing: -0.01em;
  color: var(--ink); border-bottom: 1px solid var(--line);
}
.notice-list { max-height: 300px; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.notice-item {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm); overflow: hidden;
}
.notice-toggle {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 14px; background: none; border: none; cursor: pointer; text-align: left; font: inherit;
}
.notice-meta { font-size: 13px; color: var(--ink-3); }
.notice-meta b { color: var(--accent); font-weight: 650; }
.notice-arrow { color: var(--ink-3); font-size: 12px; transition: transform .2s; flex-shrink: 0; }
.notice-toggle[aria-expanded="true"] .notice-arrow { transform: rotate(180deg); }
.notice-body { padding: 0 14px 12px; font-size: 14px; color: var(--ink-2); white-space: pre-wrap; word-break: break-word; }

@media (max-width: 800px) {
  .hero-split { grid-template-columns: 1fr; gap: 28px; }
}

/* ---------- group cards (catalog) ---------- */
.group-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 16px; }
@media (max-width: 900px) { .group-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) { .group-grid { grid-template-columns: 1fr; } }
.group-card {
  display: flex; flex-direction: column; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-sm); transition: transform .22s cubic-bezier(.16,1,.3,1), box-shadow .22s, border-color .22s;
}
.group-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--line-strong); }
.group-media { position: relative; aspect-ratio: 1 / 1; overflow: hidden; background: var(--surface-2); }
.group-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s cubic-bezier(.16,1,.3,1); }
.group-card:hover .group-media img { transform: scale(1.04); }
.group-count { position: absolute; top: 14px; right: 14px; background: rgba(10,10,10,0.82); color: #fff; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: var(--radius-pill); backdrop-filter: blur(4px); }
.group-body { padding: 20px 22px 22px; display: flex; flex-direction: column; }
.group-body h3 { font-size: 20px; font-weight: 720; letter-spacing: -0.02em; color: var(--ink); }
.group-body p { margin: 6px 0 0; color: var(--ink-3); font-size: 14px; }
.group-price { font-size: 22px; font-weight: 750; letter-spacing: -0.02em; color: var(--ink); margin: 16px 0 14px; }
.group-buy { display: flex; flex-direction: column; gap: 10px; }
.buy-btns { display: flex; gap: 8px; }
.buy-btns .btn { flex: 1; }

.section-head {
  display: flex; align-items: baseline; gap: 12px;
  margin: 0 0 20px; padding-bottom: 14px; border-bottom: 1px solid var(--line);
}
.section-head h2 { font-size: 19px; font-weight: 700; }
.section-head .muted { color: var(--ink-3); font-family: var(--font-mono); font-size: 13px; }

/* ---------- segmented filter ---------- */
.segmented {
  position: sticky; top: 60px; z-index: 40;
  display: flex; gap: 4px; padding: 8px 0 16px;
  background: linear-gradient(var(--bg) 70%, transparent);
  margin-bottom: 8px; flex-wrap: wrap;
}
.seg {
  border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--ink-2); font-size: 13.5px; font-weight: 550; font-family: inherit;
  padding: 8px 16px; border-radius: var(--radius-pill); cursor: pointer;
  transition: all .15s;
}
.seg:hover { border-color: var(--ink-3); color: var(--ink); }
.seg[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ---------- product grid + card ---------- */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 900px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid { grid-template-columns: 1fr; } }

.product {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: transform .2s cubic-bezier(.16,1,.3,1), box-shadow .2s, border-color .2s;
}
.product:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--line-strong); }
.product .cat { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.product .spec {
  font-family: var(--font-mono); font-size: 26px; font-weight: 600; letter-spacing: -0.02em;
  color: var(--ink); margin: 10px 0 2px; line-height: 1.1;
}
.product .pname { font-size: 13px; color: var(--ink-2); }
.product .divider { height: 1px; background: var(--line); margin: 18px 0 14px; }
.product .price { font-family: var(--font-mono); font-size: 20px; font-weight: 650; letter-spacing: -0.02em; }
.product .price .won { font-size: 13px; color: var(--ink-3); margin-left: 1px; }

.product-foot { display: flex; gap: 8px; margin-top: 14px; }

/* ---------- qty stepper ---------- */
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); overflow: hidden; }
.stepper button {
  width: 34px; height: 40px; border: none; background: var(--surface); color: var(--ink-2);
  font-size: 17px; cursor: pointer; font-family: inherit; transition: background .12s;
}
.stepper button:hover { background: var(--surface-2); color: var(--ink); }
.stepper input {
  width: 40px; height: 40px; border: none; border-left: 1px solid var(--line); border-right: 1px solid var(--line);
  text-align: center; font-family: var(--font-mono); font-size: 14px; color: var(--ink); background: var(--surface);
  -moz-appearance: textfield;
}
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: var(--radius-sm); padding: 0 18px; height: 44px;
  font-size: 14.5px; font-weight: 600; font-family: inherit; cursor: pointer;
  border: 1px solid transparent; background: var(--ink); color: #fff;
  transition: transform .12s, background .15s, box-shadow .15s, border-color .15s;
  white-space: nowrap;
}
.btn:hover { background: #262626; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-block { width: 100%; }
.btn-accent { background: var(--accent); }
.btn-accent:hover { background: var(--accent-strong); }
.btn-outline { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn-outline:hover { background: var(--surface-2); border-color: var(--ink-3); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn-danger { background: transparent; color: var(--danger); border-color: var(--line-strong); }
.btn-danger:hover { background: #FEF2F2; border-color: #FCA5A5; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; }
.product-foot .btn { flex: 1; }

/* ---------- forms ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow-md);
}
.brandmark { text-align: center; margin-bottom: 28px; }
.brandmark .logo { font-weight: 780; font-size: 22px; letter-spacing: -0.03em; }
.brandmark .logo b { color: var(--accent); }
.brandmark .sub { margin-top: 6px; font-size: 13px; color: var(--ink-3); }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; font-weight: 550; color: var(--ink-2); margin-bottom: 6px; }
input:not([type=checkbox]):not([type=radio]), textarea, select {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  font-family: inherit; font-size: 14.5px; background: var(--surface); color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: var(--ink-3); }
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash);
}
.btn:focus-visible, .seg:focus-visible, a:focus-visible, .stepper button:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
textarea { resize: vertical; min-height: 76px; }

.alert { padding: 12px 15px; border-radius: var(--radius-sm); font-size: 13.5px; margin-bottom: 16px; }
.alert-error { background: #FEF2F2; color: var(--danger); border: 1px solid #FEE2E2; }
.alert-info { background: var(--accent-wash); color: var(--accent-strong); border: 1px solid #FBE0D3; }

.formlink { text-align: center; margin-top: 18px; font-size: 13px; color: var(--ink-3); }
.formlink a { color: var(--accent); font-weight: 550; }

/* ---------- table (admin) ---------- */
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { padding: 13px 16px; text-align: left; }
thead th { background: var(--surface-2); color: var(--ink-3); font-weight: 600; font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; border-bottom: 1px solid var(--line); }
tbody tr { border-bottom: 1px solid var(--line); }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--surface-2); }
td .tabular, .tabular { font-family: var(--font-mono); }

.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: var(--radius-pill); }
.badge-on { background: #ECFDF3; color: #067647; }
.badge-off { background: #F4F4F5; color: var(--ink-3); }

/* ---------- misc ---------- */
.pageheading { margin-bottom: 24px; }
.pageheading h1 { font-size: 24px; font-weight: 750; }
.summary-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; font-size: 14.5px; color: var(--ink-2); }
.summary-row.total { padding-top: 16px; margin-top: 6px; border-top: 1px solid var(--line); color: var(--ink); font-weight: 700; font-size: 18px; }
.summary-row .tabular { color: var(--ink); }

/* ---------- inbox dropzone ---------- */
.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  gap: 6px; padding: 48px 24px; border: 2px dashed var(--line-strong); border-radius: var(--radius);
  background: var(--surface-2); cursor: pointer; transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-wash); }
.dz-icon { width: 44px; height: 44px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 20px; display: flex; align-items: center; justify-content: center; margin-bottom: 6px; }
.dz-title { font-weight: 600; font-size: 15px; }
.dz-sub { font-size: 13px; color: var(--ink-3); }
.dz-picked { margin-top: 8px; font-size: 13px; color: var(--accent); font-weight: 550; word-break: break-all; }

/* ---------- motion ---------- */
@keyframes riseIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.rise { animation: riseIn .5s cubic-bezier(.16,1,.3,1) both; }
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
