/*
 * NUR APTEK — brand styles. Green on white, mobile-first, no H-scroll.
 */
:root {
  --brand: #0b8a3d;
  --brand-dark: #076b2e;
  --brand-light: #e7f6ec;
  --brand-light-2: #f2faf4;
  --accent: #ffc107;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --danger: #dc2626;
  --radius: 14px;
  --shadow: 0 4px 18px rgba(11, 138, 61, .08);
  --shadow-lg: 0 12px 34px rgba(11, 138, 61, .14);
  --bottom-nav-h: 62px;
}

* { box-sizing: border-box; }
html, body { overflow-x: hidden; }
body {
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  background: #fff;
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1 0 auto; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }
img { max-width: 100%; }

.text-brand { color: var(--brand); }
.bg-brand { background-color: var(--brand); }
.btn-brand {
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: .65rem 1.25rem;
  font-weight: 600;
  transition: .18s;
}
.btn-brand:hover { background: var(--brand-dark); color: #fff; transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-brand:disabled { opacity: .6; }
.btn-outline-brand { border: 1.5px solid var(--brand); color: var(--brand); background: #fff; border-radius: 12px; padding: .6rem 1.1rem; font-weight: 600; }
.btn-outline-brand:hover { background: var(--brand-light); color: var(--brand-dark); }
.btn-soft { background: var(--brand-light); color: var(--brand-dark); border: none; border-radius: 12px; }
.btn-soft:hover { background: #d6ece0; }

.form-control, .form-select { border-radius: 11px; border-color: var(--border); }
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 .2rem rgba(11,138,61,.12); }
.form-label { font-weight: 600; font-size: .9rem; color: #374151; }

/* top header */
.site-header {
  position: sticky; top: 0; z-index: 1030;
  background: #fff;
  border-bottom: 1px solid var(--border);
}
.site-header .container-fluid { max-width: 1280px; }
.brand-logo { display: flex; align-items: center; gap: .6rem; font-weight: 800; font-size: 1.15rem; color: var(--brand-dark); }
.brand-logo img { height: 42px; width: auto; object-fit: contain; }
.brand-logo .tagline { display: block; font-size: .68rem; font-weight: 500; color: var(--muted); letter-spacing: .4px; }
.top-search { position: relative; max-width: 560px; width: 100%; }
.top-search .tt-dropdown {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 1050;
  background: #fff; border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow-lg); max-height: 420px; overflow: auto; display: none;
}
.tt-item { display: flex; gap: .7rem; align-items: center; padding: .55rem .8rem; cursor: pointer; border-bottom: 1px solid #f3f4f6; }
.tt-item:hover { background: var(--brand-light-2); }
.tt-item img { width: 40px; height: 40px; object-fit: cover; border-radius: 10px; }
.tt-item .tt-price { margin-left: auto; font-weight: 700; color: var(--brand); white-space: nowrap; font-size: .9rem; }
.icon-btn {
  position: relative; width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--border);
  display: inline-flex; align-items: center; justify-content: center; background: #fff; color: var(--text); font-size: 1.15rem;
}
.icon-btn .badge-num { position: absolute; top: -6px; right: -6px; background: var(--brand); color: #fff; font-size: .66rem; min-width: 18px; height: 18px; border-radius: 9px; display: flex; align-items: center; justify-content: center; padding: 0 4px; font-weight: 700; }
.icon-btn:hover { border-color: var(--brand); color: var(--brand); }

/* hero carousel */
.hero .carousel-item { border-radius: var(--radius); overflow: hidden; }
.hero .carousel-item img { height: 300px; object-fit: cover; width: 100%; }
.hero-caption { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; padding: 2rem 2.5rem; background: linear-gradient(90deg, rgba(0,0,0,.55) 0%, rgba(0,0,0,.05) 70%); color: #fff; }
@media (min-width: 992px) { .hero .carousel-item img { height: 400px; } }

/* category chips */
.cat-chip {
  flex: 0 0 auto; background: var(--brand-light-2); border: 1px solid var(--border);
  border-radius: 14px; padding: .55rem 1rem; font-weight: 600; font-size: .88rem; color: var(--text);
}
.cat-chip:hover { border-color: var(--brand); color: var(--brand); }

/* product card */
.product-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; transition: .2s; display: flex; flex-direction: column; height: 100%; position: relative;
}
.product-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); border-color: #cfe8d8; }
.product-card .img-wrap { position: relative; background: var(--brand-light-2); }
.product-card .img-wrap img { width: 100%; height: 190px; object-fit: contain; mix-blend-mode: multiply; }
.product-card .fav-btn { position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; border-radius: 50%; border: none; background: rgba(255,255,255,.9); box-shadow: var(--shadow); z-index: 3; }
.product-card .discount-badge { position: absolute; top: 10px; left: 10px; background: var(--brand); color: #fff; font-size: .72rem; font-weight: 700; padding: .2rem .5rem; border-radius: 999px; }
.product-card .rx-badge { position: absolute; bottom: 10px; left: 10px; background: rgba(220,38,38,.92); color: #fff; font-size: .66rem; font-weight: 600; padding: .18rem .45rem; border-radius: 999px; }
.product-card .body { padding: .85rem; display: flex; flex-direction: column; gap: .3rem; flex: 1; }
.product-card .p-cat { font-size: .72rem; color: var(--muted); }
.product-card .p-name { font-size: .92rem; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.4rem; }
.product-card .p-price { display: flex; align-items: baseline; gap: .5rem; }
.product-card .price-now { font-size: 1.05rem; font-weight: 800; color: var(--brand-dark); }
.product-card .price-old { font-size: .82rem; color: var(--muted); text-decoration: line-through; }
.product-card .add-cart { margin-top: auto; }

/* bottom mobile nav */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 1040;
  display: flex; background: #fff; border-top: 1px solid var(--border);
  padding: .35rem .25rem calc(.35rem + env(safe-area-inset-bottom));
}
.bottom-nav .bn-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .66rem; color: var(--muted); padding: .3rem 0; border-radius: 12px; }
.bottom-nav .bn-item i { font-size: 1.25rem; }
.bottom-nav .bn-item.active { color: var(--brand); font-weight: 700; background: var(--brand-light); }
.bottom-nav .bn-item .bubble { position: absolute; }
@media (min-width: 768px) { .bottom-nav { display: none; } }

/* site footer */
.site-footer { background: #0c1f13; color: #b7c9bd; margin-top: 3rem; padding: 3rem 0 1.5rem; }
.site-footer a { color: #b7c9bd; }
.site-footer a:hover { color: #fff; }
.site-footer h6 { color: #fff; font-weight: 700; margin-bottom: 1rem; }
.site-footer .social a { display: inline-flex; width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,.08); align-items: center; justify-content: center; margin-right: .5rem; font-size: 1.1rem; }

/* push bottom nav space on mobile */
body { padding-bottom: calc(var(--bottom-nav-h)); }
@media (min-width: 768px) { body { padding-bottom: 0; } }

/* page scaffolding */
.page-title { font-weight: 800; color: var(--brand-dark); }
.section-title { font-weight: 800; font-size: 1.25rem; color: var(--text); }
.section-title span { color: var(--brand); }
.page-hero { background: linear-gradient(120deg, var(--brand-light), #fff); border-radius: var(--radius); padding: 2.2rem 1.6rem; }

/* cart rows */
.cart-row { border: 1px solid var(--border); border-radius: var(--radius); padding: .9rem; background: #fff; }
.item-thumb { width: 64px; height: 64px; object-fit: contain; border-radius: 10px; background: var(--brand-light-2); }
.qty-control { display: inline-flex; align-items: center; gap: .25rem; border: 1px solid var(--border); border-radius: 12px; padding: .25rem; }
.qty-control button { width: 30px; height: 30px; border: none; background: var(--brand-light); border-radius: 9px; font-weight: 700; color: var(--brand-dark); }
.order-summary { position: sticky; top: 90px; }

/* checkout steps */
.step-badge { width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .9rem; background: var(--brand-light); color: var(--brand-dark); }
.choice-card { border: 1.5px solid var(--border); border-radius: 14px; padding: 1rem; cursor: pointer; background: #fff; }
.choice-card.selected { border-color: var(--brand); background: var(--brand-light-2); box-shadow: var(--shadow); }
.choice-card input { margin-right: .5rem; }

/* misc */
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.empty-state i { font-size: 3.2rem; color: #cfe8d8; display: block; margin-bottom: .8rem; }
.empty-state h5 { color: var(--text); font-weight: 700; }
.toast-wrap { position: fixed; top: 70px; right: 16px; z-index: 2000; display: flex; flex-direction: column; gap: .5rem; }
.toast-mini { background: var(--brand-dark); color: #fff; padding: .7rem 1.1rem; border-radius: 12px; box-shadow: var(--shadow-lg); font-size: .9rem; animation: slideIn .25s ease-out; }
.toast-mini.err { background: var(--danger); }
@keyframes slideIn { from { transform: translateX(30px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

.rx-note { background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; border-radius: 12px; padding: .8rem 1rem; font-size: .9rem; }

.skeleton { background: linear-gradient(90deg, #f1f5f2 25%, #e7eeea 37%, #f1f5f2 63%); background-size: 400% 100%; animation: sk 1.3s infinite; border-radius: 12px; }
@keyframes sk { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* admin */
.admin-body { background: #f2f4f3; }
.admin-side { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: #0c1f13; }
.admin-side .nav-link { color: #b7c9bd; border-radius: 10px; padding: .55rem .9rem; font-size: .9rem; }
.admin-side .nav-link i { width: 20px; display: inline-block; }
.admin-side .nav-link.active, .admin-side .nav-link:hover { background: var(--brand); color: #fff; }
.admin-side .side-head { color: #fff; font-weight: 800; padding: 1rem 1.2rem; }
.stat-card { background: #fff; border-radius: 14px; padding: 1rem 1.2rem; box-shadow: var(--shadow); }
.stat-card .stat-ico { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; background: var(--brand-light); color: var(--brand-dark); }
.stat-card .stat-num { font-size: 1.5rem; font-weight: 800; color: var(--text); }
.table thead th { font-size: .76rem; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); border-bottom-width: 1.5px; }

.status-pill { display: inline-block; padding: .22rem .6rem; border-radius: 999px; font-size: .72rem; font-weight: 700; }
.status-NEW { background: #eff6ff; color: #1d4ed8; }
.status-CONFIRMED { background: #fef3c7; color: #b45309; }
.status-PREPARING { background: #ffe4e6; color: #be123c; }
.status-READY { background: #ede9fe; color: #6d28d9; }
.status-OUT_FOR_DELIVERY { background: #cffafe; color: #0e7490; }
.status-DELIVERED, .status-APPROVED, .status-COMPLETED { background: #dcfce7; color: #15803d; }
.status-CANCELLED, .status-REJECTED { background: #fee2e2; color: #b91c1c; }
.status-PENDING { background: #f3f4f6; color: #374151; }
.status-REVIEWING { background: #fef3c7; color: #b45309; }

@media (max-width: 991px) {
  .admin-side { position: static; height: auto; }
  .admin-mobile-top { display: flex; }
}
.admin-table-img { width: 44px; height: 44px; object-fit: contain; border-radius: 10px; background: var(--brand-light-2); }

/* scanner & bonus */
.camera-box { position: relative; background: #0a0f0c; border-radius: 14px; overflow: hidden; min-height: 240px; display: flex; align-items: center; justify-content: center; }
.camera-box video { width: 100%; max-height: 380px; object-fit: cover; display: none; }
.camera-box::after { content: ""; position: absolute; inset: 18%; border: 2px solid #fff; border-radius: 18px; opacity: .6; pointer-events: none; }
.img-preview { margin-top: .75rem; width: 100%; max-width: 280px; border-radius: 12px; border: 1px solid var(--border); }
.bonus-card { display: flex; justify-content: space-between; align-items: center; background: linear-gradient(120deg, var(--brand), #0fc05a); color: #fff; border-radius: var(--radius); padding: 1.4rem 1.6rem; }
.rich-text { line-height: 1.75; }
.rich-text p { margin-bottom: .75rem; }