:root {
  --ivory: #FBF3E6;
  --ivory-deep: #F5E9D6;
  --ink: #2B211B;
  --ink-soft: #5A4C40;
  --maroon: #6E1E39;
  --maroon-deep: #521329;
  --gold: #C9A227;
  --gold-soft: #E4C868;
  --blush: #F3DFCB;
  --emerald: #1F4D3D;
  --radius: 14px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family: 'Inter', -apple-system, sans-serif;
  direction: ltr;
  -webkit-tap-highlight-color: transparent;
  padding-bottom: env(safe-area-inset-bottom);
}

body.urdu {
  direction: rtl;
}
body.urdu .brand-en,
body.urdu [data-en-only] {
  display: none;
}
body.urdu [data-i18n] {
  font-family: 'Noto Nastaliq Urdu', serif;
  line-height: 2;
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}

.hidden { display: none !important; }
.muted { color: var(--ink-soft); }
.small { font-size: 0.8rem; }

/* ---------- Buttons ---------- */
.btn {
  border: none;
  border-radius: 999px;
  padding: 12px 26px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-maroon { background: var(--maroon); color: var(--ivory); }
.btn-maroon:hover { background: var(--maroon-deep); }
.btn-gold { background: linear-gradient(135deg, var(--gold-soft), var(--gold)); color: var(--maroon-deep); }
.btn-outline { background: transparent; border: 2px solid var(--maroon); color: var(--maroon); }
.btn-sm { padding: 8px 16px; font-size: 0.85rem; }
.full-width { width: 100%; }
.icon-btn {
  background: var(--ivory-deep);
  border: none;
  border-radius: 999px;
  min-width: 42px; height: 42px;
  padding: 0 12px;              /* lets text buttons (اردو / account) grow instead of overlapping */
  display: inline-flex; align-items: center; justify-content: center;
  gap: 4px;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  font-size: 1.1rem;
  position: relative;
}
.icon-btn:hover { background: var(--blush); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(251,243,230,0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--blush);
}
.header-row {
  display: flex; align-items: center; justify-content: space-between;
  height: 76px;
}
.brand { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.brand-mark {
  width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--maroon));
  color: var(--ivory);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Playfair Display', serif; font-weight: 700;
  flex-shrink: 0;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-en { font-family: 'Playfair Display', serif; font-weight: 700; font-size: 1.15rem; color: var(--maroon-deep); }
.brand-ur { font-size: 0.75rem; color: var(--ink-soft); }
.header-actions { display: flex; align-items: center; gap: 10px; }
.region-select {
  border: 1px solid var(--blush);
  background: var(--ivory-deep);
  border-radius: 999px;
  padding: 8px 14px;
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--ink);
  cursor: pointer;
}
.region-display {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--blush);
  background: var(--ivory-deep);
  border-radius: 999px;
  padding: 8px 14px;
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--ink);
  white-space: nowrap;
}
.cart-btn { position: relative; }
.cart-badge {
  position: absolute; top: -4px; right: -4px;
  background: var(--maroon); color: var(--ivory);
  font-size: 0.65rem; font-weight: 700;
  border-radius: 999px; min-width: 18px; height: 18px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
}

/* ---------- Header accent strip (fills the visual space the removed
   hero banner used to occupy, keeps the top of the page from feeling
   abrupt) ---------- */
.header-accent {
  height: 4px;
  background: linear-gradient(90deg, var(--gold) 0%, var(--maroon) 50%, var(--gold) 100%);
}

/* ---------- Categories ---------- */
.categories-row { padding-top: 22px; padding-bottom: 10px; }
.categories-row { position: relative; }
.chips {
  display: flex; flex-wrap: nowrap; gap: 10px;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none; -ms-overflow-style: none;
  padding-bottom: 2px;
  mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent 100%);
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent 100%);
}
.chips::-webkit-scrollbar { display: none; }
body.urdu .chips {
  mask-image: linear-gradient(to left, #000 calc(100% - 28px), transparent 100%);
  -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 28px), transparent 100%);
}
.chip {
  border: 1px solid var(--blush);
  background: #fff;
  border-radius: 999px;
  padding: 9px 18px;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  color: var(--ink-soft);
  transition: all .15s ease;
  white-space: nowrap;
  flex: 0 0 auto;
}
.chip:hover { border-color: var(--gold); }
.chip.active {
  background: var(--maroon);
  border-color: var(--maroon);
  color: var(--ivory);
}

