/* ============================================
   C'smax Premium Skincare - Global Styles
   ============================================ */

:root {
  --gold: #c9a05a;
  --gold-light: #e8c98b;
  --gold-dark: #8c6f3a;
  --navy: #1a2849;
  --navy-deep: #0d1832;
  --navy-light: #2a3a5e;
  --ivory: #faf7f2;
  --cream: #f5ede0;
  --charcoal: #2c2c2c;
  --gray-100: #f8f9fa;
  --gray-200: #e9ecef;
  --gray-300: #dee2e6;
  --gray-500: #adb5bd;
  --gray-700: #495057;
  --gray-900: #212529;
  --white: #ffffff;
  --shadow-sm: 0 2px 8px rgba(26, 40, 73, 0.06);
  --shadow-md: 0 8px 24px rgba(26, 40, 73, 0.10);
  --shadow-lg: 0 20px 50px rgba(26, 40, 73, 0.15);
  --shadow-gold: 0 8px 24px rgba(201, 160, 90, 0.25);
  --radius-sm: 6px;
  --radius: 12px;
  --radius-lg: 20px;
  --font-th: 'Sarabun', 'Noto Sans Thai', system-ui, sans-serif;
  --font-zh: 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  --font-en: 'Inter', 'Segoe UI', system-ui, sans-serif;
  --serif: 'Playfair Display', 'Times New Roman', serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-th), var(--font-zh), var(--font-en);
  background: var(--ivory);
  color: var(--charcoal);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ============ Typography ============ */
h1, h2, h3, h4 { font-weight: 600; line-height: 1.2; color: var(--navy); }
h1 { font-size: clamp(2rem, 4vw, 3.5rem); font-family: var(--serif); }
h2 { font-size: clamp(1.5rem, 3vw, 2.5rem); font-family: var(--serif); }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.125rem; }

a { color: var(--navy); text-decoration: none; transition: color .2s; }
a:hover { color: var(--gold); }

p { margin-bottom: 1rem; }

.brand-script { font-family: var(--serif); color: var(--navy); font-style: italic; }
.gold { color: var(--gold); }

/* ============ Top Bar ============ */
.topbar {
  background: var(--navy-deep);
  color: var(--gold-light);
  font-size: 0.8rem;
  padding: 8px 0;
  text-align: center;
}
.topbar-content { display: flex; justify-content: space-between; align-items: center; max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.topbar a { color: var(--gold-light); }
.topbar .lang-switch button {
  background: transparent; border: 1px solid var(--gold); color: var(--gold-light);
  padding: 4px 10px; margin: 0 2px; border-radius: 4px; cursor: pointer; font-size: 0.75rem;
}
.topbar .lang-switch button.active { background: var(--gold); color: var(--navy-deep); }

/* ============ Navigation ============ */
.navbar {
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--gray-200);
  position: sticky; top: 0; z-index: 100;
  transition: box-shadow .3s;
}
.navbar.scrolled { box-shadow: var(--shadow-sm); }
.nav-inner {
  max-width: 1280px; margin: 0 auto; padding: 16px 24px;
  display: flex; align-items: center; justify-content: space-between;
}
.brand {
  display: flex; align-items: center; gap: 12px; cursor: pointer;
}
.brand-mark {
  width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  display: flex; align-items: center; justify-content: center;
  color: var(--gold); font-family: var(--serif); font-size: 1.5rem; font-weight: 700;
  box-shadow: var(--shadow-gold);
}
.brand-name {
  font-family: var(--serif); font-size: 1.4rem; color: var(--navy); font-weight: 700;
  line-height: 1;
}
.brand-tag { font-size: 0.7rem; color: var(--gold); letter-spacing: 1px; }

.nav-links { display: flex; gap: 32px; align-items: center; list-style: none; }
.nav-links a {
  font-size: 0.95rem; color: var(--navy); font-weight: 500;
  position: relative;
}
.nav-links a::after {
  content: ''; position: absolute; bottom: -6px; left: 0;
  width: 0; height: 2px; background: var(--gold); transition: width .3s;
}
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }

.nav-actions { display: flex; align-items: center; gap: 16px; }
.nav-btn {
  background: transparent; border: none; cursor: pointer; color: var(--navy);
  font-size: 1.1rem; padding: 8px; border-radius: 50%; transition: background .2s;
  position: relative;
}
.nav-btn:hover { background: var(--cream); }
.cart-badge {
  position: absolute; top: 0; right: 0;
  background: var(--gold); color: var(--navy-deep);
  border-radius: 50%; width: 18px; height: 18px;
  font-size: 0.65rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

.menu-toggle { display: none; }

@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-links.open {
    display: flex; flex-direction: column; gap: 16px;
    position: absolute; top: 100%; left: 0; right: 0;
    background: white; padding: 24px; box-shadow: var(--shadow-md);
  }
  .menu-toggle { display: block; }
}

