:root {
  --primary: #2ecc71;
  --primary-dark: #27ae60;
  --primary-light: #a8f0c6;
  --secondary: #3498db;
  --accent: #e74c3c;
  --warm: #f39c12;
  --dark: #2c3e50;
  --gray: #95a5a6;
  --light: #ecf0f1;
  --white: #ffffff;
  --shadow: 0 4px 20px rgba(0,0,0,0.08);
  --shadow-hover: 0 8px 30px rgba(46,204,113,0.2);
  --radius: 16px;
  --radius-sm: 8px;
  --transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
}

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

body {
  font-family: 'Noto Sans KR', 'Apple SD Gothic Neo', sans-serif;
  background: #f8fafb;
  color: var(--dark);
  min-height: 100vh;
  overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; }
ul { list-style: none; }

/* ===== HEADER ===== */
.site-header {
  background: var(--white);
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  position: sticky;
  top: 0;
  z-index: 1000;
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primary-dark);
}

.logo img { height: 56px; }

.logo span { color: var(--dark); }

.nav-desktop { display: flex; align-items: center; gap: 4px; }

.nav-desktop a {
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #555;
  transition: var(--transition);
}

.nav-desktop a:hover, .nav-desktop a.active {
  background: var(--primary-light);
  color: var(--primary-dark);
}

.header-actions { display: flex; align-items: center; gap: 10px; }

.btn-cart {
  position: relative;
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  padding: 6px;
}

.cart-badge {
  position: absolute;
  top: -2px;
  right: -4px;
  background: var(--accent);
  color: white;
  font-size: 0.65rem;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.btn-login, .btn-signup {
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: none;
}

.btn-login {
  background: transparent;
  color: var(--dark);
  border: 1.5px solid #ddd;
}

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

.btn-signup {
  background: var(--primary);
  color: white;
}

.btn-signup:hover { background: var(--primary-dark); }

.hamburger {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
}

/* ===== MOBILE NAV ===== */
.mobile-nav {
  display: none;
  position: fixed;
  top: 76px;
  left: 0;
  width: 100%;
  background: white;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  z-index: 999;
  padding: 16px;
}

.mobile-nav.open { display: block; }

.mobile-nav a {
  display: block;
  padding: 12px 16px;
  border-radius: 8px;
  font-weight: 500;
  color: #555;
  margin-bottom: 2px;
  transition: var(--transition);
}

.mobile-nav a:hover { background: var(--primary-light); color: var(--primary-dark); }

/* ===== BOTTOM NAV (Mobile) ===== */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: white;
  border-top: 1px solid #eee;
  z-index: 1000;
  padding: 8px 0 env(safe-area-inset-bottom, 8px);
}

.bottom-nav-inner {
  display: flex;
  justify-content: space-around;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 4px 12px;
  color: var(--gray);
  font-size: 0.7rem;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  background: none;
}

.bottom-nav-item .icon { font-size: 1.3rem; }
.bottom-nav-item.active, .bottom-nav-item:hover { color: var(--primary-dark); }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  text-align: center;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: var(--shadow-hover); }

.btn-outline { background: white; color: var(--primary-dark); border: 2px solid var(--primary); }
.btn-outline:hover { background: var(--primary); color: white; }

.btn-dark { background: var(--dark); color: white; }
.btn-dark:hover { opacity: 0.85; }

.btn-lg { padding: 16px 36px; font-size: 1.05rem; }
.btn-sm { padding: 8px 16px; font-size: 0.82rem; }

/* ===== CARDS ===== */
.card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: var(--transition);
}

.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }

/* ===== SECTION ===== */
.section { padding: 60px 0; }
.section-alt { background: #f0f9f4; }

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
}

.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-header h2 {
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 10px;
}

.section-header p { color: var(--gray); font-size: 1rem; }

.section-tag {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary-dark);
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 12px;
}

/* ===== GRID ===== */
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }

/* ===== HERO ===== */
.hero {
  background: linear-gradient(135deg, #1a6b3a 0%, #2ecc71 60%, #a8f0c6 100%);
  color: white;
  padding: 80px 20px;
  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.05'%3E%3Ccircle cx='30' cy='30' r='20'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

.hero h1 { font-size: 2.8rem; font-weight: 900; line-height: 1.2; margin-bottom: 20px; }
.hero p { font-size: 1.15rem; opacity: 0.9; margin-bottom: 36px; }
.hero-buttons { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* ===== STATS ===== */
.stats-bar {
  background: white;
  padding: 28px 20px;
  box-shadow: var(--shadow);
}

.stats-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 20px;
}

.stat-item { text-align: center; }

.stat-number {
  font-size: 2rem;
  font-weight: 900;
  color: var(--primary-dark);
  display: block;
}

.stat-label { font-size: 0.85rem; color: var(--gray); margin-top: 4px; }

/* ===== DONATION ORG CARD ===== */
.org-card { padding: 24px; cursor: pointer; }

.org-card .org-logo {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin-bottom: 14px;
}

.org-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 6px; }
.org-card p { font-size: 0.82rem; color: var(--gray); line-height: 1.5; margin-bottom: 14px; }

.org-stats { display: flex; gap: 12px; flex-wrap: wrap; }

.org-stat {
  background: #f8fafb;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.75rem;
  color: var(--dark);
}

.org-stat strong { color: var(--primary-dark); }

/* ===== PRODUCT CARD ===== */
.product-card { cursor: pointer; }

.product-card .product-img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
}

.product-card .product-body { padding: 16px; }

.product-card h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 8px; }

.product-price {
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--dark);
  margin-bottom: 8px;
}

.donation-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #e8f9f0;
  color: var(--primary-dark);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
}

/* ===== FEED ===== */
.feed-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.88rem;
}

.feed-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.feed-text { flex: 1; }
.feed-time { color: var(--gray); font-size: 0.75rem; }

/* ===== PROGRESS BAR ===== */
.progress-bar-wrap {
  background: #eee;
  border-radius: 4px;
  height: 8px;
  overflow: hidden;
  margin: 8px 0;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-dark));
  border-radius: 4px;
  transition: width 0.8s ease;
}

/* ===== FORM ===== */
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 6px; color: var(--dark); }

.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid #ddd;
  border-radius: 10px;
  font-size: 0.95rem;
  transition: var(--transition);
  outline: none;
  font-family: inherit;
}

.form-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }

select.form-input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23999' stroke-width='1.5' fill='none'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }

textarea.form-input { resize: vertical; min-height: 120px; }

/* ===== TOAST ===== */
#toast-container {
  position: fixed;
  bottom: 80px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--dark);
  color: white;
  padding: 14px 20px;
  border-radius: 12px;
  font-size: 0.88rem;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  animation: slideInRight 0.3s ease;
  max-width: 320px;
}

.toast.success { background: var(--primary-dark); }
.toast.error { background: var(--accent); }

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  background: white;
  border-radius: var(--radius);
  padding: 36px;
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.9);
  transition: transform 0.3s;
}

.modal-overlay.open .modal { transform: scale(1); }

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--gray);
}

/* ===== TABS ===== */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid #eee; margin-bottom: 24px; }

.tab-btn {
  padding: 10px 20px;
  border: none;
  background: none;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--gray);
  cursor: pointer;
  position: relative;
  transition: var(--transition);
  font-family: inherit;
}

.tab-btn.active { color: var(--primary-dark); }

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--primary);
}

/* ===== FOOTER ===== */
.site-footer {
  background: var(--dark);
  color: #aaa;
  padding: 48px 20px 24px;
}

.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
}

.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-brand .logo { color: white; margin-bottom: 14px; }
.footer-brand p { font-size: 0.85rem; line-height: 1.7; }

.footer-col h4 { color: white; font-size: 0.9rem; font-weight: 700; margin-bottom: 16px; }
.footer-col a { display: block; font-size: 0.85rem; margin-bottom: 8px; transition: color 0.2s; }
.footer-col a:hover { color: var(--primary); }

.footer-bottom {
  border-top: 1px solid #3a4a5a;
  padding-top: 24px;
  font-size: 0.8rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

/* ===== DONATION ANIMATION ===== */
@keyframes floatHeart {
  0% { transform: translateY(0) scale(1); opacity: 1; }
  100% { transform: translateY(-80px) scale(1.5); opacity: 0; }
}

.heart-anim {
  position: fixed;
  font-size: 2rem;
  pointer-events: none;
  animation: floatHeart 1.2s ease forwards;
  z-index: 9999;
}

/* ===== COUNTER ANIMATION ===== */
.count-up { font-variant-numeric: tabular-nums; }

/* ===== BADGE ===== */
.level-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  color: var(--primary-dark);
}

/* ===== PAGE HEADER ===== */
.page-hero {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: white;
  padding: 48px 20px;
  text-align: center;
}

.page-hero h1 { font-size: 2rem; font-weight: 900; margin-bottom: 8px; }
.page-hero p { opacity: 0.9; font-size: 1rem; }

/* ===== SUB PAGE SLIDER BANNER ===== */
.sub-banner {
  position: relative;
  overflow: hidden;
  height: 260px;
}