/* ---------- Product grid ---------- */
.loading-banner, .offline-banner, .empty-state {
  text-align: center;
  padding: 18px;
  border-radius: var(--radius);
  margin: 20px 0;
  font-size: 0.9rem;
}
.loading-banner { background: var(--ivory-deep); color: var(--ink-soft); }
.offline-banner { background: #FCEFD8; color: #7A5A12; border: 1px solid var(--gold-soft); }
.empty-state { background: var(--ivory-deep); color: var(--ink-soft); }

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 22px;
  padding: 24px 0 64px;
}
.product-card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(43,33,27,0.06);
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease;
  display: flex; flex-direction: column;
}
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(43,33,27,0.12);
}
.product-media {
  height: 200px;
  position: relative;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.85);
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
}
.product-media img { width: 100%; height: 100%; object-fit: cover; }
.product-tag {
  position: absolute; top: 10px; left: 10px;
  background: rgba(255,255,255,0.9);
  color: var(--maroon-deep);
  font-size: 0.68rem; font-weight: 700;
  padding: 4px 10px; border-radius: 999px;
  text-transform: uppercase; letter-spacing: 0.03em;
}
.product-tag.discount { background: var(--maroon); color: var(--ivory); }
.product-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.product-name { font-weight: 600; font-size: 0.98rem; color: var(--ink); }
.product-cat { font-size: 0.78rem; color: var(--ink-soft); }
.product-body .product-code { font-size: 0.78rem; font-weight: 600; color: var(--ink-soft); margin: 0; }
.product-price-row {
  margin-top: auto;
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 8px;
}
.product-price { font-weight: 700; color: var(--maroon-deep); }
.add-btn {
  background: var(--ivory-deep);
  border: none; border-radius: 999px;
  width: 34px; height: 34px;
  font-size: 1.1rem; cursor: pointer;
  color: var(--maroon);
}
.add-btn:hover { background: var(--gold-soft); }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--maroon-deep);
  color: var(--ivory);
  padding: 34px 0;
  margin-top: 20px;
}
.footer-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.footer-brand { display: flex; align-items: center; gap: 12px; }
.site-footer .muted { color: rgba(251,243,230,0.7); }
.admin-link {
  background: transparent;
  border: 1px solid rgba(251,243,230,0.4);
  color: var(--ivory);
  border-radius: 999px;
  padding: 8px 20px;
  font-size: 0.85rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
.admin-link:hover { background: rgba(251,243,230,0.1); }

/* ---------- Install popup ---------- */
.install-popup {
  position: fixed; bottom: 20px; right: 20px; z-index: 50;
  background: #fff; border-radius: var(--radius);
  box-shadow: 0 8px 30px rgba(0,0,0,0.18);
  padding: 18px 20px; max-width: 260px;
}
body.urdu .install-popup { right: auto; left: 20px; }
.install-close {
  position: absolute; top: 6px; right: 10px;
  background: none; border: none; font-size: 1.1rem; cursor: pointer; color: var(--ink-soft);
}
.install-popup p { margin: 6px 0 12px; font-size: 0.85rem; }

/* ---------- Modal / overlay ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(43,33,27,0.5);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-card {
  background: #fff;
  border-radius: 18px;
  padding: 32px;
  max-width: 420px; width: 100%;
  max-height: 88vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}
.lang-card { text-align: center; }
.lang-buttons { display: flex; gap: 12px; justify-content: center; margin-top: 22px; }

/* Product editor (Add/Edit Product) opens on top of the admin dashboard modal.
   Both share .modal-overlay (z-index:100), and since #adminOverlay comes after
   #quickViewOverlay in the DOM, it was painting over the product form and
   hiding it. Force the quick-view/product-editor overlay above any admin modal. */
#quickViewOverlay { z-index: 110; }

.quick-view-card { max-width: 520px; }
.qv-media {
  height: 240px; border-radius: 12px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.9); font-family: 'Playfair Display', serif; font-size: 1.6rem;
  margin-bottom: 18px;
}
.qv-media { position: relative; }
.qv-media img { width: 100%; height: 100%; object-fit: cover; }
.qv-media video { width: 100%; height: 100%; object-fit: cover; background: #000; }
.qv-price { font-size: 1.3rem; font-weight: 700; color: var(--maroon-deep); margin: 10px 0 18px; }

.media-count-badge {
  position: absolute; bottom: 10px; right: 10px;
  background: rgba(0,0,0,0.55); color: #fff;
  font-size: 0.7rem; padding: 3px 9px; border-radius: 999px;
}
body.urdu .media-count-badge { right: auto; left: 10px; }

.qv-thumbs {
  display: flex; gap: 8px; margin: 10px 0 16px;
}
.qv-thumb {
  width: 54px; height: 54px; border-radius: 8px; overflow: hidden;
  border: 2px solid var(--blush); background: var(--ivory-deep);
  cursor: pointer; padding: 0;
  display: flex; align-items: center; justify-content: center;
}
.qv-thumb:hover { border-color: var(--gold); }
.qv-thumb img { width: 100%; height: 100%; object-fit: cover; }
.qv-thumb-video { color: var(--maroon); font-size: 1.1rem; }

.qv-size-field { margin: 4px 0 16px; }
.qv-size-options {
  display: flex; flex-wrap: nowrap; gap: 8px; margin-top: 8px;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  padding-bottom: 6px; scrollbar-width: thin;
  mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent 100%);
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent 100%);
}
.qv-size-options::-webkit-scrollbar { height: 4px; }
.qv-size-options::-webkit-scrollbar-thumb { background: var(--blush); border-radius: 999px; }
body.urdu .qv-size-options {
  mask-image: linear-gradient(to left, #000 calc(100% - 24px), transparent 100%);
  -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 24px), transparent 100%);
}
.size-chip {
  flex: 0 0 auto; white-space: nowrap;
  padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--blush);
  background: #fff; cursor: pointer; font-size: 0.85rem; font-weight: 600;
  color: var(--ink); transition: border-color .15s, background .15s, color .15s;
}
.size-chip:hover { border-color: var(--gold); }
.size-chip.active { border-color: var(--emerald); background: var(--emerald); color: #fff; box-shadow: 0 2px 8px rgba(31,77,61,0.35); }

.qv-qty-control { justify-content: flex-start; margin-bottom: 16px; }
.qv-qty-control button {
  width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--blush);
  background: #fff; cursor: pointer; font-size: 1rem;
}
.qv-qty-control span { min-width: 28px; text-align: center; font-weight: 600; }

