/* ================================================================
   MY WEDDING STORY — 필수 비교 항목 공통 스타일
   css/compare-fields.css   v1.0  2026-05-07
   대상: 모든 카테고리 목록 카드 · 상세 인포바 · 패키지 카드 · 비교 블록
================================================================ */

/* ──────────────────────────────────────────────────────────────
   1. 공통 토큰 (이미 각 페이지 :root 에 있는 변수와 호환)
────────────────────────────────────────────────────────────── */
:root {
  /* 신뢰 배지 색상 */
  --badge-jungchal-bg:   #e8f9f8;
  --badge-jungchal-text: #0d9488;
  --badge-jungchal-bdr:  rgba(13,148,136,.25);
  --badge-cert-bg:       #fef3c7;
  --badge-cert-text:     #92400e;
  --badge-cert-bdr:      rgba(245,158,11,.25);
  --badge-new-bg:        #ede9fe;
  --badge-new-text:      #5b21b6;
  --badge-new-bdr:       rgba(91,33,182,.2);
  --badge-popular-bg:    #fef2f2;
  --badge-popular-text:  #991b1b;
  --badge-popular-bdr:   rgba(153,27,27,.2);
  --badge-outdoor-bg:    #f0fdf4;
  --badge-outdoor-text:  #166534;
  --badge-outdoor-bdr:   rgba(22,101,52,.2);
  --badge-escrow-bg:     #eff6ff;
  --badge-escrow-text:   #1e40af;
  --badge-escrow-bdr:    rgba(30,64,175,.2);
}

/* ──────────────────────────────────────────────────────────────
   2. 신뢰 배지 (trust badges) — .cf-badge
────────────────────────────────────────────────────────────── */
.cf-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
  border: 1px solid transparent;
  white-space: nowrap;
  flex-shrink: 0;
}
.cf-badge i { font-size: 10px; }

.cf-badge--jungchal {
  background: var(--badge-jungchal-bg);
  color:       var(--badge-jungchal-text);
  border-color:var(--badge-jungchal-bdr);
}
.cf-badge--cert {
  background: var(--badge-cert-bg);
  color:       var(--badge-cert-text);
  border-color:var(--badge-cert-bdr);
}
.cf-badge--new {
  background: var(--badge-new-bg);
  color:       var(--badge-new-text);
  border-color:var(--badge-new-bdr);
}
.cf-badge--popular {
  background: var(--badge-popular-bg);
  color:       var(--badge-popular-text);
  border-color:var(--badge-popular-bdr);
}
.cf-badge--outdoor {
  background: var(--badge-outdoor-bg);
  color:       var(--badge-outdoor-text);
  border-color:var(--badge-outdoor-bdr);
}
.cf-badge--escrow {
  background: var(--badge-escrow-bg);
  color:       var(--badge-escrow-text);
  border-color:var(--badge-escrow-bdr);
}

