/* ─────────────────────────────────────────
   common.css  —  전체 공통 스타일
   모든 페이지에서 공유하는 변수/컴포넌트
───────────────────────────────────────── */

/* ── CSS 변수 ── */
:root {
  --black:       #111111;
  --white:       #ffffff;
  --gold:        #c9a84c;
  --gold-light:  #e8c96a;
  --gold-bg:     #fdf9f0;
  --grey-bg:     #f7f5f0;
  --grey-line:   #e8e5de;
  --grey-mid:    #999999;
  --grey-dark:   #444444;
  --red:         #c0392b;
  --font:        'Noto Sans KR', sans-serif;
  --max-width:   1280px;
  --header-h:    106px; /* 공지바 38 + 헤더 68 */
}

/* ── 리셋 ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--white);
  color: var(--black);
  font-size: 14px;
  line-height: 1.5;
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: var(--font); }
img { display: block; max-width: 100%; }
input, select, textarea {
  font-family: var(--font);
  font-size: 14px;
  outline: none;
}
ul, ol { list-style: none; }

/* ── 공지 바 ── */
.announce-bar {
  background: var(--black);
  color: var(--gold);
  text-align: center;
  font-size: 12px;
  padding: 10px 20px;
  letter-spacing: 0.4px;
}
.announce-bar strong { color: var(--white); }

/* ── 헤더 ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 900;
  background: var(--white);
  border-bottom: 1px solid var(--grey-line);
}
.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 32px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}
.site-logo {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 4px;
  color: var(--black);
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}
.logo-r { display: inline-block; transform: scaleX(-1); }
.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: var(--grey-dark);
}
.header-left a:hover { color: var(--gold); }
.header-right {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 13px;
  color: var(--grey-dark);
}
.header-right a:hover { color: var(--gold); }
.points-badge {
  background: var(--black);
  color: var(--gold);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 2px;
  white-space: nowrap;
}
.cart-wrap { position: relative; font-size: 18px; }
.cart-count {
  position: absolute;
  top: -6px; right: -8px;
  background: var(--gold);
  color: var(--black);
  font-size: 9px;
  font-weight: 900;
  width: 16px; height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
}
.hamburger span { display: block; width: 22px; height: 2px; background: var(--black); }

/* ── GNB 네비 ── */
.main-nav {
  background: var(--white);
  border-bottom: 1px solid var(--grey-line);
  position: sticky;
  top: 68px;
  z-index: 700;
}
.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.nav-inner::-webkit-scrollbar { display: none; }
.nav-link {
  padding: 14px 0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.2px;
  color: #333;
  white-space: nowrap;
  transition: color 0.2s;
  position: relative;
  flex: 1;
  text-align: center;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0; left: 10%; right: 10%;
  height: 2px;
  background: var(--gold);
  transform: scaleX(0);
  transition: transform 0.2s;
}
.nav-link:hover, .nav-link.active { color: var(--black); }
.nav-link:hover::after, .nav-link.active::after { transform: scaleX(1); }
.nav-link.hot { color: var(--red); font-weight: 700; }
.nav-link.hot::after { background: var(--red); }

/* ── 모바일 오버레이 네비 ── */
.mob-overlay {
  position: fixed;
  inset: 0;
  background: var(--black);
  z-index: 9999;
  transform: translateX(100%);
  transition: transform 0.35s ease;
  display: flex;
  flex-direction: column;
}
.mob-overlay.open { transform: translateX(0); }
.mob-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid rgba(255,255,255,0.09);
}
.mob-logo { font-size: 18px; font-weight: 900; letter-spacing: 3px; color: var(--white); }
.mob-logo span { color: var(--gold); }
.mob-close { font-size: 22px; color: var(--white); cursor: pointer; }

/* 로그인 상태 표시 */
.mob-user-info {
  padding: 14px 22px;
  background: rgba(255,255,255,0.04);
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.mob-user-info strong { color: var(--gold); font-size: 13px; }

.mob-links { overflow-y: auto; flex: 1; }
.mob-links li a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 22px;
  font-size: 14px;
  font-weight: 500;
  color: rgba(255,255,255,0.75);
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: color 0.2s;
}
.mob-links li a:hover { color: var(--gold); }
.mob-links li a.hot { color: #e55; }
.mob-foot {
  padding: 18px 22px;
  border-top: 1px solid rgba(255,255,255,0.07);
  display: flex;
  gap: 10px;
}
.mob-foot a {
  flex: 1;
  padding: 12px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.mob-btn-fill { background: var(--gold); color: var(--black) !important; }
.mob-btn-out  { color: var(--white) !important; border: 1.5px solid rgba(255,255,255,0.25); }

/* ── 페이지 래퍼 ── */
.page-wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 48px 32px;
}

/* ── 섹션 헤더 ── */
.sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 13px;
  border-bottom: 2px solid var(--black);
  margin-bottom: 22px;
}
.sec-title { font-size: 15px; font-weight: 800; color: var(--black); }
.sec-sub   { font-size: 12px; color: var(--grey-mid); font-weight: 400; margin-left: 8px; }
.sec-more  { font-size: 12px; color: var(--grey-mid); transition: color 0.2s; }
.sec-more:hover { color: var(--gold); }

