:root {
  --brand: #ff4d8d;
  --brand-dark: #e5397a;
  --brand-2: #7c5cff;
  --brand-soft: #ffe3ee;
  --brand-soft-2: #efe9ff;
  --bg: #faf9fc;
  --card: #ffffff;
  --text: #22222e;
  --muted: #85879a;
  --border: #f0eef5;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow: 0 6px 20px rgba(90, 40, 90, 0.07);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Noto Sans Thai', 'Noto Sans KR', -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
  padding-bottom: 76px;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: 'Prompt', 'Noto Sans Thai', sans-serif; }
img { max-width: 100%; }

.container { max-width: 1000px; margin: 0 auto; padding: 16px; }

/* ---- Header ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
}
.site-header-row { display: flex; align-items: center; gap: 12px; max-width: 1000px; margin: 0 auto; }
.site-header .brand {
  font-family: 'Prompt', sans-serif;
  font-weight: 800;
  font-size: 20px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  flex-shrink: 0;
}
.search-form { flex: 1; display: flex; }
.search-form input {
  flex: 1;
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 14px;
  font-family: inherit;
}
.search-form input:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }

/* ---- Category pills ---- */
.pill-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 14px 16px 4px;
  max-width: 1000px;
  margin: 0 auto;
  scrollbar-width: none;
}
.pill-scroll::-webkit-scrollbar { display: none; }
.pill {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.pill img { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; }
.pill.active { background: linear-gradient(90deg, var(--brand), var(--brand-2)); color: #fff; border-color: transparent; }

/* ---- Homepage banners ---- */
.banner-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 14px 16px 0;
  max-width: 1000px;
  margin: 0 auto;
  scrollbar-width: none;
}
.banner-scroll::-webkit-scrollbar { display: none; }
.banner-slide {
  display: block;
  flex: 0 0 100%;
  scroll-snap-align: start;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.banner-slide img {
  width: 100%;
  display: block;
  aspect-ratio: 21 / 9;
  object-fit: cover;
}

/* ---- Section headings ---- */
.section-heading { display: flex; align-items: baseline; justify-content: space-between; margin: 28px 0 12px; }
.section-heading h2 { font-size: 18px; font-weight: 800; margin: 0; display: flex; align-items: center; gap: 6px; }
.section-heading .section-sub { font-size: 12px; color: var(--muted); }

/* ---- Grids & cards ---- */
.category-grid, .product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
@media (min-width: 600px) {
  .category-grid { grid-template-columns: repeat(4, 1fr); }
  .product-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 900px) {
  .product-grid { grid-template-columns: repeat(4, 1fr); }
}

.category-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 10px;
  text-align: center;
  font-weight: 700;
  font-size: 13px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: transform 0.15s ease;
}
.category-card:active { transform: scale(0.97); }
.category-card-img { width: 52px; height: 52px; object-fit: cover; border-radius: 50%; border: 2px solid var(--brand-soft); }

.product-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: block;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease;
}
.product-card:active { transform: scale(0.98); }
.product-thumb { aspect-ratio: 1 / 1; background: var(--brand-soft-2); overflow: hidden; position: relative; }
.product-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-thumb-placeholder { width: 100%; height: 100%; background: var(--brand-soft-2); }
.product-thumb-placeholder.large { aspect-ratio: 1/1; border-radius: var(--radius-md); }
.product-name {
  padding: 10px 10px 0;
  font-size: 13.5px;
  line-height: 1.35;
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.7em;
}
.product-price { padding: 6px 10px 0; font-weight: 800; font-size: 14.5px; }
.product-price.discounted { color: var(--brand-dark); }
.product-price.sold-out,
.product-price-detail.sold-out {
  text-decoration: line-through;
  opacity: 0.55;
  color: var(--text) !important;
}
.product-price-thb { padding: 1px 10px 12px; font-size: 11.5px; font-weight: 600; color: var(--muted); }

.sold-out-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(20, 20, 20, 0.82);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  padding: 4px 9px;
  border-radius: 6px;
  z-index: 2;
}
.product-thumb.sold-out img,
.product-detail-image.sold-out img { filter: grayscale(55%) brightness(0.85); }
.discount-badge-sm {
  display: inline-block;
  background: var(--brand);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 6px;
  margin-right: 4px;
  vertical-align: middle;
}

