/* ============================================================
   사이트 전체 테마 (구 home.css) — 모든 소비자 페이지에서 로드됨.
   main.css의 기존 클래스는 그대로 두고 새 토큰/클래스(--home-*, .home-*, .hb-*)로
   덮어쓰는 방식. .home-* 컴포넌트 클래스는 홈페이지 마크업에서만 실제로 쓰이고
   다른 페이지에선 매칭되는 요소가 없어 영향 없음(죽은 CSS, 안전).
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Gowun+Batang:wght@400;700&display=swap');

:root {
  /* 지정된 3색 팔레트: 메인 / 세컨 / 써드 */
  --home-cream:       #FEFCFA; /* 메인 */
  --home-sage:        #88936D; /* 세컨 */
  --home-forest-deep: #1A3423; /* 써드 */

  --home-cream-deep:  #F4F2E9;
  --home-ink:         #1A3423;
  --home-forest:      #4C6B44; /* 세컨-써드 사이 중간 톤 (호버용) */
  --home-line:        #E7E3D6;
  --home-serif:       'Gowun Batang', 'Noto Serif KR', serif;
}

body { background: var(--home-cream); }

.home-wrap { color: var(--home-ink); }

/* ============================================================
   헤더 / GNB / 푸터 — 이제 전체 페이지 공통.
   ============================================================ */
.site-header {
  background: var(--home-cream);
  border-bottom: 1px solid var(--home-line);
}
.header-inner { height: 116px; gap: 40px; }

.site-logo img { height: 68px; }

