:root {
  --bg: #fff7fb;
  --bg2: #f3ecff;
  --card: #ffffff;
  --line: #efe6f6;
  --text: #241d3a;
  --muted: #8b83a3;
  --brand: #7b5cff;
  --brand-dark: #6547e0;
  --pink: #ff5ea8;
  --accent: #25d366;      /* WhatsApp green */
  --accent-dark: #1fbe5b;
  --radius: 20px;
}

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

body {
  font-family: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

h1, h2, h3, .logo { font-family: "Fredoka", "Nunito", sans-serif; }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px;
  background: rgba(255,247,251,0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 34px; height: 34px; display: block; }
.logo { font-weight: 700; font-size: 22px; letter-spacing: .2px; color: var(--text); }
.cart-btn {
  position: relative; background: none; border: none;
  font-size: 24px; cursor: pointer; line-height: 1;
}
.cart-count {
  position: absolute; top: -6px; right: -8px;
  background: var(--pink); color: #fff;
  font-size: 12px; font-weight: 800;
  min-width: 18px; height: 18px; border-radius: 9px;
  display: none; align-items: center; justify-content: center; padding: 0 4px;
}

/* Hero */
.hero {
  text-align: center; padding: 48px 20px 40px;
  background: radial-gradient(90% 120% at 50% -10%, #efe4ff 0%, var(--bg) 60%);
}
.hero-badge {
  display: inline-block; background: #fff; border: 1px solid var(--line);
  color: var(--brand); font-weight: 800; font-size: 13px;
  padding: 6px 14px; border-radius: 999px; margin-bottom: 16px;
  box-shadow: 0 4px 14px rgba(123,92,255,.10);
}
.hero h1 {
  font-size: clamp(40px, 11vw, 68px); font-weight: 700; line-height: 1;
  background: linear-gradient(120deg, var(--brand), var(--pink));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { color: var(--muted); margin-top: 12px; font-size: 18px; font-weight: 600; }
.hero-btn { display: inline-block; margin-top: 22px; text-decoration: none; font-size: 16px; padding: 13px 22px; }

/* How it works */
.how {
  display: flex; justify-content: center; gap: 10px; flex-wrap: wrap;
  padding: 4px 16px 8px; max-width: 640px; margin: 0 auto;
}
.how-step {
  flex: 1; min-width: 96px; text-align: center;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; padding: 14px 8px;
}
.how-step span { font-size: 26px; }
.how-step p { font-size: 13px; font-weight: 700; color: var(--muted); margin-top: 4px; }

/* Products */
main { max-width: 1000px; margin: 0 auto; padding: 24px 16px 60px; }
.section-title { font-size: 26px; margin: 8px 4px 18px; font-weight: 700; }
.grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 6px 18px rgba(123,92,255,.06);
  transition: transform .15s ease, box-shadow .15s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 12px 26px rgba(123,92,255,.14); }
.card-image {
  font-size: 60px; height: 140px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #f7f0ff, #ffeaf4);
}
.card-body { padding: 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-body h3 { font-size: 17px; font-weight: 700; }
.desc { color: var(--muted); font-size: 13px; flex: 1; font-weight: 600; }
.card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.price { font-weight: 800; font-size: 18px; color: var(--brand); }

.btn {
  background: var(--brand); color: #fff; border: none;
  padding: 9px 14px; border-radius: 12px; font-weight: 800;
  cursor: pointer; font-size: 14px; font-family: inherit;
  transition: background .15s, transform .1s;
}
.btn:hover { background: var(--brand-dark); }
.btn:active { transform: scale(.97); }

/* Footer */
.footer { text-align: center; color: var(--muted); padding: 34px 20px 60px; border-top: 1px solid var(--line); font-size: 14px; font-weight: 600; }
.footer a { color: var(--brand); text-decoration: none; font-weight: 800; }
.footer .copyright { margin-top: 10px; font-size: 12px; opacity: .7; }
.ig-line { margin-top: 6px; }

/* Contact us */
.contact { margin-bottom: 22px; }
.contact-label { display: block; font-weight: 700; color: var(--text); margin-bottom: 10px; }
.contact-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.contact-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 18px; border-radius: 999px; font-weight: 800; font-size: 15px;
  text-decoration: none; color: #fff;
}
.contact-btn.wa { background: var(--accent); color: #062b13; }
.contact-btn.call { background: var(--brand); }
.contact-btn:active { transform: scale(.97); }

/* Overlay */
.overlay {
  position: fixed; inset: 0; background: rgba(36,29,58,.45);
  opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 30;
}
.overlay.show { opacity: 1; pointer-events: auto; }

/* Cart drawer */
.cart-drawer {
  position: fixed; top: 0; right: 0; height: 100%;
  width: min(420px, 100%);
  background: var(--bg); border-left: 1px solid var(--line);
  z-index: 40; transform: translateX(100%);
  transition: transform .25s ease;
  display: flex; flex-direction: column;
}
.cart-drawer.open { transform: translateX(0); }
.cart-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px; border-bottom: 1px solid var(--line);
}
.cart-header h2 { font-size: 20px; }
.close { background: none; border: none; color: var(--text); font-size: 20px; cursor: pointer; }
.cart-body { flex: 1; overflow-y: auto; padding: 12px 20px; }
.empty { color: var(--muted); text-align: center; padding: 40px 0; font-weight: 600; }

.cart-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.cart-emoji { font-size: 30px; }
.cart-info { flex: 1; display: flex; flex-direction: column; }
.cart-info strong { font-weight: 700; }
.cart-info span { color: var(--muted); font-size: 14px; font-weight: 700; }
.qty { display: flex; align-items: center; gap: 10px; }
.qty button {
  width: 30px; height: 30px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--card);
  color: var(--text); font-size: 17px; cursor: pointer; font-weight: 800;
}

.checkout-area { border-top: 1px solid var(--line); padding: 16px 20px 24px; }
.total-row { display: flex; justify-content: space-between; font-size: 19px; font-weight: 800; margin-bottom: 14px; }
form { display: flex; flex-direction: column; gap: 10px; }
input, textarea {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px; color: var(--text); font-size: 15px; font-family: inherit; font-weight: 600;
}
input:focus, textarea:focus { outline: 2px solid var(--brand); border-color: transparent; }
textarea { min-height: 60px; resize: vertical; }
.pay-note { color: var(--muted); font-size: 13px; font-weight: 600; }
.bank { color: var(--muted); font-size: 12px; font-weight: 600; }
.btn.checkout {
  background: var(--accent); color: #062b13; font-weight: 800;
  padding: 15px; font-size: 16px; margin-top: 6px;
}
.btn.checkout:hover { background: var(--accent-dark); }

/* Coming-soon (empty shop) */
.coming-soon {
  text-align: center; padding: 48px 24px; margin: 8px auto; max-width: 460px;
  background: var(--card); border: 1px dashed #d9c9ef; border-radius: var(--radius);
}
.coming-emoji { font-size: 52px; }
.coming-soon h3 { font-size: 22px; font-weight: 700; margin-top: 10px; }
.coming-soon p { color: var(--muted); font-weight: 600; margin-top: 8px; }

/* ============ Shared page layout (checkout + admin) ============ */
.page { max-width: 680px; margin: 0 auto; padding: 24px 16px 60px; }
.page-title { font-size: 28px; font-weight: 700; margin-bottom: 6px; }
.back-link { background: none; border: none; color: var(--brand); font-weight: 800; font-size: 15px; cursor: pointer; text-decoration: none; font-family: inherit; }
.muted { color: var(--muted); font-weight: 600; }
.admin-tag { font-size: 12px; background: var(--brand); color: #fff; padding: 2px 8px; border-radius: 999px; vertical-align: middle; }

.panel {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px; margin-top: 16px;
  box-shadow: 0 6px 18px rgba(123,92,255,.06);
}
.panel-title { font-size: 18px; font-weight: 700; margin-bottom: 12px; }

/* Checkout summary */
.summary-row, .total-row { display: flex; justify-content: space-between; padding: 6px 0; font-weight: 600; }
.total-row { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 12px; font-size: 18px; font-weight: 800; }
.total-row.big { font-size: 20px; }

/* Forms */
label { display: block; font-weight: 700; font-size: 14px; margin-bottom: 12px; }
label input, label textarea { display: block; width: 100%; margin-top: 6px; }
input, textarea, select {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 12px; color: var(--text); font-size: 15px; font-family: inherit; font-weight: 600;
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--brand); border-color: transparent; }
textarea { min-height: 64px; resize: vertical; }

.pay-box { background: #f7f2ff; border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin: 4px 0 16px; }
.pay-title { font-size: 13px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.pay-selected { font-size: 17px; font-weight: 800; margin: 4px 0; }
.pay-note { color: var(--muted); font-size: 13px; font-weight: 600; }

/* Confirmation */
.confirm { text-align: center; }
.confirm-emoji { font-size: 56px; }
.confirm h2 { font-size: 24px; margin: 6px 0; }
.order-id { margin: 12px 0 18px; }
.order-id strong { color: var(--brand); }
.empty-state { text-align: center; }
.empty-state p { margin-bottom: 14px; font-weight: 700; }

/* ============ Admin ============ */
.login-box { max-width: 380px; margin: 40px auto 0; text-align: center; }
.brand-mark-lg img { width: 64px; height: 64px; }
.login-box form { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.login-error { color: #e0245e; font-weight: 700; font-size: 14px; }

.dash-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.dash-stats { display: flex; gap: 8px; flex-wrap: wrap; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font-weight: 700; font-size: 14px; }
.stat b { color: var(--brand); }

.btn.ghost { background: #fff; color: var(--brand); border: 1px solid var(--line); margin: 14px 0; }
.btn.ghost.danger { color: #e0245e; margin: 0; }

.order-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; box-shadow: 0 4px 12px rgba(123,92,255,.05); }
.order-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.order-id-tag { font-weight: 800; font-family: monospace; font-size: 14px; }
.order-date { color: var(--muted); font-size: 13px; font-weight: 600; }
.badge { font-size: 12px; font-weight: 800; padding: 3px 10px; border-radius: 999px; margin-left: 8px; }
.badge-new { background: #e7f0ff; color: #2b6bff; }
.badge-confirmed { background: #fff3d6; color: #b8860b; }
.badge-out-for-delivery { background: #ffe6f2; color: #d6337a; }
.badge-delivered { background: #daf6e4; color: #1a8a4b; }

.order-items { margin: 12px 0; font-weight: 600; }
.order-total { font-size: 15px; border-top: 1px dashed var(--line); padding-top: 10px; }
.order-customer { margin-top: 10px; font-size: 14px; font-weight: 600; display: grid; gap: 4px; }
.order-customer a { color: var(--brand); text-decoration: none; }
.order-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.order-actions label { display: flex; align-items: center; gap: 8px; margin: 0; }
.order-actions select { padding: 8px 10px; }

/* ============ Storefront: sold-out / images ============ */
.card { position: relative; }
.card-image img { width: 100%; height: 100%; object-fit: cover; }
.card.is-soldout .card-image { filter: grayscale(0.7) opacity(0.65); }
.soldout-badge, .low-badge {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  font-size: 12px; font-weight: 800; padding: 4px 10px; border-radius: 999px;
}
.soldout-badge { background: #241d3a; color: #fff; }
.low-badge { background: #fff3d6; color: #b8860b; }
.btn-disabled { background: #cfc7dd !important; cursor: not-allowed; }
.cart-emoji img { width: 34px; height: 34px; border-radius: 8px; object-fit: cover; }

/* ============ Admin: tabs + filters ============ */
.tabs { display: flex; gap: 8px; margin: 6px 0 4px; }
.tab {
  flex: 1; background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px; font-weight: 800; font-size: 15px; cursor: pointer; color: var(--muted);
  font-family: inherit;
}
.tab.active { background: var(--brand); color: #fff; border-color: var(--brand); }

.filter-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.chip {
  background: var(--card); border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 14px; font-weight: 700; font-size: 13px; cursor: pointer; color: var(--muted);
  font-family: inherit;
}
.chip.on { background: var(--brand); color: #fff; border-color: var(--brand); }

/* ============ Admin: product form ============ */
label.checkbox { display: flex; align-items: center; gap: 8px; font-weight: 700; }
label.checkbox input { width: auto; margin: 0; }
.form-actions { display: flex; gap: 10px; align-items: center; }
.form-actions .btn { flex: 1; }

/* ============ Admin: product cards ============ */
.prod-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 12px; margin-bottom: 10px;
}
.prod-card.inactive { opacity: 0.6; }
.prod-thumb {
  width: 52px; height: 52px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 30px;
  background: linear-gradient(135deg, #f7f0ff, #ffeaf4); overflow: hidden;
}
.prod-thumb img { width: 100%; height: 100%; object-fit: cover; }
.prod-info { flex: 1; min-width: 0; }
.prod-info strong { display: block; }
.hidden-tag { font-size: 11px; font-weight: 800; background: #eee; color: #777; padding: 2px 8px; border-radius: 999px; }
.stock-out { color: #e0245e; font-weight: 800; }
.stock-low { color: #b8860b; font-weight: 800; }
.prod-actions { display: flex; flex-direction: column; gap: 6px; }
.prod-actions .btn { margin: 0; padding: 7px 12px; font-size: 13px; }
@media (max-width: 480px) {
  .prod-actions { flex-direction: row; flex-wrap: wrap; }
}
