/* ============================================================
   사이트 전체 테마 (구 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색 팔레트: 메인 / 세컨 / 써드 (본문 영역 — 밝은 쇼핑 UI용) */
  --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;

  /* 명함 무드 팔레트 — 실제 명함 이미지에서 픽셀 샘플링한 값.
     다크 배경(히어로/푸터)에는 --brand-gold 원색을, 크림 배경 위 텍스트/포인트에는
     대비가 확보되는 --brand-gold-ink(어둡힌 브론즈 톤)를 쓴다. */
  --brand-void:   #081108; /* 명함 배경 딥그린블랙 — 히어로/푸터 전용 */
  --brand-gold:   #BC9F76; /* 명함 골드 — 다크 배경 위 텍스트/보더 */
  --brand-gold-soft: rgba(188,159,118,.55);
  --brand-gold-ink: #93764B; /* 골드를 크림 배경 위에서도 읽히게 어둡힌 버전 — 가격/링크/포인트용 */
  --brand-cream:  #EEEADF; /* 명함 RUBAN 워드마크 크림 */
}

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 a.active { color: var(--brand-gold-ink); }
.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 transparent; cursor: pointer;
  color: var(--home-forest-deep); font-size: 15px;
  transition: background .15s;
}
.gnb-all-btn:hover { background: var(--home-cream-deep); }
.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:
    radial-gradient(ellipse 65% 75% at 15% 0%, rgba(188,159,118,.18), transparent 60%),
    var(--home-forest);
  border-top: 1px solid var(--brand-gold-soft);
  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 var(--brand-gold-soft);
}
.footer-links a {
  font-size: 11.5px; font-weight: 600; letter-spacing: 1px;
  text-transform: uppercase; color: rgba(238,234,223,.78) !important;
}
.footer-links a:hover { color: var(--brand-gold) !important; }
.footer-biz-info { color: rgba(238,234,223,.6) !important; line-height: 1.9; }
.footer-inner > div:last-child {
  color: rgba(238,234,223,.5); 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(--brand-gold-ink);
}
.home-eyebrow::before {
  content: ''; width: 22px; height: 1px; background: var(--brand-gold-ink);
}

.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(--brand-gold-ink);
  display: inline-flex; align-items: center; gap: 5px;
  transition: gap .18s, color .18s;
}
.home-section-link:hover { gap: 9px; color: var(--home-forest-deep); }

/* ── 이달의 리뷰 ── */
.home-review-of-month { background: var(--home-cream-deep); }
.home-rom-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
}
.home-rom-card {
  display: block; background: #fff; border: 1px solid var(--home-line);
  border-radius: 14px; padding: 20px; text-decoration: none; color: inherit;
  transition: transform .18s, box-shadow .18s;
}
.home-rom-card:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(26,52,35,.1); }
.home-rom-card-top { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.home-rom-thumb {
  width: 48px; height: 48px; border-radius: 10px; background: var(--home-cream);
  overflow: hidden; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
}
.home-rom-thumb img { width: 100%; height: 100%; object-fit: cover; }
.home-rom-thumb .no-img { color: #ccc; font-size: 18px; }
.home-rom-badge {
  display: inline-flex; align-items: center; font-size: 11px; font-weight: 700;
  color: #fff; background: var(--brand-gold-ink); border-radius: 20px; padding: 2px 10px; margin-bottom: 4px;
}
.home-rom-product { font-size: 12px; color: #888; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-rom-stars { color: #f5a623; font-size: 13px; margin-bottom: 6px; }
.home-rom-content { font-size: 13px; line-height: 1.6; color: #444; margin: 0 0 14px; min-height: 42px; }
.home-rom-foot {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; color: #999; padding-top: 12px; border-top: 1px solid var(--home-line);
}
.home-rom-reward { font-weight: 700; color: var(--brand-gold-ink); }

@media (max-width: 900px) {
  .home-rom-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .home-rom-grid { grid-template-columns: 1fr; }
}

/* ── 히어로 배너 (캐러셀 오버레이 타이포) ── */
.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(8,17,8,.78) 0%, rgba(8,17,8,.38) 46%, rgba(8,17,8,.06) 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(--brand-gold);
  margin-bottom: 20px;
}
.hb-eyebrow::before { content: ''; width: 26px; height: 1px; background: var(--brand-gold); }
.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 var(--brand-gold-soft);
  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: var(--brand-gold); color: var(--brand-void); border-color: var(--brand-gold); }

.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: var(--brand-gold); }

/* 배너 없을 때 폴백 히어로 — 명함 무드(딥그린블랙 + 골드 + 크림) */
.home-hero-fallback {
  position: relative; overflow: hidden;
  background:
    radial-gradient(ellipse 60% 50% at 50% 0%, rgba(188,159,118,.16), transparent 60%),
    radial-gradient(circle at 82% 78%, rgba(136,147,109,.14), transparent 50%),
    linear-gradient(160deg, var(--home-forest-deep) 0%, var(--brand-void) 78%);
  color: #fff; padding: 128px 20px 108px; text-align: center;
}
.home-hero-fallback::before {
  /* 명함 속 나뭇잎 사이로 비치는 빛줄기 느낌 */
  content: '';
  position: absolute; top: -20%; left: 50%; width: 140%; height: 140%;
  transform: translateX(-50%) rotate(8deg);
  background: repeating-linear-gradient(
    100deg,
    rgba(255,255,255,.05) 0px, rgba(255,255,255,.05) 1px,
    transparent 1px, transparent 90px
  );
  mask-image: radial-gradient(ellipse 55% 45% at 50% 10%, #000 0%, transparent 68%);
  -webkit-mask-image: radial-gradient(ellipse 55% 45% at 50% 10%, #000 0%, transparent 68%);
  pointer-events: none;
}
.home-hero-fallback > * { position: relative; z-index: 1; }
.home-hero-fallback .hero-mark {
  height: 84px; width: auto; margin: 0 auto 20px; display: block; opacity: .96;
}
.hero-subtitle {
  font-size: 11px; font-weight: 600; letter-spacing: 4px;
  text-transform: uppercase; color: var(--brand-gold-soft);
  margin-bottom: 28px;
}
.hero-divider {
  width: 46px; height: 1px; margin: 0 auto 26px;
  background: linear-gradient(90deg, transparent, var(--brand-gold), transparent);
}
.hero-kr-tagline {
  font-family: var(--home-serif); font-size: 22px; font-weight: 700;
  color: var(--brand-cream); letter-spacing: -.2px; margin-bottom: 18px; line-height: 1.5;
}
.home-hero-fallback p { font-size: 15px; color: rgba(255,255,255,.72); margin-bottom: 36px; font-weight: 300; }
.home-hero-fallback .hb-btn { border-color: var(--brand-gold-soft); }
.home-hero-fallback .hb-btn:hover { background: var(--brand-gold); color: var(--brand-void); border-color: var(--brand-gold); }

/* ── 카테고리 ── */
.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(--brand-gold-ink); border-color: var(--brand-gold-ink); color: #fff; }
.home-tag-count {
  font-size: 11px; font-weight: 700; color: var(--brand-gold-ink);
  transition: color .18s;
}
.home-tag-chip:hover .home-tag-count { color: rgba(255,255,255,.8); }

/* ── 상품 그리드 ── */
.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(--brand-gold-ink); 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(--brand-gold-ink); }
.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(--brand-gold-ink); 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: 76px 20px 64px; }
  .home-hero-fallback .hero-mark { height: 46px; margin-bottom: 14px; }
  .hero-subtitle { letter-spacing: 3px; margin-bottom: 20px; }
  .hero-kr-tagline { font-size: 17px; }
  .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; }
}