/* ============ Buttons ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 28px; border-radius: 999px;
  font-weight: 600; font-size: 0.95rem; cursor: pointer;
  border: none; transition: all .25s; text-decoration: none;
  font-family: inherit;
}
.btn-primary {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
  color: var(--white); box-shadow: var(--shadow-gold);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(201,160,90,0.4); color: white; }
.btn-navy {
  background: var(--navy); color: var(--white);
}
.btn-navy:hover { background: var(--navy-deep); color: white; }
.btn-outline {
  background: transparent; color: var(--navy);
  border: 2px solid var(--navy);
}
.btn-outline:hover { background: var(--navy); color: var(--white); }
.btn-ghost {
  background: transparent; color: var(--navy);
  border: 1px solid var(--gray-300);
}
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }
.btn-sm { padding: 8px 16px; font-size: 0.85rem; }
.btn-lg { padding: 16px 36px; font-size: 1rem; }
.btn-block { width: 100%; }

/* ============ Container ============ */
.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.section { padding: 80px 0; }
.section-sm { padding: 48px 0; }
.section-title {
  text-align: center; margin-bottom: 12px;
}
.section-eyebrow {
  display: inline-block; color: var(--gold); font-size: 0.85rem;
  letter-spacing: 3px; text-transform: uppercase; font-weight: 600;
  margin-bottom: 12px;
}
.section-subtitle {
  text-align: center; color: var(--gray-700);
  max-width: 600px; margin: 0 auto 48px;
  font-size: 1.05rem;
}

/* ============ Hero ============ */
.hero {
  background:
    radial-gradient(ellipse at top right, rgba(201,160,90,0.15) 0%, transparent 60%),
    radial-gradient(ellipse at bottom left, rgba(26,40,73,0.08) 0%, transparent 60%),
    linear-gradient(180deg, var(--ivory) 0%, var(--cream) 100%);
  padding: 100px 0 80px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; top: -100px; right: -100px;
  width: 400px; height: 400px; border-radius: 50%;
  background: radial-gradient(circle, rgba(201,160,90,0.2), transparent 70%);
  z-index: 0;
}
.hero-inner {
  max-width: 1280px; margin: 0 auto; padding: 0 24px;
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 60px;
  align-items: center; position: relative; z-index: 1;
}
.hero h1 {
  font-family: var(--serif);
  font-size: clamp(2.4rem, 5vw, 4rem);
  line-height: 1.1;
  margin-bottom: 20px;
}
.hero h1 .accent {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero p.lead {
  font-size: 1.15rem; color: var(--gray-700);
  margin-bottom: 32px; max-width: 520px;
}
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; }

.hero-stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 24px; margin-top: 48px;
  padding-top: 32px; border-top: 1px solid var(--gray-300);
  max-width: 520px;
}
.stat-num {
  font-family: var(--serif); font-size: 2rem;
  color: var(--gold); font-weight: 700; line-height: 1;
}
.stat-label { font-size: 0.8rem; color: var(--gray-700); margin-top: 4px; }

.hero-visual {
  position: relative; display: flex; justify-content: center; align-items: center;
  min-height: 480px;
}
.hero-bottle {
  width: 100%; max-width: 460px; height: auto;
  filter: drop-shadow(0 30px 60px rgba(26,40,73,0.25));
  border-radius: var(--radius);
  animation: float 6s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-15px) rotate(-1deg); }
}
.hero-decoration {
  position: absolute; width: 200px; height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201,160,90,0.25), transparent 70%);
  top: 20%; right: -20px; z-index: -1;
}

@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; gap: 40px; }
  .hero-visual { order: -1; }
  .hero-stats { grid-template-columns: repeat(3, 1fr); gap: 16px; }
}

/* ============ Trust Strip ============ */
.trust-strip {
  background: var(--navy);
  color: var(--ivory);
  padding: 24px 0;
}
.trust-inner {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
  text-align: center;
}
.trust-item .icon { font-size: 1.8rem; color: var(--gold); margin-bottom: 4px; }
.trust-item .label { font-size: 0.85rem; opacity: 0.9; }
@media (max-width: 700px) { .trust-inner { grid-template-columns: repeat(2, 1fr); } }

/* ============ Categories ============ */
.categories-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px;
}
.category-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 32px 20px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all .3s;
  border: 1px solid transparent;
}
.category-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
  border-color: var(--gold);
}
.category-icon { font-size: 2.5rem; margin-bottom: 12px; }
.category-name { font-size: 1rem; font-weight: 600; color: var(--navy); }
.category-count { font-size: 0.8rem; color: var(--gray-500); margin-top: 4px; }

@media (max-width: 900px) { .categories-grid { grid-template-columns: repeat(2, 1fr); } }

