/* ==========================================
   뉴트리픽 - 영양제 추천 사이트
   메인 스타일시트
   ========================================== */

:root {
  --green-dark: #1a6b3a;
  --green-main: #2d8a50;
  --green-light: #4caf75;
  --green-pale: #e8f5ee;
  --green-ultra: #f0faf4;
  --accent: #ff6b35;
  --text-dark: #1a2e22;
  --text-mid: #3d5a47;
  --text-light: #6b8c76;
  --border: #d4e8db;
  --white: #ffffff;
  --shadow-sm: 0 2px 8px rgba(45,138,80,0.08);
  --shadow-md: 0 4px 20px rgba(45,138,80,0.13);
  --shadow-lg: 0 8px 40px rgba(45,138,80,0.18);
  --radius: 14px;
  --radius-sm: 8px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Noto Sans KR', 'Pretendard', sans-serif;
  color: var(--text-dark);
  background: var(--white);
  line-height: 1.6;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; height: auto; }

/* ---- 공통 컨테이너 ---- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.container-wide { max-width: 1400px; margin: 0 auto; padding: 0 20px; }

/* ==========================================
   헤더
   ========================================== */
header {
  position: sticky; top: 0; z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; max-width: 1200px; margin: 0 auto; padding: 0 20px;
}
.logo {
  display: flex; align-items: center; gap: 8px;
  font-size: 1.3rem; font-weight: 800; color: var(--green-dark);
}
.logo span { color: var(--green-light); }
.logo-leaf { font-size: 1.5rem; }

nav { display: flex; gap: 6px; }
nav a {
  padding: 7px 14px; border-radius: 20px;
  font-size: 0.9rem; font-weight: 500; color: var(--text-mid);
  transition: all 0.2s;
}
nav a:hover, nav a.active {
  background: var(--green-pale); color: var(--green-dark); font-weight: 700;
}

.header-cta {
  background: var(--green-main); color: var(--white) !important;
  padding: 8px 18px !important; border-radius: 20px !important;
  font-weight: 700 !important;
}
.header-cta:hover { background: var(--green-dark) !important; }

.hamburger {
  display: none; flex-direction: column; gap: 5px;
  cursor: pointer; padding: 5px;
}
.hamburger span {
  display: block; width: 24px; height: 2px;
  background: var(--text-dark); border-radius: 2px; transition: all 0.3s;
}

.mobile-nav {
  display: none; flex-direction: column;
  background: var(--white); border-top: 1px solid var(--border);
  padding: 12px 20px;
}
.mobile-nav a {
  padding: 12px 0; border-bottom: 1px solid var(--border);
  font-size: 1rem; color: var(--text-mid);
}
.mobile-nav a:last-child { border-bottom: none; }

/* ==========================================
   광고 영역
   ========================================== */
.ad-wrap {
  background: var(--green-ultra);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
  text-align: center;
  overflow: hidden;
}
.ad-wrap-side { margin: 20px 0; text-align: center; }

/* ==========================================
   히어로 섹션
   ========================================== */