/* ── 상품 카드 ── */
.prod-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
.prod-card { cursor: pointer; border-radius: 12px; overflow: hidden; }
.prod-img {
  aspect-ratio: 1;
  background: linear-gradient(90deg, #f0ede8 25%, #e8e5de 50%, #f0ede8 75%);
  background-size: 200% 100%;
  animation: skeleton-wave 1.4s ease infinite;
  position: relative;
  overflow: hidden;
  margin-bottom: 11px;
  border-radius: 12px;
}
.prod-img.loaded {
  background: #f5f5f3;
  animation: none;
}
.prod-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}
.prod-img img.img-loaded {
  opacity: 1;
}
.prod-img .prod-img-placeholder {
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 72px;
  transition: transform 0.4s;
}
.prod-card:hover .prod-img img,
.prod-card:hover .prod-img-placeholder { transform: scale(1.04); }
.prod-badge {
  position: absolute;
  top: 9px; left: 9px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
  padding: 3px 7px;
  pointer-events: none;
}
.b-new  { background: var(--black); color: var(--white); }
.b-best { background: var(--gold); color: var(--black); }
.b-hot  { background: var(--red); color: var(--white); }
.prod-wish {
  position: absolute;
  top: 9px; right: 9px;
  font-size: 18px;
  opacity: 0;
  transition: opacity 0.2s;
  cursor: pointer;
  background: rgba(255,255,255,0.85);
  border-radius: 50%;
  width: 32px; height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.prod-card:hover .prod-wish { opacity: 1; }
.prod-wish.on { opacity: 1; }
.prod-brand { font-size: 11px; font-weight: 700; color: var(--gold); letter-spacing: 0.8px; margin-bottom: 4px; text-transform: uppercase; }
.prod-name  { font-size: 13px; color: #222; line-height: 1.5; margin-bottom: 6px; }
.prod-price { font-size: 16px; font-weight: 800; color: var(--black); }
.prod-market { font-size: 11px; color: #bbb; margin-top: 2px; }

/* ── 더보기 버튼 ── */
.more-wrap { text-align: center; padding: 30px 0 0; }
.more-btn {
  display: inline-block;
  padding: 11px 48px;
  border: 1.5px solid #222;
  font-size: 13px;
  font-weight: 600;
  color: #222;
  letter-spacing: 0.3px;
  transition: all 0.2s;
  background: none;
  font-family: var(--font);
}
.more-btn:hover { background: var(--black); color: var(--white); border-color: var(--black); }

/* ── 버튼 공통 ── */
.btn-gold {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--gold);
  color: var(--black);
  font-size: 13px;
  font-weight: 700;
  padding: 12px 28px;
  letter-spacing: 0.3px;
  transition: background 0.2s;
  border: none;
  cursor: pointer;
  font-family: var(--font);
}
.btn-gold:hover { background: var(--gold-light); }
.btn-black {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--black);
  color: var(--white);
  font-size: 13px;
  font-weight: 700;
  padding: 12px 28px;
  letter-spacing: 0.3px;
  transition: background 0.2s;
  border: none;
  cursor: pointer;
  font-family: var(--font);
}
.btn-black:hover { background: #333; }
.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: transparent;
  color: var(--black);
  font-size: 13px;
  font-weight: 700;
  padding: 12px 28px;
  letter-spacing: 0.3px;
  border: 1.5px solid var(--black);
  transition: all 0.2s;
  cursor: pointer;
  font-family: var(--font);
}
.btn-outline:hover { background: var(--black); color: var(--white); }
.btn-full { width: 100%; }

/* ── 폼 인풋 ── */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--grey-dark);
  margin-bottom: 7px;
  letter-spacing: 0.3px;
}
.form-input {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--grey-line);
  font-size: 14px;
  color: var(--black);
  background: var(--white);
  transition: border-color 0.2s;
}
.form-input:focus { border-color: var(--gold); }
.form-input::placeholder { color: #bbb; }
.form-error {
  font-size: 11px;
  color: var(--red);
  margin-top: 5px;
}

/* ── 토스트 알림 ── */
.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--black);
  color: var(--white);
  padding: 12px 24px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 4px;
  opacity: 0;
  transition: all 0.3s;
  z-index: 9999;
  white-space: nowrap;
  pointer-events: none;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── 빈 상태 ── */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--grey-mid);
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 16px; }
.empty-state .empty-title { font-size: 16px; font-weight: 700; color: #555; margin-bottom: 8px; }
.empty-state .empty-desc  { font-size: 13px; margin-bottom: 24px; }

/* ── 로딩 스피너 ── */
.spinner-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 0;
}
.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--grey-line);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── 푸터 ── */
.site-footer { background: var(--black); padding: 44px 32px 28px; }
.footer-inner { max-width: var(--max-width); margin: 0 auto; }
.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 44px;
  padding-bottom: 36px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  margin-bottom: 24px;
}
.f-logo { font-size: 18px; font-weight: 900; letter-spacing: 4px; color: var(--white); margin-bottom: 13px; display: block; }
.f-logo span { color: var(--gold); }
.f-desc { font-size: 12px; line-height: 1.8; color: rgba(255,255,255,0.3); }
.f-col-title { font-size: 13px; font-weight: 700; color: var(--white); margin-bottom: 14px; }
.f-links { display: flex; flex-direction: column; gap: 8px; }
.f-links a { font-size: 12px; color: rgba(255,255,255,0.38); transition: color 0.2s; }
.f-links a:hover { color: var(--gold); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: rgba(255,255,255,0.18);
}
.f-gold { color: var(--gold); }

