:root {
  --primary: #7c3aed;
  --primary-rgb: 124, 58, 237;
  --primary-dark: #4f46e5;
  --secondary: #4f46e5;
  --accent: #06b6d4;
  --bg: #faf5ff;
  --bg-light: #faf5ff;
  --bg-dark: #1e1b4b;
  --bg-alt: #ede9fe;
  --text: #1e1b4b;
  --text-light: #6366f1;
  --heading-font: 'Space Grotesk', 'Noto Sans Thai', sans-serif;
  --body-font: 'Inter', 'Noto Sans Thai', sans-serif;
  --radius: 20px;
  --radius-sm: calc(20px * 0.5);
  --radius-lg: calc(20px * 1.5);
  --section-gap: 72px;
  --gradient-from: #7c3aed;
  --gradient-to: #06b6d4;
}

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

body {
  font-family: var(--body-font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--heading-font);
  line-height: 1.2;
}

a { color: #7c3aed; text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ===== Navigation ===== */
.nav { background: #faf5ff; border-bottom: 1px solid #e5e7eb; position: sticky; top: 0; z-index: 100; transition: background 0.3s; }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.nav-brand { font-family: var(--heading-font); font-weight: 700; font-size: 1.25rem; color: var(--primary); text-decoration: none; }
.nav-brand:hover { text-decoration: none; }
.nav-links { display: flex; gap: 32px; list-style: none; }
.nav-links a { color: var(--text-light); font-size: 0.875rem; font-weight: 500; transition: color 0.2s; text-decoration: none; }
.nav-links a:hover, .nav-links a.active { color: var(--primary); text-decoration: none; }

/* Hamburger */
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--text); margin: 5px 0; transition: 0.3s; }