.qv-actions { display: flex; flex-direction: column; gap: 12px; margin-top: 10px; }
.qv-actions .btn,
.qv-actions .whatsapp-btn {
  display: flex; align-items: center; justify-content: center;
  width: 100%; box-sizing: border-box; margin: 0; flex: 0 0 auto;
  position: relative; /* never absolute — guarantees normal document flow, no overlap */
}
.whatsapp-btn {
  text-decoration: none; border-color: #25D366; color: #128C4A;
}
.whatsapp-btn:hover { background: #25D36618; }

.free-delivery-tag {
  font-size: 0.7rem; font-weight: 500; color: var(--ink-soft);
  line-height: 1.35; margin-top: 2px;
}
.qv-price + .free-delivery-tag { margin-top: -12px; margin-bottom: 14px; }

/* ---------- Cart drawer ---------- */
.drawer {
  position: fixed; top: 0; bottom: 0; right: 0; z-index: 101;
  width: min(400px, 100%);
  background: var(--ivory);
  display: flex; flex-direction: column;
  box-shadow: -6px 0 24px rgba(0,0,0,0.15);
}
body.urdu .drawer { right: auto; left: 0; box-shadow: 6px 0 24px rgba(0,0,0,0.15); }
.drawer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 22px; border-bottom: 1px solid var(--blush);
}
.cart-lines { flex: 1; overflow-y: auto; padding: 12px 22px; }
.cart-line { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--blush); align-items: center; }
.cart-line-media {
  width: 56px; height: 56px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; color: #fff; font-size: 0.7rem;
}
.cart-line-media img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; }
.cart-line-body { flex: 1; }
.cart-line-name { font-weight: 600; font-size: 0.9rem; }
.cart-line-price { font-size: 0.82rem; color: var(--ink-soft); }
.qty-control { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.qty-control button {
  width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--blush);
  background: #fff; cursor: pointer; font-size: 0.9rem;
}
.cart-empty { text-align: center; padding: 40px 0; color: var(--ink-soft); }
.drawer-footer { padding: 18px 22px 24px; border-top: 1px solid var(--blush); }
.cart-total-row { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 0.85rem; }
.cart-grand-total { font-size: 1.05rem; font-weight: 700; margin: 10px 0 14px; padding-top: 10px; border-top: 1px dashed var(--blush); }

