/* MateGift 추천 페이지 — 사용자용 (라이트 테마, 모바일 우선) */

:root {
  --bg: #ffffff;
  --bg-soft: #f8f9fb;
  --bg-muted: #f1f3f7;
  --surface: #ffffff;
  --border: #e2e6ec;
  --border-strong: #cbd2dc;
  --text: #1a1f2e;
  --text-secondary: #5b6472;
  --text-muted: #8b94a3;
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-soft: #eef0ff;
  --primary-glow: rgba(79, 70, 229, 0.15);
  --accent-emerald: #059669;
  --accent-amber: #d97706;
  --accent-rose: #e11d48;
  --accent-rose-soft: #fff1f2;
  --accent-amber-soft: #fffbeb;
  --accent-emerald-soft: #ecfdf5;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.06);
  --font: 'Plus Jakarta Sans', 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ==================== 헤더 ==================== */
.rec-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.rec-header-inner {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 16px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.rec-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--primary);
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}

.rec-nav {
  display: flex;
  gap: 4px;
}

.rec-nav-link {
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 8px;
  transition: all 0.2s;
}

.rec-nav-link:hover {
  color: var(--primary);
  background: var(--primary-soft);
}

/* ==================== 히어로 ==================== */
.rec-hero {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  color: #fff;
  padding: 40px 20px 44px;
  text-align: center;
}

.rec-hero-inner {
  max-width: 640px;
  margin: 0 auto;
}

.rec-hero-title {
  font-size: 1.55rem;
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: -0.03em;
  margin-bottom: 10px;
}

.rec-hero-sub {
  font-size: 0.92rem;
  opacity: 0.9;
  margin-bottom: 8px;
}

.rec-hero-trust {
  font-size: 0.8rem;
  opacity: 0.75;
  margin-bottom: 20px;
}

.rec-hero-cta {
  display: inline-block;
  background: #fff;
  color: var(--primary);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 12px 28px;
  border-radius: 999px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  transition: all 0.2s;
}

.rec-hero-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

/* ==================== 메인 ==================== */
.rec-main {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 16px 60px;
}

/* ==================== 폼 ==================== */
.rec-form-section {
  padding-top: 28px;
}

.rec-form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  box-shadow: var(--shadow-md);
}

.rec-form-title {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.rec-form-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.rec-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.rec-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rec-form-row {
  display: flex;
  gap: 12px;
}

.rec-form-row .rec-field {
  flex: 1;
}

.rec-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
}

.rec-required {
  color: var(--accent-rose);
}

.rec-input,
.rec-select,
.rec-textarea {
  width: 100%;
  font-family: var(--font);
  font-size: 0.95rem;
  color: var(--text);
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  transition: all 0.2s;
  -webkit-appearance: none;
  appearance: none;
}

.rec-select {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238b94a3' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.rec-textarea {
  resize: vertical;
  min-height: 70px;
}

.rec-input:focus,
.rec-select:focus,
.rec-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.rec-input::placeholder,
.rec-textarea::placeholder {
  color: var(--text-muted);
}

.rec-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.rec-input-wrap .rec-input {
  padding-right: 36px;
}

.rec-input-suffix {
  position: absolute;
  right: 13px;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
  pointer-events: none;
}

.rec-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.rec-hint-center {
  text-align: center;
}

/* 토글 그룹 */
.rec-toggle-group {
  display: flex;
  gap: 0;
  background: var(--bg-muted);
  border-radius: var(--radius-sm);
  padding: 3px;
}

.rec-toggle-btn {
  flex: 1;
  font-family: var(--font);
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: 8px;
  padding: 8px 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.rec-toggle-btn.active {
  background: #fff;
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

/* 접이식 추가 조건 */
.rec-optional {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.rec-optional-summary {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
}

.rec-optional-summary::before {
  content: "";
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238b94a3' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  transition: transform 0.2s;
}

.rec-optional[open] .rec-optional-summary::before {
  transform: rotate(45deg);
}

.rec-optional-body {
  padding: 4px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* 에러 */
.rec-form-error {
  background: var(--accent-rose-soft);
  border: 1px solid rgba(225, 29, 72, 0.2);
  color: var(--accent-rose);
  font-size: 0.83rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  padding: 10px 13px;
}

/* 제출 버튼 */
.rec-submit-btn {
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  background: var(--primary);
  border: none;
  border-radius: var(--radius);
  padding: 14px 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
  box-shadow: 0 2px 8px var(--primary-glow);
}

.rec-submit-btn:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px var(--primary-glow);
}

.rec-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.rec-submit-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: rec-spin 0.7s linear infinite;
}

@keyframes rec-spin {
  to { transform: rotate(360deg); }
}

/* ==================== 결과 ==================== */
.rec-results-section {
  padding-top: 28px;
}

.rec-results-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.rec-results-title {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.rec-results-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.rec-count-badge {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 999px;
  padding: 4px 12px;
  white-space: nowrap;
}

.rec-back-btn {
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  transition: all 0.2s;
  white-space: nowrap;
}

.rec-back-btn:hover {
  color: var(--primary);
  background: var(--primary-soft);
}

/* 예산 계산 안내 */
.rec-budget-note {
  background: var(--accent-amber-soft);
  border: 1px solid rgba(217, 119, 6, 0.2);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: 0.83rem;
  color: #92400e;
  line-height: 1.55;
}

.rec-budget-note strong {
  font-weight: 700;
}

/* ==================== 결과 카드 ==================== */
.rec-cards {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.rec-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
}

.rec-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

/* 랭크 배지 */
.rec-card-rank {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  font-size: 0.72rem;
  font-weight: 800;
  color: #fff;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  border-radius: 999px;
  padding: 3px 10px;
}

.rec-card-image-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: var(--bg-muted);
  overflow: hidden;
}

.rec-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.rec-card-image-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-muted);
  color: var(--text-muted);
}