/* ──────────────────────────────────────────────────────────────
   3. 카드 필수 스펙 행 — .cf-specs
   목록 카드 하단 스펙 영역에 사용
────────────────────────────────────────────────────────────── */
.cf-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 12px;
  color: #4a5568;
}
.cf-spec-item {
  display: flex;
  align-items: center;
  gap: 4px;
}
.cf-spec-label {
  color: #8a94a6;
  font-size: 11px;
}
.cf-spec-value {
  font-weight: 600;
  color: #1a1c1e;
}
.cf-spec-value.incl  { color: #16a34a; }
.cf-spec-value.excl  { color: #dc2626; }
.cf-spec-value.range { color: #1a1c1e; }

/* 가격 행 전용 */
.cf-price-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}
.cf-price-range {
  font-size: 15px;
  font-weight: 700;
  color: #1a1c1e;
  letter-spacing: -.02em;
}
.cf-price-fixed {
  font-size: 16px;
  font-weight: 800;
  color: #1a1c1e;
  letter-spacing: -.02em;
}
.cf-price-unit {
  font-size: 12px;
  font-weight: 400;
  color: #8a94a6;
}
.cf-price-orig {
  font-size: 12px;
  color: #8a94a6;
  text-decoration: line-through;
}
.cf-price-disc {
  font-size: 11px;
  font-weight: 700;
  color: #dc2626;
  background: #fef2f2;
  padding: 2px 6px;
  border-radius: 9999px;
}

/* ──────────────────────────────────────────────────────────────
   4. 상세 페이지 — 요약 인포바 .cf-infobar
────────────────────────────────────────────────────────────── */
.cf-infobar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0;
  background: #fff;
  border: 1px solid #eaecef;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.cf-infobar-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 18px 12px;
  gap: 6px;
  border-right: 1px solid #eaecef;
  text-align: center;
  position: relative;
}
.cf-infobar-item:last-child { border-right: none; }
.cf-infobar-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: #f2fbfa;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}
.cf-infobar-label {
  font-size: 11px;
  color: #8a94a6;
  font-weight: 500;
}
.cf-infobar-value {
  font-size: 14px;
  font-weight: 700;
  color: #1a1c1e;
  line-height: 1.25;
}
.cf-infobar-value.accent { color: #3aa8a0; }
.cf-infobar-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
  margin-top: 2px;
}

/* 모바일 인포바 — 2열 그리드 */
@media (max-width: 767px) {
  .cf-infobar {
    grid-template-columns: 1fr 1fr;
    border-radius: 12px;
  }
  .cf-infobar-item:nth-child(even) { border-right: none; }
  .cf-infobar-item:nth-child(n+3) { border-top: 1px solid #eaecef; }
}

/* ──────────────────────────────────────────────────────────────
   5. 패키지 카드 — .cf-pkg-card
   상세 페이지 패키지 선택 영역
────────────────────────────────────────────────────────────── */
.cf-pkg-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 900px)  { .cf-pkg-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px)  { .cf-pkg-grid { grid-template-columns: 1fr; } }

.cf-pkg-card {
  border: 2px solid #eaecef;
  border-radius: 16px;
  padding: 24px 20px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  transition: border-color .22s, box-shadow .22s;
  cursor: pointer;
}
.cf-pkg-card:hover {
  border-color: #81D8D0;
  box-shadow: 0 4px 20px rgba(129,216,208,.18);
}
.cf-pkg-card.selected {
  border-color: #5ec4bb;
  box-shadow: 0 4px 20px rgba(94,196,187,.25);
  background: #f2fbfa;
}
.cf-pkg-card.recommended::before {
  content: '추천';
  position: absolute;
  top: -1px; right: 18px;
  background: linear-gradient(135deg, #81D8D0 0%, #5ec4bb 100%);
  color: #fff;
  font-size: 11px; font-weight: 800;
  padding: 3px 12px;
  border-radius: 0 0 10px 10px;
  letter-spacing: .04em;
}
.cf-pkg-name {
  font-size: 15px;
  font-weight: 800;
  color: #1a1c1e;
}
.cf-pkg-price {
  font-size: 22px;
  font-weight: 800;
  color: #1a1c1e;
  letter-spacing: -.02em;
}
.cf-pkg-price span {
  font-size: 14px;
  font-weight: 400;
  color: #8a94a6;
}

/* 패키지 필드 목록 — 수직 정렬 고정 */
.cf-pkg-fields {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12.5px;
}
.cf-pkg-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid #f0f0f0;
}
.cf-pkg-field:last-child { border-bottom: none; }
.cf-pkg-field-label {
  color: #8a94a6;
  font-weight: 500;
  flex-shrink: 0;
}
.cf-pkg-field-value {
  font-weight: 700;
  color: #1a1c1e;
  text-align: right;
}
.cf-pkg-field-value.incl { color: #16a34a; }
.cf-pkg-field-value.excl { color: #dc2626; }

/* ──────────────────────────────────────────────────────────────
   6. 비교 블록 — .cf-compare-table
   compare tray → modal 내부 테이블
────────────────────────────────────────────────────────────── */
.cf-compare-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.cf-compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 560px;
}
.cf-compare-table th,
.cf-compare-table td {
  padding: 11px 14px;
  border: 1px solid #eaecef;
  text-align: center;
  vertical-align: middle;
}
.cf-compare-table thead th {
  background: #f2fbfa;
  color: #3aa8a0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
}
/* 행 라벨 열 */
.cf-compare-table td:first-child {
  text-align: left;
  font-weight: 600;
  color: #4a5568;
  background: #fafafa;
  min-width: 110px;
  white-space: nowrap;
}
.cf-compare-table tr:hover td { background: #f8feff; }
.cf-compare-table tr:hover td:first-child { background: #f2f9f8; }

/* 포함/미포함 셀 */
.cf-cmp-incl { color: #16a34a; font-weight: 700; font-size: 15px; }
.cf-cmp-excl { color: #dc2626; font-weight: 700; font-size: 15px; }
.cf-cmp-best {
  background: #e8f9f8 !important;
  font-weight: 700;
  color: #0d9488;
}

/* 섹션 구분 행 */
.cf-compare-table .cf-cmp-section td {
  background: #f9fafb;
  font-size: 11px;
  font-weight: 700;
  color: #8a94a6;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 7px 14px;
  text-align: left;
  border-color: #eaecef;
}

/* ──────────────────────────────────────────────────────────────
   7. 포함/미포함 범용 표시 — .cf-yn
────────────────────────────────────────────────────────────── */
.cf-yn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 9999px;
}
.cf-yn.yes {
  background: #f0fdf4;
  color: #16a34a;
}
.cf-yn.no {
  background: #fef2f2;
  color: #dc2626;
}
.cf-yn i { font-size: 10px; }

/* ──────────────────────────────────────────────────────────────
   8. 카드 배지 행 — .cf-badge-row
   카드 상단 배지들을 가로로 배치
────────────────────────────────────────────────────────────── */
.cf-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

/* ──────────────────────────────────────────────────────────────
   9. 필터 슬라이더 공통 — .cf-range-slider
────────────────────────────────────────────────────────────── */
.cf-range-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cf-range-labels {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #4a5568;
  font-weight: 600;
}
.cf-range-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: #e8f9f8;
  outline: none;
  cursor: pointer;
}
.cf-range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #5ec4bb;
  border: 2px solid #fff;
  box-shadow: 0 1px 6px rgba(94,196,187,.4);
  cursor: pointer;
}
.cf-range-slider::-moz-range-thumb {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #5ec4bb;
  border: 2px solid #fff;
  box-shadow: 0 1px 6px rgba(94,196,187,.4);
  cursor: pointer;
}

/* ──────────────────────────────────────────────────────────────
   10. 빈/로딩 상태 공통 — .cf-empty / .cf-loading
────────────────────────────────────────────────────────────── */
.cf-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  text-align: center;
  color: #8a94a6;
}
.cf-empty-icon { font-size: 48px; margin-bottom: 14px; opacity: .7; }
.cf-empty-title { font-size: 16px; font-weight: 700; color: #4a5568; margin-bottom: 8px; }
.cf-empty-desc  { font-size: 13px; line-height: 1.65; }

.cf-loading {
  display: grid;
  gap: 16px;
}
.cf-skel {
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  border: 1px solid #eaecef;
}
.cf-skel-img {
  height: 220px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: cf-shimmer 1.4s infinite;
}
.cf-skel-body { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.cf-skel-line {
  height: 12px; border-radius: 6px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: cf-shimmer 1.4s infinite;
}
.cf-skel-line.w60 { width: 60%; }
.cf-skel-line.w80 { width: 80%; }
.cf-skel-line.w40 { width: 40%; }

@keyframes cf-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ──────────────────────────────────────────────────────────────
   11. 모바일 전용 비교 트레이 — .cf-m-tray
────────────────────────────────────────────────────────────── */
.cf-m-tray {
  position: fixed;
  bottom: 60px; /* 탭바 위 */
  left: 0; right: 0;
  background: #fff;
  border-top: 2px solid #81D8D0;
  box-shadow: 0 -4px 20px rgba(0,0,0,.12);
  padding: 10px 16px;
  z-index: 500;
  transform: translateY(100%);
  transition: transform .3s ease;
}
.cf-m-tray.show { transform: translateY(0); }
.cf-m-tray-inner {
  display: flex;
  align-items: center;
  gap: 10px;
}
.cf-m-tray-label {
  font-size: 12px;
  font-weight: 700;
  color: #1a1c1e;
  white-space: nowrap;
}
.cf-m-tray-slots {
  display: flex;
  gap: 6px;
  flex: 1;
  overflow-x: auto;
}
.cf-m-tray-slot {
  min-width: 72px;
  border: 1.5px dashed #dde1e7;
  border-radius: 10px;
  padding: 6px 8px;
  font-size: 11px;
  color: #8a94a6;
  text-align: center;
  background: #fafafa;
  flex-shrink: 0;
}
.cf-m-tray-slot.filled {
  border-style: solid;
  border-color: #5ec4bb;
  background: #f2fbfa;
  color: #0d9488;
  font-weight: 600;
}
.cf-m-tray-go {
  background: #1a1c1e;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 9px 14px;
  border-radius: 10px;
  white-space: nowrap;
  flex-shrink: 0;
}
.cf-m-tray-go:disabled { opacity: .35; cursor: not-allowed; }
