:root {
  --green: #1f7a4d;
  --green-dark: #155c39;
  --green-soft: #e8f4ec;
  --amber: #e8a317;
  --red: #c0392b;
  --ink: #1d2a22;
  --muted: #6b7a70;
  --line: #e2e8e4;
  --bg: #f6f8f6;
  --card: #fff;
  --radius: 12px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'Hind Siliguri', 'Noto Sans Bengali', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
}
a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
h1 { font-size: 1.6rem; margin: 1rem 0; line-height: 1.3; }
h2 { font-size: 1.2rem; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); font-size: .92rem; }
.unit { color: var(--muted); font-size: .88rem; }
.warn { color: var(--red); font-size: .88rem; }

/* বোতাম */
.btn {
  display: inline-block; border: 1px solid var(--line); background: #fff; color: var(--ink);
  padding: .55rem 1rem; border-radius: 8px; font: inherit; font-weight: 600; cursor: pointer;
}
.btn:hover { text-decoration: none; border-color: var(--green); }
.btn-primary { background: var(--green); color: #fff; border-color: var(--green); }
.btn-primary:hover { background: var(--green-dark); }
.btn-danger { color: var(--red); border-color: #f0c7c2; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.link-btn { background: none; border: 0; color: var(--muted); font: inherit; cursor: pointer; padding: .25rem .5rem; }
.link-btn:hover { color: var(--red); }

/* হেডার */
.site-header, .admin-header { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.header-row { display: flex; align-items: center; gap: 16px; padding-top: 10px; padding-bottom: 10px; }
.logo { display: flex; align-items: center; gap: 6px; font-size: 1.5rem; font-weight: 700; color: var(--green); white-space: nowrap; }
.logo:hover { text-decoration: none; }
.logo-mark { font-size: 1.6rem; }
.search { flex: 1; display: flex; }
.search input {
  flex: 1; min-width: 0; padding: .6rem .9rem; border: 2px solid var(--green); border-right: 0;
  border-radius: 8px 0 0 8px; font: inherit; outline: none;
}
.search button { border: 0; background: var(--green); color: #fff; padding: 0 1rem; border-radius: 0 8px 8px 0; cursor: pointer; font-size: 1.05rem; }
.cart-link { position: relative; font-weight: 600; white-space: nowrap; color: var(--ink); }
.badge { background: var(--amber); color: #fff; border-radius: 999px; padding: 0 .45rem; font-size: .8rem; margin-left: 4px; }
.cat-nav { border-top: 1px solid var(--line); background: #fff; }
.cat-nav-row { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding-top: 6px; padding-bottom: 6px; }
.cat-nav-row::-webkit-scrollbar { display: none; }
.cat-nav a { white-space: nowrap; padding: .3rem .7rem; border-radius: 999px; color: var(--ink); font-size: .95rem; }
.cat-nav a:hover, .cat-nav a.active { background: var(--green-soft); color: var(--green-dark); text-decoration: none; }
.flash { background: var(--green-soft); border: 1px solid #bfe0cb; padding: .6rem 1rem; border-radius: 8px; margin: 12px 0 0; }

/* হিরো */
.hero {
  margin-top: 16px; padding: 28px; border-radius: var(--radius);
  background: linear-gradient(120deg, var(--green) 0%, #2e9a63 100%); color: #fff;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.hero h1 { margin: 0 0 .4rem; font-size: 1.9rem; }
.hero p { margin: 0 0 1rem; max-width: 560px; opacity: .95; }
.hero-badges { display: flex; flex-wrap: wrap; gap: 8px; }
.hero-badges span { background: rgba(255,255,255,.18); padding: .25rem .7rem; border-radius: 999px; font-size: .92rem; }
.hero-art { font-size: 6rem; line-height: 1; }

.section-title { margin: 28px 0 12px; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.cat-tile {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 10px;
  text-align: center; color: var(--ink); font-weight: 600; font-size: .95rem;
}
.cat-tile span { display: block; font-size: 2rem; margin-bottom: 4px; }
.cat-tile:hover { border-color: var(--green); text-decoration: none; }

/* প্রোডাক্ট কার্ড */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.card-img { position: relative; aspect-ratio: 1; background: #f1f4f2; display: flex; align-items: center; justify-content: center; }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.ph { font-size: 3.5rem; }
.ph.big { font-size: 8rem; }
.off { position: absolute; top: 8px; left: 8px; background: var(--red); color: #fff; font-size: .8rem; padding: 0 .45rem; border-radius: 6px; font-weight: 600; }
.card-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.card-title { color: var(--ink); font-weight: 600; line-height: 1.35; }
.price-row { display: flex; align-items: baseline; gap: 8px; margin: 4px 0 8px; flex-wrap: wrap; }
.price { color: var(--green-dark); font-weight: 700; font-size: 1.1rem; }
.old { color: var(--muted); font-size: .9rem; }
.card form { margin-top: auto; }
.btn-add { width: 100%; background: var(--green-soft); border-color: #cfe6d7; color: var(--green-dark); }
.btn-add:hover { background: var(--green); color: #fff; }

.listing-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.sort-form select { font: inherit; padding: .35rem; border-radius: 6px; border: 1px solid var(--line); }
.pager { display: flex; gap: 6px; justify-content: center; margin: 24px 0; }
.pager a { padding: .3rem .8rem; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.pager a.active { background: var(--green); color: #fff; border-color: var(--green); }
.empty { text-align: center; padding: 48px 16px; background: #fff; border: 1px dashed var(--line); border-radius: var(--radius); margin: 16px 0; }

/* প্রোডাক্ট পাতা */
.crumbs { margin: 16px 0 0; font-size: .92rem; color: var(--muted); }
.product { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-top: 12px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.product-img { aspect-ratio: 1; background: #f1f4f2; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.product-img img { width: 100%; height: 100%; object-fit: cover; }
.product-info h1 { margin-top: 0; }
.price-row.big .price { font-size: 1.7rem; }
.save { background: #fdecea; color: var(--red); padding: 0 .5rem; border-radius: 6px; font-size: .9rem; }
.stock.in { color: var(--green); font-weight: 600; }
.stock.out { color: var(--red); font-weight: 600; }
.add-form { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; margin: 12px 0; }
.add-form input { width: 80px; padding: .5rem; font: inherit; border: 1px solid var(--line); border-radius: 8px; display: block; }
.desc { white-space: pre-line; margin: 16px 0; }
.perks { list-style: none; padding: 12px 14px; background: var(--green-soft); border-radius: 8px; margin: 0; }

/* কার্ট */
.cart { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 16px 16px; }
.cart-row { display: grid; grid-template-columns: 64px 1fr 80px 100px 32px; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.cart-thumb { width: 64px; height: 64px; background: #f1f4f2; border-radius: 8px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.cart-thumb .ph { font-size: 1.8rem; }
.cart-name { display: flex; flex-direction: column; }
.cart-name a { color: var(--ink); font-weight: 600; }
.qty { width: 80px; padding: .4rem; font: inherit; border: 1px solid var(--line); border-radius: 8px; }
.line-total { font-weight: 700; text-align: right; }
.cart-foot { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; padding-top: 16px; }
.cart-sum { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }

/* ফর্ম */
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.form label { display: block; margin-bottom: 12px; font-weight: 500; }
.form input:not([type=radio]):not([type=checkbox]):not([type=file]), .form textarea, .form select {
  display: block; width: 100%; margin-top: 4px; padding: .55rem .7rem; font: inherit;
  border: 1px solid #cfd8d2; border-radius: 8px; background: #fff;
}
.form input:focus, .form textarea:focus, .form select:focus { outline: 2px solid var(--green-soft); border-color: var(--green); }
.form .radio, .form .check { display: flex; gap: 8px; align-items: center; font-weight: 400; margin-bottom: 6px; }
.form fieldset { border: 1px solid var(--line); border-radius: 8px; margin: 0 0 12px; padding: 8px 12px; }
.form legend { font-weight: 500; padding: 0 4px; }
.narrow { max-width: 420px; margin: 24px auto; }
.errors { background: #fdecea; border: 1px solid #f5c6c0; color: var(--red); border-radius: 8px; padding: 4px 12px; margin-bottom: 12px; }
.errors p { margin: 6px 0; }
.pay { background: var(--bg); border-radius: 8px; padding: 10px 12px; margin-bottom: 14px; }
.pay p { margin: 4px 0 0; }
.checkout { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; align-items: start; }
.summary h2 { margin-top: 0; }
.sum-row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.sum-row.total { font-weight: 700; font-size: 1.15rem; border-bottom: 0; color: var(--green-dark); }
.success { background: var(--green-soft); border: 1px solid #bfe0cb; border-radius: var(--radius); padding: 8px 20px; margin: 16px 0; }

/* টেবিল */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; background: #fff; }
.table th, .table td { text-align: left; padding: .55rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-size: .88rem; color: var(--muted); font-weight: 600; }
.table tfoot td { border-bottom: 0; }
.table .total td { font-weight: 700; color: var(--green-dark); }
.table tr.dim td { opacity: .55; }
.status { display: inline-block; padding: 0 .55rem; border-radius: 999px; font-size: .85rem; font-weight: 600; background: #eee; }
.status-pending { background: #fff4d6; color: #8a5a00; }
.status-confirmed { background: #e1efff; color: #1d4f91; }
.status-shipped { background: #efe4ff; color: #5b2a9a; }
.status-delivered { background: var(--green-soft); color: var(--green-dark); }
.status-cancelled { background: #fdecea; color: var(--red); }

/* ফুটার */
.site-footer { margin-top: 48px; background: #fff; border-top: 1px solid var(--line); padding-top: 20px; }
.footer-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.footer-row p { margin: 4px 0; color: var(--muted); }
.copy { color: var(--muted); font-size: .85rem; padding-bottom: 20px; }

/* অ্যাডমিন */
.admin-nav { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-left: auto; }
.admin-nav a { color: var(--ink); font-weight: 500; }
.admin-nav form { margin: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; color: var(--ink); }
.stat span { display: block; color: var(--muted); font-size: .9rem; }
.stat b { font-size: 1.6rem; color: var(--green-dark); }
.stat:hover { text-decoration: none; border-color: var(--green); }
.two-col { display: grid; grid-template-columns: 1.5fr 1fr; gap: 16px; align-items: start; }
.two-col h2 { margin-top: 0; }
.plain { padding-left: 18px; margin: 0; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.tabs a { padding: .3rem .8rem; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--ink); }
.tabs a.active { background: var(--green); color: #fff; border-color: var(--green); }
.inline-search { display: flex; gap: 8px; margin-bottom: 12px; }
.inline-search input { flex: 1; max-width: 360px; padding: .5rem; font: inherit; border: 1px solid var(--line); border-radius: 8px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.image-field { display: grid; grid-template-columns: 140px 1fr; gap: 16px; align-items: start; margin-bottom: 12px; }
.image-preview { width: 140px; height: 140px; background: #f1f4f2; border-radius: 8px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.image-preview img { width: 100%; height: 100%; object-fit: cover; }
.form-actions { display: flex; gap: 10px; margin-top: 8px; }
.danger-zone { margin-top: 8px; }
.cat-edit { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--line); }
.cat-edit input { padding: .45rem .6rem; font: inherit; border: 1px solid var(--line); border-radius: 8px; }
.cat-edit .icon-in { width: 56px; text-align: center; }
.cat-edit .sort-in { width: 70px; }
.status-form { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; }
.status-form select { display: block; font: inherit; padding: .45rem; border-radius: 8px; border: 1px solid var(--line); margin-top: 4px; }

@media (max-width: 760px) {
  h1 { font-size: 1.35rem; }
  .header-row { flex-wrap: wrap; gap: 10px; }
  .search { order: 3; flex-basis: 100%; }
  .cart-link { margin-left: auto; }
  .hero { padding: 20px; }
  .hero h1 { font-size: 1.45rem; }
  .hero-art { display: none; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .product, .checkout, .two-col, .form-grid, .footer-row { grid-template-columns: 1fr; }
  .product { padding: 14px; gap: 16px; }
  .cart-row { grid-template-columns: 56px 1fr 64px; grid-template-areas: 'img name rm' 'img qty total'; }
  .cart-thumb { grid-area: img; width: 56px; height: 56px; }
  .cart-name { grid-area: name; }
  .qty { grid-area: qty; width: 72px; }
  .line-total { grid-area: total; }
  .cart-row .link-btn { grid-area: rm; justify-self: end; }
  .image-field { grid-template-columns: 1fr; }
  .admin-nav { margin-left: 0; gap: 10px; font-size: .95rem; }
}