/* ============================================================
   상품 목록(products/index.php) / 상품 상세(products/view.php) —
   메인 페이지와 같은 명함 톤(크림 유지 + 골드 포인트)을 적용.
   .products-list-page / .product-detail로 스코프해서 store(파트너 스토어),
   마이페이지·주문·체크아웃 등 같은 클래스(.discount-badge, .price-original 등)를
   공유하는 다른 페이지에는 영향 없음.
   ============================================================ */
.products-list-page .product-card-partner,
.product-detail-partner { color: var(--brand-gold-ink); }

.products-list-page .product-card-price,
.products-list-page .price-sale { color: var(--brand-gold-ink); }

.products-list-page .discount-badge,
.product-detail .discount-badge {
  background: var(--brand-gold-ink); color: #fff;
}

.products-list-page .cat-chip:hover,
.products-list-page .cat-chip.active {
  background: var(--brand-gold-ink); border-color: var(--brand-gold-ink); color: #fff;
}

.product-detail .product-detail-price { color: var(--brand-gold-ink); }

.product-detail .product-tag-chip {
  background: #FBF8F2; border-color: var(--brand-gold-soft); color: var(--brand-gold-ink);
}
.product-detail .product-tag-chip:hover {
  background: var(--brand-gold-ink); border-color: var(--brand-gold-ink); color: #fff;
}

.product-detail .pdp-tab:hover { color: var(--brand-gold-ink); }
.product-detail .pdp-tab.active { color: var(--brand-gold-ink); border-bottom-color: var(--brand-gold-ink); }
.product-detail .pdp-tab-count { background: var(--brand-gold-ink); }

/* ============================================================
   마이페이지 / 주문·체크아웃 / 장바구니 — 같은 골드 포인트 확장.
   .mypage-nav, .page-link-item, .cart-total, .cart-item-price는
   mypage/*, orders/guest_lookup.php, coupons/claim.php, cart/index.php,
   products·store·likes 목록에서만 쓰이는 클래스라(관리자/파트너 페이지 미사용)
   스코프 없이 직접 override해도 안전함.
   상태 배지(.badge-order 계열: 대기/결제완료/배송중 등)는 의미를 담은 시맨틱 컬러라
   그대로 둠 — 골드로 바꾸면 상태 구분이 사라짐.
   ============================================================ */
.mypage-nav a:hover, .mypage-nav a.active { color: var(--brand-gold-ink); background: #FBF7EF; }
.page-link-item:hover { border-color: var(--brand-gold-ink); color: var(--brand-gold-ink); }
.page-link-item.active { background: var(--brand-gold-ink); border-color: var(--brand-gold-ink); color: #fff; }
.cart-total, .cart-item-price { color: var(--brand-gold-ink); }