.breadcrumb { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.breadcrumb a { font-weight: 600; }
.product-detail .breadcrumb { margin-bottom: 6px; }

.pagination { display: flex; gap: 8px; margin: 20px 0; flex-wrap: wrap; }
.pagination a { padding: 7px 13px; border: 1px solid var(--border); border-radius: 999px; background: var(--card); font-size: 13px; font-weight: 700; }
.pagination a.active { background: var(--text); color: #fff; border-color: var(--text); }

/* ---- Product detail ---- */
/* Tighter gap on mobile (image/info stacked) than desktop (side-by-side)
   so the square image doesn't push the name/price further down than
   needed on a small phone screen. */
.product-detail-main { display: flex; flex-direction: column; gap: 8px; }
@media (min-width: 700px) {
  .product-detail-main { flex-direction: row; gap: 20px; }
  .product-detail-image, .product-detail-info { flex: 1; }
}
.product-detail-image { position: relative; }
.product-detail-image img {
  width: 100%;
  border-radius: var(--radius-lg);
  aspect-ratio: 1/1;
  object-fit: cover;
  box-shadow: var(--shadow);
}
.product-detail-image .sold-out-badge { top: 12px; left: 12px; font-size: 13px; padding: 6px 12px; }
.product-detail-info h1 { font-size: 17px; line-height: 1.3; margin: 0 0 4px; }

.detail-images { margin-top: 36px; }
.detail-images img {
  width: 100%;
  display: block;
  border-radius: var(--radius-md);
  margin-bottom: 10px;
}

.product-code {
  font-size: 13px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border-radius: 999px;
  padding: 6px 6px 6px 14px;
  width: fit-content;
}
.copy-btn {
  border: none;
  background: var(--brand-soft);
  color: var(--brand-dark);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.share-btn {
  display: block;
  margin: 10px 0 0;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}
.share-btn:active { background: var(--brand-soft); }
.product-price-detail { font-size: 23px; font-weight: 800; margin: 6px 0 0; }
.product-price-detail.discounted { color: var(--brand-dark); }
p.product-price-thb { font-size: 14px; font-weight: 600; color: var(--muted); margin: 2px 0 10px; }
.product-price-detail .original-price {
  display: block;
  font-size: 15px;
  font-weight: 500;
  text-decoration: line-through;
  opacity: 0.55;
  color: var(--text);
  margin-bottom: 2px;
}
.discount-badge {
  display: inline-block;
  background: var(--brand);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  padding: 2px 9px;
  border-radius: 8px;
  margin-left: 8px;
  vertical-align: middle;
}
.product-description { line-height: 1.7; margin-bottom: 24px; white-space: pre-wrap; font-size: 14.5px; }

.line-buy-btn {
  display: block;
  background: linear-gradient(90deg, #06c755, #05a648);
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  text-align: center;
  width: 100%;
  box-shadow: 0 8px 20px rgba(6, 199, 85, 0.3);
}
.line-hint { font-size: 12.5px; color: var(--muted); margin-top: 10px; line-height: 1.6; }

/* ---- Reviews ---- */
.reviews-section { margin-top: 36px; border-top: 1px solid var(--border); padding-top: 22px; }
.reviews-section h2 { display: flex; align-items: center; gap: 8px; font-size: 17px; }
.average-rating { font-size: 13px; color: var(--muted); font-weight: 600; }
.review-submitted-msg { background: var(--brand-soft); color: var(--brand-dark); padding: 12px 14px; border-radius: var(--radius-sm); font-size: 13.5px; font-weight: 600; }
.review-incentive-banner {
  background: linear-gradient(135deg, var(--brand-soft), var(--brand-soft-2));
  border: 1px solid var(--brand-soft);
  color: var(--text);
  padding: 14px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 18px;
}
.review-incentive-banner strong { color: var(--brand-dark); }
.review-list { margin: 14px 0 26px; }
.review-item { border-bottom: 1px solid var(--border); padding: 14px 0; }
.review-item-meta { font-size: 13px; display: flex; gap: 8px; align-items: center; }
.stars { color: #f5a623; }
.review-date { color: var(--muted); }
.review-item-content { margin: 6px 0 0; line-height: 1.6; font-size: 14px; }
.review-photo-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.review-photo-list img { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; }

.review-form {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow);
}
.review-form h3 { margin: 0; font-size: 15px; }
.review-form input, .review-form select, .review-form textarea {
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  background: var(--bg);
}
.review-form textarea { min-height: 90px; resize: vertical; }
.review-form button {
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 12px;
  font-weight: 700;
  cursor: pointer;
  font-size: 14px;
}

.review-item-picker { display: flex; flex-direction: column; gap: 10px; }
.review-item-card {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  background: var(--bg);
}
.review-item-card-info { flex: 1; min-width: 0; }
.review-item-card-name { font-weight: 700; font-size: 13.5px; overflow-wrap: break-word; }
.review-item-card-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }

.review-item-thumb {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--brand-soft-2);
}
.review-item-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.censor-overlay {
  position: absolute;
  inset: 0;
  background: #0a0a0a;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}
.review-item-thumb.revealed .censor-overlay { display: none; }
.review-form .censor-reveal-btn {
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.2;
  color: #fff;
  cursor: pointer;
  text-align: center;
}

.star-rating { display: flex; gap: 4px; margin-bottom: 4px; }
.review-form .star-btn {
  background: none;
  border: none;
  padding: 0;
  font-size: 32px;
  line-height: 1;
  color: #ddd;
  cursor: pointer;
}
.review-form .star-btn.active { color: #ffb400; }

.photo-upload { display: flex; flex-direction: column; gap: 8px; }
.photo-upload-thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.photo-upload-thumb { position: relative; width: 64px; height: 64px; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); }
.photo-upload-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-upload-thumb-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.review-form .photo-upload-add-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  background: var(--bg);
  color: var(--text);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}
.photo-upload-status { font-size: 12px; color: var(--muted); }

/* ---- Static pages ---- */
.static-page h1 { margin-bottom: 18px; font-size: 22px; }
.steps { line-height: 2; font-size: 14.5px; }
.steps li { margin-bottom: 6px; }
.post-list { list-style: none; padding: 0; }
.post-list li {
  display: flex;
  justify-content: space-between;
  padding: 14px 16px;
  margin-bottom: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
}
.post-date { font-size: 12px; color: var(--muted); font-weight: 400; }
.back-link { display: inline-block; margin-bottom: 14px; color: var(--muted); font-weight: 600; font-size: 13px; }
.post-content { line-height: 1.8; margin-top: 18px; font-size: 14.5px; }

.search-empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.search-empty .emoji { font-size: 40px; display: block; margin-bottom: 12px; }

.empty { color: var(--muted); padding: 24px 0; text-align: center; }

/* ---- Order tracking ---- */
.order-status-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.order-status-badge {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
}
.order-status-badge.muted { background: #eee; color: #666; }
.order-status-badge.brand { background: var(--brand-soft); color: var(--brand-dark); }
.order-status-badge.success { background: #e6f9f0; color: #17b26a; }
.order-status-badge.danger { background: #fdeaee; color: #d33; }
.order-code { margin: 10px 0 0; font-size: 13px; color: var(--muted); }

.order-items-list { margin-bottom: 8px; }
.order-item-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.order-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  font-weight: 800;
  font-size: 17px;
}
.order-total-amount { color: var(--brand-dark); }

/* ---- Bottom nav ---- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 30;
  display: flex;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
}
.bottom-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--muted);
  padding: 4px 0;
}
.bottom-nav a .icon { display: flex; }
.bottom-nav a .icon svg { width: 21px; height: 21px; }
.bottom-nav a.active { color: var(--brand); }

.sort-bar { display: flex; justify-content: flex-end; margin: -4px 0 10px; }
.sort-select {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
}

.site-footer {
  text-align: center;
  font-size: 11.5px;
  color: var(--muted);
  padding: 28px 16px 20px;
}

/* ---- Age gate ---- */
.age-gate {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(160deg, var(--brand-soft), var(--brand-soft-2));
}
.age-gate-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 32px 26px;
  max-width: 380px;
  width: 100%;
  text-align: center;
}
.age-gate-emoji { font-size: 44px; margin-bottom: 8px; }
.age-gate-card h1 { font-size: 19px; margin: 0 0 10px; }
.age-gate-card p { font-size: 13.5px; color: var(--muted); line-height: 1.6; margin: 0 0 24px; }
.age-gate-actions { display: flex; flex-direction: column; gap: 10px; }
.age-gate-btn-yes {
  display: block;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  padding: 14px;
  border-radius: var(--radius-sm);
}
.age-gate-btn-no {
  display: block;
  background: var(--bg);
  color: var(--muted);
  font-weight: 700;
  font-size: 13.5px;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
