:root {
  --primary: #7e57c2;
  --primary-light: #b39ddb;
  --primary-dark: #512da8;
  --lavender-bg: #f7f4fb;
  --lavender-soft: #ede7f6;
  --accent-pink: #d81b60;
  --text-dark: #261e35;
  --text-muted: #6b617b;
  --border: #e4ddf0;
  --card-bg: #ffffff;
  --radius: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Sarabun', sans-serif;
  background-color: var(--lavender-bg);
  color: var(--text-dark);
  line-height: 1.6;
}

h1, h2, h3, h4, .brand-logo, .tab-btn {
  font-family: 'Prompt', sans-serif;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  padding: 0.8rem 1.5rem;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  font-weight: 700;
  font-size: 1.1rem;
  padding: 8px 14px;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(126,87,194,0.3);
}

.brand-title h1 {
  font-size: 1.25rem;
  color: var(--primary-dark);
  line-height: 1.2;
}

.brand-title p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.nav-links {
  display: flex;
  gap: 24px;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-dark);
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--primary); }

.cart-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--primary);
  color: white;
  border: none;
  padding: 8px 18px;
  border-radius: 30px;
  cursor: pointer;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(126,87,194,0.25);
  transition: all 0.2s;
}

.cart-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.cart-badge {
  background: #ffca28;
  color: #261e35;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
}

/* Hero */
.hero-section {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 1.5rem;
}

.hero-container {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2.5rem;
  align-items: center;
}

.badge-pill {
  display: inline-block;
  background: var(--lavender-soft);
  color: var(--primary-dark);
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.hero-text h2 {
  font-size: 2.4rem;
  line-height: 1.25;
  color: var(--primary-dark);
  margin-bottom: 1.2rem;
}

.hero-text p {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 1.8rem;
}

.hero-cta { display: flex; gap: 14px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 22px;
  border-radius: 25px;
  cursor: pointer;
  font-weight: 500;
  text-decoration: none;
  border: none;
  font-size: 0.95rem;
  transition: all 0.2s;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: white; color: var(--primary-dark); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--lavender-soft); }
.btn-block { width: 100%; margin-top: 12px; }

.hero-cards {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.highlight-card {
  padding: 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: 0 4px 15px rgba(0,0,0,0.03);
}

.lavender-card {
  background: linear-gradient(135deg, #ffffff, var(--lavender-soft));
}

.pink-card {
  background: linear-gradient(135deg, #ffffff, #fce4ec);
  border-color: #f8bbd0;
}

.hl-icon { font-size: 2rem; margin-bottom: 0.5rem; }
.highlight-card h3 { font-size: 1.15rem; color: var(--primary-dark); margin-bottom: 0.3rem; }
.highlight-card p { font-size: 0.85rem; color: var(--text-muted); }

/* Catalog */
.catalog-section {
  max-width: 1200px;
  margin: 3rem auto;
  padding: 0 1.5rem;
}

.section-title-wrap {
  text-align: center;
  margin-bottom: 2rem;
}

.section-title-wrap h2 {
  font-size: 2rem;
  color: var(--primary-dark);
}

.section-title-wrap p {
  color: var(--text-muted);
}

.filter-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-bottom: 2rem;
}

.search-box input {
  width: 100%;
  max-width: 460px;
  padding: 10px 18px;
  border-radius: 30px;
  border: 1px solid var(--border);
  font-size: 0.95rem;
  outline: none;
  background: white;
  transition: border-color 0.2s;
}

.search-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(126,87,194,0.15);
}

.category-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.tab-btn {
  background: white;
  border: 1px solid var(--border);
  padding: 8px 18px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-dark);
  transition: all 0.2s;
}

.tab-btn.active, .tab-btn:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.8rem;
}

.product-card {
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 25px rgba(126,87,194,0.12);
  border-color: var(--primary-light);
}

.card-icon-area {
  background: linear-gradient(135deg, #fdfbff, var(--lavender-soft));
  text-align: center;
  padding: 2.2rem 1rem;
  position: relative;
}

.item-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
}

