/* ============================================
   Little NiHao — Global Stylesheet
   Mobile-first, warm, educational
   ============================================ */

:root {
  --green: #6B9E5A;
  --green-dark: #4d7a3e;
  --green-light: #e8f5e2;
  --orange: #F5A623;
  --orange-light: #FFF4E0;
  --cream: #FDFAF4;
  --white: #ffffff;
  --text: #2C2C2C;
  --text-muted: #6B6B6B;
  --border: #E8E8E8;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-hover: 0 6px 24px rgba(0,0,0,0.14);
  --radius: 16px;
  --radius-sm: 8px;
  --font: 'Nunito', system-ui, -apple-system, sans-serif;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: var(--font); }

/* Typography */
h1, h2, h3, h4 { line-height: 1.25; font-weight: 800; }
h1 { font-size: clamp(1.8rem, 5vw, 2.8rem); }
h2 { font-size: clamp(1.4rem, 3.5vw, 2rem); }
h3 { font-size: clamp(1.1rem, 2.5vw, 1.4rem); }
p { color: var(--text-muted); }

/* ============================================
   Layout
   ============================================ */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

section {
  padding: 60px 0;
}

/* ============================================
   Navigation
   ============================================ */
.nav {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 8px rgba(0,0,0,0.06);
}

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

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--green-dark);
}

.nav-logo img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
}

.nav-logo .brand-en { color: var(--green-dark); }
.nav-logo .brand-zh {
  font-size: 0.85rem;
  color: var(--orange);
  font-weight: 700;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
}

.nav-links a {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: all 0.2s;
}

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

.nav-links .nav-cta a {
  background: var(--orange);
  color: var(--white);
  padding: 9px 18px;
  border-radius: 50px;
}
.nav-links .nav-cta a:hover {
  background: #e0941a;
  color: var(--white);
}

.nav-mobile-toggle {
  display: none;
  background: none;
  border: none;
  padding: 8px;
  color: var(--text);
}

/* ============================================
   Buttons
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 50px;
  font-weight: 700;
  font-size: 1rem;
  border: none;
  transition: all 0.2s;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--orange);
  color: var(--white);
}
.btn-primary:hover {
  background: #e0941a;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(245,166,35,0.4);
}

.btn-secondary {
  background: var(--green);
  color: var(--white);
}
.btn-secondary:hover {
  background: var(--green-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(107,158,90,0.4);
}

.btn-outline {
  background: transparent;
  color: var(--green-dark);
  border: 2px solid var(--green);
}
.btn-outline:hover {
  background: var(--green-light);
  transform: translateY(-1px);
}

.btn-sm {
  padding: 10px 20px;
  font-size: 0.9rem;
}

.btn-block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ============================================
   Hero
   ============================================ */
.hero {
  background: linear-gradient(135deg, var(--cream) 0%, var(--orange-light) 50%, var(--green-light) 100%);
  padding: 80px 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -10%;
  width: 120%;
  height: 200%;
  background: radial-gradient(ellipse at 30% 40%, rgba(245,166,35,0.12) 0%, transparent 60%),
              radial-gradient(ellipse at 70% 60%, rgba(107,158,90,0.12) 0%, transparent 60%);
  pointer-events: none;
}

.hero-badge {
  display: inline-block;
  background: var(--green);
  color: var(--white);
  padding: 6px 16px;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.hero h1 {
  max-width: 700px;
  margin: 0 auto 16px;
  color: var(--text);
}

.hero h1 span {
  color: var(--green-dark);
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 500px;
  margin: 0 auto 32px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-emoji-row {
  margin-top: 48px;
  font-size: 2.5rem;
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  opacity: 0.8;
}

/* ============================================
   Section Headers
   ============================================ */
.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-tag {
  display: inline-block;
  background: var(--orange-light);
  color: var(--orange);
  padding: 4px 14px;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.section-header h2 {
  margin-bottom: 12px;
  color: var(--text);
}

/* ============================================
   Product Cards
   ============================================ */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}

.product-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.25s;
  display: flex;
  flex-direction: column;
}

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

.product-card-image {
  aspect-ratio: 4/3;
  background: linear-gradient(135deg, var(--green-light), var(--orange-light));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  position: relative;
  overflow: hidden;
}

.product-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--orange);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 50px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.product-card-body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.product-category {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--green);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.product-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.product-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
  flex: 1;
}

.product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.product-price {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text);
}

.product-price .price-original {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: line-through;
  font-weight: 500;
  margin-left: 6px;
}

/* ============================================
   Features / Trust Signals
   ============================================ */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
}

.feature-card {
  text-align: center;
  padding: 32px 24px;
  background: var(--cream);
  border-radius: var(--radius);
}

.feature-icon {
  font-size: 2.5rem;
  margin-bottom: 16px;
}

.feature-card h3 {
  margin-bottom: 8px;
  font-size: 1rem;
  color: var(--text);
}

.feature-card p {
  font-size: 0.875rem;
}

/* ============================================
   Free Books Page
   ============================================ */
.free-hero {
  background: linear-gradient(135deg, var(--green-light) 0%, var(--cream) 100%);
  padding: 60px 0;
  text-align: center;
}

.tiktok-gate {
  background: var(--orange-light);
  border: 2px dashed var(--orange);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  margin-bottom: 40px;
}

.tiktok-gate .gate-icon { font-size: 3rem; margin-bottom: 12px; }
.tiktok-gate h3 { color: var(--text); margin-bottom: 8px; }
.tiktok-gate p { margin-bottom: 20px; }

.free-books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}

.free-book-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.25s;
}

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

.free-book-card .book-image {
  aspect-ratio: 3/4;
  background: linear-gradient(135deg, var(--green-light), var(--cream));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
}