/* ---------- Payment method (frontend only, UI for now) ---------- */
.payment-options { display: flex; flex-direction: column; gap: 8px; }
.payment-option {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--blush); border-radius: 10px;
  padding: 10px 12px; font-size: 0.88rem; cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.payment-option:has(input:checked) { border-color: var(--gold); background: var(--ivory-deep); }
.payment-option input { accent-color: var(--maroon); }

/* ---------- Admin ---------- */
.admin-card h3 { font-family: 'Playfair Display', serif; color: var(--maroon-deep); margin-top: 0; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 0.82rem; font-weight: 600; margin-bottom: 6px; color: var(--ink-soft); }
.field input, .field select, .field textarea {
  width: 100%; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--blush); font-family: inherit; font-size: 16px;
}
.field textarea { resize: vertical; min-height: 70px; }
.error-text { color: var(--maroon); font-size: 0.85rem; margin: 8px 0; }
.role-tabs { display: flex; gap: 8px; margin-bottom: 18px; }
.role-tab {
  flex: 1; padding: 9px; border-radius: 10px; border: 1px solid var(--blush);
  background: #fff; cursor: pointer; font-size: 0.82rem; font-weight: 600; color: var(--ink-soft);
}
.role-tab.active { background: var(--maroon); border-color: var(--maroon); color: var(--ivory); }

/* ---- Production / Inventory pipeline tables ---- */
.pill-nav { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 16px; }
.pill-nav button {
  border: 1px solid var(--maroon); background: transparent; color: var(--maroon);
  border-radius: 999px; padding: 6px 12px; font-size: 0.78rem; cursor: pointer;
}
.pill-nav button.active { background: var(--maroon); color: var(--ivory); }
.table-wrap { overflow-x: auto; margin: 10px 0 20px; }
table.data-table { border-collapse: collapse; width: 100%; font-size: 0.82rem; }
table.data-table th, table.data-table td {
  border: 1px solid var(--blush); padding: 6px 8px; text-align: left; white-space: nowrap;
}
table.data-table th { background: var(--ivory-deep); font-weight: 600; }
table.data-table input, table.data-table select { width: 100%; min-width: 90px; font-size: 0.8rem; padding: 3px 4px; }
table.data-table td.actions-cell { white-space: nowrap; }
/* Assign-orders grid: every input/select fills its own cell and sits on its own line
   (cells are nowrap, so inline inputs used to land side by side and overlap the next column). */
table.grid-assign { width: max-content; min-width: 100%; }
table.grid-assign td { vertical-align: top; min-width: 110px; }
table.grid-assign td:first-child { min-width: 36px; }
table.grid-assign input, table.grid-assign select { display: block; width: 100%; min-width: 100px; margin: 0 0 4px; }
table.grid-assign input:last-child, table.grid-assign select:last-child { margin-bottom: 0; }
table.grid-assign input[type="file"] { min-width: 170px; }
table.grid-assign td.actions-cell { min-width: 120px; }
.add-row-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin: 10px 0 6px; }
.add-row-form .field { min-width: 130px; margin: 0; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 0.72rem; font-weight: 600; }
.badge-ok { background: #dff3e3; color: #1f7a37; }
.badge-wait { background: #fbe7cf; color: #a15a00; }
.badge-cancelled { background: #f3d9d9; color: var(--maroon-deep); }
.admin-list-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--blush);
}
.admin-list-item .meta { font-size: 0.8rem; color: var(--ink-soft); }
.link-btn { background: none; border: none; color: var(--maroon); cursor: pointer; font-size: 0.85rem; font-weight: 600; }
.danger-link { color: #a23; }
.spinner {
  display: inline-block; width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.4); border-top-color: #fff;
  border-radius: 50%; animation: spin 0.7s linear infinite; vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

.product-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--blush);
}
.product-row .thumb {
  width: 44px; height: 44px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; color: #fff; font-size: 0.65rem;
}
.product-row .grow { flex: 1; }
.product-row .name { font-weight: 600; font-size: 0.88rem; }
.product-row .sub { font-size: 0.75rem; color: var(--ink-soft); }