.header-search-trigger {
  background: #fff; border-color: var(--home-line);
  border-radius: 2px; padding: 10px 18px;
}
.header-search-trigger:hover { border-color: var(--home-forest); background: #fff; }
.header-search-trigger i { color: var(--home-forest-deep); }

.header-actions { gap: 26px; }
.header-actions a { color: var(--home-ink); }
.header-actions a:hover { color: var(--home-forest); }
.header-actions .icon-label {
  font-size: 10px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase;
  margin-top: 1px;
}
.cart-badge .count { background: var(--home-sage); }

.gnb {
  background: var(--home-cream);
  border-bottom: 1px solid var(--home-line);
  position: relative;
}
.gnb-inner { justify-content: center; align-items: center; gap: 8px; position: relative; }
.gnb-links { display: flex; align-items: center; gap: 8px; min-width: 0; }
.gnb a {
  color: #6b6f63 !important; font-size: 12.5px; font-weight: 600;
  letter-spacing: 1.2px; text-transform: uppercase;
  padding: 16px 18px !important;
  border-bottom: 2px solid transparent;
  transition: color .18s, border-color .18s;
}
.gnb a:hover, .gnb a.active {
  color: var(--home-forest-deep) !important;
  background: transparent !important;
  border-bottom-color: var(--home-sage);
}

/* ── 전체 카테고리 버튼 ("전체 상품" 바로 왼쪽) ── */
.gnb-all-wrap { position: relative; flex-shrink: 0; }
.gnb-all-btn {
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 4px;
  background: none; border: 1px solid var(--home-line); cursor: pointer;
  color: var(--home-forest-deep); font-size: 15px;
  transition: background .15s, border-color .15s;
}
.gnb-all-btn:hover { background: var(--home-cream-deep); border-color: var(--home-forest); }
.gnb-all-btn.open { background: var(--home-forest-deep); border-color: var(--home-forest-deep); color: #fff; }
.gnb-all-btn i { display: inline-block; transition: transform .3s cubic-bezier(.34,1.56,.64,1); }
.gnb-all-btn.open i { transform: rotate(90deg); }

/* ── 전체 카테고리 메가메뉴 (버튼 위치에 맞춰 드롭다운) ── */
.category-mega-menu {
  display: none; position: absolute; top: calc(100% + 12px); left: 0;
  background: #fff; border: 1px solid var(--home-line); border-radius: 10px;
  box-shadow: 0 16px 32px rgba(26,52,35,.14);
  z-index: 220; width: max-content; max-width: calc(100vw - 40px);
}
.category-mega-menu.open { display: block; }
.category-mega-inner {
  display: grid; grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 28px; padding: 24px 28px;
}
.category-mega-group { min-width: 0; }
.category-mega-title {
  display: block; font-size: 14px; font-weight: 700; color: var(--home-forest-deep);
  margin-bottom: 12px; padding-bottom: 8px; border-bottom: 2px solid var(--home-sage);
}
.category-mega-sublist { list-style: none; margin: 0; padding: 0; }
.category-mega-sublist li { margin-bottom: 8px; }
.category-mega-sublist a {
  font-size: 13px; color: #6b6f63; transition: color .15s;
}
.category-mega-sublist a:hover { color: var(--home-forest-deep); }

.category-mega-backdrop {
  display: none; position: fixed; inset: 0; z-index: 210;
  background: rgba(26,52,35,.25);
}
.category-mega-backdrop.open { display: block; }

@media (max-width: 768px) {
  .header-inner { height: 84px; }
  .site-logo img { height: 48px; }

  /* 모바일: 검색창 전체 대신 돋보기 아이콘만 */
  .header-search-trigger {
    flex: 0 0 auto; max-width: none; width: 40px; height: 40px;
    padding: 0; justify-content: center; border: none; background: none;
  }
  .header-search-trigger span { display: none; }
  .header-search-trigger i { font-size: 19px; }

  .category-mega-menu { max-width: calc(100vw - 24px); }
  .category-mega-inner { grid-template-columns: repeat(2, minmax(120px, 1fr)); gap: 20px; padding: 20px; }

  /* main.css가 .gnb-inner에 건 overflow-x:auto는 overflow-y도 auto로 만들어서
     버튼 아래로 펼쳐지는 category-mega-menu 드롭다운을 잘라버림 —
     스크롤은 .gnb-links로 옮기고 .gnb-inner 자체는 클리핑 없앰. */
  .gnb-inner { overflow-x: visible; flex-wrap: nowrap; justify-content: flex-start; }
  .gnb-links { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .gnb-links::-webkit-scrollbar { display: none; }
}

/* ── 푸터 ── */
.site-footer {
  background: var(--home-forest-deep);
  padding: 64px 20px 36px;
  margin-top: 0;
}
.footer-brand {
  margin-bottom: 28px;
}
.footer-brand img { height: 44px; width: auto; display: block; }
.footer-links {
  gap: 28px; margin-bottom: 28px; padding-bottom: 28px;
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.footer-links a {
  font-size: 11.5px; font-weight: 600; letter-spacing: 1px;
  text-transform: uppercase; color: rgba(255,255,255,.55) !important;
}
.footer-links a:hover { color: var(--home-sage) !important; }
.footer-biz-info { color: rgba(255,255,255,.4) !important; line-height: 1.9; }
.footer-inner > div:last-child {
  color: rgba(255,255,255,.35); margin-top: 6px;
  font-size: 11px; letter-spacing: .4px;
}

.home-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 600; letter-spacing: 2.5px;
  text-transform: uppercase; color: var(--home-sage);
}
.home-eyebrow::before {
  content: ''; width: 22px; height: 1px; background: var(--home-sage);
}

.home-section { padding: 88px 0; }
.home-section + .home-section { border-top: 1px solid var(--home-line); }

.home-section-head { margin-bottom: 44px; }
.home-section-head .home-eyebrow { margin-bottom: 14px; }
.home-section-title {
  font-family: var(--home-serif);
  font-size: 34px; font-weight: 700; letter-spacing: -0.5px;
  color: var(--home-forest-deep); line-height: 1.3;
}
.home-section-desc {
  font-size: 14px; color: #6b6f63; margin-top: 8px; line-height: 1.7;
}
.home-section-link {
  font-size: 13px; font-weight: 600; color: var(--home-forest);
  display: inline-flex; align-items: center; gap: 5px;
  transition: gap .18s;
}
.home-section-link:hover { gap: 9px; color: var(--home-forest-deep); }

/* ── 히어로 배너 (캐러셀 오버레이 타이포) ── */
.home-wrap .banner-slide { max-height: 620px !important; }
.home-wrap .banner-slide img { height: 620px !important; }
.hb-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(100deg, rgba(26,52,35,.72) 0%, rgba(26,52,35,.34) 46%, rgba(26,52,35,.05) 75%);
}
.hb-content {
  position: absolute; top: 50%; left: 0; transform: translateY(-50%);
  padding: 0 min(9vw, 110px); color: #fff; max-width: 640px;
}
.hb-eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 12px; font-weight: 600; letter-spacing: 3px;
  text-transform: uppercase; color: var(--home-sage);
  margin-bottom: 20px;
}
.hb-eyebrow::before { content: ''; width: 26px; height: 1px; background: var(--home-sage); }
.hb-title {
  font-family: var(--home-serif);
  font-size: 46px; font-weight: 700; line-height: 1.28;
  margin-bottom: 18px; letter-spacing: -0.5px;
  text-shadow: 0 2px 16px rgba(0,0,0,.25);
}
.hb-desc {
  font-size: 16px; line-height: 1.75; color: rgba(255,255,255,.86);
  margin-bottom: 32px; max-width: 460px; font-weight: 300;
}
.hb-btn {
  display: inline-flex; align-items: center; gap: 10px;
  background: transparent; color: #fff;
  border: 1px solid rgba(255,255,255,.7);
  padding: 14px 30px; font-size: 13px; font-weight: 600;
  letter-spacing: 1.5px; text-transform: uppercase;
  transition: background .25s, color .25s, border-color .25s;
}
.hb-btn:hover { background: #fff; color: var(--home-forest-deep); border-color: #fff; }

.home-wrap .carousel-indicators { margin-bottom: 22px; }
.home-wrap .carousel-indicators [data-bs-target] {
  width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.55);
  border: none; margin: 0 4px;
}
.home-wrap .carousel-indicators .active { background: #fff; }

/* 배너 없을 때 폴백 히어로 */
.home-hero-fallback {
  background:
    radial-gradient(circle at 15% 20%, rgba(136,147,109,.22), transparent 45%),
    linear-gradient(135deg, var(--home-forest-deep) 0%, var(--home-forest) 100%);
  color: #fff; padding: 140px 20px; text-align: center;
}
.home-hero-fallback .hb-eyebrow { justify-content: center; }
.home-hero-fallback .hb-eyebrow::before { display: none; }
.home-hero-fallback h1 {
  font-family: var(--home-serif); font-size: 48px; font-weight: 700;
  margin: 18px 0 16px; letter-spacing: -0.5px; line-height: 1.3;
}
.home-hero-fallback p { font-size: 16px; color: rgba(255,255,255,.78); margin-bottom: 36px; font-weight: 300; }

/* ── 카테고리 ── */
.home-cat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 4px;
}
.home-cat-card {
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  padding: 32px 12px; text-decoration: none; color: var(--home-ink);
  border-right: 1px solid var(--home-line);
  transition: background .2s;
}
.home-cat-card:last-child { border-right: none; }
.home-cat-card:hover { background: var(--home-cream-deep); }
.home-cat-img {
  width: 92px; height: 92px; border-radius: 50%; overflow: hidden;
  background: #fff; border: 1px solid var(--home-line);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; color: var(--home-forest);
  transition: transform .25s, box-shadow .25s;
}
.home-cat-card:hover .home-cat-img { transform: translateY(-4px); box-shadow: 0 10px 24px rgba(26,52,35,.12); }
.home-cat-img img { width: 100%; height: 100%; object-fit: cover; }
.home-cat-name { font-size: 13px; font-weight: 600; letter-spacing: .3px; }

/* ── 태그 ── */
.home-tag-list { display: flex; flex-wrap: wrap; gap: 10px; }
.home-tag-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px; border-radius: 40px;
  border: 1px solid var(--home-line); background: #fff;
  font-size: 13px; color: #4a4f43; text-decoration: none;
  transition: all .18s;
}
.home-tag-chip:hover { background: var(--home-forest-deep); border-color: var(--home-forest-deep); color: #fff; }
.home-tag-count {
  font-size: 11px; font-weight: 700; color: var(--home-sage);
  transition: color .18s;
}
.home-tag-chip:hover .home-tag-count { color: rgba(255,255,255,.7); }

/* ── 상품 그리드 ── */
.home-product-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px 24px;
}
@media (max-width: 1000px) { .home-product-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 680px)  { .home-product-grid { grid-template-columns: repeat(2, 1fr); gap: 24px 14px; } }