/* ============ Product Card ============ */
.products-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px;
}
.product-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all .3s;
  cursor: pointer;
  display: flex; flex-direction: column;
  border: 1px solid var(--gray-200);
}
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--gold);
}
.product-image {
  aspect-ratio: 1 / 1;
  background: linear-gradient(135deg, var(--cream) 0%, var(--ivory) 100%);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; position: relative;
}
.product-image img { width: 100%; height: 100%; object-fit: cover; }
.product-image .no-img {
  font-family: var(--serif); font-size: 2.5rem;
  color: var(--gold); opacity: 0.4;
}
.product-badge {
  position: absolute; top: 12px; left: 12px;
  background: var(--gold); color: var(--navy-deep);
  padding: 4px 10px; border-radius: 999px;
  font-size: 0.7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px;
}
.product-badge.new { background: var(--navy); color: var(--gold); }
.product-info { padding: 16px; flex: 1; display: flex; flex-direction: column; }
.product-cat {
  font-size: 0.7rem; color: var(--gold-dark);
  text-transform: uppercase; letter-spacing: 1px;
  font-weight: 600;
}
.product-name {
  font-size: 0.95rem; color: var(--navy); font-weight: 600;
  margin: 6px 0; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
  min-height: 2.7em;
}
.product-size { font-size: 0.8rem; color: var(--gray-500); margin-bottom: 8px; }
.product-footer {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: auto; padding-top: 12px;
  border-top: 1px solid var(--gray-200);
}
.product-price {
  font-family: var(--serif);
  font-size: 1.25rem; color: var(--navy); font-weight: 700;
}
.product-price .currency { font-size: 0.9rem; color: var(--gold); margin-right: 4px; }
.add-cart-btn {
  background: var(--navy); color: var(--white);
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: none; cursor: pointer; transition: all .2s;
  font-size: 1rem;
}
.add-cart-btn:hover { background: var(--gold); transform: scale(1.1); }

@media (max-width: 1100px) { .products-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px) { .products-grid { grid-template-columns: repeat(2, 1fr); } }

/* ============ AI Skin Test ============ */
.ai-section {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-deep) 100%);
  color: var(--white);
  position: relative;
  overflow: hidden;
}
.ai-section::before {
  content: ''; position: absolute; top: -50%; right: -10%;
  width: 600px; height: 600px; border-radius: 50%;
  background: radial-gradient(circle, rgba(201,160,90,0.2), transparent 60%);
}
.ai-inner {
  display: grid; grid-template-columns: 1fr 1fr; gap: 60px;
  align-items: center; position: relative; z-index: 1;
}
.ai-section h2 { color: var(--white); }
.ai-section h2 .accent { color: var(--gold); }
.ai-section .section-subtitle { color: rgba(255,255,255,0.8); }

.ai-feature-list { list-style: none; padding: 0; margin: 24px 0 32px; }
.ai-feature-list li {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 0; color: rgba(255,255,255,0.9);
}
.ai-feature-list .check {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--gold); color: var(--navy);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-weight: 700; font-size: 0.8rem;
}

.ai-card {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(201,160,90,0.3);
  border-radius: var(--radius-lg);
  padding: 32px;
  backdrop-filter: blur(10px);
}
.ai-card-step { display: none; }
.ai-card-step.active { display: block; }
.ai-card-progress {
  display: flex; gap: 8px; margin-bottom: 24px;
}
.ai-card-progress .dot {
  flex: 1; height: 4px; background: rgba(255,255,255,0.2);
  border-radius: 2px; transition: background .3s;
}
.ai-card-progress .dot.active { background: var(--gold); }
.ai-card-progress .dot.done { background: var(--gold-light); }

.ai-question { font-size: 1.2rem; font-weight: 600; margin-bottom: 20px; }
.ai-options { display: grid; gap: 12px; }
.ai-option {
  background: rgba(255,255,255,0.08);
  border: 2px solid rgba(255,255,255,0.1);
  border-radius: var(--radius); padding: 16px;
  cursor: pointer; transition: all .2s;
  display: flex; align-items: center; gap: 12px;
}
.ai-option:hover { border-color: var(--gold); background: rgba(201,160,90,0.1); }
.ai-option.selected { border-color: var(--gold); background: rgba(201,160,90,0.15); }
.ai-option .emoji { font-size: 1.5rem; }

.ai-result { text-align: center; }
.ai-result h3 { color: var(--white); font-family: var(--serif); }
.ai-result-products { margin-top: 24px; }

@media (max-width: 900px) { .ai-inner { grid-template-columns: 1fr; gap: 32px; } }

