:root {
  --bg: #faf7f2;
  --card: #ffffff;
  --ink: #2b2622;
  --muted: #8a7f75;
  --brand: #c1440e;
  --brand2: #e8743b;
  --gold: #b8893b;
  --line: #ece4da;
  --ok: #2e7d4f;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
.container { max-width: 1140px; margin: 0 auto; padding: 0 18px; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 18px; height: 62px; }
.logo { font-weight: 800; font-size: 22px; letter-spacing: .5px; color: var(--brand); }
.main-nav { display: flex; gap: 18px; margin-left: 8px; }
.main-nav a { color: var(--ink); font-weight: 600; font-size: 14px; }
.main-nav a:hover { color: var(--brand); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.lang-select {
  border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; background: #fff; font-size: 13px;
}
.cart-btn {
  position: relative; border: 1px solid var(--line); background: #fff; border-radius: 10px;
  padding: 7px 12px; cursor: pointer; font-size: 16px;
}
.cart-count {
  position: absolute; top: -7px; right: -7px; background: var(--brand); color: #fff;
  font-size: 11px; border-radius: 999px; padding: 1px 6px; font-weight: 700;
}
.admin-link { font-size: 13px; color: var(--muted); border: 1px solid var(--line); padding: 6px 10px; border-radius: 8px; }
.admin-link:hover { color: var(--brand); border-color: var(--brand); }

/* Hero */
.hero {
  background: linear-gradient(135deg, #2b2622, #4a3b2e);
  color: #fff; text-align: center; padding: 56px 18px 64px;
}
.hero h1 { font-size: 40px; margin: 0 0 8px; }
.hero p { color: #e7d9c9; margin: 0 0 22px; }
.btn-primary {
  display: inline-block; background: var(--brand); color: #fff; border: none;
  padding: 12px 26px; border-radius: 10px; font-weight: 700; cursor: pointer; font-size: 15px;
  transition: transform .08s ease, background .2s;
}
.btn-primary:hover { background: var(--brand2); transform: translateY(-1px); }
.btn-primary.block { width: 100%; margin-top: 6px; }
.btn-ghost {
  border: 1px solid var(--brand); color: var(--brand); background: #fff;
  padding: 9px 16px; border-radius: 9px; cursor: pointer; font-weight: 600;
}
.btn-ghost:hover { background: var(--brand); color: #fff; }

/* Coupon banner */
.coupon-banner {
  background: linear-gradient(90deg, var(--gold), #d9a94e);
  color: #fff; text-align: center; padding: 10px; font-weight: 600; font-size: 14px;
}

/* Shop */
.shop-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 32px 0 18px; }
.shop-head h2 { margin: 0; font-size: 24px; }
.filters { display: flex; gap: 8px; }
.chip {
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 7px 16px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted);
}
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.search-input {
  margin-left: auto; border: 1px solid var(--line); border-radius: 10px; padding: 9px 14px; min-width: 220px; font-size: 14px;
}

.product-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; padding-bottom: 40px; }
@media (max-width: 920px) { .product-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .product-grid { grid-template-columns: 1fr; } .search-input { margin-left: 0; width: 100%; } }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
  cursor: pointer; transition: box-shadow .2s, transform .12s; display: flex; flex-direction: column;
}
.card:hover { box-shadow: var(--shadow); transform: translateY(-3px); }
.card-img { position: relative; aspect-ratio: 1/1; background: #efe7dc; }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.badge-off {
  position: absolute; top: 10px; left: 10px; background: var(--brand); color: #fff;
  font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 6px;
}
.card-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-title { font-weight: 700; font-size: 15px; line-height: 1.3; }
.card-meta { font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; }
.card-price { display: flex; align-items: baseline; gap: 8px; margin-top: auto; }
.price-now { color: var(--brand); font-weight: 800; font-size: 17px; }
.price-old { color: var(--muted); text-decoration: line-through; font-size: 13px; }
.stars { color: var(--gold); font-size: 13px; }

/* Track */
.track-section { padding: 30px 18px 50px; }
.track-section h2 { font-size: 24px; margin: 0 0 14px; }
.track-box { display: flex; gap: 10px; max-width: 520px; }
.track-box input { flex: 1; border: 1px solid var(--line); border-radius: 10px; padding: 11px 14px; font-size: 14px; }
#trackResult { margin-top: 18px; }

/* Timeline */
.timeline { list-style: none; padding: 0; margin: 8px 0 0; }
.timeline li { display: flex; gap: 12px; padding: 8px 0; position: relative; }
.timeline li::before { content: ''; position: absolute; left: 7px; top: 22px; bottom: -8px; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.dot { width: 16px; height: 16px; border-radius: 50%; background: var(--line); flex: 0 0 16px; margin-top: 3px; z-index: 1; }
.timeline li.done .dot { background: var(--ok); }
.timeline li.current .dot { background: var(--brand); box-shadow: 0 0 0 4px rgba(193,68,14,.18); }
.tl-text b { display: block; font-size: 14px; }
.tl-text span { font-size: 12px; color: var(--muted); }
.track-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px; max-width: 560px; }
.track-card .tracking-no { font-weight: 700; color: var(--brand); }

/* Cart */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.4); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 60; }
.overlay.show { opacity: 1; pointer-events: auto; }
.cart-drawer {
  position: fixed; top: 0; right: 0; height: 100%; width: 380px; max-width: 92vw; background: #fff;
  z-index: 70; transform: translateX(100%); transition: transform .25s; display: flex; flex-direction: column;
  box-shadow: -10px 0 40px rgba(0,0,0,.12);
}
.cart-drawer.show { transform: translateX(0); }
.cart-head { display: flex; justify-content: space-between; align-items: center; padding: 18px; border-bottom: 1px solid var(--line); }
.cart-head h3 { margin: 0; }
.icon-btn { border: none; background: none; font-size: 20px; cursor: pointer; color: var(--muted); }
.cart-items { flex: 1; overflow-y: auto; padding: 12px 18px; }
.cart-row { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.cart-row img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; }
.cart-row .ci-info { flex: 1; }
.cart-row .ci-title { font-weight: 600; font-size: 14px; }
.cart-row .ci-price { color: var(--brand); font-weight: 700; }
.qty-box { display: inline-flex; align-items: center; gap: 8px; margin-top: 6px; }
.qty-box button { width: 24px; height: 24px; border: 1px solid var(--line); background: #fff; border-radius: 6px; cursor: pointer; }
.cart-foot { padding: 16px 18px; border-top: 1px solid var(--line); }
.coupon-row { display: flex; gap: 8px; }
.coupon-row input { flex: 1; border: 1px solid var(--line); border-radius: 9px; padding: 9px 12px; }
.coupon-msg { font-size: 12px; min-height: 16px; margin: 6px 2px; }
.coupon-msg.ok { color: var(--ok); }
.coupon-msg.err { color: var(--brand); }
.sum-line { display: flex; justify-content: space-between; font-size: 14px; padding: 4px 0; }
.discount-line span:last-child { color: var(--ok); }
.total-line { font-weight: 800; font-size: 16px; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 10px; }
.cod-note { font-size: 12px; color: var(--muted); text-align: center; margin: 10px 0 0; }

/* Modal */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: none; align-items: center; justify-content: center; z-index: 80; padding: 18px; }
.modal.show { display: flex; }
.modal-card { background: #fff; border-radius: 16px; padding: 24px; width: 100%; max-width: 460px; max-height: 90vh; overflow-y: auto; position: relative; }
.modal-close { position: absolute; top: 14px; right: 14px; }
.checkout-form label { display: block; margin: 12px 0; font-size: 13px; font-weight: 600; color: var(--muted); }
.checkout-form input { width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 11px 12px; margin-top: 5px; font-size: 14px; }

/* Product modal */
.product-card { max-width: 720px; display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 640px) { .product-card { grid-template-columns: 1fr; } }
.pc-imgs img { width: 100%; border-radius: 12px; background: #efe7dc; aspect-ratio: 1/1; object-fit: cover; }
.pc-thumbs { display: flex; gap: 8px; margin-top: 8px; }
.pc-thumbs img { width: 56px; height: 56px; border-radius: 8px; cursor: pointer; border: 2px solid transparent; }
.pc-thumbs img.active { border-color: var(--brand); }
.pc-title { font-size: 22px; font-weight: 800; margin: 0 0 6px; }
.pc-price { display: flex; align-items: baseline; gap: 10px; margin: 8px 0; }
.pc-meta { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.pc-desc { font-size: 14px; line-height: 1.6; color: #4a423a; }
.pc-actions { display: flex; gap: 10px; margin: 16px 0; }
.pc-actions .btn-primary, .pc-actions .btn-ghost { flex: 1; }
.wa-inline { display: inline-flex; align-items: center; gap: 6px; background: #25d366; color: #fff; padding: 9px 14px; border-radius: 9px; font-weight: 600; font-size: 14px; }
.reviews-block { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.reviews-block h4 { margin: 0 0 10px; }
.review-item { padding: 10px 0; border-bottom: 1px solid var(--line); }
.review-item .rv-head { display: flex; justify-content: space-between; font-size: 13px; }
.review-item .rv-author { font-weight: 700; }
.review-item .rv-comment { font-size: 14px; margin-top: 3px; color: #4a423a; }
.review-form { margin-top: 12px; background: var(--bg); padding: 12px; border-radius: 10px; }
.review-form input, .review-form textarea, .review-form select { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 9px; margin-top: 5px; font-size: 14px; }
.review-form textarea { min-height: 64px; resize: vertical; }

/* WhatsApp float */
.wa-float {
  position: fixed; bottom: 20px; right: 20px; z-index: 65;
  background: #25d366; color: #fff; padding: 12px 16px; border-radius: 999px;
  font-weight: 700; font-size: 14px; box-shadow: 0 6px 20px rgba(37,211,102,.4);
}
.wa-float:hover { transform: translateY(-2px); }
.fb-float {
  position: fixed; bottom: 76px; right: 20px; z-index: 65;
  background: #1877f2; color: #fff; padding: 12px 16px; border-radius: 999px;
  font-weight: 700; font-size: 14px; box-shadow: 0 6px 20px rgba(24,119,242,.4);
}
.fb-float:hover { transform: translateY(-2px); }

/* Footer */
.site-footer { background: #2b2622; color: #cfc3b6; padding: 26px 0; margin-top: 30px; font-size: 13px; text-align: center; }
.site-footer a { color: #e7d9c9; }

/* Toast */
.toast {
  position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 10px; font-size: 14px;
  opacity: 0; pointer-events: none; transition: all .25s; z-index: 90; max-width: 90vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.ok { background: var(--ok); }
.toast.err { background: var(--brand); }
