/* ============================================================
   디자인 토큰 & 초기화
   ============================================================ */
:root {
  --primary: #FF5A3D;
  --primary-hover: #E84528;
  --primary-light: #FFF0ED;
  --accent-blue: #0074E9;
  --accent-blue-hover: #005FBF;
  --accent-blue-bg: #F0F6FF;

  --bg: #F8F9FA;
  --surface: #FFFFFF;
  --text-main: #191F28;
  --text-sub: #4E5968;
  --text-muted: #8B95A1;
  --border: #E5E8EB;
  --border-light: #F2F4F6;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.12);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg);
  color: var(--text-main);
  line-height: 1.6;
  word-break: keep-all;
}

/* ============================================================
   헤더 & 레이아웃
   ============================================================ */
header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
}

.header-inner {
  max-width: 768px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-logo {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

.header-tag {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}

.container {
  max-width: 768px;
  margin: 0 auto;
  padding: 20px 16px 80px;
}

/* 브레드크럼 (레시피 상세 페이지) */
.breadcrumb {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.breadcrumb a {
  color: var(--text-sub);
  text-decoration: none;
  font-weight: 600;
}

.breadcrumb span {
  margin: 0 4px;
}

/* ============================================================
   애드센스 슬롯 스타일
   ============================================================ */
.adsense-wrap {
  margin: 0 0 24px;
}

.ad-placeholder {
  background: #F2F4F6;
  border: 1px dashed #CBD0D6;
  border-radius: var(--radius-sm);
  padding: 18px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.82rem;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ============================================================
   히어로 및 재료 선택 카드
   ============================================================ */
.hero-section {
  text-align: center;
  margin-bottom: 24px;
  padding: 10px 0;
}

.hero-title {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.hero-desc {
  font-size: 0.95rem;
  color: var(--text-sub);
}

.selection-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 28px;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.card-step {
  background: var(--primary);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.card-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-main);
}

.chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-item {
  background: var(--border-light);
  border: 1px solid transparent;
  color: var(--text-sub);
  padding: 8px 15px;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.chip-item:hover {
  background: #EAECEF;
}

.chip-item.active {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 700;
  transform: translateY(-1px);
}

/* 재료 검색창 + 자동완성 */
.ingredient-search-wrap {
  position: relative;
  margin-bottom: 12px;
}

.ingredient-search-input {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--bg);
  color: var(--text-main);
}

.ingredient-search-input:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface);
}

.search-suggestions {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  z-index: 20;
  max-height: 260px;
  overflow-y: auto;
}

.search-suggestions.open {
  display: block;
}

.suggestion-item {
  padding: 10px 14px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
}

.suggestion-item:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.suggestion-empty {
  padding: 10px 14px;
  font-size: 0.85rem;
  color: var(--text-sub);
}

/* 선택한 재료 요약 줄 */
.selected-chips-row {
  margin-bottom: 14px;
}

.selected-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 6px;
}

.selected-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 6px 8px 6px 12px;
  border-radius: var(--radius-full);
}

.selected-chip-remove {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-size: 0.8rem;
  padding: 2px 4px;
  line-height: 1;
}

.selected-chip-remove:hover {
  opacity: 0.6;
}

.clear-all-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-sub);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: var(--radius-full);
  cursor: pointer;
}

.clear-all-btn:hover {
  background: var(--border-light);
}

/* 자주 쓰는 조합 프리셋 */
.preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 14px;
}

.preset-row-label {
  font-size: 0.82rem;
  color: var(--text-sub);
  font-weight: 600;
  margin-right: 2px;
}

.preset-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 7px 12px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: 0.15s;
}

.preset-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* 재료 카테고리 탭 */
.ingredient-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.ingredient-tab-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-sub);
  padding: 6px 4px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.ingredient-tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 800;
}

/* 필터 버튼 */
.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}

.filter-group .filter-btn {
  flex: 1 1 auto;
}

.filter-btn {
  background: var(--border-light);
  border: none;
  padding: 9px 4px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-sub);
  cursor: pointer;
  transition: 0.15s;
}

.filter-btn.active {
  background: var(--text-main);
  color: #FFFFFF;
}

.cta-search-btn {
  width: 100%;
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 15px;
  border-radius: var(--radius-md);
  font-size: 1.02rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(255, 90, 61, 0.25);
  transition: 0.2s;
}

.cta-search-btn:hover {
  background: var(--primary-hover);
}

/* ============================================================
   레시피 카드 그리드
   ============================================================ */
.result-header {
  margin-bottom: 14px;
}

.result-title {
  font-size: 1.05rem;
  font-weight: 700;
}

.recipe-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.recipe-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  transition: all 0.2s ease;
  position: relative;
}

.recipe-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.recipe-card-link {
  display: block;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.quick-view-btn {
  margin-top: 12px;
  width: 100%;
  background: var(--border-light);
  border: none;
  padding: 9px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-sub);
  cursor: pointer;
}

.quick-view-btn:hover {
  background: #EAECEF;
}

.card-top-badges {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}

.badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
}

.badge-time {
  background: var(--accent-blue-bg);
  color: var(--accent-blue);
}

.badge-match {
  background: var(--primary-light);
  color: var(--primary);
}

.recipe-name {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-main);
}