.add-btn:disabled { opacity: 0.4; cursor: not-allowed; }
#quickViewContent .btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- Super Admin: dashboard stats / order cards ---------- */
.stat-row {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 9px 0; border-bottom: 1px solid var(--blush);
  font-size: 0.85rem;
}
.order-card {
  border: 1px solid var(--blush); border-radius: 10px;
  padding: 10px 12px; margin-bottom: 10px; font-size: 0.85rem;
}
.order-card-head { display: flex; justify-content: space-between; font-weight: 600; margin-bottom: 4px; }
.order-card select {
  border-radius: 8px; border: 1px solid var(--blush); padding: 6px 8px; font-family: inherit;
}
.stat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px; margin-bottom: 6px;
}
.stat-card {
  border: 1px solid var(--blush); border-radius: 10px; padding: 12px;
  background: #fff;
}
.stat-card-label { font-size: 0.72rem; color: var(--ink-soft); margin-bottom: 4px; }
.stat-card-value { font-size: 1.05rem; font-weight: 700; color: var(--maroon); }

/* =================================================================
   MOBILE RESPONSIVENESS
   ================================================================= */
@media (max-width: 640px) {
  /* NOTE: only top/bottom padding here — `padding: 10px 0` used to wipe the
     container's left/right padding, pushing the logo to the screen edge. */
  .header-row { height: auto; min-height: 0; padding-top: 8px; padding-bottom: 8px; flex-wrap: wrap; gap: 8px; }
  .brand { gap: 10px; }
  .brand-mark { width: 38px; height: 38px; font-size: 0.9rem; }
  .brand-text { line-height: 1.1; }
  .brand-en { font-size: 1rem; }
  .brand-ur { font-size: 0.68rem; }
  /* Row 2: currency pill on one side, buttons on the other */
  .header-actions { width: 100%; gap: 6px; }
  .region-select { padding: 7px 10px; font-size: 0.78rem; max-width: 118px; }
  .region-display { margin-inline-end: auto; padding: 7px 10px; font-size: 0.78rem; max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
  .icon-btn { min-width: 38px; height: 38px; padding: 0 10px; font-size: 1rem; }
  .account-label { display: none; }   /* icon only on phones — "My Account" is in the sub-nav */
  .cart-badge { top: -3px; right: -3px; }
  body.urdu .cart-badge { right: auto; left: -3px; }

  .categories-row { padding-top: 18px; padding-bottom: 4px; }
  .chips { gap: 8px; }
  .chip { padding: 7px 14px; font-size: 0.8rem; }
  .size-chip { padding: 6px 11px; font-size: 0.78rem; }

  .product-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; padding: 16px 0 44px; }
  .product-media { height: 150px; font-size: 1.05rem; }
  .product-body { padding: 10px 12px 12px; gap: 4px; }
  .product-name { font-size: 0.85rem; }
  .product-cat { font-size: 0.7rem; }
  .product-body .product-code { font-size: 0.7rem; }
  .product-price { font-size: 0.9rem; }
  .free-delivery-tag { font-size: 0.66rem; }
  .add-btn { width: 32px; height: 32px; flex-shrink: 0; }
  .product-name { overflow-wrap: anywhere; }

  .modal-card { padding: 18px; border-radius: 14px; max-height: 92vh; }
  .modal-overlay { padding: 10px; }
  .quick-view-card { max-width: 100%; }
  .qv-media { height: 180px; }

  .drawer { width: 100%; }

  .footer-inner { flex-direction: column; align-items: flex-start; }

  .install-popup { left: 12px; right: 12px; max-width: none; bottom: 12px; }
  body.urdu .install-popup { left: 12px; right: 12px; }
}

