/* ===== Design tokens ===== */
:root{
  /* 색상 */
  --bg: #ffffff;              /* 기본 배경: 흰색(권장) */
  --bg-soft: #fafbfc;         /* 섹션 배경으로 가볍게 쓰고 싶을 때 */
  --text: #111827;            /* 본문 텍스트 (근현대 그레이) */
  --muted: #6b7280;           /* 보조 텍스트 */
  --border: #e5e7eb;          /* 경계선 */
  --primary: #0b66ff;         /* 포인트(버튼/링크) */
  --primary-dk: #0650cc;

  /* 레이아웃 */
  --container-max: 1120px;
  --gap: 16px;
  --radius: 12px;
  --header-h-mobile: 56px;
  --header-h-desktop: 64px;

  /* 타이포 스케일 */
  --fz-hero: 34px;
  --fz-h2: 20px;
  --fz-body: 15px;
  --fz-small: 13px;
}

/* ===== Base ===== */
html { box-sizing:border-box }
*,*::before,*::after { box-sizing:inherit }
body{
  margin:0;
  color:var(--text);
  background:var(--bg);            /* ← 배경: 흰색 */
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans KR", Arial, sans-serif;
  font-size: var(--fz-body);
  line-height: 1.55;
}
main{ max-width:var(--container-max); margin:0 auto; padding:24px 16px }

/* 제목 */
h1{ font-size:var(--fz-hero); line-height:1.25; margin:24px 0 8px; font-weight:800 }
h2{ font-size:var(--fz-h2); line-height:1.35; margin:24px 0 12px; font-weight:700 }
p,li{ color:var(--text) }
.muted{ color:var(--muted) }

