:root {
  --nav: #131a2a;
  --nav2: #232f3e;
  --bg: #eaeded;
  --card: #fff;
  --border: #d5d9d9;
  --text: #0f1111;
  --muted: #565959;
  --accent: #ff9900;
  --accent-dark: #e88b00;
  --good: #067d62;
  --bad: #b12704;
  --link: #007185;
  --price: #b12704;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}
a { cursor: pointer; color: var(--link); }

/* ── Header ───────────────────────────────────────────── */
.nav {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 10px 20px;
  background: var(--nav);
  color: #fff;
}
.nav-logo { font-size: 20px; font-weight: 800; cursor: pointer; white-space: nowrap; }
.nav-deliver { cursor: pointer; line-height: 1.15; }
.nav-deliver:hover { outline: 1px solid #fff; }
.nl-small { font-size: 11px; color: #ccc; display: block; }
.nl-big { font-size: 13px; font-weight: 700; display: block; }
.nav-search { flex: 1; max-width: 620px; }
.nav-search input {
  width: 100%;
  padding: 10px 14px;
  border-radius: 6px;
  border: none;
  font-size: 14px;
}
.nav-search input:focus { outline: 3px solid var(--accent); }
.nav-link { cursor: pointer; line-height: 1.15; white-space: nowrap; }
.nav-cart {
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.cart-count { color: var(--accent); font-weight: 800; }

/* ── Subnav (categories) ─────────────────────────────── */
.subnav {
  display: flex;
  gap: 4px;
  padding: 6px 16px;
  background: var(--nav2);
  overflow-x: auto;
}
.cat-chip {
  border: 1px solid transparent;
  background: transparent;
  color: #eee;
  border-radius: 4px;
  padding: 5px 10px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}
.cat-chip:hover { border-color: #fff; }
.cat-chip.active { border-color: #fff; font-weight: 700; color: #fff; }

/* ── Home ────────────────────────────────────────────── */
.hero {
  background: linear-gradient(120deg, #1b2a4a, #3a1b4a 60%, #4a2a1b);
  color: #fff;
  padding: 40px 32px;
}
.hero h1 { margin: 0 0 6px; font-size: 30px; }
.hero p { margin: 0 0 16px; opacity: .9; font-size: 15px; }
.hero .btn-buy { display: inline-block; }

.section { padding: 20px 24px; max-width: 1280px; margin: 0 auto; }
.section-title { font-size: 20px; font-weight: 800; margin: 0 0 14px; }

.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}
.cat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 10px;
  text-align: center;
  cursor: pointer;
  transition: box-shadow .15s;
}
.cat-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,.12); }
.cat-img {
  height: 88px;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 8px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f4f6f6;
}
.cat-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #fff; }
.cat-name { font-size: 14px; font-weight: 600; }

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}
.product-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: box-shadow .15s;
}
.product-card:hover { box-shadow: 0 6px 20px rgba(0,0,0,.14); }
.img-box {
  position: relative;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f7f7f7;
  overflow: hidden;
}
.img-box img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #fff; }
.ph-emoji { font-size: 54px; }
.pc-discount {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--bad);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  z-index: 2;
}
.pc-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.pc-name { font-size: 14px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 38px; }
.pc-rating { font-size: 12px; color: var(--good); }
.pc-rating .rc { color: var(--muted); font-weight: 400; }
.pc-price { font-size: 18px; font-weight: 700; }
.pc-price .cur { font-size: 12px; vertical-align: top; }
.pc-price .mrp { font-size: 12px; color: var(--muted); text-decoration: line-through; font-weight: 400; margin-left: 6px; }
.pc-cta {
  margin-top: auto;
  background: var(--accent);
  border: none;
  border-radius: 20px;
  padding: 8px 0;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.pc-cta:hover { background: var(--accent-dark); }

.empty { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 60px 0; }

/* ── Detail ──────────────────────────────────────────── */
.breadcrumb { padding: 12px 24px; font-size: 12px; color: var(--muted); }
.breadcrumb a { color: var(--muted); }

.detail-wrap {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 24px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px 24px;
}
.detail-left { background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 20px; }
.detail-img { position: relative; height: 380px; display: flex; align-items: center; justify-content: center; background: #fff; overflow: hidden; margin-bottom: 14px; }
.detail-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.detail-img .ph-emoji { font-size: 120px; }
.detail-name { font-size: 22px; font-weight: 700; margin: 0 0 8px; }
.detail-rating { font-size: 14px; color: var(--good); margin-bottom: 6px; }
.detail-rating .rc { color: var(--muted); }
.detail-brand { font-size: 13px; color: var(--link); margin-bottom: 16px; }

.detail-meta { font-size: 13px; color: var(--muted); line-height: 1.8; margin-bottom: 16px; border-top: 1px solid var(--border); padding-top: 14px; }

.specs-table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 12px 0; }
.specs-table tr:nth-child(odd) { background: #f7f7f7; }
.specs-table td { padding: 9px 12px; border: 1px solid var(--border); }
.specs-table td:first-child { width: 40%; font-weight: 700; color: var(--muted); }

.detail-right { display: flex; flex-direction: column; gap: 14px; }
.buybox { background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 18px; }
.bb-price { font-size: 26px; font-weight: 700; }
.bb-price .mrp { font-size: 13px; color: var(--muted); text-decoration: line-through; font-weight: 400; margin-left: 8px; }
.bb-discount { color: var(--good); font-size: 14px; font-weight: 700; margin: 4px 0 10px; }
.bb-tax { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.bb-emi { font-size: 13px; margin-bottom: 12px; }

.bb-deliver { font-size: 13px; line-height: 1.7; border-top: 1px solid var(--border); padding-top: 12px; margin-bottom: 12px; }
.bb-stock { color: var(--good); font-weight: 700; font-size: 15px; margin: 6px 0; }
.bb-qty { display: flex; align-items: center; gap: 10px; margin: 12px 0; font-size: 14px; }
.bb-qty select { padding: 6px 10px; border: 1px solid var(--border); border-radius: 6px; background: #f0f2f2; }
.bb-actions { display: flex; flex-direction: column; gap: 8px; }
.btn-buy {
  background: #ffd814;
  border: none;
  border-radius: 20px;
  padding: 11px 0;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
}
.btn-buy:hover { background: #f7ca00; }
.btn-cart { background: var(--accent); border: none; border-radius: 20px; padding: 11px 0; font-size: 14px; font-weight: 700; cursor: pointer; }
.btn-cart:hover { background: var(--accent-dark); }
.bb-secure { font-size: 12px; color: var(--muted); margin-top: 8px; text-align: center; }

.offerbox { background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 16px; }
.offerbox h4 { margin: 0 0 10px; font-size: 15px; }
.offerbox ul { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.9; }
.offerbox .offer { color: var(--text); }
.offerbox .offer a { color: var(--link); }

/* Reviews */
.reviews { margin-top: 20px; }
.reviews h3 { font-size: 16px; margin: 0 0 12px; }
.rev-summary { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.rev-big { font-size: 34px; font-weight: 700; }
.rev-stars { color: var(--accent); font-size: 16px; }
.rev-count { color: var(--muted); font-size: 13px; }
.review { border-bottom: 1px solid var(--border); padding: 14px 0; }
.review:last-child { border-bottom: none; }
.rev-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.rev-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: #c7c7c7; color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
}
.rev-name { font-size: 13px; font-weight: 700; }
.rev-stars-sm { color: var(--accent); font-size: 13px; }
.rev-verified { color: var(--bad); font-size: 11px; font-weight: 700; }
.rev-title { font-size: 14px; font-weight: 700; margin: 2px 0; }
.rev-body { font-size: 13px; color: var(--text); line-height: 1.6; }
.rev-date { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* ── Cart drawer ─────────────────────────────────────── */
.cart-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 60; }
.cart-panel {
  position: absolute; top: 0; right: 0; height: 100%; width: 400px; max-width: 94vw;
  background: #fff; padding: 22px; display: flex; flex-direction: column;
  box-shadow: -8px 0 30px rgba(0,0,0,.2);
}
.cart-panel h2 { margin: 0 0 16px; font-size: 18px; }
.cart-items { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.cart-item { display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--border); padding-bottom: 12px; }
.ci-img { width: 60px; height: 60px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: #f7f7f7; border-radius: 6px; position: relative; overflow: hidden; }
.ci-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.ci-img .ph-emoji { font-size: 26px; }
.ci-info { flex: 1; }
.ci-name { font-size: 13px; line-height: 1.3; }
.ci-price { font-size: 13px; font-weight: 700; color: var(--price); }
.ci-qty { display: flex; align-items: center; gap: 6px; }
.ci-qty button { border: 1px solid var(--border); background: #fff; width: 24px; height: 24px; border-radius: 6px; cursor: pointer; font-weight: 700; }
.ci-remove { border: none; background: none; color: var(--link); cursor: pointer; font-size: 12px; }
.cart-subtotal { margin: 14px 0 4px; font-size: 14px; color: var(--muted); text-align: right; }
.cart-total { margin: 0 0 14px; font-size: 17px; font-weight: 800; text-align: right; }
.checkout-form { display: flex; flex-direction: column; gap: 8px; margin: 0 0 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.checkout-form h3 { margin: 0; font-size: 14px; }
.checkout-form input { padding: 9px 12px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; }
.checkout-form input:focus { outline: 2px solid var(--accent); }
.checkout-form .btn-buy { padding: 11px 0; border-radius: 20px; }
.btn-ghost { border: none; background: none; color: var(--muted); padding: 10px; cursor: pointer; font-size: 14px; }
.btn-ghost:hover { color: var(--text); }

/* ── PIN modal ───────────────────────────────────────── */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; z-index: 70; padding: 20px; }
.pin-modal { background: #fff; border-radius: 10px; padding: 24px; width: 360px; max-width: 92vw; }
.pin-modal h3 { margin: 0 0 6px; }
.pin-hint { font-size: 12px; color: var(--muted); margin: 0 0 14px; }
.pin-modal input { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px; margin-bottom: 14px; }
.pin-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* ── Footer ──────────────────────────────────────────── */
.footer { margin-top: 10px; }
.foot-top { background: var(--nav2); color: #fff; text-align: center; padding: 14px; font-size: 13px; cursor: pointer; }
.foot-cols { display: flex; justify-content: space-around; background: var(--nav); color: #ddd; padding: 30px 24px; flex-wrap: wrap; gap: 20px; }
.fcol { display: flex; flex-direction: column; gap: 6px; }
.fcol h4 { color: #fff; margin: 0 0 8px; font-size: 15px; }
.fcol a { color: #ddd; font-size: 13px; }
.foot-fine { background: var(--nav); color: #999; text-align: center; padding: 16px; font-size: 12px; }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--nav); color: #fff; padding: 12px 20px; border-radius: 8px;
  font-size: 14px; opacity: 0; transition: all .3s; z-index: 100;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Support chat widget ─────────────────────────────── */
.chat-fab {
  position: fixed; bottom: 20px; right: 20px; width: 56px; height: 56px;
  border-radius: 50%; background: var(--accent); color: #fff; border: none;
  font-size: 24px; cursor: pointer; z-index: 55; box-shadow: 0 4px 16px rgba(0,0,0,.25);
}
.chat-fab:hover { background: var(--accent-dark); }
.chat-window {
  position: fixed; bottom: 84px; right: 20px; width: 360px; max-width: 92vw;
  height: 480px; max-height: 70vh; background: #fff; border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0,0,0,.28); display: flex; flex-direction: column;
  z-index: 56; overflow: hidden;
}
.chat-head {
  background: var(--nav); color: #fff; padding: 12px 16px;
  display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 14px;
}
.chat-x { background: none; border: none; color: #fff; font-size: 22px; cursor: pointer; line-height: 1; }
.chat-msgs { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: #f4f6f6; }
.cmsg { max-width: 84%; padding: 9px 13px; border-radius: 12px; font-size: 13px; line-height: 1.45; white-space: pre-wrap; }
.cmsg.assistant { align-self: flex-start; background: #fff; border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.cmsg.user { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.chat-input-row { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--border); background: #fff; }
.chat-input-row input { flex: 1; padding: 9px 13px; border: 1px solid var(--border); border-radius: 20px; font-size: 13px; }
.chat-input-row input:focus { outline: 2px solid var(--accent); }
.chat-input-row .btn-buy { padding: 9px 16px; border-radius: 20px; font-size: 13px; }

@media (max-width: 900px) {
  .detail-wrap { grid-template-columns: 1fr; }
  .nav { flex-wrap: wrap; }
}