@media (max-width: 380px) {
  .container { padding: 0 14px; }
  .brand-en { font-size: 0.86rem; }
  .brand-ur { display: none; }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(135px, 1fr)); gap: 10px; }
  .region-select { max-width: 100px; padding: 6px 8px; font-size: 0.72rem; }
  .region-display { max-width: 120px; padding: 6px 8px; font-size: 0.72rem; overflow: hidden; text-overflow: ellipsis; }
  .icon-btn { min-width: 34px; height: 34px; padding: 0 8px; font-size: 0.92rem; }
  .header-actions { gap: 4px; }
}

/* ---------- Tablets / small laptops ---------- */
@media (min-width: 641px) and (max-width: 1024px) {
  .container { padding: 0 24px; }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 18px; }
}

/* Prevent any accidental horizontal scroll on small screens */
html, body { max-width: 100%; overflow-x: hidden; }
img { max-width: 100%; }

/* ---------- Standalone product detail page (product.html) ---------- */
.product-page-breadcrumb { padding-top: 18px; }
.back-link {
  display: inline-block; text-decoration: none; color: var(--maroon-deep, #6E1E39);
  font-weight: 600; font-size: 0.9rem;
}
.back-link:hover { text-decoration: underline; }

.product-page-grid {
  display: grid; grid-template-columns: minmax(0, 480px) minmax(280px, 420px);
  gap: 40px; align-items: start;
  padding: 24px 0 60px;
}
.product-page-gallery .product-page-media {
  aspect-ratio: 1 / 1; height: auto; margin-bottom: 0;
  border-radius: 16px; box-shadow: 0 6px 22px rgba(43,33,27,0.12);
}
.product-page-info h1 {
  font-family: 'Playfair Display', serif; font-size: 1.6rem; margin: 0 0 6px;
  color: var(--ink, #2b211b);
}
.product-page-info .product-cat { margin-bottom: 4px; }
.product-page-info .qv-actions { max-width: 420px; }

@media (max-width: 700px) {
  .product-page-grid { grid-template-columns: 1fr; gap: 20px; padding: 16px 0 40px; }
  .product-page-gallery .product-page-media { aspect-ratio: 4 / 3; }
}

/* ---------- Image zoom overlay (product.html) ---------- */
.image-zoom-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(10, 8, 6, 0.94);
  display: flex; align-items: center; justify-content: center;
  touch-action: none;
}
.image-zoom-close {
  position: absolute; top: 16px; right: 16px; z-index: 210;
  background: rgba(255,255,255,0.15); color: #fff; border: none;
  width: 40px; height: 40px; border-radius: 50%;
  font-size: 1.4rem; line-height: 1; cursor: pointer;
}
.image-zoom-close:hover { background: rgba(255,255,255,0.28); }
body.urdu .image-zoom-close { right: auto; left: 16px; }
.image-zoom-stage {
  width: 100%; height: 100%; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  touch-action: none;
}
.image-zoom-stage img {
  max-width: 92%; max-height: 88%;
  user-select: none; -webkit-user-drag: none;
  transform-origin: center center;
  will-change: transform;
  cursor: zoom-in;
  touch-action: none;
}
/* Product-page gallery main image: signal it's zoomable */
.product-page-media img { cursor: zoom-in; }

/* ---------- Standalone Admin page (admin.html) ---------- */
body.admin-page { min-height: 100vh; }
.admin-page-main { padding-top: 40px; padding-bottom: 60px; }

.admin-login-wrap {
  min-height: calc(100vh - 180px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px 0;
}
.admin-login-card {
  width: 100%; max-width: 380px;
  background: #fff; border-radius: 16px;
  box-shadow: 0 12px 36px rgba(43,33,27,0.10);
  padding: 34px 30px;
}
.admin-login-card h1 {
  font-family: 'Playfair Display', serif; font-size: 1.5rem; margin: 0 0 24px;
  text-align: center; color: var(--maroon-deep);
}

.admin-dashboard-shell {
  max-width: 920px; margin: 0 auto;
  background: #fff; border-radius: 16px;
  box-shadow: 0 12px 36px rgba(43,33,27,0.08);
  padding: 28px 30px 34px;
}
.admin-dashboard-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 20px; flex-wrap: wrap; gap: 10px;
  padding-bottom: 16px; border-bottom: 1px solid var(--blush);
}
.admin-dashboard-head h2 {
  font-family: 'Playfair Display', serif; font-size: 1.35rem; margin: 0;
  color: var(--ink);
}

@media (max-width: 640px) {
  .admin-login-card { padding: 26px 20px; border-radius: 14px; }
  .admin-dashboard-shell { padding: 20px 16px 26px; border-radius: 14px; }
}

/* =================================================================
   SITE SUB-NAVIGATION (Home / About / Contact / Privacy)
   Used on index.html, product.html, about.html, contact.html, privacy.html
   ================================================================= */
.site-subnav {
  background: var(--ivory);
  border-bottom: 1px solid var(--blush);
}
.site-subnav-inner {
  display: flex;
  gap: 26px;
  justify-content: center;
  padding: 10px 20px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; -ms-overflow-style: none;
}
.site-subnav-inner::-webkit-scrollbar { display: none; }
.site-subnav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 600;
  white-space: nowrap;
  padding: 4px 2px;
  border-bottom: 2px solid transparent;
  transition: color .15s ease, border-color .15s ease;
}
.site-subnav a:hover,
.site-subnav a.active {
  color: var(--maroon-deep);
  border-bottom-color: var(--gold);
}