.sub-banner-track {
  display: flex;
  height: 100%;
  transition: transform 0.6s cubic-bezier(0.4,0,0.2,1);
}

.sub-banner-slide {
  min-width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: white;
  padding: 40px 20px;
  position: relative;
  overflow: hidden;
}

.sub-banner-slide::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Ccircle cx='40' cy='40' r='30'/%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

.sub-banner-slide-content { position: relative; z-index: 1; }

.sub-banner-slide h1 {
  font-size: 2.2rem;
  font-weight: 900;
  margin-bottom: 10px;
  line-height: 1.2;
  text-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.sub-banner-slide p {
  font-size: 1rem;
  opacity: 0.92;
  margin-bottom: 20px;
  max-width: 500px;
}

.sub-banner-slide .banner-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.22);
  backdrop-filter: blur(4px);
  border: 1.5px solid rgba(255,255,255,0.5);
  color: white;
  padding: 9px 22px;
  border-radius: 24px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.sub-banner-slide .banner-btn:hover {
  background: rgba(255,255,255,0.35);
}

/* 슬라이드 도트 */
.sub-banner-dots {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 7px;
  z-index: 10;
}

.sub-banner-dots button {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.45);
  cursor: pointer;
  transition: all 0.3s;
  padding: 0;
}

.sub-banner-dots button.active {
  background: white;
  width: 22px;
  border-radius: 4px;
}

/* 좌우 화살표 */
.sub-banner-prev,
.sub-banner-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(4px);
  border: none;
  color: white;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sub-banner-prev { left: 14px; }
.sub-banner-next { right: 14px; }
.sub-banner-prev:hover, .sub-banner-next:hover { background: rgba(255,255,255,0.38); }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-top { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .nav-desktop { display: none; }
  .hamburger { display: block; }
  .bottom-nav { display: block; }
  body { padding-bottom: 70px; font-size: 0.95rem; }

  /* 헤더 */
  .header-inner { height: 68px; padding: 0 16px; }
  .logo img { height: 50px !important; }
  .btn-login, .btn-signup { padding: 7px 12px; font-size: 0.78rem; }
  .btn-cart { font-size: 1.2rem; }
  .header-actions { gap: 6px; }

  /* 모바일 드롭다운 메뉴 */
  .mobile-nav { top: 68px; padding: 12px 16px 20px; }
  .mobile-nav a { padding: 14px 16px; font-size: 0.95rem; font-weight: 600; border-bottom: 1px solid #f0f0f0; border-radius: 0; margin-bottom: 0; }
  .mobile-nav a:last-child { border-bottom: none; }

  /* 히어로 */
  .hero h1 { font-size: 1.7rem; line-height: 1.35; }
  .hero p { font-size: 0.9rem; }
  .hero-buttons { flex-direction: column; align-items: center; gap: 10px; }
  .hero-buttons .btn { width: 200px; justify-content: center; }

  /* 섹션 */
  .section { padding: 52px 0; }
  .section h2 { font-size: 1.45rem; }
  .section-sub { font-size: 0.85rem; }
  .section-header { margin-bottom: 36px; }

  /* 그리드 */
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .footer-bottom { flex-direction: column; gap: 4px; }

  /* 카드 */
  .card { border-radius: 12px; }
  .org-card { padding: 20px; }
  .product-card .product-body { padding: 14px 16px; }
  .product-card .product-name { font-size: 0.88rem; }
  .product-card .product-price { font-size: 1rem; }

  /* stats */
  .stats-bar { padding: 24px 16px; }
  .stats-inner { gap: 14px; padding: 0; }
  .stat-number { font-size: 1.4rem; }
  .stat-label { font-size: 0.72rem; }

  /* page hero */
  .page-hero { padding: 48px 20px; }
  .page-hero h1 { font-size: 1.5rem; }
  .page-hero p { font-size: 0.9rem; }

  /* sub banner */
  .sub-banner { height: 220px; }
  .sub-banner-slide h1 { font-size: 1.6rem; }
  .sub-banner-slide p { font-size: 0.88rem; margin-bottom: 14px; }
  .sub-banner-prev, .sub-banner-next { display: none; }

  /* 버튼 */
  .btn { font-size: 0.88rem; padding: 10px 18px; }
  .btn-lg { font-size: 0.95rem; padding: 13px 24px; }
}

@media (max-width: 480px) {
  .header-inner { padding: 0 12px; }
  .logo img { height: 38px !important; }
  .grid-4, .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .hero h1 { font-size: 1.45rem; }
  .stats-inner { gap: 8px; }
  .stat-number { font-size: 1.3rem; }
  .btn-login span, .btn-signup span { display: none; }
}