/* ============ Membership ============ */
.membership-section { background: var(--cream); }
.tier-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.tier-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  text-align: center;
  border: 2px solid var(--gray-200);
  transition: all .3s;
  position: relative; overflow: hidden;
}
.tier-card.featured {
  border-color: var(--gold);
  transform: scale(1.05);
  box-shadow: var(--shadow-lg);
}
.tier-card.featured::before {
  content: 'MOST POPULAR'; position: absolute; top: 16px; right: -32px;
  background: var(--gold); color: var(--navy-deep);
  font-size: 0.65rem; font-weight: 700; padding: 4px 36px;
  transform: rotate(45deg); letter-spacing: 1px;
}
.tier-icon { font-size: 2.5rem; margin-bottom: 8px; }
.tier-name {
  font-family: var(--serif); font-size: 1.4rem; color: var(--navy);
  font-weight: 700;
}
.tier-points { color: var(--gold); font-size: 0.85rem; margin: 8px 0 16px; font-weight: 600; }
.tier-benefits { list-style: none; padding: 0; margin: 16px 0; text-align: left; }
.tier-benefits li {
  padding: 8px 0; font-size: 0.85rem; color: var(--gray-700);
  border-bottom: 1px dashed var(--gray-200);
  display: flex; align-items: flex-start; gap: 8px;
}
.tier-benefits li::before { content: '✓'; color: var(--gold); font-weight: 700; }

@media (max-width: 900px) { .tier-grid { grid-template-columns: 1fr; } .tier-card.featured { transform: none; } }

/* ============ Testimonials ============ */
.testimonials { background: var(--white); }
.test-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.test-card {
  background: var(--ivory);
  padding: 32px;
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
}
.test-stars { color: var(--gold); font-size: 1rem; margin-bottom: 12px; }
.test-text { font-style: italic; color: var(--gray-700); margin-bottom: 16px; }
.test-author { display: flex; align-items: center; gap: 12px; }
.test-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  display: flex; align-items: center; justify-content: center;
  color: var(--white); font-weight: 700;
}
.test-name { font-weight: 600; color: var(--navy); }
.test-loc { font-size: 0.8rem; color: var(--gray-500); }
@media (max-width: 900px) { .test-grid { grid-template-columns: 1fr; } }

/* ============ Footer ============ */
.footer {
  background: var(--navy-deep); color: rgba(255,255,255,0.7);
  padding: 64px 0 32px;
}
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px; margin-bottom: 48px;
}
.footer h4 { color: var(--white); margin-bottom: 16px; font-size: 1rem; }
.footer-brand .brand-name { color: var(--white); }
.footer-brand p { margin-top: 12px; font-size: 0.9rem; }
.footer ul { list-style: none; }
.footer li { margin-bottom: 10px; }
.footer a { color: rgba(255,255,255,0.7); font-size: 0.9rem; }
.footer a:hover { color: var(--gold); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 24px; text-align: center; font-size: 0.85rem;
}
.footer-social { display: flex; gap: 12px; margin-top: 16px; }
.footer-social a {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,0.08);
  display: flex; align-items: center; justify-content: center;
  transition: all .2s;
}
.footer-social a:hover { background: var(--gold); color: var(--navy); }

@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }

/* ============ Modal ============ */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(13,24,50,0.7);
  display: none; align-items: center; justify-content: center;
  z-index: 200; padding: 24px;
  backdrop-filter: blur(4px);
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--white); border-radius: var(--radius-lg);
  max-width: 900px; width: 100%; max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-lg); position: relative;
}
.modal-sm { max-width: 480px; }
.modal-close {
  position: absolute; top: 16px; right: 16px;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--gray-100); border: none;
  font-size: 1.2rem; cursor: pointer; color: var(--navy);
  display: flex; align-items: center; justify-content: center;
  transition: all .2s;
}
.modal-close:hover { background: var(--gold); color: var(--white); }
.modal-header { padding: 32px 32px 0; }
.modal-body { padding: 24px 32px 32px; }