/* ---------- Footer quick links (About / Contact / Privacy) ---------- */
.footer-inner.footer-inner-expanded {
  align-items: flex-start;
}
.footer-col-title {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--gold-soft);
  margin: 0 0 14px;
  position: relative;
  padding-bottom: 10px;
}
.footer-col-title::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 34px; height: 2px;
  background: linear-gradient(90deg, var(--gold), var(--gold-soft));
  border-radius: 999px;
}
.footer-links {
  list-style: none;
  margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 10px;
}
.footer-links a {
  color: rgba(251,243,230,0.82);
  text-decoration: none;
  font-size: 0.88rem;
  transition: color .15s ease, padding-left .15s ease;
  position: relative;
}
.footer-links a:hover { color: var(--gold-soft); padding-left: 4px; }
.footer-contact-line {
  color: rgba(251,243,230,0.82);
  font-size: 0.88rem;
  margin: 0 0 10px;
  text-decoration: none;
  display: inline-block;
  transition: color .15s ease, padding-left .15s ease;
}
.footer-contact-line:hover { color: var(--gold-soft); padding-left: 4px; }
.footer-bottom-row {
  border-top: 1px solid rgba(251,243,230,0.15);
  margin-top: 22px;
  padding-top: 16px;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px;
}

/* =================================================================
   STATIC CONTENT PAGES (about.html, contact.html, privacy.html)
   ================================================================= */
.page-hero { padding-top: 30px; padding-bottom: 8px; }
.page-hero .back-link { margin-bottom: 6px; display: inline-block; }
.page-eyebrow {
  text-transform: uppercase; letter-spacing: 0.08em;
  font-size: 0.75rem; font-weight: 700; color: var(--gold);
  margin: 6px 0 6px;
}
.page-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  color: var(--maroon-deep);
  margin: 0 0 12px;
  line-height: 1.2;
}
.page-subtitle {
  color: var(--ink-soft);
  font-size: 1.02rem;
  max-width: 680px;
  line-height: 1.7;
  margin: 0 0 6px;
}
.divider-gold {
  height: 3px; width: 64px;
  background: linear-gradient(90deg, var(--gold), var(--maroon));
  border-radius: 999px;
  margin: 4px 0 22px;
}

.page-section { padding: 18px 0; }
.page-section + .page-section { padding-top: 6px; }
.page-section h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  color: var(--maroon-deep);
  margin: 0 0 14px;
}
.page-section h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  color: var(--maroon-deep);
  margin: 0 0 8px;
}
.page-section p {
  line-height: 1.8;
  color: var(--ink);
  margin: 0 0 14px;
}
.page-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: 0 2px 10px rgba(43,33,27,0.06);
}

/* About page */
.about-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin: 4px 0 10px;
}
.about-feature {
  background: #fff;
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: 0 2px 10px rgba(43,33,27,0.06);
}
.about-feature .about-feature-icon {
  width: 42px; height: 42px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-soft), var(--gold));
  color: var(--maroon-deep);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; margin-bottom: 12px;
}
.about-feature h3 { margin: 0 0 8px; font-size: 1.02rem; }
.about-feature p { margin: 0; color: var(--ink-soft); font-size: 0.92rem; line-height: 1.65; }
.about-quote {
  border-left: 3px solid var(--gold);
  padding: 4px 0 4px 18px;
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  color: var(--maroon-deep);
  font-style: italic;
  margin: 26px 0;
}