.recipe-summary {
  font-size: 0.88rem;
  color: var(--text-sub);
  margin-bottom: 12px;
}

.card-inventory-status {
  font-size: 0.82rem;
  padding: 8px 12px;
  background: var(--bg);
  border-radius: var(--radius-sm);
}

.status-missing {
  color: #DC2626;
  font-weight: 600;
}

.status-complete {
  color: #059669;
  font-weight: 700;
}

.badge-complete {
  background: #D1FAE5;
  color: #059669;
}

.badge-almost {
  background: #FFEDD5;
  color: #C2410C;
}

.selected-count-text {
  font-size: 0.8rem;
  color: var(--text-sub);
  margin: 8px 0 2px;
}

.selected-count-text b {
  color: var(--primary);
}

.match-filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.match-filter-group .filter-btn {
  flex: 1 1 auto;
}

.empty-state {
  text-align: center;
  padding: 32px 16px;
  background: var(--bg);
  border-radius: var(--radius-md);
  color: var(--text-sub);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* ============================================================
   모달 윈도우 (상세 레시피)
   ============================================================ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  z-index: 100;
  overflow-y: auto;
  padding: 16px;
  align-items: flex-start;
  justify-content: center;
}

.modal-overlay.open {
  display: flex;
}

.modal-window {
  background: var(--surface);
  width: 100%;
  max-width: 680px;
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  margin: 30px auto;
  position: relative;
  box-shadow: var(--shadow-lg);
}

.modal-close-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  background: var(--border-light);
  border: none;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-sub);
  cursor: pointer;
}

.modal-recipe-title {
  font-size: 1.45rem;
  font-weight: 800;
  margin-bottom: 8px;
  padding-right: 36px;
}

.modal-recipe-desc {
  font-size: 0.95rem;
  color: var(--text-sub);
  margin-bottom: 22px;
}

/* 재료 대조 및 쿠팡 구매 컴포넌트 */
.inventory-check-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-bottom: 24px;
}

.check-list-title {
  font-size: 0.92rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text-main);
}

.check-items {
  list-style: none;
  margin-bottom: 14px;
}

.check-items.plain-list {
  list-style: disc;
  padding-left: 20px;
  margin-bottom: 16px;
}

.check-items.plain-list li {
  padding: 3px 0;
  border-bottom: none;
}

.check-item-row {
  display: flex;
  justify-content: space-between;
  padding: 7px 0;
  font-size: 0.9rem;
  border-bottom: 1px dashed var(--border);
}

.check-item-row:last-child {
  border-bottom: none;
}

.tag-have {
  color: #059669;
  font-weight: 600;
}

.tag-need {
  color: #DC2626;
  font-weight: 700;
}

/* 쿠팡 파트너스 다이내믹 박스 */
.coupang-dynamic-card {
  background: var(--accent-blue-bg);
  border: 1px solid #BFDBFE;
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
  margin-top: 12px;
}

.coupang-dynamic-msg {
  font-size: 0.9rem;
  color: #1E3A8A;
  font-weight: 700;
  margin-bottom: 10px;
}

.coupang-dynamic-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent-blue);
  color: #FFFFFF;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 700;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  transition: background 0.15s ease;
}

.coupang-dynamic-btn:hover {
  background: var(--accent-blue-hover);
}

.affiliate-disclaimer {
  font-size: 0.73rem;
  color: var(--text-muted);
  margin-top: 10px;
  line-height: 1.4;
}

/* SEO 및 텍스트 볼륨 섹션 */
.content-block {
  margin-bottom: 24px;
}

.content-block-heading {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 10px;
  border-left: 4px solid var(--primary);
  padding-left: 10px;
  color: var(--text-main);
}

.content-block-text {
  font-size: 0.93rem;
  color: #374151;
  line-height: 1.7;
}

.recipe-steps-list {
  padding-left: 20px;
  font-size: 0.93rem;
  color: #374151;
}

.recipe-steps-list li {
  margin-bottom: 12px;
  line-height: 1.6;
}

.secret-tip-box {
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 0.88rem;
  color: #92400E;
  margin-top: 14px;
}

/* FAQ */
.faq-item {
  margin-bottom: 14px;
}

.faq-q {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.faq-a {
  font-size: 0.9rem;
  color: var(--text-sub);
}

.plain-list {
  list-style: disc;
  padding-left: 20px;
  font-size: 0.9rem;
  color: var(--text-sub);
}

.plain-list li {
  margin-bottom: 6px;
}

.plain-list a {
  color: var(--accent-blue);
  font-weight: 700;
  text-decoration: none;
}

/* ============================================================
   푸터 & E-E-A-T 정책
   ============================================================ */
footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 30px 20px;
  text-align: center;
}

.footer-content {
  max-width: 768px;
  margin: 0 auto;
}

.footer-links {
  margin-bottom: 10px;
}

.footer-links a {
  color: var(--text-sub);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
}

.footer-links .divider {
  color: var(--border);
  margin: 0 8px;
}

.footer-copy {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.footer-legal {
  font-size: 0.75rem;
  color: #9CA3AF;
}

/* 정책 모달 전용 */
.policy-window {
  max-width: 580px;
  line-height: 1.8;
  font-size: 0.92rem;
  color: var(--text-sub);
}
