:root {
  --brand: #d71920;
  --brand-dark: #a81218;
  --brand-light: #fff0f0;
  --white: #ffffff;
  --gray-50: #f7f7f8;
  --gray-100: #eceef2;
  --gray-300: #c5ccd6;
  --gray-500: #6b7280;
  --gray-700: #374151;
  --ink: #1f2937;
  --green: #16a34a;
  --container: 1240px;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--gray-50);
  color: var(--ink);
  font-family: "Noto Sans Thai", "Inter", "Segoe UI", sans-serif;
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }

img { display: block; max-width: 100%; }

.container {
  margin: 0 auto;
  width: min(100% - 32px, var(--container));
}

.topbar {
  background: var(--ink);
  color: #e5e7eb;
  font-size: 0.84rem;
  padding: 8px 0;
}

.topbar-inner {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
}

.promo-pill {
  background: var(--brand);
  border-radius: 999px;
  color: white;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 12px;
}

.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-100);
  position: sticky;
  top: 0;
  z-index: 90;
}

.header-row {
  align-items: center;
  display: grid;
  gap: 16px;
  grid-template-columns: auto 1fr auto;
  min-height: 76px;
}

.brand {
  align-items: center;
  display: flex;
  font-size: 1.3rem;
  font-weight: 800;
  gap: 10px;
  letter-spacing: -0.02em;
}

.brand-mark {
  align-items: center;
  background: linear-gradient(135deg, var(--brand), #ff5a5f);
  border-radius: 10px;
  color: white;
  display: inline-flex;
  font-size: 0.95rem;
  font-weight: 900;
  height: 40px;
  justify-content: center;
  width: 40px;
}

.search-box {
  align-items: center;
  background: var(--gray-50);
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  display: flex;
  gap: 8px;
  padding: 0 12px;
}

.search-box input {
  background: transparent;
  border: 0;
  flex: 1;
  font: inherit;
  min-height: 42px;
  outline: 0;
}

.header-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.88rem;
  font-weight: 600;
}

.cart-badge {
  align-items: center;
  background: var(--brand);
  border-radius: 999px;
  color: white;
  display: inline-flex;
  font-size: 0.72rem;
  height: 20px;
  justify-content: center;
  min-width: 20px;
  padding: 0 5px;
}

.main-nav {
  background: var(--white);
  border-bottom: 1px solid var(--gray-100);
  overflow-x: auto;
}

.main-nav .container {
  display: flex;
  gap: 4px;
  padding: 8px 0;
  white-space: nowrap;
}

.main-nav a {
  border-radius: 6px;
  color: var(--gray-700);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 8px 14px;
}

.main-nav a:hover,
.main-nav a.active {
  background: var(--brand-light);
  color: var(--brand);
}

.voucher-banner {
  background: linear-gradient(90deg, #fff7ed, #fff);
  border: 1px solid #fed7aa;
  border-radius: 10px;
  color: #9a3412;
  font-size: 0.92rem;
  font-weight: 600;
  margin-top: 20px;
  padding: 12px 16px;
}

.page-title {
  margin: 24px 0 8px;
}

.page-title h1 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
}

.page-title p {
  color: var(--gray-500);
  font-size: 0.95rem;
}

.shop-layout {
  display: grid;
  gap: 24px;
  grid-template-columns: 260px 1fr;
  margin: 24px 0 48px;
}

.filter-panel {
  align-self: start;
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: 12px;
  padding: 18px;
  position: sticky;
  top: 100px;
}

.filter-panel h2 {
  font-size: 1rem;
  margin-bottom: 14px;
}

.filter-group + .filter-group {
  border-top: 1px solid var(--gray-100);
  margin-top: 16px;
  padding-top: 16px;
}

.filter-group h3 {
  font-size: 0.88rem;
  margin-bottom: 10px;
}

.filter-list label {
  align-items: center;
  cursor: pointer;
  display: flex;
  font-size: 0.86rem;
  gap: 8px;
  margin-bottom: 8px;
}

.price-range {
  color: var(--gray-500);
  font-size: 0.82rem;
  margin-top: 8px;
}

.shop-main {
  min-width: 0;
}

.toolbar {
  align-items: center;
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 16px;
  padding: 12px 16px;
}

.category-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  background: var(--gray-50);
  border: 1px solid var(--gray-300);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 12px;
}

.chip.active,
.chip:hover {
  background: var(--brand-light);
  border-color: var(--brand);
  color: var(--brand);
}

.sort-select {
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  font: inherit;
  padding: 8px 12px;
}

.product-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
}

.product-card {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
}

.product-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.product-image {
  aspect-ratio: 1;
  background: #fff;
  overflow: hidden;
}

.product-image img {
  height: 100%;
  object-fit: contain;
  padding: 8px;
  width: 100%;
}