/* Contact page */
.contact-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 26px;
  align-items: start;
}
.contact-row {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 14px 0;
  border-bottom: 1px solid var(--blush);
}
.contact-row:last-child { border-bottom: none; }
.contact-icon {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--ivory-deep);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.05rem; flex-shrink: 0;
}
.contact-label {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--ink-soft); margin: 0 0 3px;
}
.contact-value { font-weight: 600; color: var(--ink); word-break: break-word; }
.contact-value a { color: var(--maroon-deep); text-decoration: none; }
.contact-value a:hover { text-decoration: underline; }
.contact-value.placeholder { color: var(--ink-soft); font-style: italic; font-weight: 500; }
.contact-cta { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 12px; }
.contact-cta .whatsapp-btn,
.contact-cta .btn { text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }

.support-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.support-list li {
  display: flex; gap: 10px; align-items: flex-start;
  font-size: 0.93rem; color: var(--ink); line-height: 1.6;
}
.support-list li::before {
  content: "✓";
  color: var(--emerald); font-weight: 700; flex-shrink: 0;
}

/* Privacy policy page */
.policy-toc {
  background: #fff; border-radius: var(--radius);
  padding: 18px 24px; box-shadow: 0 2px 10px rgba(43,33,27,0.06);
  margin-bottom: 28px;
}
.policy-toc-title { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-soft); margin: 0 0 10px; }
.policy-toc ol { margin: 0; padding-left: 18px; columns: 2; column-gap: 24px; }
.policy-toc li { margin-bottom: 8px; }
.policy-toc a { color: var(--maroon-deep); text-decoration: none; font-weight: 600; font-size: 0.9rem; }
.policy-toc a:hover { text-decoration: underline; }
.policy-section { padding: 20px 0; border-bottom: 1px solid var(--blush); scroll-margin-top: 90px; }
.policy-section:last-of-type { border-bottom: none; }
.policy-section ul { margin: 0 0 14px; padding-left: 20px; }
.policy-section li { line-height: 1.75; margin-bottom: 6px; }
.updated-note { font-size: 0.85rem; color: var(--ink-soft); margin: -4px 0 0; }

@media (max-width: 820px) {
  .about-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .policy-toc ol { columns: 1; }
}
@media (max-width: 640px) {
  .page-card { padding: 20px; }
  .site-subnav-inner { justify-content: flex-start; gap: 18px; padding: 9px 20px; }
}

/* ---------- Product Code badge (cards, quick view, product page, cart) ---------- */
.product-code {
  font-size: 0.78rem;
  color: var(--ink-soft);
  font-weight: 600;
  letter-spacing: 0.3px;
  margin: 2px 0 4px;
}
.cart-line-code { margin-top: 2px; }

/* ---------- Account header button ---------- */
.account-btn { font-size: 0.85rem; }
.account-label { max-width: 70px; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Account page (signup / login) ---------- */
.account-card { max-width: 460px; margin: 0 auto; }
.auth-tabs { display: flex; gap: 8px; margin-bottom: 18px; }
.auth-tab {
  flex: 1; padding: 10px; border-radius: 10px; border: 1px solid var(--blush);
  background: #fff; cursor: pointer; font-size: 0.9rem; font-weight: 600; color: var(--ink-soft);
}
.auth-tab.active { background: var(--maroon); border-color: var(--maroon); color: var(--ivory); }
.account-value {
  padding: 10px 12px; border-radius: 10px; background: var(--ivory-deep);
  font-size: 0.95rem; color: var(--ink);
}
.account-success {
  background: var(--ivory-deep); border: 1px solid var(--gold-soft); color: var(--emerald);
  padding: 10px 12px; border-radius: 10px; font-size: 0.88rem; margin-bottom: 14px;
}
.account-switch-line { text-align: center; margin-top: 14px; }
.account-switch-line a { color: var(--maroon); font-weight: 600; text-decoration: none; }
.account-switch-line a:hover { text-decoration: underline; }
