/* =========================================================
   StoreBass - Design System
   Palette : Electric Indigo + Amber accent + Ink text
   Type    : Space Grotesk (display) / Plus Jakarta Sans (body)
   ========================================================= */

:root {
  --ink: #2B1B2D;
  --ink-soft: #8B6F7E;
  --bg: #FFF7F5;
  --surface: #FFFFFF;
  --line: #F5E1E6;

  --brand: #D6336C;
  --brand-dark: #A8235A;
  --brand-light: #FDEAF0;

  --amber: #F5A623;
  --amber-dark: #D6890F;

  --coral: #FF7A59;

  --wa: #25D366;
  --wa-dark: #1DA851;

  --danger: #E5484D;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;

  --shadow-sm: 0 2px 8px rgba(43, 27, 45, 0.08);
  --shadow-md: 0 12px 32px rgba(43, 27, 45, 0.12);
  --shadow-lg: 0 24px 60px rgba(214, 51, 108, 0.22);

  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  margin: 0;
  letter-spacing: -0.01em;
}

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ---------- Topbar & Navbar ---------- */
.topbar {
  background: var(--ink);
  color: #D7D2F8;
  font-size: 13px;
  padding: 7px 0;
}
.topbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.topbar a { color: #D7D2F8; }
.topbar .topbar-wa { display: flex; align-items: center; gap: 6px; }

.navbar {
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line);
}
.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  color: var(--ink);
  white-space: nowrap;
}
.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--brand), var(--coral));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}
.brand-mark svg { width: 20px; height: 20px; }

.search-box {
  flex: 1;
  max-width: 480px;
  position: relative;
}
.search-box input {
  width: 100%;
  padding: 12px 44px 12px 16px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--bg);
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
}
.search-box input:focus { border-color: var(--brand); background: #fff; }
.search-box svg {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--ink-soft);
}

.nav-actions { display: flex; align-items: center; gap: 10px; }
.btn-admin {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
  transition: all .15s ease;
}
.btn-admin:hover { border-color: var(--brand); color: var(--brand); }
.btn-admin svg { width: 16px; height: 16px; }

/* ---------- Hero ---------- */
.hero {
  background: radial-gradient(circle at 15% 20%, rgba(255,167,127,.4), transparent 55%),
              linear-gradient(135deg, var(--brand) 0%, var(--coral) 55%, var(--brand-dark) 100%);
  color: #fff;
  padding: 56px 0 72px;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  right: -80px;
  top: -80px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: rgba(245, 166, 35, 0.25);
}
.hero .container {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 32px;
  align-items: center;
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.25);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 18px;
}
.hero h1 {
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.12;
  font-weight: 700;
  margin-bottom: 16px;
}
.hero h1 span { color: var(--amber); }
.hero p {
  font-size: 16px;
  color: rgba(255,255,255,.85);
  max-width: 460px;
  margin-bottom: 26px;
}
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }

.hero-art {
  display: flex;
  justify-content: center;
  align-items: center;
}
.hero-card {
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.22);
  border-radius: var(--radius-lg);
  padding: 22px;
  backdrop-filter: blur(6px);
  width: 100%;
  max-width: 320px;
}
.hero-card .price-tag {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  color: var(--ink);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-top: 14px;
  font-weight: 700;
}
.hero-card .price-tag small { display: block; color: var(--ink-soft); font-weight: 500; font-size: 12px; }
.hero-stats { display: flex; gap: 18px; margin-top: 18px; }
.hero-stats div { text-align: center; color: #fff; }
.hero-stats strong { display: block; font-family: var(--font-display); font-size: 20px; }
.hero-stats span { font-size: 12px; color: rgba(255,255,255,.75); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
  border: none;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--amber); color: var(--ink); box-shadow: 0 10px 24px rgba(245,166,35,.35); }