.free-book-card .book-body {
  padding: 20px;
}

.free-book-card h3 {
  margin-bottom: 6px;
  font-size: 1rem;
}

.free-book-card p {
  font-size: 0.85rem;
  margin-bottom: 16px;
}

/* ============================================
   Product Detail Page
   ============================================ */
.product-detail {
  padding: 60px 0;
}

.product-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: start;
}

.product-gallery {
  position: sticky;
  top: 80px;
}

.product-main-image {
  aspect-ratio: 4/3;
  background: linear-gradient(135deg, var(--green-light), var(--orange-light));
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  margin-bottom: 12px;
  overflow: hidden;
}

.product-main-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-thumbnails {
  display: flex;
  gap: 8px;
}

.product-thumb {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-sm);
  background: var(--green-light);
  border: 2px solid transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  transition: border-color 0.2s;
}

.product-thumb.active,
.product-thumb:hover {
  border-color: var(--green);
}

.product-info { }

.product-info .category-tag {
  display: inline-block;
  background: var(--green-light);
  color: var(--green-dark);
  padding: 4px 12px;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.product-info h1 {
  margin-bottom: 16px;
  font-size: clamp(1.5rem, 3vw, 2rem);
}

.product-info .price-display {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 24px;
}

.product-info .price-display .cents {
  font-size: 1.2rem;
  vertical-align: super;
}

.what-included {
  background: var(--cream);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}

.what-included h4 {
  margin-bottom: 16px;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.what-included ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.what-included li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  color: var(--text);
}

.what-included li::before {
  content: '✓';
  background: var(--green);
  color: white;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
}

.buy-box {
  background: var(--orange-light);
  border: 1px solid rgba(245,166,35,0.3);
  border-radius: var(--radius);
  padding: 24px;
}

.buy-box .buy-price {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 16px;
}

.buy-box .secure-note {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 12px;
  justify-content: center;
}

/* ============================================
   Success Page
   ============================================ */
.success-page {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 20px;
}

.success-card {
  max-width: 520px;
  width: 100%;
}

.success-icon {
  width: 90px;
  height: 90px;
  background: var(--green);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  margin: 0 auto 24px;
}

.success-card h1 {
  margin-bottom: 12px;
}

.success-card p {
  margin-bottom: 32px;
}

.download-box {
  background: var(--cream);
  border: 2px dashed var(--green);
  border-radius: var(--radius);
  padding: 32px;
  margin-bottom: 24px;
}

.download-box .download-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.download-box .download-filename {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 20px;
}

.download-expiry {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 12px;
}

/* ============================================
   About Page
   ============================================ */
.about-hero {
  background: linear-gradient(135deg, var(--green-light) 0%, var(--cream) 100%);
  padding: 80px 0;
  text-align: center;
}

.about-content {
  max-width: 680px;
  margin: 0 auto;
  padding: 60px 20px;
}

.about-content p {
  font-size: 1.05rem;
  margin-bottom: 20px;
  line-height: 1.8;
}

.team-card {
  display: flex;
  gap: 24px;
  background: var(--cream);
  border-radius: var(--radius);
  padding: 32px;
  margin-bottom: 32px;
  align-items: flex-start;
}

.team-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--green-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  flex-shrink: 0;
  border: 3px solid var(--green);
}

.team-info h3 { margin-bottom: 6px; }
.team-info p { font-size: 0.9rem; }

.social-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 32px;
}

.social-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.9rem;
  border: 2px solid var(--border);
  transition: all 0.2s;
}

.social-link:hover {
  border-color: var(--green);
  background: var(--green-light);
  transform: translateY(-2px);
}

.social-link.tiktok { border-color: #010101; }
.social-link.tiktok:hover { background: #010101; color: white; }

.social-link.facebook { border-color: #1877F2; }
.social-link.facebook:hover { background: #1877F2; color: white; }

.social-link.payhip { border-color: var(--orange); }
.social-link.payhip:hover { background: var(--orange); color: white; }

/* ============================================
   Footer
   ============================================ */
.footer {
  background: var(--text);
  color: rgba(255,255,255,0.7);
  padding: 48px 0 24px;
}

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

.footer-brand .nav-logo {
  color: white;
  margin-bottom: 12px;
  display: inline-flex;
}

.footer-brand p {
  color: rgba(255,255,255,0.5);
  font-size: 0.875rem;
  max-width: 240px;
}

.footer-col h4 {
  color: white;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 16px;
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-col a {
  color: rgba(255,255,255,0.55);
  font-size: 0.875rem;
  transition: color 0.2s;
}

.footer-col a:hover { color: white; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.35);
  flex-wrap: wrap;
  gap: 8px;
}

/* ============================================
   Toast / Loading
   ============================================ */
.loading-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--text);
  color: white;
  padding: 14px 24px;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 600;
  z-index: 999;
  transition: transform 0.3s ease;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 16px 20px;
    gap: 4px;
    box-shadow: var(--shadow);
  }

  .nav-links.open { display: flex; }
  .nav-mobile-toggle { display: block; }

  .nav-links a { padding: 12px 16px; }
  .nav-links .nav-cta a {
    width: 100%;
    text-align: center;
    border-radius: var(--radius-sm);
  }

  .hero { padding: 60px 0; }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .product-detail-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .product-gallery { position: static; }

  .team-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  section { padding: 48px 0; }
}

@media (max-width: 480px) {
  .products-grid {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }

  .product-card-body { padding: 14px; }
  .product-title { font-size: 0.875rem; }
  .product-price { font-size: 1.1rem; }

  .hero-emoji-row { display: none; }

  .free-books-grid {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
}

/* Utility */
.text-center { text-align: center; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-40 { margin-top: 40px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.hidden { display: none !important; }