/* ============ Product Detail Modal ============ */
.product-detail {
  display: grid; grid-template-columns: 1fr 1fr; gap: 32px;
  padding: 32px;
}
.pd-image {
  aspect-ratio: 1 / 1; border-radius: var(--radius);
  background: linear-gradient(135deg, var(--cream), var(--ivory));
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.pd-image img { width: 100%; height: 100%; object-fit: cover; }
.pd-info { display: flex; flex-direction: column; }
.pd-cat { color: var(--gold-dark); font-size: 0.85rem; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; }
.pd-name { font-family: var(--serif); font-size: 1.8rem; color: var(--navy); margin: 8px 0 16px; }
.pd-meta { display: flex; gap: 16px; margin-bottom: 16px; }
.pd-meta-item {
  background: var(--cream); padding: 8px 14px; border-radius: var(--radius-sm);
  font-size: 0.85rem; color: var(--gray-700);
}
.pd-benefit {
  background: var(--ivory); padding: 16px; border-radius: var(--radius);
  border-left: 3px solid var(--gold); margin: 16px 0;
  font-size: 0.95rem; color: var(--gray-700); line-height: 1.7;
}
.pd-price {
  font-family: var(--serif); font-size: 2.4rem; color: var(--navy);
  font-weight: 700; margin: 16px 0;
}
.pd-price .currency { font-size: 1.4rem; color: var(--gold); margin-right: 6px; }
.pd-actions { display: flex; gap: 12px; margin-top: 16px; }

@media (max-width: 700px) { .product-detail { grid-template-columns: 1fr; padding: 16px; } }

/* ============ Filters Bar ============ */
.filters-bar {
  display: flex; gap: 12px; flex-wrap: wrap;
  background: var(--white); padding: 16px;
  border-radius: var(--radius); margin-bottom: 32px;
  box-shadow: var(--shadow-sm);
  align-items: center;
}
.filter-search {
  flex: 1; min-width: 200px;
  padding: 10px 16px; border: 1px solid var(--gray-300);
  border-radius: var(--radius); font-size: 0.95rem;
  font-family: inherit;
}
.filter-chip {
  background: var(--gray-100); border: 1px solid var(--gray-300);
  padding: 8px 16px; border-radius: 999px;
  cursor: pointer; font-size: 0.85rem;
  font-family: inherit; transition: all .2s;
}
.filter-chip.active, .filter-chip:hover {
  background: var(--gold); color: var(--white); border-color: var(--gold);
}
.filter-select {
  padding: 10px 16px; border: 1px solid var(--gray-300);
  border-radius: var(--radius); font-family: inherit; font-size: 0.9rem;
}

/* ============ Cart Drawer ============ */
.cart-drawer {
  position: fixed; top: 0; right: -440px;
  width: 100%; max-width: 420px; height: 100vh;
  background: var(--white); z-index: 200;
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
  transition: right .3s;
}
.cart-drawer.open { right: 0; }
.cart-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4);
  display: none; z-index: 199;
}
.cart-overlay.open { display: block; }
.cart-header {
  padding: 24px; border-bottom: 1px solid var(--gray-200);
  display: flex; justify-content: space-between; align-items: center;
}
.cart-header h3 { font-family: var(--serif); }
.cart-items { flex: 1; overflow-y: auto; padding: 16px 24px; }
.cart-item {
  display: grid; grid-template-columns: 64px 1fr auto;
  gap: 12px; padding: 12px 0;
  border-bottom: 1px solid var(--gray-200);
}
.cart-item img { width: 64px; height: 64px; object-fit: cover; border-radius: var(--radius-sm); }
.cart-item .name { font-size: 0.9rem; color: var(--navy); font-weight: 600; }
.cart-item .qty {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 6px;
}
.cart-item .qty button {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--gray-100); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.cart-item .price { font-weight: 600; color: var(--navy); }
.cart-empty {
  text-align: center; padding: 60px 20px; color: var(--gray-500);
}
.cart-empty .icon { font-size: 3rem; opacity: 0.3; }
.cart-footer {
  padding: 24px; border-top: 1px solid var(--gray-200);
  background: var(--ivory);
}
.cart-summary { display: flex; justify-content: space-between; margin-bottom: 8px; }
.cart-total {
  display: flex; justify-content: space-between;
  padding-top: 12px; margin-top: 12px;
  border-top: 1px solid var(--gray-300);
  font-weight: 700; font-size: 1.1rem; color: var(--navy);
}
.discount-tag {
  background: #d4edda; color: #155724; padding: 4px 8px;
  border-radius: var(--radius-sm); font-size: 0.8rem;
  margin-top: 8px; display: inline-block;
}

