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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: #222;
  background: #fafaf8;
}

.container { max-width: 960px; margin: 0 auto; padding: 0 1rem; }

/* Header */
.site-header { background: #1a1a1a; padding: .75rem 0; }
.site-header .container { display: flex; align-items: center; gap: 2rem; }
.logo { color: #fff; font-weight: 700; font-size: 1.1rem; text-decoration: none; }
.site-header nav a { color: #ccc; text-decoration: none; font-size: .9rem; }
.site-header nav a:hover { color: #fff; }

main.container { padding-top: 2rem; padding-bottom: 3rem; }

/* Footer */
.site-footer { border-top: 1px solid #e0e0e0; padding: 1.5rem 0; margin-top: 3rem; }
.site-footer p { font-size: .8rem; color: #888; }

/* Typography */
h1 { font-size: 1.6rem; margin-bottom: .5rem; }
h2 { font-size: 1.2rem; margin: 1.5rem 0 .75rem; }
.lead { color: #555; margin-bottom: 1.5rem; }

/* Breadcrumb */
.breadcrumb { font-size: .85rem; color: #888; margin-bottom: 1rem; }
.breadcrumb a { color: #888; }

/* Verdict */
.verdict {
  padding: .75rem 1rem;
  border-radius: 6px;
  margin-bottom: 1.5rem;
  font-size: .95rem;
}
.verdict--good { background: #eafaf1; border-left: 4px solid #27ae60; color: #1e8449; }
.verdict--neutral { background: #fef9e7; border-left: 4px solid #f39c12; color: #7d6608; }

/* Price rows */
.prices { margin-bottom: 2rem; }
.price-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .6rem 0;
  border-bottom: 1px solid #f0f0f0;
  flex-wrap: wrap;
}
.price-row--oos { opacity: .5; }
.price-row__price { font-weight: 700; font-size: 1.1rem; margin-left: auto; }
.price-row__stock { font-size: .8rem; color: #888; }

/* Buttons */
.btn {
  display: inline-block;
  padding: .4rem .9rem;
  border-radius: 5px;
  text-decoration: none;
  font-size: .85rem;
  font-weight: 600;
}
.btn--buy { background: #e67e22; color: #fff; }
.btn--buy:hover { background: #ca6f1e; }
.btn--detail { background: #f0f0f0; color: #333; }
.btn--detail:hover { background: #e0e0e0; }

/* Chart */
.chart-section { margin-bottom: 2rem; }
.chart-tabs { display: flex; gap: .5rem; margin-bottom: .75rem; }
.chart-tabs a {
  padding: .3rem .8rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: .85rem;
  text-decoration: none;
  color: #555;
}
.chart-tabs a.active, .chart-tabs a:hover { background: #1a1a1a; color: #fff; border-color: #1a1a1a; }

/* Spec */
.spec dl { display: grid; grid-template-columns: auto 1fr; gap: .3rem 1rem; font-size: .9rem; }
.spec dt { color: #888; }

/* Product grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}
.product-card {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 1rem;
  text-decoration: none;
  color: inherit;
  background: #fff;
  transition: box-shadow .15s;
}
.product-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,.1); }
.product-card--mock { opacity: .75; }
.product-card__badge { margin-bottom: .4rem; }
.product-card__name { font-weight: 600; margin-bottom: .5rem; font-size: .95rem; }
.product-card__price { color: #e67e22; font-weight: 700; }
.product-card__cat { font-size: .75rem; color: #aaa; margin-top: .25rem; }

.badge { font-size: .7rem; padding: .15rem .5rem; border-radius: 20px; font-weight: 600; }
.badge--live { background: #eafaf1; color: #27ae60; }
.badge--soon { background: #f5f5f5; color: #999; }

/* Product row (best-of) */
.product-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .75rem 0;
  border-bottom: 1px solid #f0f0f0;
}
.product-row__rank {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: #1a1a1a;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
  font-weight: 700;
  flex-shrink: 0;
}
.product-row__info { flex: 1; }
.product-row__info a { text-decoration: none; color: #222; }
.product-row__info a:hover { text-decoration: underline; }
.product-row__price { color: #e67e22; font-weight: 700; margin-top: .2rem; }
.product-row__actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* Compare grid */
.compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin-bottom: 2rem; }
@media (max-width: 600px) { .compare-grid { grid-template-columns: 1fr; } }

/* Related */
.related ul { list-style: none; padding: 0; }
.related li { padding: .3rem 0; }
.related a { color: #2980b9; }

/* Banner (alert set / cancelled) */
.banner {
  padding: .75rem 1rem;
  border-radius: 6px;
  margin-bottom: 1.25rem;
  font-size: .95rem;
}
.banner--success { background: #eafaf1; border-left: 4px solid #27ae60; color: #1e8449; }
.banner--neutral { background: #f5f5f5; border-left: 4px solid #bbb; color: #555; }

/* Alert form */
.alert-section { margin: 2rem 0; }
.alert-desc { color: #666; font-size: .9rem; margin-bottom: .75rem; }
.alert-form { display: flex; align-items: flex-end; gap: .75rem; flex-wrap: wrap; }
.alert-form label { display: flex; flex-direction: column; font-size: .85rem; color: #555; gap: .25rem; }
.alert-form input[type="number"] {
  padding: .45rem .7rem;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-size: 1rem;
  width: 130px;
}
.btn--line { background: #06c755; color: #fff; }
.btn--line:hover { background: #05a847; }

/* Product Hero */
.product-hero {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
  align-items: start;
}
@media (max-width: 640px) { .product-hero { grid-template-columns: 1fr; } }

.product-hero__img-placeholder {
  background: #f5f3ef;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  gap: .75rem;
  min-height: 220px;
  text-align: center;
}
.product-hero__img-placeholder span { font-size: 3.5rem; }
.product-hero__img-placeholder p { font-size: .85rem; color: #888; line-height: 1.4; }

.product-hero__img-real {
  width: 100%;
  max-height: 280px;
  object-fit: contain;
  border-radius: 12px;
  background: #f5f3ef;
  display: block;
}

/* Home card thumbnail */
.product-card__thumb {
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 6px;
  margin-bottom: .6rem;
  background: #f5f3ef;
}
.product-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-hero__brand { color: #888; font-size: .9rem; margin-bottom: .75rem; }
.product-hero__info h1 { font-size: 1.4rem; margin-bottom: .25rem; line-height: 1.3; }

.hero-price-box {
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  margin: 1rem 0;
  display: flex;
  flex-direction: column;
  gap: .4rem;
}
.hero-price-box__label { font-size: .8rem; color: #888; text-transform: uppercase; letter-spacing: .03em; }
.hero-price-box__price { font-size: 2rem; font-weight: 700; color: #e67e22; }
.hero-price-box__from { font-size: .85rem; color: #666; margin-bottom: .25rem; }
.btn--lg { padding: .65rem 1.5rem; font-size: 1rem; margin-top: .25rem; align-self: flex-start; }

/* Platform badge */
.platform-badge { font-size: .75rem; padding: .2rem .55rem; border-radius: 20px; font-weight: 600; }
.platform-badge--shopee { background: #fff0e6; color: #e05c00; }
.platform-badge--lazada { background: #f0e6ff; color: #6a0dad; }
.platform-badge--mock { background: #f0f0f0; color: #888; }

/* Chart */
.chart-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem; margin-bottom: .75rem; }
.chart-header h2 { margin: 0; }
.chart-wrap { position: relative; }
.chart-empty {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: 3rem 1rem;
  background: #fafaf8;
  border: 2px dashed #e0e0e0;
  border-radius: 8px;
  text-align: center;
  color: #aaa;
}
.chart-empty span { font-size: 2rem; }
.chart-empty p { font-weight: 600; color: #888; }
.chart-empty small { font-size: .8rem; }
.chart-hint { font-size: .82rem; color: #999; margin-top: .5rem; }

/* Lower grid */
.product-lower { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin-top: 1rem; }
@media (max-width: 600px) { .product-lower { grid-template-columns: 1fr; } }

.spec-card {
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
}
.spec-card h2 { margin-top: 0; }
.spec-card dl { display: grid; grid-template-columns: auto 1fr; gap: .4rem 1rem; font-size: .9rem; }
.spec-card dt { color: #888; }

/* Alert form inline */
.alert-form { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-top: .5rem; }
.alert-form input[type="number"] {
  padding: .45rem .7rem;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-size: .95rem;
  width: 150px;
}

/* Admin table */
table { width: 100%; border-collapse: collapse; margin-top: 1rem; }
th, td { padding: .5rem .75rem; text-align: left; border-bottom: 1px solid #eee; font-size: .9rem; }
th { background: #f5f5f5; font-weight: 600; }