.badge-type {
  background: var(--ink);
  border-radius: 4px;
  color: white;
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  margin-bottom: 4px;
  padding: 2px 8px;
}

.badge-type.trimmer { background: #0f766e; }

.primary-hero {
  background: var(--white);
  border-bottom: 1px solid var(--gray-100);
  line-height: 0;
}

.primary-hero-inner {
  margin: 0 auto;
  max-width: 1440px;
  width: 100%;
}

.primary-hero img {
  display: block;
  height: auto;
  width: 100%;
}

.product-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
}

.product-body h3 {
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.4;
  min-height: 2.8em;
}

.badge-new {
  background: #dbeafe;
  border-radius: 4px;
  color: #1d4ed8;
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  margin-bottom: 4px;
  padding: 2px 8px;
}

.price-row {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

.sale-price {
  color: var(--brand);
  font-size: 1.05rem;
  font-weight: 800;
}

.old-price {
  color: var(--gray-500);
  font-size: 0.82rem;
  text-decoration: line-through;
}

.btn {
  border-radius: 8px;
  display: inline-flex;
  font-size: 0.86rem;
  font-weight: 700;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  place-items: center;
}

.btn-cart {
  background: var(--brand);
  border: 0;
  color: white;
  cursor: pointer;
  margin-top: 8px;
  width: 100%;
}

.btn-cart:hover { background: var(--brand-dark); }

.btn-outline {
  background: transparent;
  border: 1px solid var(--gray-300);
  color: var(--ink);
}

.seo-block,
.section {
  margin: 48px 0;
}

.seo-block {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: 12px;
  padding: 28px;
}

.seo-block h2 {
  font-size: 1.35rem;
  margin-bottom: 12px;
}

.seo-block h3 {
  font-size: 1rem;
  margin: 18px 0 8px;
}

.seo-block p {
  color: var(--gray-700);
  margin-bottom: 10px;
}

.section-head {
  align-items: end;
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
}

.section-head h2 {
  font-size: 1.5rem;
  font-weight: 800;
}

.section-head a {
  color: var(--brand);
  font-size: 0.9rem;
  font-weight: 700;
}

.article-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.article-card {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: 12px;
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.article-card:hover { box-shadow: var(--shadow); }

.article-card .thumb {
  background: linear-gradient(135deg, #fee2e2, #fff7ed);
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 28px 20px;
  text-transform: uppercase;
}

.article-card .body {
  padding: 16px;
}

.article-card h3 {
  font-size: 1rem;
  line-height: 1.4;
  margin-bottom: 8px;
}

.article-card p {
  color: var(--gray-500);
  font-size: 0.88rem;
}

.article-card .meta {
  color: var(--gray-500);
  font-size: 0.78rem;
  margin-top: 10px;
}

.article-page {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: 12px;
  margin: 28px auto 48px;
  max-width: 800px;
  padding: 32px;
}

.article-page h1 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  line-height: 1.3;
  margin-bottom: 8px;
}

.article-page .meta {
  color: var(--gray-500);
  font-size: 0.88rem;
  margin-bottom: 24px;
}

.article-page h2 {
  font-size: 1.15rem;
  margin: 24px 0 10px;
}

.article-page p,
.article-page li {
  color: var(--gray-700);
  margin-bottom: 10px;
}

.article-page ul {
  margin: 0 0 16px 20px;
}

.breadcrumb {
  color: var(--gray-500);
  font-size: 0.84rem;
  margin-top: 16px;
}

.breadcrumb a:hover { color: var(--brand); }

.footer {
  background: var(--ink);
  color: #d1d5db;
  margin-top: 48px;
  padding: 40px 0 20px;
}

.footer-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.footer h3 {
  color: white;
  font-size: 0.95rem;
  margin-bottom: 12px;
}

.footer a,
.footer p {
  color: #d1d5db;
  display: block;
  font-size: 0.86rem;
  margin-bottom: 8px;
}

.footer a:hover { color: white; }

.footer-bottom {
  border-top: 1px solid #374151;
  color: #9ca3af;
  font-size: 0.82rem;
  margin-top: 28px;
  padding-top: 16px;
  text-align: center;
}

.whatsapp-float {
  align-items: center;
  background: #25d366;
  border-radius: 999px;
  bottom: 24px;
  box-shadow: var(--shadow);
  color: white;
  display: flex;
  font-size: 0.78rem;
  font-weight: 800;
  height: 52px;
  justify-content: center;
  position: fixed;
  right: 24px;
  width: 52px;
  z-index: 100;
}

@media (max-width: 900px) {
  .header-row { grid-template-columns: 1fr; }
  .shop-layout { grid-template-columns: 1fr; }
  .filter-panel { position: static; }
}