.hero {
  background: linear-gradient(135deg, var(--green-dark) 0%, var(--green-main) 60%, var(--green-light) 100%);
  padding: 80px 20px 60px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Ccircle cx='30' cy='30' r='20'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero-content { position: relative; }
.hero-badge {
  display: inline-block;
  background: rgba(255,255,255,0.2);
  color: #fff; padding: 5px 16px; border-radius: 20px;
  font-size: 0.82rem; font-weight: 600; letter-spacing: 0.05em;
  margin-bottom: 18px;
}
.hero h1 {
  font-size: clamp(1.8rem, 5vw, 3rem);
  font-weight: 900; color: #fff;
  line-height: 1.25; margin-bottom: 14px;
}
.hero h1 em { color: #a8f0c0; font-style: normal; }
.hero p {
  font-size: clamp(0.95rem, 2.5vw, 1.15rem);
  color: rgba(255,255,255,0.85); margin-bottom: 36px;
}

/* 검색창 */
.search-box {
  display: flex; max-width: 600px; margin: 0 auto;
  background: #fff; border-radius: 50px;
  box-shadow: 0 4px 30px rgba(0,0,0,0.2);
  overflow: hidden;
}
.search-box input {
  flex: 1; border: none; outline: none;
  padding: 16px 24px; font-size: 1rem; color: var(--text-dark);
  background: transparent;
}
.search-box input::placeholder { color: #aaa; }
.search-box button {
  background: var(--accent); color: #fff; border: none;
  padding: 16px 28px; font-size: 1rem; font-weight: 700;
  cursor: pointer; transition: background 0.2s;
}
.search-box button:hover { background: #e55a25; }

.hero-stats {
  display: flex; justify-content: center; gap: 40px;
  margin-top: 40px; flex-wrap: wrap;
}
.hero-stat { color: #fff; text-align: center; }
.hero-stat strong { display: block; font-size: 1.5rem; font-weight: 900; color: #a8f0c0; }
.hero-stat span { font-size: 0.82rem; opacity: 0.85; }

/* ==========================================
   카테고리 퀵 버튼
   ========================================== */
.categories {
  padding: 50px 20px 30px;
  background: var(--white);
}
.section-title {
  text-align: center;
  font-size: 1.5rem; font-weight: 800;
  color: var(--text-dark); margin-bottom: 8px;
}
.section-title span { color: var(--green-main); }
.section-sub {
  text-align: center; color: var(--text-light);
  font-size: 0.92rem; margin-bottom: 30px;
}

.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 14px; max-width: 1000px; margin: 0 auto;
}
.cat-card {
  display: flex; flex-direction: column; align-items: center;
  padding: 22px 10px; border-radius: var(--radius);
  background: var(--green-ultra);
  border: 1.5px solid var(--border);
  cursor: pointer; transition: all 0.22s;
  text-align: center;
}
.cat-card:hover {
  background: var(--green-pale);
  border-color: var(--green-main);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.cat-icon { font-size: 2.2rem; margin-bottom: 8px; }
.cat-name { font-size: 0.88rem; font-weight: 700; color: var(--text-dark); }
.cat-count { font-size: 0.75rem; color: var(--text-light); margin-top: 3px; }

/* ==========================================
   제품 카드 그리드
   ========================================== */
.products-section { padding: 40px 20px 60px; background: var(--green-ultra); }

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 22px; margin-top: 30px;
}

.product-card {
  background: var(--white); border-radius: var(--radius);
  border: 1.5px solid var(--border);
  overflow: hidden; transition: all 0.25s;
  display: flex; flex-direction: column;
}
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--green-light);
}

.product-img {
  position: relative;
  background: var(--green-ultra);
  display: flex; align-items: center; justify-content: center;
  height: 200px; overflow: hidden;
}
.product-img img {
  width: 100%; height: 100%; object-fit: contain;
  padding: 16px; transition: transform 0.3s;
}
.product-card:hover .product-img img { transform: scale(1.05); }

.product-badge {
  position: absolute; top: 12px; left: 12px;
  background: var(--accent); color: #fff;
  font-size: 0.72rem; font-weight: 700;
  padding: 3px 10px; border-radius: 12px;
}
.product-badge.new { background: var(--green-main); }
.product-badge.best { background: #f4a100; }

.product-body { padding: 18px; flex: 1; display: flex; flex-direction: column; }
.product-brand { font-size: 0.78rem; color: var(--text-light); font-weight: 500; margin-bottom: 4px; }
.product-name {
  font-size: 1rem; font-weight: 700; color: var(--text-dark);
  margin-bottom: 8px; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.product-desc {
  font-size: 0.82rem; color: var(--text-light);
  line-height: 1.5; margin-bottom: 12px; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}

.product-rating { display: flex; align-items: center; gap: 6px; margin-bottom: 12px; }
.stars { color: #f4a100; font-size: 0.85rem; letter-spacing: 1px; }
.rating-num { font-size: 0.82rem; font-weight: 700; color: var(--text-mid); }
.rating-count { font-size: 0.75rem; color: var(--text-light); }

.product-price-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.product-price { font-size: 1.15rem; font-weight: 800; color: var(--green-dark); }
.product-price-usd { font-size: 0.78rem; color: var(--text-light); }

.btn-iherb {
  display: block; text-align: center;
  background: var(--green-main); color: #fff !important;
  padding: 12px; border-radius: var(--radius-sm);
  font-weight: 700; font-size: 0.92rem;
  transition: background 0.2s;
}
.btn-iherb:hover { background: var(--green-dark); }
.btn-iherb::after { content: ' →'; }

/* ==========================================
   검색 결과
   ========================================== */
#search-results { padding: 30px 20px; min-height: 200px; }
#search-results.hidden { display: none; }

/* ==========================================
   인기 영양제 섹션
   ========================================== */
.top-section { padding: 50px 20px; background: var(--white); }

/* ==========================================
   정보 배너
   ========================================== */
.info-banner {
  background: linear-gradient(135deg, var(--green-dark), var(--green-main));
  padding: 50px 20px; text-align: center; color: #fff;
}
.info-banner h2 { font-size: 1.6rem; font-weight: 800; margin-bottom: 12px; }
.info-banner p { opacity: 0.88; margin-bottom: 26px; font-size: 0.97rem; }
.btn-white {
  display: inline-block;
  background: #fff; color: var(--green-dark) !important;
  padding: 12px 30px; border-radius: 30px;
  font-weight: 800; font-size: 0.97rem;
  transition: all 0.2s;
}
.btn-white:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.2); }

/* ==========================================
   블로그/정보 카드
   ========================================== */
.blog-section { padding: 50px 20px; background: var(--green-ultra); }
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 22px; margin-top: 30px;
}
.blog-card {
  background: var(--white); border-radius: var(--radius);
  border: 1.5px solid var(--border);
  overflow: hidden; transition: all 0.22s;
}
.blog-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.blog-thumb {
  height: 160px; background: var(--green-pale);
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem;
}
.blog-body { padding: 18px; }
.blog-tag {
  display: inline-block;
  background: var(--green-pale); color: var(--green-dark);
  font-size: 0.72rem; font-weight: 700;
  padding: 3px 10px; border-radius: 10px; margin-bottom: 8px;
}
.blog-title {
  font-size: 1rem; font-weight: 700; margin-bottom: 8px;
  line-height: 1.4; color: var(--text-dark);
}
.blog-excerpt { font-size: 0.83rem; color: var(--text-light); line-height: 1.55; }
.blog-meta { margin-top: 12px; font-size: 0.75rem; color: var(--text-light); }

/* ==========================================
   푸터
   ========================================== */
footer {
  background: var(--text-dark); color: rgba(255,255,255,0.75);
  padding: 50px 20px 30px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px; max-width: 1200px; margin: 0 auto;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.footer-logo {
  font-size: 1.3rem; font-weight: 800; color: #fff; margin-bottom: 10px;
}
.footer-logo span { color: var(--green-light); }
.footer-desc { font-size: 0.83rem; line-height: 1.65; }
.footer-col h4 { color: #fff; font-size: 0.9rem; font-weight: 700; margin-bottom: 14px; }
.footer-col a {
  display: block; font-size: 0.82rem;
  color: rgba(255,255,255,0.65); margin-bottom: 8px;
  transition: color 0.2s;
}
.footer-col a:hover { color: var(--green-light); }
.footer-bottom {
  text-align: center; font-size: 0.78rem;
  padding-top: 24px; max-width: 1200px; margin: 0 auto;
  color: rgba(255,255,255,0.45);
}
.footer-disclaimer {
  font-size: 0.75rem; color: rgba(255,255,255,0.4);
  max-width: 700px; margin: 10px auto 0;
  line-height: 1.6;
}

/* ==========================================
   상세 페이지
   ========================================== */
.detail-hero {
  background: var(--green-ultra);
  padding: 50px 20px;
  border-bottom: 1px solid var(--border);
}
.detail-grid {
  display: grid; grid-template-columns: 1fr 1.5fr;
  gap: 50px; align-items: start;
  max-width: 1000px; margin: 0 auto;
}
.detail-img-wrap {
  background: #fff; border-radius: var(--radius);
  border: 1.5px solid var(--border);
  padding: 30px; text-align: center;
}
.detail-img-wrap img { max-height: 320px; object-fit: contain; }
.detail-brand { font-size: 0.85rem; color: var(--text-light); margin-bottom: 6px; }
.detail-name { font-size: 1.6rem; font-weight: 900; margin-bottom: 16px; line-height: 1.3; }
.detail-rating { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.detail-price { font-size: 2rem; font-weight: 900; color: var(--green-dark); margin-bottom: 8px; }
.detail-price-note { font-size: 0.8rem; color: var(--text-light); margin-bottom: 22px; }
.btn-iherb-lg {
  display: block; text-align: center;
  background: var(--green-main); color: #fff !important;
  padding: 16px; border-radius: var(--radius);
  font-weight: 800; font-size: 1.05rem;
  transition: background 0.2s; margin-bottom: 10px;
}
.btn-iherb-lg:hover { background: var(--green-dark); }
.btn-note { font-size: 0.75rem; color: var(--text-light); text-align: center; }

.detail-tabs {
  max-width: 1000px; margin: 0 auto; padding: 40px 20px;
}
.tab-nav {
  display: flex; border-bottom: 2px solid var(--border);
  gap: 0; margin-bottom: 30px; overflow-x: auto;
}
.tab-btn {
  padding: 12px 24px; font-size: 0.92rem; font-weight: 600;
  color: var(--text-light); cursor: pointer;
  border-bottom: 3px solid transparent; margin-bottom: -2px;
  white-space: nowrap; background: none; border-top: none;
  border-left: none; border-right: none; transition: all 0.2s;
}
.tab-btn.active { color: var(--green-dark); border-bottom-color: var(--green-main); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

.info-table { width: 100%; border-collapse: collapse; }
.info-table th, .info-table td {
  padding: 12px 16px; text-align: left;
  border-bottom: 1px solid var(--border); font-size: 0.9rem;
}
.info-table th { width: 35%; color: var(--text-light); font-weight: 600; }
.info-table td { color: var(--text-dark); font-weight: 500; }

.pros-cons { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.pros h4 { color: var(--green-dark); margin-bottom: 10px; }
.cons h4 { color: #c0392b; margin-bottom: 10px; }
.pros ul, .cons ul { list-style: none; }
.pros li::before { content: '✓ '; color: var(--green-main); font-weight: 700; }
.cons li::before { content: '✗ '; color: #c0392b; font-weight: 700; }
.pros li, .cons li { font-size: 0.88rem; margin-bottom: 6px; color: var(--text-mid); }

/* 관련 상품 */
.related-section { padding: 40px 20px; background: var(--green-ultra); }

/* ==========================================
   카테고리 페이지
   ========================================== */
.cat-hero {
  background: linear-gradient(135deg, var(--green-dark), var(--green-main));
  padding: 50px 20px; color: #fff; text-align: center;
}
.cat-hero h1 { font-size: 2rem; font-weight: 900; margin-bottom: 8px; }
.cat-hero p { opacity: 0.85; font-size: 0.97rem; }

.filter-bar {
  background: var(--white); border-bottom: 1px solid var(--border);
  padding: 14px 20px; display: flex; gap: 10px;
  flex-wrap: wrap; align-items: center;
}
.filter-btn {
  padding: 7px 16px; border-radius: 20px;
  border: 1.5px solid var(--border);
  font-size: 0.83rem; font-weight: 600; cursor: pointer;
  background: var(--white); color: var(--text-mid);
  transition: all 0.2s;
}
.filter-btn:hover, .filter-btn.active {
  background: var(--green-pale); border-color: var(--green-main);
  color: var(--green-dark);
}

/* ==========================================
   브레드크럼
   ========================================== */
.breadcrumb {
  padding: 14px 20px; background: var(--white);
  font-size: 0.82rem; color: var(--text-light);
  border-bottom: 1px solid var(--border);
}
.breadcrumb a { color: var(--green-main); }
.breadcrumb span { margin: 0 6px; }

/* ==========================================
   반응형
   ========================================== */
@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .pros-cons { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  nav { display: none; }
  .hamburger { display: flex; }
  .mobile-nav.open { display: flex; }
  .hero { padding: 50px 20px 40px; }
  .hero-stats { gap: 24px; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .cat-grid { grid-template-columns: repeat(4, 1fr); }
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .product-body { padding: 12px; }
  .blog-grid { grid-template-columns: 1fr; }
  .tab-btn { padding: 10px 16px; font-size: 0.82rem; }
}

@media (max-width: 400px) {
  .cat-grid { grid-template-columns: repeat(3, 1fr); }
  .product-grid { grid-template-columns: 1fr; }
}

/* 검색 결과 하이라이트 */
.search-highlight { background: #fff3cd; padding: 2px 0; border-radius: 2px; }

/* 로딩 스피너 */
.loading { text-align: center; padding: 40px; color: var(--text-light); }

/* 스크롤 탑 버튼 */
.scroll-top {
  position: fixed; bottom: 24px; right: 24px;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--green-main); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; cursor: pointer;
  box-shadow: var(--shadow-md); opacity: 0;
  transition: all 0.3s; pointer-events: none; z-index: 99;
}
.scroll-top.show { opacity: 1; pointer-events: auto; }