.home-product-wrap { position: relative; }
.home-product-card { display: block; text-decoration: none; color: inherit; }
.home-product-img {
  aspect-ratio: 4/5; background: var(--home-cream-deep); position: relative;
  overflow: hidden; margin-bottom: 16px;
}
.home-product-img img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .5s cubic-bezier(.2,.8,.2,1);
}
.home-product-card:hover .home-product-img img { transform: scale(1.06); }
.home-product-img .no-img { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; color: #c9cabf; font-size: 36px; }
.home-soldout-badge {
  position: absolute; inset: 0; background: rgba(26,52,35,.45); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; letter-spacing: 2px;
}
.home-product-partner { font-size: 11px; color: var(--home-sage); font-weight: 600; letter-spacing: .3px; margin-bottom: 4px; }
.home-product-name {
  font-size: 14.5px; font-weight: 500; color: var(--home-ink); margin-bottom: 8px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.home-product-price { font-size: 15px; font-weight: 700; color: var(--home-forest-deep); }
.home-price-original { font-size: 12px; color: #b3b0a2; text-decoration: line-through; margin-right: 5px; font-weight: 400; }
.home-discount-badge {
  display: inline-block; background: var(--home-forest-deep); color: #fff;
  font-size: 10px; font-weight: 700; border-radius: 3px;
  padding: 1px 6px; vertical-align: middle; margin-left: 5px;
}

.home-hover-actions {
  position: absolute; top: 12px; right: 12px; left: 12px;
  display: flex; justify-content: flex-end; gap: 8px;
  opacity: 0; transform: translateY(-4px);
  transition: opacity .2s, transform .2s;
}
.home-product-wrap:hover .home-hover-actions { opacity: 1; transform: translateY(0); }
.home-like-btn {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: rgba(255,255,255,.92); backdrop-filter: blur(4px);
  border: none; color: var(--home-ink); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; transition: background .15s, color .15s;
}
.home-like-btn:hover { background: #fff; }
.home-like-btn.liked { color: #C0392B; }
.home-cart-btn {
  height: 34px; padding: 0 16px; border-radius: 40px;
  background: var(--home-forest-deep); color: #fff; border: none;
  font-size: 12px; font-weight: 600; cursor: pointer;
  display: flex; align-items: center; gap: 6px; white-space: nowrap;
  transition: background .15s;
}
.home-cart-btn:hover { background: #000; }
.home-cart-btn.added { background: var(--home-forest); }

@media (max-width: 768px) {
  .home-section { padding: 56px 0; }
  .home-section-title { font-size: 24px; }
  .home-wrap .banner-slide, .home-wrap .banner-slide img { height: 360px !important; }
  .hb-content { padding: 0 28px; }
  .hb-title { font-size: 26px; }
  .hb-desc { font-size: 13px; margin-bottom: 20px; }
  .hb-btn { padding: 11px 22px; font-size: 12px; }
  .home-hero-fallback { padding: 80px 20px; }
  .home-hero-fallback h1 { font-size: 30px; }
  .home-cat-grid { grid-template-columns: repeat(3, 1fr); }
  .home-cat-card { padding: 20px 8px; border-right: none; }
  .home-cat-img { width: 68px; height: 68px; }
}