.badge-med { background: #ede7f6; color: var(--primary-dark); }
.badge-fem { background: #fce4ec; color: var(--accent-pink); }

.item-icon { font-size: 4rem; }

.card-body {
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card-body h3 {
  font-size: 1.15rem;
  color: var(--primary-dark);
  margin-bottom: 0.3rem;
}

.card-category-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}

.card-body p {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  flex-grow: 1;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid #f2ecf8;
  padding-top: 0.8rem;
}

.price {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary-dark);
}

/* AI Assistant */
.ai-section {
  background: white;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 3rem 1.5rem;
}

.ai-container {
  max-width: 900px;
  margin: 0 auto;
}

.ai-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.ai-badge {
  background: var(--lavender-soft);
  color: var(--primary-dark);
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
}

.ai-header h3 {
  font-size: 1.6rem;
  color: var(--primary-dark);
  margin-top: 0.5rem;
}

.ai-chat-box {
  background: var(--lavender-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.ai-prompt-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 1.2rem;
}

.ai-pill {
  background: white;
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
}

.ai-pill:hover {
  background: var(--primary);
  color: white;
}

.ai-response {
  background: white;
  padding: 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Modals */
.modal { display: none; position: fixed; inset: 0; z-index: 1000; }
.modal.active { display: block; }
.modal-overlay { position: absolute; inset: 0; background: rgba(38,30,53,0.6); backdrop-filter: blur(4px); }
.modal-card {
  position: relative;
  max-width: 540px;
  margin: 40px auto;
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 15px 35px rgba(0,0,0,0.25);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.cart-card { max-width: 600px; }

.modal-header {
  padding: 1rem 1.4rem;
  background: var(--lavender-soft);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 { font-size: 1.15rem; color: var(--primary-dark); }
.close-btn { background: none; border: none; font-size: 1.6rem; color: var(--text-muted); cursor: pointer; }
.modal-body { padding: 1.4rem; overflow-y: auto; }
.modal-footer {
  padding: 1rem 1.4rem;
  background: var(--lavender-soft);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.cart-items { display: flex; flex-direction: column; gap: 10px; }
.cart-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  background: var(--lavender-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.cart-modal-footer { flex-direction: column; gap: 12px; }
.total-row { display: flex; justify-content: space-between; font-size: 1.2rem; }
.total-price { color: var(--primary-dark); }
.modal-btns { display: flex; justify-content: flex-end; gap: 10px; }

.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 0.88rem; font-weight: 500; margin-bottom: 0.3rem; }
.form-group input, .form-group textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
}

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.radio-chips { display: flex; gap: 16px; margin-top: 4px; }

.order-summary-box {
  background: var(--lavender-bg);
  padding: 10px;
  border-radius: 8px;
  border: 1px dashed var(--border);
  font-size: 0.88rem;
}
.order-grand-total { text-align: right; margin-top: 6px; font-size: 1.05rem; color: var(--primary-dark); }

.success-icon { font-size: 3.5rem; margin-bottom: 0.5rem; }
.ref-box {
  background: var(--lavender-soft);
  color: var(--primary-dark);
  font-weight: 700;
  display: inline-block;
  padding: 6px 16px;
  border-radius: 20px;
  margin: 12px 0;
}

.site-footer {
  background: #1f172e;
  color: #d1c8e2;
  padding: 3rem 1.5rem 1.5rem;
  margin-top: 4rem;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2.5rem;
  margin-bottom: 2rem;
}

.footer-col h3, .footer-col h4 { color: white; margin-bottom: 0.8rem; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 6px; font-size: 0.9rem; }
.footer-bottom {
  text-align: center;
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 1.5rem;
  font-size: 0.85rem;
  color: #8c829e;
}

@media (max-width: 768px) {
  .hero-container { grid-template-columns: 1fr; text-align: center; }
  .hero-cta { justify-content: center; }
  .nav-links { display: none; }
  .form-row { grid-template-columns: 1fr; }
}