/* ============ Toast ============ */
.toast-container {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 300; display: flex; flex-direction: column; gap: 8px;
}
.toast {
  background: var(--navy); color: var(--white);
  padding: 14px 20px; border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  animation: slideIn .3s; display: flex; align-items: center; gap: 12px;
  max-width: 320px; font-size: 0.9rem;
}
.toast.success { background: #2d6a4f; }
.toast.error { background: #c44536; }
.toast .icon { font-size: 1.2rem; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ============ Auth Modal ============ */
.auth-tabs { display: flex; border-bottom: 1px solid var(--gray-200); margin-bottom: 24px; }
.auth-tab {
  flex: 1; padding: 14px; background: transparent;
  border: none; border-bottom: 3px solid transparent;
  font-family: inherit; font-size: 0.95rem; font-weight: 600;
  color: var(--gray-500); cursor: pointer;
}
.auth-tab.active { color: var(--navy); border-bottom-color: var(--gold); }

.form-group { margin-bottom: 16px; }
.form-label {
  display: block; font-size: 0.85rem; color: var(--gray-700);
  margin-bottom: 6px; font-weight: 600;
}
.form-input {
  width: 100%; padding: 12px 16px;
  border: 1px solid var(--gray-300); border-radius: var(--radius);
  font-family: inherit; font-size: 0.95rem;
  transition: border-color .2s;
}
.form-input:focus { outline: none; border-color: var(--gold); }
.form-help { font-size: 0.8rem; color: var(--gray-500); margin-top: 4px; }

/* ============ Chat Widget ============ */
.chat-launcher {
  position: fixed; bottom: 24px; right: 24px;
  width: 60px; height: 60px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
  color: var(--white); border: none;
  box-shadow: var(--shadow-lg);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; z-index: 150;
  font-size: 1.6rem;
  transition: transform .2s;
}
.chat-launcher:hover { transform: scale(1.1); }
.chat-launcher .pulse {
  position: absolute; inset: 0; border-radius: 50%;
  background: var(--gold); opacity: 0.5;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { transform: scale(1); opacity: 0.5; }
  100% { transform: scale(1.5); opacity: 0; }
}

.chat-window {
  position: fixed; bottom: 100px; right: 24px;
  width: 380px; max-width: calc(100vw - 48px);
  height: 540px; max-height: calc(100vh - 140px);
  background: var(--white); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: none; flex-direction: column; overflow: hidden;
  z-index: 150;
}
.chat-window.open { display: flex; animation: slideIn .3s; }
.chat-header {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-deep) 100%);
  color: var(--white); padding: 16px 20px;
  display: flex; align-items: center; gap: 12px;
}
.chat-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--gold); color: var(--navy);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1.1rem;
}
.chat-header-info { flex: 1; }
.chat-header-name { font-weight: 600; }
.chat-status { font-size: 0.75rem; opacity: 0.8; }
.chat-status::before {
  content: ''; display: inline-block; width: 8px; height: 8px;
  background: #4ade80; border-radius: 50%; margin-right: 6px;
}
.chat-messages {
  flex: 1; overflow-y: auto;
  padding: 16px;
  background: var(--ivory);
  display: flex; flex-direction: column; gap: 8px;
}
.chat-msg {
  max-width: 85%; padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 0.9rem; line-height: 1.5;
  animation: fadeIn .3s;
}
.chat-msg.bot {
  background: var(--white); color: var(--charcoal);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.chat-msg.user {
  background: var(--navy); color: var(--white);
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.chat-msg.bot strong { color: var(--gold-dark); }
.chat-msg.product-card-mini {
  background: var(--white); border: 1px solid var(--gold);
  padding: 12px; max-width: 90%;
  align-self: flex-start;
  display: flex; gap: 10px; cursor: pointer;
}
.chat-msg.product-card-mini img { width: 50px; height: 50px; object-fit: cover; border-radius: 6px; }
.chat-quick { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 12px; background: var(--ivory); }
.chat-quick button {
  background: var(--white); border: 1px solid var(--gold);
  color: var(--gold-dark); padding: 6px 12px;
  border-radius: 999px; font-size: 0.8rem;
  cursor: pointer; font-family: inherit;
}
.chat-quick button:hover { background: var(--gold); color: var(--white); }
.chat-input {
  padding: 12px 16px;
  border-top: 1px solid var(--gray-200);
  display: flex; gap: 8px;
  background: var(--white);
}
.chat-input input {
  flex: 1; padding: 10px 14px;
  border: 1px solid var(--gray-300); border-radius: 999px;
  font-family: inherit; font-size: 0.9rem;
}
.chat-input input:focus { outline: none; border-color: var(--gold); }
.chat-input button {
  background: var(--gold); color: var(--white);
  border: none; width: 38px; height: 38px;
  border-radius: 50%; cursor: pointer;
}

@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ============ Blog ============ */
.blog-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.blog-card {
  background: var(--white); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-sm);
  transition: all .3s;
}
.blog-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.blog-thumb {
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, var(--cream), var(--ivory));
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem; color: var(--gold);
}
.blog-body { padding: 20px; }
.blog-cat { color: var(--gold-dark); font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; }
.blog-title { font-size: 1.1rem; color: var(--navy); margin: 8px 0; line-height: 1.4; }
.blog-excerpt { color: var(--gray-700); font-size: 0.9rem; line-height: 1.6; }
.blog-meta { color: var(--gray-500); font-size: 0.8rem; margin-top: 12px; }
@media (max-width: 900px) { .blog-grid { grid-template-columns: 1fr; } }

/* ============ CTA Strip ============ */
.cta-strip {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
  padding: 48px 0;
  color: var(--white);
}
.cta-inner {
  display: flex; justify-content: space-between; align-items: center;
  gap: 32px; flex-wrap: wrap;
}
.cta-inner h2 { color: var(--white); margin-bottom: 8px; }
.cta-inner p { font-size: 1.05rem; opacity: 0.95; margin: 0; }
.cta-inner .btn-primary {
  background: var(--navy); color: var(--gold-light);
}
.cta-inner .btn-primary:hover { background: var(--navy-deep); }