/* ── 플로팅 채팅 ── */
.float-btn-group{
  position:fixed;
  bottom:28px;right:24px;
  display:flex;flex-direction:column;
  align-items:center;gap:10px;
  z-index:800;
}
.float-kakao{
  width:52px;height:52px;
  background:#111;color:#FEE500;
  border-radius:50%;
  display:flex;align-items:center;justify-content:center;
  cursor:pointer;
  box-shadow:0 4px 16px rgba(0,0,0,0.18);
  transition:transform 0.2s,box-shadow 0.2s;
}
.float-kakao:hover{transform:scale(1.08);box-shadow:0 6px 20px rgba(0,0,0,0.22);}
.float-top{
  width:44px;height:44px;
  background:#fff;color:#333;
  border:1.5px solid #e8e5de;
  border-radius:50%;
  display:none;align-items:center;justify-content:center;
  cursor:pointer;
  box-shadow:0 2px 10px rgba(0,0,0,0.1);
  transition:all 0.2s;
  opacity:0;pointer-events:none;
}
.float-top.visible{opacity:1;pointer-events:all;}
.float-top:hover{background:#111;color:#fff;border-color:#111;}

/* ── 반응형 공통 ── */
@media (max-width: 1024px) {
  .prod-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-top { grid-template-columns: 1fr 1fr; gap: 28px; }
}
@media (max-width: 768px) {
  html, body { overflow-x: hidden !important; max-width: 100vw !important; }
  .site-header { width: 100% !important; max-width: 100vw !important; overflow: hidden !important; box-sizing: border-box !important; }
  .header-inner { width: 100% !important; max-width: 100vw !important; padding: 0 14px !important; box-sizing: border-box !important; }
  .main-nav { display: block; top: 68px; width: 100% !important; max-width: 100vw !important; overflow: hidden !important; box-sizing: border-box !important; }
  .nav-inner { padding: 0 4px !important; justify-content: flex-start; width: 100% !important; max-width: 100vw !important; box-sizing: border-box !important; }
  .nav-link { padding: 10px 8px !important; font-size: 12px !important; flex: 0 0 auto !important; text-align: left; }
  .hamburger { display: flex; }
  .site-logo { font-size: 18px; letter-spacing: 2px; }
  /* header-left: 각 페이지에서 제어 */
  .page-wrap { padding: 32px 18px; }
  .prod-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .site-footer { padding: 36px 18px 22px; }
  .footer-top { grid-template-columns: 1fr; gap: 24px; }
  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
  .float-btn-group{bottom:76px;right:14px;}
  .float-kakao{width:46px;height:46px;}
  .float-top{display:flex;}
}
@media (max-width: 480px) {
  .prod-grid { gap: 10px; }
  .prod-name { font-size: 12px; }
  .prod-price { font-size: 14px; }
}

/* ── 공통 JS 함수용 ── */
.hidden { display: none !important; }
.loading { pointer-events: none; opacity: 0.6; }