/* Transparent nav variant */
.nav-transparent { background: transparent; border-bottom: none; position: fixed; width: 100%; }
.nav-transparent .nav-brand, .nav-transparent .nav-links a { color: white; }
.nav-transparent .nav-toggle span { background: white; }
.nav-transparent.scrolled { background: #faf5ff; border-bottom: 1px solid #e5e7eb; backdrop-filter: blur(12px); }
.nav-transparent.scrolled .nav-brand, .nav-transparent.scrolled .nav-links a { color: var(--text); }
.nav-transparent.scrolled .nav-links a.active { color: var(--primary); }
.nav-transparent.scrolled .nav-toggle span { background: var(--text); }

/* Solid nav variant */
.nav-solid { background: var(--primary); border-bottom: none; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.nav-solid .nav-brand { color: white; }
.nav-solid .nav-links a { color: rgba(255,255,255,0.85); }
.nav-solid .nav-links a:hover, .nav-solid .nav-links a.active { color: white; }
.nav-solid .nav-toggle span { background: white; }

/* ===== Buttons ===== */
.btn-primary {
  display: inline-block; padding: 12px 32px; background: var(--primary); color: white;
  border: none; border-radius: var(--radius); font-size: 0.875rem; font-weight: 600;
  cursor: pointer; transition: all 0.3s ease; text-decoration: none;
}
.btn-primary:hover { background: linear-gradient(135deg, var(--gradient-from), var(--gradient-to)); transform: translateY(-2px); box-shadow: 0 4px 15px rgba(var(--primary-rgb), 0.3); text-decoration: none; color: white; }

.btn-ghost {
  display: inline-block; padding: 12px 32px; background: transparent; color: white;
  border: 2px solid white; border-radius: var(--radius); font-size: 0.875rem; font-weight: 600;
  cursor: pointer; transition: all 0.3s ease; text-decoration: none;
}
.btn-ghost:hover { background: rgba(255,255,255,0.15); text-decoration: none; color: white; }

/* ===== Sections ===== */
section { padding: var(--section-gap) 0; }
.section-alt { background: var(--bg-alt); }
.section-title { font-size: 2rem; font-weight: 700; text-align: center; margin-bottom: 12px; }
.section-subtitle { text-align: center; color: var(--text-light); margin-bottom: 48px; max-width: 600px; margin-left: auto; margin-right: auto; }

/* ===== Cards ===== */

.card, .product-card { background: rgba(255,255,255,0.08); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-radius: var(--radius); border: 1px solid rgba(255,255,255,0.15); box-shadow: 0 8px 32px rgba(0,0,0,0.1); transition: transform 0.3s, box-shadow 0.3s; }
.card:hover, .product-card:hover { transform: translateY(-4px); box-shadow: 0 16px 48px rgba(0,0,0,0.15); }
.card { padding: 32px; }
.card-icon { color: var(--primary); margin-bottom: 16px; }
.card h3 { font-size: 1.125rem; font-weight: 600; margin-bottom: 8px; }
.card p { color: var(--text-light); font-size: 0.875rem; }

/* Product cards */
.product-card { overflow: hidden; }
.product-card-img { width: 100%; height: 220px; object-fit: cover; }
.product-card-body { padding: 24px; }
.product-card-body h3 { font-size: 1.125rem; font-weight: 600; margin-bottom: 8px; }
.product-card-body p { color: var(--text-light); font-size: 0.875rem; margin-bottom: 12px; }

/* Benefits list */
.benefits { list-style: none; margin-top: 12px; }
.benefits li { padding: 4px 0; font-size: 0.875rem; color: var(--text-light); }
.benefits li::before { content: "✓ "; color: var(--primary); font-weight: 700; }

/* Card grid */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; }

/* About grid */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.about-img { border-radius: var(--radius); width: 100%; height: 350px; object-fit: cover; }

/* ===== Stats ===== */
.stats-bar { padding: var(--section-gap) 0; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 24px; text-align: center; }
.stat-number { font-size: 2.25rem; font-weight: 700; color: var(--primary); font-family: var(--heading-font); }
.stat-label { font-size: 0.875rem; color: var(--text-light); margin-top: 4px; }

/* ===== Hero variants ===== */
.hero-split { display: grid; grid-template-columns: 1fr 1fr; min-height: 500px; overflow: hidden; }
.hero-content { display: flex; flex-direction: column; justify-content: center; padding: 64px 48px; background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: white; }
.hero-content h1 { font-size: 2.5rem; font-weight: 700; margin-bottom: 16px; line-height: 1.3; color: white; }
.hero-content p { font-size: 1.125rem; opacity: 0.9; margin-bottom: 32px; max-width: 500px; }
.hero-image { background-size: cover; background-position: center; min-height: 400px; }

.hero-centered { position: relative; min-height: 520px; overflow: hidden; display: flex; align-items: center; justify-content: center; text-align: center; }
.hero-centered .hero-bg-image { position: absolute; inset: 0; background-size: cover; background-position: center; }
.hero-centered .hero-overlay { position: absolute; inset: 0; background: linear-gradient(135deg, rgba(0,0,0,0.6), rgba(0,0,0,0.3)); }
.hero-centered .hero-inner { position: relative; z-index: 2; max-width: 700px; padding: 64px 24px; color: white; }
.hero-centered .hero-inner h1 { font-size: 2.75rem; font-weight: 700; margin-bottom: 16px; text-shadow: 0 2px 8px rgba(0,0,0,0.3); color: white; }
.hero-centered .hero-inner p { font-size: 1.125rem; opacity: 0.95; margin-bottom: 32px; }

.hero-stacked { overflow: hidden; }
.hero-stacked .hero-stacked-img { width: 100%; height: 350px; object-fit: cover; }
.hero-stacked .hero-stacked-body { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: white; padding: 48px; }
.hero-stacked .hero-stacked-body h1 { font-size: 2.25rem; font-weight: 700; margin-bottom: 12px; color: white; }
.hero-stacked .hero-stacked-body p { font-size: 1.125rem; opacity: 0.9; margin-bottom: 24px; }
.hero-stacked .hero-badge { display: inline-block; background: var(--accent); color: (token2) => "#000"; font-size: 0.75rem; font-weight: 600; padding: 4px 12px; border-radius: 9999px; margin-bottom: 16px; }

.hero-minimal { padding: 100px 0 80px; background: var(--bg-alt); text-align: center; }
.hero-minimal .hero-eyebrow { font-size: 0.875rem; font-weight: 600; color: var(--primary); letter-spacing: 2px; text-transform: uppercase; margin-bottom: 16px; }
.hero-minimal h1 { font-size: 3.25rem; font-weight: 800; margin-bottom: 24px; line-height: 1.15; }
.hero-minimal .hero-divider { width: 60px; height: 3px; background: var(--primary); margin: 0 auto 24px; }
.hero-minimal p { font-size: 1.25rem; color: var(--text-light); max-width: 600px; margin: 0 auto; }

/* Simple hero for sub-pages */
.hero-simple { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: white; padding: 60px 0; text-align: center; }
.hero-simple h1 { font-size: 2.25rem; font-weight: 700; margin-bottom: 12px; color: white; }
.hero-simple p { font-size: 1.125rem; opacity: 0.9; max-width: 600px; margin: 0 auto; }

/* ===== GIF Header ===== */
.gif-header { width: 100%; overflow: hidden; }
.gif-header a { display: block; width: 100%; }
.gif-header a:hover { text-decoration: none; }
.gif-header img { width: 100%; display: block; }

/* ===== Footer ===== */
.footer { background: #1e1b4b; color: #94a3b8; padding: 48px 0 24px; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 32px; margin-bottom: 32px; }
.footer h4 { color: white; font-size: 0.875rem; font-weight: 600; margin-bottom: 16px; font-family: var(--heading-font); }
.footer p, .footer a { font-size: 0.8125rem; color: #94a3b8; }
.footer a:hover { color: white; }
.footer-bottom { border-top: 1px solid #334155; padding-top: 24px; text-align: center; font-size: 0.75rem; }

/* Footer simple */
.footer-simple { background: #1e1b4b; color: #94a3b8; padding: 24px 0; }
.footer-simple-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.footer-simple a { color: #94a3b8; font-size: 0.8125rem; margin: 0 12px; }
.footer-simple a:hover { color: white; }

/* Footer centered */
.footer-centered { background: #1e1b4b; color: #94a3b8; padding: 48px 0 24px; text-align: center; }
.footer-centered h4 { color: white; font-family: var(--heading-font); font-size: 1.125rem; margin-bottom: 12px; }
.footer-centered p { font-size: 0.875rem; max-width: 400px; margin: 0 auto 24px; }
.footer-centered .footer-links { display: flex; justify-content: center; gap: 24px; margin-bottom: 24px; flex-wrap: wrap; }
.footer-centered .footer-links a { color: #94a3b8; font-size: 0.8125rem; }
.footer-centered .footer-links a:hover { color: white; }

/* ===== Carousel ===== */
.carousel-container { position: relative; overflow: hidden; }
.carousel-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; gap: 24px; padding: 8px 0; }
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-track .product-card { scroll-snap-align: start; flex: 0 0 calc(33.333% - 16px); min-width: 280px; }
.carousel-btn { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; background: var(--primary); color: white; border: none; cursor: pointer; font-size: 1.25rem; display: flex; align-items: center; justify-content: center; z-index: 5; box-shadow: 0 2px 8px rgba(0,0,0,0.2); transition: background 0.2s; }
.carousel-btn:hover { background: var(--primary-dark); }
.carousel-btn.prev { left: 8px; }
.carousel-btn.next { right: 8px; }
.carousel-dots { display: flex; justify-content: center; gap: 8px; margin-top: 20px; }
.carousel-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--text-light); opacity: 0.3; border: none; cursor: pointer; transition: opacity 0.3s, background 0.3s; }
.carousel-dot.active { opacity: 1; background: var(--primary); }

/* ===== Masonry ===== */
.masonry-grid { columns: 3; column-gap: 24px; }
.masonry-item { break-inside: avoid; margin-bottom: 24px; }

/* ===== Alternating layout ===== */
.alternating-row { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; margin-bottom: 48px; }
.alternating-row.reverse { direction: rtl; }
.alternating-row.reverse > * { direction: ltr; }
.alternating-img { width: 100%; height: 300px; object-fit: cover; border-radius: var(--radius); }

/* ===== Timeline ===== */
.timeline { position: relative; padding-left: 40px; }
.timeline::before { content: ''; position: absolute; left: 15px; top: 0; bottom: 0; width: 2px; background: var(--primary); opacity: 0.3; }
.timeline-item { position: relative; margin-bottom: 32px; }
.timeline-item::before { content: ''; position: absolute; left: -33px; top: 6px; width: 14px; height: 14px; border-radius: 50%; background: var(--primary); border: 3px solid var(--bg); }
.timeline-year { font-family: var(--heading-font); font-weight: 700; color: var(--primary); font-size: 1.125rem; margin-bottom: 4px; }
.timeline-text { color: var(--text-light); font-size: 0.9375rem; }

/* ===== Stats variants ===== */
.stats-horizontal { background: var(--bg-dark); color: white; padding: var(--section-gap) 0; }
.stats-horizontal .stat-number { color: var(--accent); }
.stats-horizontal .stat-label { color: rgba(255,255,255,0.7); }

.stats-cards .stat-card { background: var(--bg-alt); border-radius: var(--radius); padding: 32px; text-align: center; }
.stats-cards .stat-card .stat-icon { color: var(--primary); margin-bottom: 12px; }

.stats-banner { background: linear-gradient(135deg, var(--gradient-from), var(--gradient-to)); color: white; padding: 48px 0; }
.stats-banner .stats-grid { display: flex; justify-content: center; align-items: center; gap: 0; }
.stats-banner .stat-item { padding: 0 40px; text-align: center; }
.stats-banner .stat-item + .stat-item { border-left: 1px solid rgba(255,255,255,0.3); }
.stats-banner .stat-number { color: white; }
.stats-banner .stat-label { color: rgba(255,255,255,0.8); }

/* ===== Contact variants ===== */
.contact-split { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.contact-map { border-radius: var(--radius); overflow: hidden; min-height: 400px; }
.contact-cards-stack { display: flex; flex-direction: column; gap: 16px; }
.contact-card { background: var(--bg-alt); border-radius: var(--radius); padding: 20px; display: flex; align-items: center; gap: 14px; }
.contact-card-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.contact-card-label { font-size: 0.75rem; color: var(--text-light); margin-bottom: 2px; }
.contact-card-value { font-weight: 500; color: var(--text); }

.contact-full-map { border-radius: var(--radius); overflow: hidden; height: 350px; margin-bottom: 32px; }
.contact-cards-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }

.contact-cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
.contact-big-card { background: var(--bg-alt); border-radius: var(--radius); padding: 32px; text-align: center; }
.contact-big-card .contact-big-icon { width: 56px; height: 56px; border-radius: 14px; display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; }

/* ===== WhyChoose Variants ===== */
.wc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; }
.wc-grid-item { padding: 32px; }
.wc-grid-item .wc-icon { color: var(--primary); margin-bottom: 16px; }
.wc-grid-item h3 { font-size: 1.125rem; font-weight: 600; margin-bottom: 8px; }
.wc-grid-item p { color: var(--text-light); font-size: 0.875rem; line-height: 1.7; }

.wc-list { max-width: 800px; margin: 0 auto; }
.wc-list-item { display: flex; gap: 24px; align-items: flex-start; padding: 32px 0; border-bottom: 1px solid #7c3aed15; }
.wc-list-item:last-child { border-bottom: none; }
.wc-list-num { font-family: var(--heading-font); font-size: 3rem; font-weight: 800; color: var(--primary); opacity: 0.2; line-height: 1; min-width: 60px; }
.wc-list-body h3 { font-size: 1.125rem; font-weight: 600; margin-bottom: 6px; }
.wc-list-body p { color: var(--text-light); font-size: 0.875rem; line-height: 1.7; }

.wc-alt { max-width: 800px; margin: 0 auto; }
.wc-alt-item { display: flex; gap: 24px; padding: 28px 0; }
.wc-alt-item:nth-child(even) { flex-direction: row-reverse; text-align: right; }
.wc-alt-bar { width: 4px; background: linear-gradient(180deg, var(--gradient-from), var(--gradient-to)); border-radius: 2px; flex-shrink: 0; }
.wc-alt-body h3 { font-size: 1.125rem; font-weight: 600; margin-bottom: 6px; }
.wc-alt-body p { color: var(--text-light); font-size: 0.875rem; line-height: 1.7; }

.wc-minimal { max-width: 700px; margin: 0 auto; }
.wc-minimal-item { padding: 24px 0; }
.wc-minimal-item + .wc-minimal-item { border-top: 1px solid #7c3aed10; }
.wc-minimal-item h3 { font-size: 1rem; font-weight: 600; margin-bottom: 4px; letter-spacing: 0.02em; }
.wc-minimal-item p { color: var(--text-light); font-size: 0.875rem; line-height: 1.7; }

/* ===== Privacy ===== */
.privacy-content h3 { font-size: 1.125rem; font-weight: 600; color: var(--text); margin: 24px 0 12px; }
.privacy-content h3:first-child { margin-top: 0; }
.privacy-content p { margin-bottom: 12px; }
.privacy-content ul { margin: 8px 0 16px 24px; }
.privacy-content li { margin-bottom: 6px; }

/* ===== Animations ===== */

.animate-on-scroll { opacity: 0; transform: scale(0.95); transition: opacity 0.5s ease, transform 0.5s ease; }
.animate-on-scroll.visible { opacity: 1; transform: scale(1); }

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .hero-split { grid-template-columns: 1fr; }
  .hero-content { padding: 40px 24px; }
  .hero-content h1 { font-size: 1.75rem; }
  .hero-image { min-height: 250px; }
  .hero-centered { min-height: 400px; }
  .hero-centered .hero-inner h1 { font-size: 1.75rem; }
  .hero-centered .hero-inner { padding: 32px 24px; }
  .hero-stacked .hero-stacked-img { height: 250px; }
  .hero-stacked .hero-stacked-body { padding: 32px 24px; }
  .hero-stacked .hero-stacked-body h1 { font-size: 1.75rem; }
  .hero-minimal { padding: 60px 0 48px; }
  .hero-minimal h1 { font-size: 2rem; }
  .hero-simple { padding: 40px 0; }
  .hero-simple h1 { font-size: 1.75rem; }
  .nav-links { display: none; position: absolute; top: 64px; left: 0; right: 0; background: #faf5ff; flex-direction: column; padding: 16px 24px; gap: 12px; border-bottom: 1px solid #e5e7eb; box-shadow: 0 4px 12px rgba(0,0,0,0.1); z-index: 99; }
  .nav-links.open { display: flex; }
  .nav-toggle { display: block; }
  .nav-transparent .nav-links { background: #faf5ff; }
  .nav-transparent .nav-links a { color: var(--text); }
  .nav-solid .nav-links { background: var(--primary); }
  section { padding: calc(var(--section-gap) * 0.6) 0; }
  .section-title { font-size: 1.5rem; }
  .about-grid { grid-template-columns: 1fr; }
  .about-img { height: 250px; }
  .product-card-img { height: 180px; }
  .card-grid { grid-template-columns: 1fr; }
  .alternating-row { grid-template-columns: 1fr; }
  .alternating-row.reverse { direction: ltr; }
  .alternating-img { height: 220px; }
  .masonry-grid { columns: 1; }
  .contact-split { grid-template-columns: 1fr; }
  .contact-map { min-height: 250px; }
  .carousel-track .product-card { flex: 0 0 calc(100% - 16px); }
  .stats-banner .stats-grid { flex-wrap: wrap; }
  .stats-banner .stat-item { padding: 16px 24px; }
  .stats-banner .stat-item + .stat-item { border-left: none; border-top: 1px solid rgba(255,255,255,0.3); }
  .footer-simple-inner { flex-direction: column; text-align: center; }
  .wc-grid { grid-template-columns: 1fr; }
  .wc-list-item { gap: 16px; }
  .wc-list-num { font-size: 2rem; min-width: 40px; }
  .wc-alt-item, .wc-alt-item:nth-child(even) { flex-direction: column; text-align: left; }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .carousel-track .product-card { flex: 0 0 calc(50% - 12px); }
  .masonry-grid { columns: 2; }
}