/* =========================================================
   108problems.com - Custom Minimalist CSS
   Theme: ขาว / เทา / ดำ + Accent สีแบรนด์แพลตฟอร์ม
   ========================================================= */

:root {
  --color-bg: #ffffff;
  --color-surface: #f7f7f8;
  --color-border: #e5e5e8;
  --color-text: #1a1a1a;
  --color-text-muted: #6b6b70;
  --color-accent: #111111;

  /* Brand colors ของแต่ละแพลตฟอร์ม */
  --brand-shopee: #ee4d2d;
  --brand-lazada: #0f146d;
  --brand-tiktok: #010101;
  --brand-tiktok-accent: #25f4ee;

  --radius-sm: 8px;
  --radius-md: 14px;
  --shadow-card: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-card-hover: 0 10px 20px rgba(0,0,0,0.08);
}

* { box-sizing: border-box; }

body {
  font-family: "Noto Sans Thai", "Segoe UI", system-ui, -apple-system, sans-serif;
  background-color: var(--color-bg);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; }
.text-accent { color: var(--brand-shopee); }

/* ---------- Header ---------- */
.site-header { z-index: 1030; }
.navbar-brand { font-size: 1.35rem; letter-spacing: -0.5px; }
.nav-link { font-weight: 500; color: var(--color-text) !important; }
.nav-link:hover { color: var(--brand-shopee) !important; }

/* ---------- Hero / Page heading ---------- */
.page-hero {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 2.5rem 0;
}
.page-hero h1 { font-weight: 800; letter-spacing: -0.5px; }

/* ---------- Product Card Grid ---------- */
.product-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #fff;
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease;
  height: 100%;
}
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card-hover);
}
.product-card__img-wrap {
  aspect-ratio: 1 / 1;
  background: var(--color-surface);
  overflow: hidden;
}
.product-card__img-wrap img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .3s ease;
}
.product-card:hover .product-card__img-wrap img { transform: scale(1.04); }
.product-card__body { padding: .9rem 1rem 1.1rem; }
.product-card__title {
  font-size: .95rem;
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.6em;
}
.product-card__price {
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--color-accent);
}
.product-card__category {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--color-text-muted);
}

/* ---------- Category filter chips ---------- */
.category-chip {
  display: inline-block;
  padding: .4rem .9rem;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  font-size: .85rem;
  font-weight: 500;
  color: var(--color-text);
  background: #fff;
}
.category-chip.active,
.category-chip:hover {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff;
}

/* ---------- Product Detail ---------- */
.gallery-main {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 1/1;
  background: var(--color-surface);
}
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumb {
  width: 72px; height: 72px; object-fit: cover;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  cursor: pointer;
}
.gallery-thumb.active { border-color: var(--color-accent); }

.before-after-box {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.before-after-box .ba-col { position: relative; aspect-ratio: 1/1; }
.before-after-box img { width: 100%; height: 100%; object-fit: cover; }
.before-after-box .ba-label {
  position: absolute; top: 8px; left: 8px;
  background: rgba(0,0,0,.7); color: #fff;
  font-size: .7rem; font-weight: 700; letter-spacing: .05em;
  padding: 2px 10px; border-radius: 999px; text-transform: uppercase;
}

/* ---------- Affiliate Buttons ---------- */
.btn-affiliate {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%;
  padding: .85rem 1.1rem;
  border-radius: var(--radius-sm);
  border: none;
  color: #fff;
  font-weight: 700;
  margin-bottom: .6rem;
  transition: filter .15s ease, transform .15s ease;
}
.btn-affiliate:hover { filter: brightness(1.08); transform: translateY(-1px); color: #fff; }
.btn-affiliate .badge-note {
  font-weight: 500; font-size: .75rem;
  background: rgba(255,255,255,.18);
  padding: 2px 10px; border-radius: 999px;
}
.btn-shopee { background: var(--brand-shopee); }
.btn-lazada { background: var(--brand-lazada); }
.btn-tiktok { background: var(--brand-tiktok); }
.btn-other  { background: #3a3a3c; }

/* ---------- Admin ---------- */
.admin-sidebar {
  min-height: 100vh;
  background: #111;
  color: #eee;
}
.admin-sidebar a {
  color: #cfcfcf; display: block; padding: .65rem 1.2rem; font-size: .92rem;
}
.admin-sidebar a:hover, .admin-sidebar a.active {
  background: rgba(255,255,255,.08); color: #fff;
}
.stat-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  background: #fff;
}
.stat-card .stat-value { font-size: 1.8rem; font-weight: 800; }
.stat-card .stat-label { font-size: .8rem; color: var(--color-text-muted); }

.repeater-row {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin-bottom: .75rem;
  background: var(--color-surface);
}

.thumb-preview {
  width: 90px; height: 90px; object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
}

/* ---------- Utilities ---------- */
.text-muted-sm { font-size: .8rem; color: var(--color-text-muted); }
.empty-state { padding: 4rem 0; text-align: center; color: var(--color-text-muted); }
