:root {
  --bg: #0f0f12;
  --surface: #1a1a22;
  --border: #2a2a36;
  --text: #f4f4f6;
  --muted: #9b9bab;
  --accent: #ff6b2c;
  --accent-hover: #ff8549;
  --success: #3dd68c;
  --radius: 14px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(255, 107, 44, 0.18), transparent),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(255, 107, 44, 0.08), transparent);
  color: var(--text);
  line-height: 1.5;
}

a {
  color: var(--accent);
}

.container {
  width: min(1100px, 100% - 2rem);
  margin: 0 auto;
}

.site-header {
  padding: 2.5rem 0 1.5rem;
  text-align: center;
}

.site-brand {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1rem 1.5rem;
  margin-bottom: 0.25rem;
}

.site-header h1 {
  margin: 0;
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.site-header h1 span {
  color: var(--accent);
}

.whatsapp-join {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 1rem 0.55rem 0.75rem;
  text-decoration: none;
  text-align: left;
  color: var(--text);
  background: rgba(37, 211, 102, 0.1);
  border: 1px solid rgba(37, 211, 102, 0.45);
  border-radius: 12px;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.whatsapp-join:hover {
  background: rgba(37, 211, 102, 0.18);
  border-color: #25d366;
  color: var(--text);
  transform: translateY(-1px);
}

.whatsapp-join__icon {
  display: flex;
  flex-shrink: 0;
  color: #25d366;
}

.whatsapp-join__text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  line-height: 1.25;
}

.whatsapp-join__title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #3dd68c;
}

.whatsapp-join__desc {
  font-size: 0.75rem;
  color: var(--muted);
  max-width: 220px;
}

@media (max-width: 520px) {
  .site-brand {
    flex-direction: column;
  }

  .whatsapp-join {
    width: 100%;
    max-width: 320px;
    justify-content: center;
  }

  .whatsapp-join__text {
    align-items: center;
    text-align: center;
  }

  .whatsapp-join__desc {
    max-width: none;
  }
}

.tagline {
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.status-bar {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 1.25rem 0 2rem;
}

.status-pill {
  font-size: 0.85rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
}

.status-pill.ok {
  color: var(--success);
  border-color: rgba(61, 214, 140, 0.35);
}

.status-pill.err {
  color: #ff7b7b;
  border-color: rgba(255, 123, 123, 0.35);
}

.source-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
}

.source-filter {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-family: inherit;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.source-filter:hover {
  color: var(--text);
  border-color: rgba(255, 107, 44, 0.4);
}

.source-filter.is-active {
  color: var(--text);
  background: rgba(255, 107, 44, 0.12);
  border-color: var(--accent);
}

.source-filter__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.85;
}

.source-filter.is-active .source-filter__icon {
  opacity: 1;
}

.source-filter__icon--shopee {
  color: #ee4d2d;
}

.source-filter__icon--ml {
  color: #ffe600;
}

.source-filter.is-active .source-filter__icon--shopee {
  color: #ff6b4a;
}

.source-filter.is-active .source-filter__icon--ml {
  color: #ffe600;
  filter: drop-shadow(0 0 1px rgba(0, 0, 0, 0.5));
}

.search-bar {
  margin-bottom: 1.5rem;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

.search-bar__label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.search-bar__input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-bar__input::placeholder {
  color: var(--muted);
}

.search-bar__input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 107, 44, 0.2);
}

.offers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  padding-bottom: 3rem;
}

.offer-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.offer-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 107, 44, 0.45);
}

.offer-card__image-wrap {
  aspect-ratio: 1;
  background: #121218;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.offer-card__image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.offer-card__image-wrap .placeholder {
  color: var(--muted);
  font-size: 3rem;
}

.offer-card__body {
  padding: 1rem 1.1rem 1.15rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.offer-card__source {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  font-weight: 600;
}

.offer-card__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.offer-card__prices {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.price-current {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--success);
}

.price-previous {
  font-size: 0.9rem;
  color: var(--muted);
  text-decoration: line-through;
}

.offer-card__date {
  font-size: 0.78rem;
  color: var(--muted);
}

.offer-card__cta {
  margin-top: auto;
  display: inline-block;
  text-align: center;
  padding: 0.65rem 1rem;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  border-radius: 10px;
  transition: background 0.15s ease;
}

.offer-card__cta:hover {
  background: var(--accent-hover);
  color: #fff;
}

.empty-state,
.error-state,
.loading-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 1.5rem;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--muted);
}

.error-state code {
  display: block;
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--text);
  word-break: break-all;
}

.site-footer {
  text-align: center;
  padding: 2rem 0 2.5rem;
  color: var(--muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
}