.rec-card-body {
  padding: 14px 16px 16px;
}

.rec-card-name {
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.rec-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.rec-price-tag {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--primary);
}

.rec-price-sep {
  color: var(--border-strong);
  font-size: 0.85rem;
}

.rec-moq-tag {
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 600;
}

/* 예상금액 */
.rec-card-estimate {
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  padding: 8px 11px;
  margin-bottom: 10px;
}

.rec-estimate-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
}

.rec-estimate-label {
  color: var(--text-secondary);
  font-weight: 600;
}

.rec-estimate-value {
  font-weight: 800;
  color: var(--text);
}

.rec-estimate-note {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 3px;
  line-height: 1.4;
}

/* 추천 이유 */
.rec-reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 10px;
}

.rec-reason {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 999px;
  padding: 3px 9px;
}

/* 확인 필요 */
.rec-check-needed {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 10px;
}

.rec-check-item {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--accent-amber);
  background: var(--accent-amber-soft);
  border: 1px solid rgba(217, 119, 6, 0.2);
  border-radius: 999px;
  padding: 3px 9px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.rec-check-item::before {
  content: "!";
  font-weight: 800;
  font-size: 0.7rem;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--accent-amber);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* 카테고리 */
.rec-card-category {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 액션 버튼 */
.rec-card-actions {
  display: flex;
  gap: 8px;
}

.rec-btn {
  font-family: var(--font);
  font-size: 0.83rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.rec-btn-detail {
  flex: 1;
  color: var(--text);
  background: var(--bg-muted);
}

.rec-btn-detail:hover {
  background: var(--border);
}

.rec-btn-consult {
  flex: 1.4;
  color: #fff;
  background: var(--primary);
  box-shadow: 0 2px 6px var(--primary-glow);
}

.rec-btn-consult:hover {
  background: var(--primary-hover);
}

/* ==================== 빈 결과 ==================== */
.rec-empty {
  text-align: center;
  padding: 48px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.rec-empty-icon {
  color: var(--text-muted);
  margin-bottom: 12px;
}

.rec-empty-title {
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.rec-empty-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.55;
}

.rec-relax-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 400px;
  margin: 0 auto;
}

.rec-relax-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  text-align: left;
}

.rec-relax-label {
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--text);
}

.rec-relax-btn {
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-soft);
  border: none;
  border-radius: 999px;
  padding: 5px 12px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}

.rec-relax-btn:hover {
  background: var(--primary);
  color: #fff;
}

/* 더 보기 */
.rec-more {
  text-align: center;
  padding-top: 20px;
}

.rec-more-btn {
  font-family: var(--font);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: 11px 28px;
  cursor: pointer;
  transition: all 0.2s;
}

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

/* ==================== 모달 ==================== */
.rec-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: rec-fade-in 0.2s ease-out;
}

@keyframes rec-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.rec-modal {
  background: var(--surface);
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  overflow-y: auto;
  position: relative;
  animation: rec-slide-up 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes rec-slide-up {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.rec-modal-close {
  position: sticky;
  float: right;
  top: 12px;
  right: 12px;
  z-index: 3;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: var(--bg-muted);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.rec-modal-close:hover {
  background: var(--border);
  color: var(--text);
}

.rec-modal-body {
  padding: 20px;
}

.rec-modal-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
  padding-right: 40px;
}

.rec-modal-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

/* 상세 모달 내용 */
.rec-detail-hero {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 14px;
  background: var(--bg-muted);
}

.rec-detail-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rec-detail-name {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}

.rec-detail-price {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 4px;
}

.rec-detail-meta {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.rec-detail-section {
  margin-bottom: 14px;
}

.rec-detail-section h4 {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.rec-detail-spec-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.rec-detail-spec {
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  padding: 8px 11px;
}

.rec-detail-spec dt {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
}

.rec-detail-spec dd {
  font-size: 0.83rem;
  font-weight: 700;
  margin-top: 1px;
}

/* 상담 모달 */
.rec-consult-products {
  background: var(--bg-soft);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 12px;
}

.rec-consult-product {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 0.83rem;
  padding: 4px 0;
}

.rec-consult-product-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rec-consult-product-price {
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
  flex-shrink: 0;
}

.rec-consult-conditions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 16px;
}

.rec-consult-condition {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-muted);
  border-radius: 999px;
  padding: 3px 9px;
}

.rec-consult-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ==================== 푸터 ==================== */
.rec-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
  padding: 24px 16px 32px;
}

.rec-footer-inner {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
}

.rec-footer-text {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 3px;
}

.rec-footer-copy {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ==================== 유틸 ==================== */
.rec-hidden {
  display: none !important;
}

/* ==================== 반응형 (태블릿 이상) ==================== */
@media (min-width: 768px) {
  .rec-hero-title { font-size: 1.9rem; }
  .rec-hero-sub { font-size: 1rem; }
  .rec-form-card { padding: 28px 24px; }
  .rec-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
  .rec-modal-backdrop {
    align-items: center;
    padding: 20px;
  }
  .rec-modal {
    border-radius: var(--radius-lg);
    max-height: 88vh;
  }
}

@media (min-width: 1024px) {
  .rec-main { max-width: 720px; }
  .rec-header-inner { max-width: 720px; }
  .rec-hero-inner { max-width: 720px; }
  .rec-footer-inner { max-width: 720px; }
  .rec-cards { grid-template-columns: repeat(3, 1fr); }
  .rec-form-card { padding: 32px 28px; }
}
