/* 폰트 로드 */
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css');

:root {
  /* 1-2. 컬러 시스템 */
  --color-primary: #4a5e2f;
  --color-secondary: #7a9a3f;
  --color-muted: #c8d4b0;
  --color-surface: #f2f0e8;
  --color-surface-2: #f7f5ee;
  --color-text-primary: #2e2e2e;
  --color-text-secondary: #6b6b6b;
  --color-reject-bg: #ffe5e5;
  --color-reject-text: #a03030;
  
  --color-kakao-border: rgba(254, 229, 0, 0.6);
  --color-kakao-bg: #FEE500;
  --color-naver-border: rgba(3, 199, 90, 0.5);
  --color-naver-bg: #03C75A;
}

* {
  font-family: 'Pretendard', -apple-system, sans-serif;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--color-surface);
  color: var(--color-text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 1-3. 타이포그래피 */
.text-h1 { font-size: clamp(28px, 5vw, 48px); font-weight: 500; line-height: 1.2; }
.text-h2 { font-size: clamp(20px, 3vw, 32px); font-weight: 500; line-height: 1.3; }
.text-h3 { font-size: 18px; font-weight: 500; line-height: 1.4; }
.text-body { font-size: 15px; font-weight: 400; line-height: 1.7; }
.text-caption { font-size: 12px; font-weight: 400; line-height: 1.6; font-style: italic; }

/* 버튼 텍스트 유틸리티 */
.text-btn-primary { font-size: 15px; font-weight: 500; }
.text-btn-secondary { font-size: 14px; font-weight: 500; }
.text-btn-social { font-size: 14px; font-weight: 500; }
.text-link-guest { font-size: 12px; font-weight: 400; text-decoration: underline; cursor: pointer; }
.text-floating-price { font-size: 16px; font-weight: 500; }
.text-floating-product { font-size: 12px; font-weight: 400; }

/* 1-4. 컴포넌트 스타일 원칙 */
.neumorphism {
  box-shadow: 4px 4px 10px rgba(0,0,0,0.08), -4px -4px 10px rgba(255,255,255,0.7);
  background: var(--color-surface);
  border-radius: 12px;
  border: 0.5px solid transparent;
  transition: all 0.2s ease-in-out;
}

.glassmorphism {
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(242,240,232,0.92);
  border: 0.5px solid rgba(200,212,176,0.6);
}

.border-base { border: 0.5px solid var(--color-muted); }
.border-active { border: 1px solid var(--color-primary); }

.radius-card { border-radius: 16px; }
.radius-btn { border-radius: 14px; }
.radius-tag { border-radius: 10px; }

svg { stroke-width: 1.2; stroke-linecap: round; fill: none; }
.icon-body { width: 20px; height: 20px; }
.icon-btn { width: 16px; height: 16px; }

/* 1-5. 반응형 브레이크포인트 & 그리드 */
.container { width: 100%; margin: 0 auto; }

@media (max-width: 639px) {
  .container { padding: 0 20px; }
  .grid-product { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
}

@media (min-width: 640px) and (max-width: 1023px) {
  .container { padding: 0 32px; }
  .grid-product { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
}

@media (min-width: 1024px) {
  .container { max-width: 1200px; padding: 0 48px; }
  .grid-hero { display: grid; grid-template-columns: 5fr 7fr; gap: 24px; }
  .grid-12col { display: grid; grid-template-columns: repeat(12, 1fr); gap: 24px; }
}

/* D-23: 3SecFix Micro-animations */
.sec-fix-step {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 150ms ease-in-out, transform 150ms ease-in-out;
}

.sec-fix-container.animate .step-chik {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0ms;
}

.sec-fix-container.animate .step-tok {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 450ms; /* 0ms + 150ms(duration) + 300ms(gap) */
}

.sec-fix-container.animate .step-ssuk {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 900ms; /* 450ms + 150ms(duration) + 300ms(gap) */
}

@media (prefers-reduced-motion: reduce) {
  .sec-fix-step {
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* GNB 전체 */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(242, 240, 232, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 0.5px solid #c8d4b0;
  padding: 0 48px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* 로고 */
.gnb-logo {
  font-family: 'Pretendard', sans-serif;
  font-size: 20px;
  font-weight: 500;
  font-style: italic;
  color: #4a5e2f;
  text-decoration: none;
}

/* 메뉴 항목 */
.gnb-menu a {
  font-family: 'Pretendard', sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: #2e2e2e;
  text-decoration: none;
  margin: 0 20px;
  letter-spacing: 0.04em;
  transition: color 0.15s;
}
.gnb-menu a:hover { color: #4a5e2f; }
.gnb-menu a.active { color: #4a5e2f; font-weight: 500; }

/* 진단하기 버튼 */
.gnb-cta {
  font-family: 'Pretendard', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: #ffffff;
  background: #4a5e2f;
  border: none;
  border-radius: 24px;
  padding: 8px 20px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, transform 0.1s;
}
.gnb-cta:hover { background: #3b4f24; }
.gnb-cta:active { transform: scale(0.97); }

/* 모바일 햄버거 */
@media (max-width: 639px) {
  nav { padding: 0 20px; }
  .gnb-menu { display: none; }
  .gnb-hamburger { display: flex; flex-direction: column; gap: 4px; cursor: pointer; }
  .gnb-hamburger span { width: 22px; height: 1px; background: #2e2e2e; }
}
@media (min-width: 640px) {
  .gnb-hamburger { display: none; }
}

/* Drawer */
.gnb-drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: #f2f0e8;
  z-index: 200;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s ease-in-out;
}
.gnb-drawer.open {
  transform: translateX(0);
}
.gnb-drawer-header {
  height: 60px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 0.5px solid #c8d4b0;
}
.gnb-close {
  font-size: 24px;
  cursor: pointer;
  color: #2e2e2e;
}
.gnb-drawer-menu {
  flex: 1;
  padding: 40px 20px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.gnb-drawer-menu a {
  font-family: 'Pretendard', sans-serif;
  font-size: 28px;
  font-weight: 500;
  color: #2e2e2e;
  text-decoration: none;
}
.gnb-drawer-cta {
  margin: 20px;
  width: calc(100% - 40px);
  height: 52px;
  background: #4a5e2f;
  color: #ffffff;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Pretendard', sans-serif;
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
}

/* 구매 버튼 CSS (rules.md Part B 기준) */
.buy-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  max-width: 320px;
  height: 52px;
  border-radius: 14px;
  background: #f2f0e8;
  border: 0.5px solid rgba(3, 199, 90, 0.5);
  font-family: 'Pretendard', sans-serif;
  font-size: 15px;
  font-weight: 500;
  color: #2e2e2e;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.buy-btn:hover {
  background: #e8f5ec;
  border-color: rgba(3, 199, 90, 0.8);
}
.buy-btn:active { transform: scale(0.97); }

/* 일반 성분 태그 */
.ing-tag {
  font-size: 11px;
  padding: 3px 10px;
  background: #f7f5ee;
  border: 0.5px solid #c8d4b0;
  border-radius: 10px;
  color: #2e2e2e;
  display: inline-block;
  margin: 2px;
}
/* 배제 성분 태그 */
.ing-reject {
  font-size: 11px;
  padding: 3px 10px;
  background: #ffe5e5;
  border: 0.5px solid #f0b0b0;
  border-radius: 10px;
  color: #a03030;
  display: inline-block;
  margin: 2px;
}

/* 모바일 플로팅 바 */
@media (max-width: 639px) {
  .mobile-floating-bar {
    position: static;
    bottom: 0;
    padding: 16px 0;
    background: var(--color-surface);
    z-index: 50;
    border-top: 0.5px solid var(--color-muted);
    margin-top: 24px;
    display: flex;
    justify-content: center;
  }
}
@media (min-width: 640px) {
  .mobile-floating-bar {
    margin-top: auto;
  }
}

/* 플로팅 바 모바일 전용 처리 */
#floating-bar {
  display: none;
  padding: 12px 20px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
}

/* 모바일에서만 표시 */
@media (max-width: 639px) {
  #floating-bar {
    display: flex;
  }
}