.btn-primary:hover { transform: translateY(-2px); }
.btn-outline { background: transparent; color: #fff; border: 1.5px solid rgba(255,255,255,.5); }
.btn-outline:hover { border-color: #fff; }
.btn-wa { background: var(--wa); color: #fff; box-shadow: 0 10px 24px rgba(37,211,102,.35); width: 100%; }
.btn-wa:hover { background: var(--wa-dark); transform: translateY(-2px); }
.btn-buy { background: var(--brand); color: #fff; width: 100%; box-shadow: 0 10px 24px rgba(214,51,108,.3); }
.btn-buy:hover { background: var(--brand-dark); transform: translateY(-2px); }
.btn-ghost { background: var(--brand-light); color: var(--brand-dark); }
.btn-danger { background: #FBE4E4; color: var(--danger); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: 8px; }

/* ---------- Section headers ---------- */
.section { padding: 56px 0; }
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 26px;
  gap: 16px;
  flex-wrap: wrap;
}
.section-head .eyebrow {
  color: var(--brand);
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 6px;
  display: block;
}
.section-head h2 { font-size: 26px; }
.section-head p { color: var(--ink-soft); margin: 6px 0 0; font-size: 14px; }

/* ---------- Category chips ---------- */
.chip-row { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 30px; }
.chip {
  flex-shrink: 0;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
  transition: all .15s ease;
}
.chip.active, .chip:hover { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ---------- Product grid & card ---------- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.product-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease;
  display: flex;
  flex-direction: column;
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.product-thumb {
  aspect-ratio: 1 / 1;
  background: var(--brand-light);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.product-thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-thumb .placeholder-icon { width: 46px; height: 46px; color: var(--brand); opacity: .5; }
.badge-featured {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--amber);
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
}
.product-info { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.product-info h3 {
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font-body);
  line-height: 1.3;
  min-height: 38px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-price { font-family: var(--font-display); font-size: 18px; font-weight: 700; color: var(--brand-dark); margin-top: auto; }
.product-meta { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--ink-soft); }

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--ink-soft);
}
.empty-state svg { width: 64px; height: 64px; color: var(--line); margin: 0 auto 14px; }

/* ---------- Trust strip ---------- */
.trust-strip { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.trust-strip .container { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; padding: 26px 20px; }
.trust-item { display: flex; align-items: center; gap: 12px; }
.trust-item .icon-box {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--brand-light); color: var(--brand);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.trust-item .icon-box svg { width: 22px; height: 22px; }
.trust-item strong { display: block; font-size: 14px; }
.trust-item span { font-size: 12.5px; color: var(--ink-soft); }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #C9C5E8; padding: 48px 0 24px; margin-top: 20px; }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 30px; padding-bottom: 30px; border-bottom: 1px solid rgba(255,255,255,.1); }
.footer-brand { display: flex; align-items: center; gap: 10px; color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 20px; margin-bottom: 10px; }
.site-footer p { font-size: 13.5px; line-height: 1.6; max-width: 320px; }
.site-footer h4 { color: #fff; font-size: 14px; margin-bottom: 14px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; font-size: 13.5px; }
.footer-bottom { text-align: center; font-size: 12.5px; padding-top: 18px; color: #8E88B8; }

/* ---------- Product detail page ---------- */
.detail-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  padding: 40px 0 60px;
  align-items: flex-start;
}
.breadcrumb { font-size: 13px; color: var(--ink-soft); margin-bottom: 18px; }
.breadcrumb a { color: var(--brand); font-weight: 600; }
.detail-image {
  border-radius: var(--radius-lg);
  background: var(--brand-light);
  aspect-ratio: 1/1;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  position: sticky;
  top: 96px;
}
.detail-image img { width: 100%; height: 100%; object-fit: cover; }
.detail-image svg { width: 90px; height: 90px; color: var(--brand); opacity: .5; }

.detail-info h1 { font-size: 28px; margin-bottom: 10px; }
.detail-stock { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--wa-dark); background: #E7F9EE; padding: 5px 12px; border-radius: 999px; margin-bottom: 16px; }
.detail-price { font-family: var(--font-display); font-size: 32px; font-weight: 700; color: var(--brand-dark); margin-bottom: 20px; }
.detail-desc { color: var(--ink-soft); line-height: 1.7; font-size: 14.5px; margin-bottom: 26px; }

.buy-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px; box-shadow: var(--shadow-sm); }
.qty-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.qty-row label { font-weight: 700; font-size: 14px; }
.qty-control { display: flex; align-items: center; border: 1.5px solid var(--line); border-radius: 999px; overflow: hidden; }
.qty-control button { width: 38px; height: 38px; background: var(--bg); font-size: 18px; font-weight: 700; color: var(--brand); border: none; }
.qty-control button:hover { background: var(--brand-light); }
.qty-control input { width: 50px; text-align: center; border: none; font-weight: 700; font-size: 15px; font-family: inherit; background: transparent; }

.total-row { display: flex; justify-content: space-between; align-items: center; padding: 14px 0; border-top: 1px dashed var(--line); margin-bottom: 18px; }
.total-row span { color: var(--ink-soft); font-size: 14px; }
.total-row strong { font-family: var(--font-display); font-size: 22px; color: var(--ink); }

.wa-field { display: flex; align-items: center; gap: 10px; background: var(--bg); border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 18px; font-size: 13.5px; color: var(--ink-soft); }
.wa-field svg { width: 20px; height: 20px; color: var(--wa); flex-shrink: 0; }

#waButtonWrap { display: none; margin-top: 14px; }
#waButtonWrap.show { display: block; animation: pop .25s ease; }
@keyframes pop { from { opacity: 0; transform: scale(.95); } to { opacity: 1; transform: scale(1); } }

/* =========================================================
   ADMIN PANEL
   ========================================================= */
.admin-body { background: var(--bg); min-height: 100vh; }
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 240px;
  background: var(--ink);
  color: #D7D2F8;
  flex-shrink: 0;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
}
.admin-sidebar .brand { color: #fff; margin-bottom: 30px; padding: 0 6px; }
.admin-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.admin-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; border-radius: 10px; font-size: 14px; font-weight: 600;
  color: #C9C5E8;
}
.admin-nav a svg { width: 18px; height: 18px; }
.admin-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.admin-nav a.active { background: var(--brand); color: #fff; }
.admin-logout { border-top: 1px solid rgba(255,255,255,.1); padding-top: 14px; margin-top: 10px; }
.admin-logout a { color: #F5A3A3; }

.admin-main { flex: 1; padding: 28px 34px; max-width: 1200px; }
.admin-topline { display: flex; justify-content: space-between; align-items: center; margin-bottom: 26px; flex-wrap: wrap; gap: 14px; }
.admin-topline h1 { font-size: 24px; }
.admin-topline p { color: var(--ink-soft); font-size: 13.5px; margin: 4px 0 0; }

.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-bottom: 28px; }
.stat-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 20px; display: flex; align-items: center; gap: 14px; }
.stat-card .icon-box { width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center; }
.stat-card .icon-box svg { width: 22px; height: 22px; }
.stat-card .icon-box.i1 { background: var(--brand-light); color: var(--brand); }
.stat-card .icon-box.i2 { background: #FFF3DC; color: var(--amber-dark); }
.stat-card .icon-box.i3 { background: #E7F9EE; color: var(--wa-dark); }
.stat-card strong { display: block; font-family: var(--font-display); font-size: 22px; }
.stat-card span { font-size: 12.5px; color: var(--ink-soft); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 24px; margin-bottom: 24px; }
.card h2 { font-size: 17px; margin-bottom: 18px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { margin-bottom: 16px; display: flex; flex-direction: column; gap: 6px; }
.form-group.full { grid-column: 1 / -1; }
.form-group label { font-size: 13.5px; font-weight: 700; }
.form-group input[type=text],
.form-group input[type=number],
.form-group input[type=password],
.form-group textarea,
.form-group select {
  padding: 11px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  background: var(--bg);
  color: var(--ink);
}
.form-group textarea { resize: vertical; min-height: 90px; }
.form-group input:focus, .form-group textarea:focus, .form-group select:focus { border-color: var(--brand); background: #fff; }
.help-text { font-size: 12px; color: var(--ink-soft); }

.file-drop {
  border: 2px dashed var(--line);
  border-radius: var(--radius-sm);
  padding: 20px;
  text-align: center;
  cursor: pointer;
  background: var(--bg);
}
.file-drop:hover { border-color: var(--brand); }
.file-drop svg { width: 28px; height: 28px; color: var(--brand); margin: 0 auto 8px; }
.file-drop input { display: none; }
.file-drop span { display: block; font-size: 13px; color: var(--ink-soft); }

table.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data-table th, table.data-table td { padding: 12px 10px; text-align: left; border-bottom: 1px solid var(--line); }
table.data-table th { color: var(--ink-soft); font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; }
table.data-table .prod-cell { display: flex; align-items: center; gap: 12px; }
table.data-table .prod-cell .thumb { width: 44px; height: 44px; border-radius: 8px; background: var(--brand-light); object-fit: cover; flex-shrink: 0; }
table.data-table .row-actions { display: flex; gap: 8px; }
.status-pill { padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.status-pill.active { background: #E7F9EE; color: var(--wa-dark); }
.status-pill.inactive { background: #FBE4E4; color: var(--danger); }

.alert { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 13.5px; margin-bottom: 18px; font-weight: 600; }
.alert-success { background: #E7F9EE; color: var(--wa-dark); }
.alert-error { background: #FBE4E4; color: var(--danger); }

/* Login page */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--brand), var(--coral) 60%, var(--brand-dark)); padding: 20px; }
.login-card { background: #fff; border-radius: var(--radius-lg); padding: 38px 32px; max-width: 380px; width: 100%; box-shadow: var(--shadow-lg); }
.login-card .brand-mark { margin: 0 auto 16px; }
.login-card h1 { text-align: center; font-size: 22px; margin-bottom: 6px; }
.login-card p.sub { text-align: center; color: var(--ink-soft); font-size: 13.5px; margin-bottom: 24px; }
.login-back { display: block; text-align: center; margin-top: 18px; font-size: 13px; color: var(--brand); font-weight: 600; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .hero .container { grid-template-columns: 1fr; }
  .hero-art { order: -1; }
  .product-grid { grid-template-columns: repeat(3, 1fr); }
  .detail-wrap { grid-template-columns: 1fr; }
  .detail-image { position: static; }
  .footer-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .admin-sidebar { position: fixed; left: -260px; top: 0; height: 100%; z-index: 100; transition: left .2s ease; }
  .admin-sidebar.open { left: 0; }
}
@media (max-width: 720px) {
  .search-box { display: none; }
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .trust-strip .container { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: 1fr; }
  .admin-main { padding: 20px 16px; }
}
