:root {
  --bg: #faf9f6;
  --card: #ffffff;
  --ink: #2a2438;
  --muted: #6f6a7d;
  --line: #e9e5dd;
  --brand: #8b7fa8;
  --brand-dark: #6f6390;
  --brand-soft: #f1edf8;
  --ok: #1f7a4d;
  --ok-soft: #e6f5ec;
  --warn: #9a5b00;
  --warn-soft: #fdf1dd;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(42, 36, 56, 0.08);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

img { display: block; max-width: 100%; }

.wrap { width: min(1100px, 100% - 2rem); margin-inline: auto; }

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(250, 249, 246, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 0;
}

.logo {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: var(--brand-soft);
}

.logo-fallback {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 1rem; letter-spacing: -0.01em; }
.brand-text span { font-size: 0.75rem; color: var(--muted); }

.spacer { flex: 1; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border: 0;
  border-radius: 999px;
  padding: 0.65rem 1.1rem;
  font: inherit;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.btn:active { transform: scale(0.97); }

.btn-wa { background: #25d366; color: #08331b; }
.btn-wa:hover { background: #1fbe5a; }

.btn-brand { background: var(--brand); color: #fff; }
.btn-brand:hover { background: var(--brand-dark); }

.btn-ghost { background: var(--brand-soft); color: var(--brand-dark); }
.btn-ghost:hover { background: #e6dff3; }

.btn-block { width: 100%; padding: 0.85rem 1rem; font-size: 0.95rem; }

/* ---------- hero ---------- */
.hero {
  position: relative;
  margin-top: 1rem;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--brand);
  min-height: 190px;
  display: flex;
  align-items: flex-end;
}

.hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(20, 16, 30, 0.05) 20%, rgba(20, 16, 30, 0.78) 100%);
}

.hero-body { position: relative; z-index: 1; padding: 1.4rem; color: #fff; }
.hero-body h1 { margin: 0 0 0.25rem; font-size: 1.55rem; letter-spacing: -0.02em; }
.hero-body p { margin: 0; font-size: 0.9rem; opacity: 0.9; max-width: 46ch; }

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.8rem;
  font-size: 0.75rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(4px);
}

/* ---------- toolbar ---------- */
.toolbar { margin: 1.6rem 0 1rem; display: grid; gap: 0.85rem; }

.search {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.55rem 0.9rem;
  box-shadow: 0 4px 14px rgba(42, 36, 56, 0.04);
}

.search input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: 0.9rem;
  color: var(--ink);
  min-width: 0;
}

.cats { display: flex; gap: 0.45rem; overflow-x: auto; padding-bottom: 0.35rem; scrollbar-width: thin; }

.cat {
  white-space: nowrap;
  padding: 0.42rem 0.85rem;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--line);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}

.cat:hover { border-color: var(--brand); color: var(--brand-dark); }
.cat.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }

.result-line { font-size: 0.8rem; color: var(--muted); margin: 0 0 0.9rem; }

/* ---------- grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.9rem;
  padding-bottom: 2.5rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: #ded8ef; }

.card-media { position: relative; aspect-ratio: 1 / 1; background: var(--brand-soft); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.35s ease; }
.card:hover .card-media img { transform: scale(1.04); }

.badge {
  position: absolute;
  top: 0.55rem;
  left: 0.55rem;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0.22rem 0.5rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--brand-dark);
  box-shadow: 0 2px 8px rgba(42, 36, 56, 0.12);
}

.badge-stock { left: auto; right: 0.55rem; background: var(--ok-soft); color: var(--ok); }
.badge-stock.low { background: var(--warn-soft); color: var(--warn); }

.card-body { padding: 0.7rem 0.75rem 0.85rem; display: flex; flex-direction: column; gap: 0.3rem; flex: 1; }

.card-cat { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--brand); font-weight: 700; }

.card-title {
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.2em;
}

.card-price { margin-top: auto; font-weight: 800; font-size: 0.95rem; color: var(--ink); }
.card-price small { font-weight: 600; font-size: 0.7rem; color: var(--muted); }

/* ---------- detail page ---------- */
.detail { display: grid; gap: 1.4rem; padding: 1.2rem 0 2.5rem; }

@media (min-width: 780px) {
  .detail { grid-template-columns: 1.05fr 1fr; align-items: start; gap: 2rem; }
}

.gallery-main {
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow);
  aspect-ratio: 1 / 1;
}

.gallery-main img { width: 100%; height: 100%; object-fit: cover; }

.thumbs { display: flex; gap: 0.5rem; margin-top: 0.6rem; overflow-x: auto; padding-bottom: 0.2rem; }

.thumb {
  width: 64px;
  height: 64px;
  flex: 0 0 auto;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  background: none;
}

.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb.is-active { border-color: var(--brand); }

.back { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.82rem; color: var(--muted); margin: 1rem 0 0.4rem; font-weight: 600; }
.back:hover { color: var(--brand-dark); }

.detail h1 { font-size: 1.4rem; line-height: 1.25; margin: 0.2rem 0 0.5rem; letter-spacing: -0.02em; }

.pill-row { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-bottom: 0.9rem; }

.pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.low { background: var(--warn-soft); color: var(--warn); }

.price { font-size: 1.7rem; font-weight: 800; letter-spacing: -0.02em; margin: 0.2rem 0 1rem; }

.option-group { margin-bottom: 0.9rem; }
.option-group label { display: block; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 0.4rem; }

.section-title { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 1.2rem 0 0.5rem; }

.description { white-space: pre-line; font-size: 0.92rem; color: #443e56; }
.description p { margin: 0 0 0.6rem; }

.buy-box {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: 0 6px 20px rgba(42, 36, 56, 0.05);
  display: grid;
  gap: 0.6rem;
}

.note { font-size: 0.75rem; color: var(--muted); text-align: center; }

.checkout { margin-top: 1rem; padding: 0.9rem 1rem; border-radius: 14px; background: var(--brand-soft); font-size: 0.8rem; color: var(--brand-dark); }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 1.5rem 0 2.5rem; font-size: 0.78rem; color: var(--muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; justify-content: space-between; }
.site-footer a { color: var(--brand-dark); font-weight: 600; }

.empty { padding: 3rem 1rem; text-align: center; color: var(--muted); }
.empty strong { display: block; color: var(--ink); margin-bottom: 0.3rem; }