/* ============ Profile Page ============ */
.profile-page { padding: 48px 0 80px; }
.profile-grid {
  display: grid; grid-template-columns: 280px 1fr; gap: 32px;
}
.profile-sidebar {
  background: var(--white); padding: 24px;
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  height: fit-content;
}
.profile-avatar {
  width: 80px; height: 80px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  display: flex; align-items: center; justify-content: center;
  color: var(--white); font-size: 2rem; font-weight: 700;
  margin: 0 auto 16px;
}
.profile-name { text-align: center; font-weight: 600; color: var(--navy); }
.profile-tier { text-align: center; margin: 8px 0; color: var(--gold-dark); font-size: 0.9rem; }
.profile-points {
  background: var(--cream); padding: 12px; border-radius: var(--radius);
  text-align: center; margin: 16px 0;
}
.profile-points .num { font-size: 1.5rem; font-weight: 700; color: var(--gold-dark); }
.profile-nav { list-style: none; padding: 0; margin-top: 24px; }
.profile-nav li a {
  display: block; padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--navy); font-size: 0.9rem; transition: all .2s;
}
.profile-nav li a:hover, .profile-nav li a.active { background: var(--cream); color: var(--gold-dark); }

.profile-content {
  background: var(--white); padding: 32px;
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.profile-content h2 { margin-bottom: 24px; }

.order-card {
  border: 1px solid var(--gray-200); border-radius: var(--radius);
  padding: 16px; margin-bottom: 12px;
}
.order-head {
  display: flex; justify-content: space-between;
  padding-bottom: 12px; border-bottom: 1px solid var(--gray-200);
  margin-bottom: 12px; font-size: 0.9rem;
}
.order-status {
  background: #d4edda; color: #155724;
  padding: 2px 10px; border-radius: 999px; font-size: 0.75rem;
}
.order-products { display: flex; gap: 8px; flex-wrap: wrap; }
.order-products .item {
  display: flex; align-items: center; gap: 8px;
  background: var(--cream); padding: 6px 10px;
  border-radius: var(--radius-sm); font-size: 0.85rem;
}

@media (max-width: 900px) { .profile-grid { grid-template-columns: 1fr; } }

/* ============ Utilities ============ */
.text-center { text-align: center; }
.text-gold { color: var(--gold); }
.text-navy { color: var(--navy); }
.mb-2 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 32px; }
.hidden { display: none !important; }
.flex { display: flex; }
.flex-1 { flex: 1; }
.gap-2 { gap: 16px; }
.gap-4 { gap: 32px; }
/* ============================================
   Supplemental styles (app.js dynamic components)
   ============================================ */

/* Category card arrow */
.cat-arrow {
  display: inline-block; margin-top: 12px;
  color: var(--gold); font-weight: 700;
  transition: transform .2s;
}
.category-card:hover .cat-arrow { transform: translateX(4px); }

/* Product card internals */
.p-img-wrap {
  position: relative; aspect-ratio: 1; overflow: hidden;
  background: var(--ivory);
}
.p-img-wrap img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .4s;
}
.product-card:hover .p-img-wrap img { transform: scale(1.05); }
.p-chips {
  position: absolute; bottom: 8px; left: 8px; right: 8px;
  display: flex; gap: 4px; flex-wrap: wrap;
}
.p-chip {
  background: rgba(26,40,73,0.85); color: var(--white);
  font-size: 0.68rem; padding: 3px 8px; border-radius: 999px;
  backdrop-filter: blur(4px);
}
.p-info { padding: 14px 16px; display: flex; flex-direction: column; flex: 1; }
.p-cat {
  font-size: 0.7rem; color: var(--gold-dark); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px;
}
.p-name {
  font-size: 0.95rem; color: var(--navy); font-weight: 600;
  line-height: 1.4; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.p-price-row {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 12px;
}
.p-price { font-family: var(--serif); font-size: 1.15rem; color: var(--gold-dark); font-weight: 700; }
.btn-add {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1.5px solid var(--gold); background: transparent;
  color: var(--gold-dark); font-size: 1.2rem; font-weight: 700;
  cursor: pointer; transition: all .2s; line-height: 1;
}
.btn-add:hover { background: var(--gold); color: var(--white); transform: scale(1.1); }

/* Tier cards supplemental */
.tier-range { font-size: 0.78rem; color: var(--gray-500); margin: 4px 0 12px; }

/* Product detail modal */
.pd-grid {
  display: grid; grid-template-columns: 1fr 1.2fr; gap: 32px;
  padding: 24px;
}
.pd-img {
  aspect-ratio: 1; border-radius: var(--radius);
  overflow: hidden; background: var(--ivory);
}
.pd-img img { width: 100%; height: 100%; object-fit: cover; }
.pd-chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0; }
.pd-chips .p-chip { position: static; background: var(--cream); color: var(--navy); font-size: 0.72rem; }
.pd-section { margin-top: 16px; }
.pd-section h4 {
  font-size: 0.85rem; color: var(--gold-dark);
  text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px;
}
.pd-desc {
  font-size: 0.9rem; color: var(--gray-700); line-height: 1.7;
  max-height: 160px; overflow-y: auto; white-space: pre-line;
}
.pd-actions { display: flex; gap: 12px; align-items: center; margin-top: 20px; flex-wrap: wrap; }
.qty-selector {
  display: flex; align-items: center; gap: 12px;
  border: 1.5px solid var(--gray-300); border-radius: var(--radius);
  padding: 8px 12px;
}
.qty-selector button {
  background: none; border: none; font-size: 1.2rem;
  color: var(--navy); cursor: pointer;
}
.qty-selector span { font-weight: 700; color: var(--navy); min-width: 20px; text-align: center; }
.pd-trust {
  display: flex; gap: 16px; flex-wrap: wrap; margin-top: 20px;
  font-size: 0.8rem; color: var(--gray-500);
}
@media (max-width: 700px) { .pd-grid { grid-template-columns: 1fr; } }