/* 링크/버튼 */
a{ color:var(--primary); text-decoration:none }
a:hover{ text-decoration:underline; color:var(--primary-dk) }
.button,.btn{
  display:inline-block; border-radius:10px; padding:9px 14px;
  text-decoration:none; border:1px solid transparent; font-weight:600
}
.btn-primary{ background:var(--primary); color:#fff; border-color:var(--primary) }
.btn-primary:hover{ background:var(--primary-dk); border-color:var(--primary-dk) }
.btn-ghost{ background:#f3f4f6; color:var(--text); border:1px solid var(--border) }
.btn-ghost:hover{ background:#e9eaee }

/* ===== Header (겹침 방지 + 깔끔) ===== */
.site-header{ position:sticky; top:0; z-index:1000; background:#fff; border-bottom:1px solid var(--border) }
.nav-inner{
  max-width:var(--container-max); margin:0 auto;
  height:var(--header-h-mobile); display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:0 16px;
}
@media (min-width:900px){ .nav-inner{ height:var(--header-h-desktop) } }
.brand{ font-weight:800; font-size:18px; color:var(--text) }
.hamburger{ display:inline-flex; width:40px; height:40px; align-items:center; justify-content:center; font-size:20px; background:none; border:none; cursor:pointer }
.nav-links{ display:none; gap:8px; align-items:center }
@media (min-width:900px){ .hamburger{ display:none } .nav-links{ display:inline-flex } }
.linklike{ background:none; border:none; color:var(--primary); padding:9px 10px; cursor:pointer }
.linklike:hover{ text-decoration:underline; color:var(--primary-dk) }

.mobile-menu{ border-bottom:1px solid var(--border); background:#fff }
.mobile-menu nav > *{ display:block; padding:12px 16px }

/* ===== Cards (3열 목표) ===== */
/* 모바일 1열 → 태블릿 2열 → 데스크탑 3열 (요청 반영) */
.cards-grid{ display:grid; grid-template-columns:1fr; gap:var(--gap) }
@media (min-width:600px){ .cards-grid{ grid-template-columns: repeat(2, 1fr) } }
@media (min-width:900px){ .cards-grid{ grid-template-columns: repeat(3, 1fr) } }

.card{
  border:1px solid var(--border); border-radius:var(--radius); overflow:hidden; background:#fff;
  transition: box-shadow .15s ease-in-out
}
.card:hover{ box-shadow:0 6px 20px rgba(0,0,0,.06) }
.card-thumb{ aspect-ratio:1/1; background:#f7f7f7; display:flex; align-items:center; justify-content:center }
.card-thumb img{ width:100%; height:100%; object-fit:cover; display:block }
.card-body{ padding:12px }
.card-title{
  font-weight:700; font-size:14.5px; line-height:1.35; margin:0 0 6px;
  overflow:hidden; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; color:var(--text)
}
.card-price{ font-size:var(--fz-small); color:#374151 }  /* 가격은 조금 진하게 */

/* ===== Hero Section ===== */
.hero {
  position: relative;
  min-height: 380px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 16px;
  color: #0f172a; /* 텍스트 대비 확보 */
  background: #fafbfc;
  overflow: hidden;
}
.hero::before {
  /* 배너 이미지 (모바일에서 과도한 크롭 방지 위해 contain + center) */
  content: "";
  position: absolute; inset: 0;
  background: url("../img/hero-banner.png") center / cover no-repeat; /* 배너 경로 */
  opacity: 0.40; /* 배경으로 은은하게 */
}
.hero::after {
  /* 가독성 향상을 위한 그라디언트 오버레이 */
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,.65) 0%, rgba(255,255,255,.72) 100%);
}
.hero-inner {
  position: relative; z-index: 1;
  width: 100%; max-width: 900px; text-align: center;
}
.hero h1 { font-size: 30px; font-weight: 800; margin: 0 0 8px; }
.hero .subtitle { font-size: 18px; font-weight: 500; margin: 0 0 16px; color: #334155; }
.hero .desc { font-size: 15px; line-height: 1.6; color: #475569; margin: 0 auto 18px; max-width: 720px; }
.hero-buttons a { margin: 0 6px; }

/* 행사 정보 박스 */
.event-info {
  margin: 18px auto 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  display: grid; gap: 12px;
  padding: 14px 16px;
  max-width: 720px;
  box-shadow: 0 6px 20px rgba(0,0,0,.04);
}
.event-row {
  display: grid; grid-template-columns: 24px 1fr; align-items: start; gap: 10px;
  color: #0f172a;
}
.event-kicker { color: #0b66ff; font-weight: 700; font-size: 30px; letter-spacing: .02em; }
.event-strong { font-weight: 700; }
.event-muted { color: #6b7280; }

@media (min-width: 900px) {
  .hero { min-height: 380px; padding: 64px 16px; }
  .hero h1 { font-size: 34px; }
  .hero .subtitle { font-size: 20px; }
  .hero::before { opacity: 0.48; }
  .hero::after {
    background: linear-gradient(180deg,
      rgba(255,255,255,.55) 0%,
      rgba(255,255,255,.68) 100%);
  }
}

/* 옵션 1: 더 선명하게 보이고 싶을 때 hero--vivid 클래스 추가 */
.hero.hero--vivid::before { opacity: 0.62; }
.hero.hero--vivid::after {
  background: linear-gradient(180deg,
    rgba(255,255,255,.40) 0%,
    rgba(255,255,255,.55) 100%);
}

/* ===== Auth pages (login / signup) ===== */
.auth-wrap {
  display: flex;
  justify-content: center;
  padding: 32px 16px 64px;
}
.auth-card {
  width: 100%;
  max-width: 520px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 8px 28px rgba(0,0,0,.06);
  padding: 24px;
}
.auth-title {
  margin: 4px 0 16px;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: .2px;
}
.auth-form .field {
  margin-bottom: 14px;
}
.auth-form label {
  display: block;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 6px;
}
.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"]{
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #dfe3e8;
  border-radius: 10px;
  font-size: 15px;
}
.auth-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 6px;
}
.auth-actions .btn-primary {
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 700;
}
.auth-help {
  margin-top: 12px;
  font-size: 14px;
}
.auth-error, .auth-form .errorlist {
  color: #b42318;
  background: #fff2f0;
  border: 1px solid #f3b3ae;
  border-radius: 10px;
  padding: 8px 10px;
  margin: 8px 0 12px;
  list-style: none;
}

/* ===== Signup form tweaks ===== */
.auth-form .row-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 720px){
  .auth-form .row-2 { grid-template-columns: 1fr 1fr; }
}
/* select도 input과 동일한 높이/스타일 */
.auth-form select{
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #dfe3e8;
  border-radius: 10px;
  font-size: 15px;
  background: #fff;
}
.auth-form small.help {
  display:block; margin-top:6px; color: var(--muted); font-size: 12.5px;
}

/* flash messages - 내 정보 수정화면 */
.alert {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
}
.alert-success { background: #ecfdf5; border:1px solid #a7f3d0; color:#065f46; }
.alert-error   { background: #fff2f0; border:1px solid #f3b3ae; color:#b42318; }

/* ===== Item create / edit ===== */
.form-wrap { display:flex; justify-content:center; padding:32px 16px 64px; }
.form-card {
  width:100%; max-width:880px; background:#fff; border:1px solid var(--border);
  border-radius:14px; box-shadow:0 8px 28px rgba(0,0,0,.06); padding:24px;
}
.form-title { margin:4px 0 16px; font-size:28px; font-weight:800; }

.form-grid { display:grid; grid-template-columns:1fr; gap:14px; }
@media (min-width:900px){ .form-grid.two { grid-template-columns:1fr 1fr; } }

.form-field label{ display:block; font-size:14px; color:var(--muted); margin-bottom:6px; }
.form-field input[type="text"],
.form-field input[type="number"],
.form-field select,
.form-field textarea{
  width:100%; padding:10px 12px; border:1px solid #dfe3e8; border-radius:10px; font-size:15px;
}
.form-field textarea{ min-height:160px; resize:vertical; }

/* 가격: $ 접두사 */
.price-input{ display:flex; align-items:center; gap:6px; }
.price-input .prefix{
  display:inline-block; min-width:36px; text-align:center; padding:10px 8px;
  border:1px solid #dfe3e8; border-radius:10px; background:#f7f8fa; color:#374151;
}
.price-input input{ flex:1; }

/* 체크/토글 정렬 */
.inline-row{ display:flex; gap:14px; align-items:center; flex-wrap:wrap; }

/* 업로더 */
.uploader { display:grid; gap:10px; }
.uploader small{ color:var(--muted); }

/* 버튼 줄 */
.form-actions{ display:flex; gap:10px; align-items:center; margin-top:12px; }

/* 페이지 타이틀 통일 */
.page-title { font-size: 28px; font-weight: 800; margin: 8px 0 12px; }

/* 카드 그리드 (홈과 동일 규칙 사용) */
.cards-grid{
  display:grid; gap:16px;
  grid-template-columns: 1fr;
}
@media (min-width: 640px){ .cards-grid{ grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px){ .cards-grid{ grid-template-columns: repeat(3, 1fr); } }

/* 카드 */
.card{
  border:1px solid var(--border);
  border-radius:14px;
  overflow:hidden;
  background:#fff;
  box-shadow:0 6px 18px rgba(0,0,0,.04);
  display:flex; flex-direction:column;
}
.card-thumb img{ width:100%; height:220px; object-fit:cover; display:block; }
.card-body{ padding:12px; display:flex; flex-direction:column; gap:8px; }
.card-title{ font-size:16px; font-weight:700; line-height:1.3; }
.card-price{ font-weight:800; }
.card-meta{ display:flex; justify-content:space-between; align-items:center; }
.badge{
  display:inline-block; padding:2px 8px; border-radius:999px;
  background:#eef2ff; color:#1d4ed8; font-size:12px; font-weight:700;
}

/* 액션 버튼들 */
.card-actions{ display:flex; gap:8px; margin-top:4px; }
.btn-sm{ padding:6px 10px; border-radius:10px; font-size:13px; }
.btn-danger{ background:#fee2e2; border:1px solid #fecaca; }
.btn-danger:hover{ background:#fecaca; }

/*static/img/placeholder.png 이미지가 없다면*/
.card-thumb img[alt=""]{ background:#f6f7f8; }

/* ===== Item detail ===== */
.detail{
  display:grid; gap:24px; align-items:start;
  grid-template-columns: 1fr;
  margin-top: 8px;
}
@media (min-width: 980px){
  .detail{ grid-template-columns: 1.1fr .9fr; }
}

.detail-gallery{ display:flex; flex-direction:column; gap:12px; }
.detail-main{
  width:100%; height: 520px; object-fit:cover;
  border-radius:16px; border:1px solid var(--border); background:#f6f7f8;
}
@media (max-width: 640px){ .detail-main{ height: 360px; } }

.detail-thumbs{ display:grid; grid-template-columns: repeat(6, 1fr); gap:8px; }
.detail-thumb{
  width:100%; height:72px; object-fit:cover; border-radius:10px;
  border:2px solid transparent; cursor:pointer; background:#f6f7f8;
}
.detail-thumb.is-active{ border-color:#2563eb; }

.detail-info{ display:flex; flex-direction:column; gap:14px; }
.detail-title{ font-size:28px; line-height:1.2; font-weight:800; margin:0 0 4px; }
@media (min-width: 640px){ .detail-title{ font-size:32px; } }
.detail-price{ font-size:24px; font-weight:800; }
.detail-meta{ margin:6px 0; padding:0; list-style:none; display:grid; gap:8px; }
.detail-meta li{ color:#111; }
.detail-meta li span{ display:inline-block; min-width:88px; color:var(--muted); }

.detail-desc h3{ font-size:16px; font-weight:800; margin:6px 0; }
.detail-desc p{ line-height:1.7; }

.detail-actions{ display:flex; gap:10px; align-items:center; margin-top:6px; }

/* 하트 좋아요 버튼 */
.like-btn{
  display:inline-flex; align-items:center; gap:8px;
  border:1px solid #dbe2ea; background:#fff; padding:10px 14px;
  border-radius:999px; font-weight:700;
  box-shadow:0 2px 8px rgba(0,0,0,.04);
}
.like-btn svg path{ fill:#9aa4b2; transition:fill .15s ease; }
.like-btn em{ font-style:normal; color:#6b7280; }
.like-btn:hover svg path{ fill:#ef4444; }
.like-btn.liked{ border-color:#fecaca; background:#fff1f2; }
.like-btn.liked svg path{ fill:#ef4444; }

/* 공통 버튼 */
.btn{ padding:10px 16px; border-radius:10px; border:1px solid var(--border); }
.btn-ghost{ background:#fff; }
.btn-danger{ background:#fee2e2; border-color:#fecaca; }
.btn-danger:hover{ background:#fecaca; }

.badge-auction {
  background:#fef3c7;
  color:#b45309;
  border:1px solid #fcd34d;
}

/* ===== See All (모바일 CTA) ===== */
.see-all { margin-top: 16px; text-align: center; }

.see-all a{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  /* 버튼 형태 */
  background: var(--primary);
  color: #fff;
  border: 1px solid var(--primary);
  border-radius: 999px;
  font-weight: 800;
  text-decoration: none;

  /* 터치 타겟 & 시각 강조 */
  padding: 12px 16px;
  box-shadow: 0 8px 20px rgba(11,102,255,.25);
  transition: transform .08s ease, box-shadow .12s ease, background .12s ease;
}

/* 화살표 아이콘 느낌 */
.see-all a::after{
  content: "›";
  font-size: 18px;
  line-height: 1;
  transform: translateY(1px);
}

/* Hover/Active */
.see-all a:hover{
  background: var(--primary-dk);
  border-color: var(--primary-dk);
  text-decoration: none;
}
.see-all a:active{
  transform: translateY(1px);
  box-shadow: 0 6px 14px rgba(11,102,255,.22);
}

/* 모바일에서 더 크게 & 풀폭 느낌 */
@media (max-width: 899px){
  .see-all a{
    width: 100%;
    max-width: 520px;
    padding: 14px 18px;
    font-size: 16px;
  }
}

/* 데스크톱에선 살짝 단정하게 */
@media (min-width: 900px){
  .see-all a{
    padding: 10px 14px;
    font-weight: 700;
    box-shadow: 0 6px 16px rgba(11,102,255,.18);
  }
}