/* Mini quiz result (home) */
.mini-rec {
  display: flex; align-items: center; gap: 12px; text-align: left;
  background: rgba(255,255,255,0.08); border-radius: var(--radius-sm);
  padding: 10px 14px; margin-bottom: 8px;
}
.mini-rec img { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; }
.mini-rec .name { font-size: 0.82rem; color: var(--white); flex: 1; line-height: 1.3; }
.mini-rec .price { color: var(--gold); font-weight: 700; font-size: 0.9rem; }

/* Chat bubbles & products */
.chat-bubble {
  display: inline-block; max-width: 100%;
  background: var(--cream); color: var(--navy);
  padding: 10px 14px; border-radius: 14px;
  font-size: 0.88rem; line-height: 1.5;
  word-break: break-word;
}
.chat-msg.user .chat-bubble { background: var(--navy); color: var(--white); }
.chat-bubble.typing { display: flex; gap: 4px; align-items: center; padding: 14px; }
.chat-bubble.typing span {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--gold); opacity: 0.5;
  animation: typingBlink 1.2s infinite;
}
.chat-bubble.typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-bubble.typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBlink {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}
.chat-product {
  display: flex; align-items: center; gap: 10px;
  background: var(--cream); border-radius: 12px;
  padding: 10px 12px; margin-top: 8px; cursor: pointer;
  transition: all .2s;
}
.chat-product:hover { background: rgba(201,160,90,0.18); }
.chat-product img { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; }
.chat-product .cp-info { flex: 1; min-width: 0; }
.chat-product .cp-name {
  font-size: 0.8rem; color: var(--navy); font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chat-product .cp-price { font-size: 0.85rem; color: var(--gold-dark); font-weight: 700; }

/* Tier grid responsive */
@media (max-width: 1000px) { .tier-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .tier-grid { grid-template-columns: 1fr; } }


/* ===== LINE sign-up & Level-up list (added) ===== */
.auth-divider { display: flex; align-items: center; margin: 18px 0 14px; color: var(--gray-500); font-size: 0.85rem; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--gray-200); }
.auth-divider span { padding: 0 12px; }
.line-btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; background: #06C755; color: #ffffff; font-weight: 600; font-size: 0.95rem; padding: 13px 16px; border-radius: var(--radius); text-decoration: none; transition: all 0.2s; border: none; cursor: pointer; }
.line-btn:hover { background: #05b14a; color: #ffffff; transform: translateY(-1px); }
.line-btn svg { flex-shrink: 0; }
.lvl-list { display: flex; flex-direction: column; gap: 14px; max-width: 640px; margin: 0 auto; }
.lvl-row { display: flex; gap: 16px; align-items: center; background: var(--white); padding: 18px 20px; border-radius: var(--radius); box-shadow: 0 2px 10px rgba(26,40,73,0.06); }
.lvl-row p { margin: 4px 0 0; color: var(--gray-700); font-size: 0.92rem; }
.lvl-badge { width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; color: var(--white); flex-shrink: 0; }

/* ===== Checkout (bank transfer / PromptPay) ===== */
.pay-box { background: var(--cream); border: 1px solid var(--gray-200); border-radius: 14px; padding: 12px 16px; margin: 10px 0; }
.pay-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 3px 0; font-size: 0.88rem; color: var(--gray-700); }
.pay-row .val { font-weight: 600; color: var(--navy); text-align: right; }
.pay-row.pay-total { border-top: 1px solid var(--gray-200); margin-top: 6px; padding-top: 8px; font-weight: 700; color: var(--navy); }
.pay-row.pay-total span:last-child { color: var(--gold-dark); font-size: 1.05rem; }
.form-group textarea { width: 100%; padding: 12px 14px; border: 1px solid var(--gray-200); border-radius: 10px; font: inherit; resize: vertical; box-sizing: border-box; }
.copy-mini { background: var(--navy); color: #fff; border: none; border-radius: 6px; font-size: 0.72rem; padding: 3px 8px; margin-left: 6px; cursor: pointer; font-weight: 600; }
.copy-mini:hover { background: var(--gold-dark); }
