@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300&display=swap');

/* ── Order History ──────────────────────────────────────────────────────────── */

.oh-tab-bar {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--border-light);
  margin-bottom: 20px;
}
.oh-tab {
  background: none;
  border: none;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
}
.oh-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.oh-tab:hover:not(.active) { color: var(--text); }

.oh-list-wrap {
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.oh-list-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  background: var(--surface);
}
.oh-list-table thead tr {
  background: var(--bg);
  border-bottom: 2px solid var(--border-light);
}
.oh-list-table thead th {
  padding: 11px 16px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  text-align: left;
  white-space: nowrap;
}
.oh-list-table thead th.oh-num { text-align: right; }
.oh-row {
  cursor: pointer;
  transition: background 0.1s;
  border-bottom: 1px solid var(--border-light);
}
.oh-row:last-child { border-bottom: none; }
.oh-row:hover { background: var(--accent-light); }
.oh-row td { padding: 12px 16px; vertical-align: middle; }
.oh-col-num { font-weight: 700; color: var(--text); white-space: nowrap; }
.oh-col-date { color: var(--text-secondary); font-size: 13px; white-space: nowrap; }
.oh-col-action { text-align: right; white-space: nowrap; }
.oh-view-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
}
.oh-row:hover .oh-view-link { text-decoration: underline; }

.oh-status {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
}
.oh-status--draft   { background: #F3F4F6; color: #6B7280; }
.oh-status--open    { background: var(--accent-light);  color: var(--accent); }
.oh-status--paid    { background: var(--success-light); color: var(--success); }
.oh-status--neutral { background: var(--border-light);  color: var(--text-secondary); }

.oh-lines-panel { border-top: 1px solid var(--border-light); }
.oh-lines-spinner { display: flex; align-items: center; gap: 10px; padding: 16px 20px; color: var(--text-secondary); font-size: 13px; }
.oh-lines-error, .oh-lines-empty { padding: 16px 20px; font-size: 13px; color: var(--text-secondary); }

.oh-lines-wrap { padding: 16px 20px 4px; }
.oh-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  overflow: hidden;
}
.oh-table thead th {
  background: var(--primary);
  padding: 11px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  text-align: left;
  border-right: 1px solid rgba(255,255,255,0.15);
  white-space: nowrap;
}
.oh-table thead th:last-child { border-right: none; }
.oh-table thead th.oh-num { text-align: right; }
.oh-table tbody tr { border-bottom: 1px solid var(--border-light); }
.oh-table tbody tr:last-child { border-bottom: none; }
.oh-table tbody td {
  padding: 11px 14px;
  vertical-align: middle;
  font-size: 14px;
  color: var(--text);
}
.oh-num { text-align: right; font-variant-numeric: tabular-nums; }
.oh-item-no { font-family: inherit; font-size: 14px; font-weight: 400; color: var(--text); }
.oh-th-thumb { width: 52px; padding: 0 !important; }
.oh-td-thumb { width: 52px; padding: 6px 8px !important; text-align: center; }
.oh-line-thumb { width: 40px; height: 40px; object-fit: contain; border-radius: 5px; background: var(--bg); border: 1px solid var(--border-light); display: block; }
.oh-line-thumb-placeholder { font-size: 22px; line-height: 40px; }
.oh-lines-footer { padding: 16px 20px; display: flex; justify-content: flex-end; border-top: 1px solid var(--border-light); margin-top: 12px; }

/* ── Order History Lines Modal ─────────────────────────────────────────────── */
.oh-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.oh-modal-sheet {
  background: var(--surface);
  border-radius: 16px;
  width: 100%;
  max-width: 820px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  box-shadow: 0 16px 48px rgba(0,0,0,0.28);
}
.oh-modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  z-index: 2;
  background: rgba(255,255,255,0.85);
  border: 1px solid var(--border-light);
  font-size: 16px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 3px 9px;
  border-radius: 6px;
  line-height: 1.4;
  transition: background 0.12s;
}
.oh-modal-close:hover { background: var(--bg); }

/* ── Invoice document ─────────────────────────────────────── */
.oh-inv-scroll { overflow-y: auto; flex: 1; padding: 24px 36px 0; }
.oh-inv-doc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 52px 14px 28px;
  background: var(--primary);
  flex-shrink: 0;
}
.oh-inv-brand { display: flex; align-items: center; gap: 14px; }
.oh-inv-logo  { height: 38px; width: auto; }
.oh-inv-brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.oh-inv-company-name { font-size: 16px; font-weight: 800; color: #ffffff; letter-spacing: -0.5px; }
.oh-inv-company-sub  { font-size: 10px; font-weight: 400; font-style: italic; color: #D9E5EF; letter-spacing: 0.3px; }
.oh-inv-tagline-accent { font-weight: 700; font-style: normal; color: #FFD100; letter-spacing: 0.2px; }
/* Document info tile — below addresses, above line items */
.oh-doc-tile {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 24px;
}
.oh-doc-tile-item {
  padding: 20px 24px;
  border-right: 1px solid var(--border-light);
}
.oh-doc-tile-item:last-child { border-right: none; }
.oh-doc-tile-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 10px;
}
.oh-inv-ref-num {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.5px;
  line-height: 1.1;
}
.oh-doc-tile-val { font-size: 13px; line-height: 1.75; color: var(--text); }
.oh-inv-due { font-size: 12px; color: var(--text-muted); }

/* Addresses */
.oh-inv-addrs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 28px;
  padding: 20px 24px;
  background: var(--bg);
  border-radius: 10px;
  border: 1px solid var(--border-light);
}
.oh-inv-addr-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}
.oh-inv-addr-body { font-size: 13px; line-height: 1.75; color: var(--text); }
.oh-inv-addr-empty { color: var(--text-secondary); }

/* Totals */
.oh-inv-totals {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  padding: 16px 20px 8px;
}
.oh-inv-total-row { display: flex; gap: 60px; justify-content: flex-end; font-size: 14px; }
.oh-inv-total-row span:first-child { color: var(--text-secondary); }
.oh-inv-total-row span:last-child  { font-variant-numeric: tabular-nums; min-width: 110px; text-align: right; }
.oh-inv-total-grand {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
  margin-top: 6px;
  padding-top: 10px;
  border-top: 2px solid var(--primary);
}
.oh-inv-total-grand span:first-child { color: var(--primary); }

.oh-review-banner {
  margin: 16px 20px 0;
  padding: 12px 16px;
  background: #FFF8E1;
  border-left: 4px solid #F5B800;
  border-radius: 4px;
  font-size: 13px;
  color: #5C4500;
  line-height: 1.5;
}

/* Footer */
.oh-inv-footer {
  padding: 16px 20px 24px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ── Print / PDF ─────────────────────────────────────────── */
#oh-print-area { display: none; }

@media print {
  @page { margin: 12mm 10mm; size: A4; }

  body * { visibility: hidden; }

  #oh-print-area,
  #oh-print-area * { visibility: visible; }

  #oh-print-area {
    display: block !important;
    position: fixed;
    inset: 0;
    background: #fff;
    z-index: 99999;
  }

  #oh-print-area .oh-inv-doc-header {
    padding: 16px 28px !important;
  }
  #oh-print-area .oh-inv-logo { display: block !important; }
  #oh-print-area .oh-print-body { padding: 0 28px 16px; }
  #oh-print-area .oh-inv-addrs { margin-bottom: 20px; }
  #oh-print-area .oh-lines-wrap { overflow: visible !important; }
  #oh-print-area .oh-inv-totals { padding: 14px 0 8px; }
  #oh-print-area .oh-review-banner { margin: 16px 0 0; }

  /* Force background colours to print */
  .oh-inv-doc-header { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .oh-table thead    { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ── Order history — mobile ──────────────────────────────── */
@media (max-width: 600px) {
  /* List table: smaller text, hide date columns */
  .oh-list-table { font-size: 12px; }
  .oh-list-table thead th { font-size: 10px; padding: 9px 10px; }
  .oh-row td { padding: 10px 10px; }
  .oh-col-num { font-size: 12px; }
  .oh-col-date { display: none; }
  .oh-status { font-size: 10px; padding: 2px 6px; }
  .oh-view-link { font-size: 11px; }
  .oh-num { font-size: 12px; }

  /* Popup: near full-screen sheet */
  .oh-modal-backdrop { padding: 0; align-items: flex-end; }
  .oh-modal-sheet {
    border-radius: 16px 16px 0 0;
    max-height: 92vh;
    max-width: 100%;
  }

  /* Header: tighter padding, smaller text, hide logo */
  .oh-inv-doc-header { padding: 10px 44px 10px 12px; }
  .oh-inv-logo { display: none; }
  .oh-inv-brand { gap: 0; }
  .oh-inv-company-name { font-size: 13px; }
  .oh-inv-company-sub  { font-size: 9px; }
  /* Doc tile: collapse to 2×2 on small screens */
  .oh-doc-tile { grid-template-columns: 1fr 1fr; }
  .oh-doc-tile-item:nth-child(2) { border-right: none; }
  .oh-doc-tile-item:nth-child(3),
  .oh-doc-tile-item:nth-child(4) { border-top: 1px solid var(--border-light); }
  .oh-inv-ref-num  { font-size: 16px; }
  .oh-doc-tile-val, .oh-inv-due { font-size: 10px; }

  /* Scroll area: less horizontal padding */
  .oh-inv-scroll { padding: 14px 12px 0; }

  /* Addresses: stack to one column, smaller text */
  .oh-inv-addrs {
    grid-template-columns: 1fr;
    padding: 12px;
    gap: 14px;
    margin-bottom: 14px;
  }
  .oh-inv-addr-label { font-size: 9px; }
  .oh-inv-addr-body  { font-size: 11px; line-height: 1.6; }

  /* Popup table: hide Unit Price column, smaller text, horizontal scroll */
  .oh-lines-wrap { padding: 0 0 4px; overflow-x: auto; }
  .oh-table { font-size: 11px; min-width: 300px; }
  .oh-table thead th { font-size: 10px; padding: 8px 8px; }
  .oh-table tbody td { font-size: 11px; padding: 8px 8px; }
  .oh-item-no { font-size: 11px; }
  .oh-table thead th:nth-child(5),
  .oh-table tbody td:nth-child(5) { display: none; }

  /* Thumbnail: smaller */
  .oh-th-thumb, .oh-td-thumb { width: 32px; }
  .oh-line-thumb { width: 28px; height: 28px; }

  /* Totals: smaller text */
  .oh-inv-totals { padding: 10px 12px 4px; }
  .oh-inv-total-row { font-size: 12px; gap: 24px; }
  .oh-inv-total-grand { font-size: 13px; }

  /* Footer and banner */
  .oh-inv-footer { padding: 10px 12px 18px; }
  .oh-review-banner { margin: 10px 12px 0; font-size: 12px; padding: 10px 12px; }
}

:root {
  --primary: #003B71;
  --primary-dark: #002C56;
  --primary-light: #004d95;
  --accent: #1A5EA8;
  --accent-light: #EAF1FA;
  --accent-mid: #99BBE0;
  --success: #059669;
  --success-light: #ECFDF5;
  --warning: #D97706;
  --warning-light: #FFFBEB;
  --error: #DC2626;
  --error-light: #FEF2F2;
  --bg: #F5F7FA;
  --surface: #FFFFFF;
  --border: #D0DDE9;
  --border-light: #E8EFF7;
  --text: #0D1C3C;
  --text-secondary: #4A6080;
  --text-light: #8BA3BF;
  --text-inverse: #FFFFFF;
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 14px;
  --shadow: 0 1px 4px rgba(0,59,113,0.08), 0 2px 12px rgba(0,59,113,0.06);
  --shadow-lg: 0 4px 24px rgba(0,59,113,0.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  overflow-y: scroll;
  overscroll-behavior-y: none;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.55;
  font-size: 15px;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── Layout ─────────────────────────────────────────────── */
.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
  z-index: 0;
}


/* ─── Topbar ──────────────────────────────────────────────── */
.topbar {
  background: var(--primary);
  border-bottom: 1px solid var(--primary-dark);
  display: flex;
  align-items: center;
  gap: 0;
  height: 52px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 8px rgba(0,0,0,0.18);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  height: 100%;
  border-right: 1px solid rgba(255,255,255,0.15);
  min-width: 220px;
  text-decoration: none;
}

.topbar-brand:hover { text-decoration: none; }

.topbar-logo-img {
  height: 36px;
  width: auto;
  object-fit: contain;
  display: block;
}

.topbar-logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.topbar-logo-text strong {
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
}

.topbar-logo-text > span {
  font-size: 10px;
  font-weight: 400;
  font-style: italic;
  color: #D9E5EF;
  text-transform: none;
  letter-spacing: 0.3px;
}

.topbar-tagline-accent {
  font-weight: 700;
  font-style: normal;
  color: #FFD100;
  letter-spacing: 0.2px;
}

.auth-brand-logo-text .topbar-tagline-accent,
.auth-mobile-logo-text .topbar-tagline-accent {
  color: #FFD100;
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  padding: 0 16px;
}

.topbar-nav a, .topbar-nav button.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: rgba(255,255,255,0.85);
  font-size: 14px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
  font-family: inherit;
}

.topbar-nav a:hover, .topbar-nav button.nav-link:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
  text-decoration: none;
}

.topbar-nav a.active, .topbar-nav button.nav-link.active {
  background: rgba(255,255,255,0.18);
  color: #fff;
}

.topbar-cart-btn {
  position: relative;
}

#nav-cart.has-items {
  background: #fff;
  color: var(--primary);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

#nav-cart.has-items:hover {
  background: #fff;
  color: var(--primary-dark);
}

#nav-cart.has-items--free {
  background: #f0fdf4;
  color: #065F46;
  border: 1px solid #86efac;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}
#nav-cart.has-items--free:hover {
  background: #dcfce7;
  color: #065F46;
}

#nav-cart.has-items--fee {
  background: #fffbeb;
  color: #92400E;
  border: 1px solid #f59e0b;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}
#nav-cart.has-items--fee:hover {
  background: #fef3c7;
  color: #92400E;
}

/* When the parent cart button already signals free/fee, drop the inner dot's
   pill background so it reads as plain status text rather than a nested chip. */
#nav-cart.has-items--free .delivery-dot,
#nav-cart.has-items--fee .delivery-dot {
  background: transparent;
  padding: 0 0 0 6px;
  border-radius: 0;
  margin-left: 8px;
  min-width: 92px;
  justify-content: center;
}
#nav-cart.has-items--free .delivery-dot {
  color: #065F46;
  border-left: 1px solid rgba(6,95,70,0.3);
}
#nav-cart.has-items--fee .delivery-dot {
  color: #92400E;
  border-left: 1px solid rgba(146,64,14,0.3);
}

.cart-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: #E85C00;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
}

.delivery-dot {
  display: inline-flex;
  align-items: center;
  border-radius: 20px;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 600;
  margin-left: 5px;
  white-space: nowrap;
  flex-shrink: 0;
}
.delivery-dot.free { background: #D1FAE5; color: #065F46; }
.delivery-dot.fee  { background: #FEF3C7; color: #92400E; }

.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px;
  border-left: 1px solid rgba(255,255,255,0.15);
  height: 100%;
}

.topbar-user-name {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.85);
  max-width: 160px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-signout {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.85);
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  transition: color 0.15s, background 0.15s;
}

.topbar-signout:hover { color: #fff; background: rgba(255,255,255,0.12); }

.topbar-contact {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  border-left: 1px solid rgba(255,255,255,0.15);
  height: 100%;
  white-space: nowrap;
}

.topbar-contact-label {
  font-size: 12px;
  color: rgba(255,255,255,0.85);
  font-weight: 600;
}

.topbar-contact-cta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #fff;
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: 0.1px;
  white-space: nowrap;
}

.topbar-contact-link {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  color: rgba(255,255,255,0.9);
  font-weight: 600;
  text-decoration: none;
}


.topbar-contact-sep {
  font-size: 13px;
  color: rgba(255,255,255,0.3);
}

@media (max-width: 900px) {
  .topbar-contact { display: none; }
}

/* Topbar — responsive collapse */
@media (max-width: 660px) {
  .topbar-brand { min-width: auto; padding: 0 12px; }
  .topbar-logo-text > span { display: none; }
  .topbar-logo-text strong { font-size: 14px; }
  .topbar-logo-img { height: 30px; }
  .topbar-nav { padding: 0 8px; gap: 4px; }
  .topbar-user { padding: 0 12px; }
}

@media (max-width: 480px) {
  .topbar-logo-text { display: none; }
  .topbar-brand { padding: 0 10px; }
  .topbar-nav { padding: 0 6px; gap: 4px; }
  .topbar-user { padding: 0 8px; }
  .topbar-signout { font-size: 12px; padding: 5px 8px; }
}


.main-content {
  flex: 1;
  padding: 10px 20px 18px;
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
}

/* ─── Auth / Login ────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

@media (max-width: 760px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-brand-panel { display: none; }
}

.auth-brand-panel {
  background: var(--primary);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px 52px;
  position: relative;
  overflow: hidden;
}

.auth-brand-panel::before {
  content: '';
  position: absolute;
  top: -100px;
  right: -100px;
  width: 400px;
  height: 400px;
  background: rgba(255,255,255,0.04);
  border-radius: 50%;
}

.auth-brand-panel::after {
  content: '';
  position: absolute;
  bottom: -80px;
  left: -80px;
  width: 300px;
  height: 300px;
  background: rgba(255,255,255,0.04);
  border-radius: 50%;
}

.auth-brand-logo {
  display: flex;
  align-items: center;
  gap: 14px;
}

.auth-brand-logo img {
  height: 48px;
  width: auto;
}

.auth-brand-logo-text strong {
  display: block;
  font-size: 18px;
  font-weight: 700;
  color: white;
  letter-spacing: -0.3px;
}

.auth-brand-logo-text span {
  font-size: 11px;
  color: rgba(255,255,255,0.65);
  letter-spacing: 0.2px;
}

.auth-brand-body {
  position: relative;
  z-index: 1;
}

.auth-brand-body h2 {
  font-size: 32px;
  font-weight: 700;
  color: white;
  line-height: 1.2;
  margin-bottom: 16px;
}

.auth-brand-body h2 em {
  font-style: italic;
  font-weight: 300;
  color: rgba(255,255,255,0.75);
}

.auth-brand-body p {
  font-size: 15px;
  color: rgba(255,255,255,0.65);
  line-height: 1.7;
  max-width: 320px;
}

.auth-brand-footer {
  position: relative;
  z-index: 1;
}

.auth-brand-footer p {
  font-size: 12px;
  color: rgba(255,255,255,0.35);
}

.auth-form-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  padding: 48px 52px;
}

@media (max-width: 760px) {
  .auth-form-panel { padding: 40px 28px; min-height: 100vh; }
}

.auth-form-inner {
  width: 100%;
  max-width: 380px;
}

.auth-mobile-logo {
  display: none;
  margin-bottom: 32px;
}

@media (max-width: 760px) {
  .auth-mobile-logo { display: block; }
}

.auth-mobile-logo img {
  height: 40px;
  width: auto;
}

.auth-mobile-logo-text {
  margin-top: 12px;
}

.auth-mobile-logo-text strong {
  display: block;
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
}

.auth-mobile-logo-text span {
  font-size: 12px;
  color: var(--text-secondary);
  letter-spacing: 0.2px;
}

.auth-form-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.auth-form-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

/* ─── Form Controls ───────────────────────────────────────── */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 7px;
}

.form-input {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
  font-family: inherit;
}

.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(26,94,168,0.10);
}

.form-input::placeholder { color: var(--text-light); }

textarea.form-input { resize: vertical; }

/* ─── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  font-family: inherit;
  letter-spacing: 0.1px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark);
  box-shadow: 0 4px 14px rgba(0,59,113,0.25);
}

.btn-accent {
  background: var(--accent);
  color: white;
}

.btn-accent:hover:not(:disabled) { background: #155090; }

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}

.btn-outline:hover:not(:disabled) {
  background: var(--accent-light);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1.5px solid var(--border);
}

.btn-ghost:hover:not(:disabled) { background: var(--bg); }

.btn-danger {
  background: var(--error);
  color: white;
}

.btn-danger:hover:not(:disabled) { background: #b91c1c; }

.btn-sm { padding: 6px 13px; font-size: 13px; }
.btn-lg { padding: 14px 24px; font-size: 15px; }
.btn-full { width: 100%; }
.btn-icon { padding: 7px; border-radius: var(--radius-sm); }

/* ─── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow);
}

.card-header {
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border-light);
}

.card-header strong {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.card-body { padding: 20px 22px; }
.card-footer {
  padding: 16px 22px;
  border-top: 1px solid var(--border-light);
  background: #FAFCFE;
  border-radius: 0 0 var(--radius) var(--radius);
}

/* ─── Page Headers ────────────────────────────────────────── */
.page-header {
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.page-header-text h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 3px;
}

.page-header-text p {
  font-size: 13px;
  color: var(--text-secondary);
}

.page-header h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 3px;
}

.page-header p {
  font-size: 13px;
  color: var(--text-secondary);
}

/* ─── Alerts ──────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.alert-error { background: var(--error-light); color: var(--error); border: 1px solid rgba(220,38,38,0.18); }
.alert-success { background: var(--success-light); color: var(--success); border: 1px solid rgba(5,150,105,0.18); }
.alert-warning { background: var(--warning-light); color: var(--warning); border: 1px solid rgba(217,119,6,0.18); }
.alert-info { background: var(--accent-light); color: var(--accent); border: 1px solid var(--border); }

/* ─── Catalogue ───────────────────────────────────────────── */
.search-bar {
  display: flex;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  box-sizing: border-box;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  color: var(--text-secondary);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.filter-pill .filter-pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #cbd5e1;
  transition: background 0.15s, box-shadow 0.15s;
}
.filter-pill[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

/* In-stock pill (green) */
.in-stock-toggle:not([disabled]):hover {
  border-color: #86efac;
  color: #166534;
}
.in-stock-toggle.active {
  background: #f0fdf4;
  border-color: #86efac;
  color: #166534;
}
.in-stock-toggle.active .filter-pill-dot {
  background: #16a34a;
  box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.18);
}

/* Promotion pill (gold/amber) */
.promotion-toggle:not([disabled]):hover {
  border-color: #fcd34d;
  color: #92400e;
}
.promotion-toggle.active {
  background: #fffbeb;
  border-color: #f59e0b;
  color: #92400e;
}
.promotion-toggle.active .filter-pill-dot {
  background: #f59e0b;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.18);
}

/* Clearance pill (red) — disabled placeholder */
.clearance-toggle:not([disabled]):hover {
  border-color: #fca5a5;
  color: #991b1b;
}
.clearance-toggle.active {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #991b1b;
}
.clearance-toggle.active .filter-pill-dot {
  background: #dc2626;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.18);
}

.search-bar .form-input {
  flex: 1;
  min-width: 0;
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
  box-sizing: border-box;
}

.search-bar .btn {
  height: 28px;
  padding-top: 0;
  padding-bottom: 0;
  box-sizing: border-box;
}

/* ─── Always-visible quick filter bar ───────────────────────── */
.cat-quickbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 6px 10px;
  margin-bottom: 10px;
  position: sticky;
  top: 52px;
  z-index: 99;
  transition: box-shadow 0.2s, border-radius 0.2s;
}
.cat-quickbar.is-stuck {
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: 0 4px 16px rgba(0,0,0,0.10);
  border-top-color: transparent;
}

/* Buttons row — desktop: just a flex row that fills the quickbar */
.cat-quickbar-buttons-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  flex-wrap: nowrap;
}

@media (max-width: 640px) {
  .cat-quickbar { flex-direction: column; align-items: stretch; gap: 6px; overflow-x: visible; }
  /* Grid: 3 equal columns with gaps. Pills spans cols 2-3; filter pills auto-flow to row 2 */
  .cat-quickbar-buttons-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; overflow: visible; }
  .cat-quickbar-buttons-row .cat-panel-toggle { grid-column: 1; grid-row: 1; justify-content: center; }
  .cat-quickbar-buttons-row .cat-quickbar-pills { grid-column: 2 / 4; grid-row: 1; gap: 6px; }
  /* Each nav item inside pills gets equal share of its 2-column container */
  .cat-quickbar-pills .cat-nav-item { flex: 1; justify-content: center; text-align: center; min-width: 0; }
  /* Filter pills auto-placed into row 2 by the grid, one per column */
  .cat-quickbar .search-bar { width: 100%; }
  .cat-quickbar .search-bar .form-input { font-size: 14px; }
  .cat-btn-icon { display: none; }
}

.cat-quickbar-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  overflow: hidden;
  min-width: 0;
}

.cat-panel-toggle {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  border: 1px solid var(--primary);
  background: var(--primary);
  border-radius: var(--radius-sm);
  font-family: inherit;
  transition: background 0.12s, color 0.12s;
  white-space: nowrap;
  flex-shrink: 0;
  box-sizing: border-box;
  line-height: 1;
}
@media (hover: hover) {
  .cat-panel-toggle:hover {
    background: var(--accent);
    border-color: var(--accent);
  }
}
.cat-panel-toggle.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ─── Scroll lock when category panel is open ───────────────── */
html.panel-open,
html.panel-open body {
  background: #fff;   /* so any overscroll bleed shows white, not grey */
}

/* ─── Slide-out category panel ───────────────────────────────── */
.cat-filter-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 200;
  touch-action: none;
  overscroll-behavior: none;
}
.cat-filter-overlay.open { display: block; }

.cat-filter-panel {
  position: fixed;
  top: 0;
  left: -110vw;
  width: 310px;
  height: 100dvh;
  background: var(--surface);
  border-right: 1px solid var(--border-light);
  box-shadow: 6px 0 32px rgba(0,0,0,0.15);
  z-index: 201;
  overflow: hidden;
  transition: left 0.25s ease;
  display: flex;
  flex-direction: column;
}
.cat-filter-panel.open { left: 0; }

/* Full-width on small phones so no background peeks through */
@media (max-width: 520px) {
  .cat-filter-panel { width: 100vw; border-right: none; }
}

/* Categories list is the scroll container — header stays fixed above it */
#categories-container {
  flex: 1;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
#categories-container::-webkit-scrollbar { display: none; }

.cat-filter-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--border-light);
  background: var(--surface);
  flex-shrink: 0;
  z-index: 1;
}
.cat-filter-panel-header span {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.cat-filter-panel-close {
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 3px 10px;
  border-radius: 20px;
  line-height: 1.4;
  font-family: inherit;
  letter-spacing: 0.1px;
}
.cat-filter-panel-close:hover { background: var(--border-light); color: var(--text); }

/* Category vertical list inside the panel */
.cat-list {
  display: flex;
  flex-direction: column;
  padding: 6px 0;
}
.cat-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  border: none;
  background: transparent;
  text-align: left;
  width: 100%;
  font-family: inherit;
  transition: background 0.12s, color 0.12s;
}
.cat-list-item:hover { background: var(--accent-light); }
.cat-list-item.active {
  background: var(--accent-light);
  color: var(--primary);
  font-weight: 600;
}
.cat-list-img {
  width: 30px;
  height: 30px;
  object-fit: contain;
  flex-shrink: 0;
}
.cat-list-icon { font-size: 20px; line-height: 1; flex-shrink: 0; }
.cat-list-label { flex: 1; line-height: 1.3; }
.cat-list-arrow {
  display: flex;
  align-items: center;
  color: var(--text-light);
  flex-shrink: 0;
  transition: transform 0.2s;
}
.cat-list-item.expanded .cat-list-arrow { transform: rotate(90deg); }

.cat-list-children {
  display: none;
  flex-direction: column;
  background: var(--surface);
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
}
.cat-list-children.open { display: flex; }

.cat-list-child {
  display: flex;
  align-items: center;
  padding: 8px 16px 8px 56px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  border: none;
  background: transparent;
  text-align: left;
  width: 100%;
  font-family: inherit;
  transition: background 0.12s, color 0.12s;
}
.cat-list-child:hover { background: var(--accent-light); color: var(--accent); }
.cat-list-child.active {
  color: var(--primary);
  font-weight: 600;
  background: var(--accent-light);
}

/* Pill buttons (quickbar + sub-category pills in panel) */
.cat-nav-item {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
  white-space: nowrap;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  border-radius: var(--radius-sm);
  font-family: inherit;
  box-sizing: border-box;
  line-height: 1;
}
.cat-nav-item:hover {
  background: var(--accent-light);
  color: var(--accent);
}
.cat-nav-item.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.cat-nav-item.all-categories {
  color: var(--primary);
  font-weight: 600;
  background: #fff;
  border-color: var(--border-light);
}
.cat-nav-item.all-categories:hover {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
}
.cat-nav-item.all-categories.active {
  background: var(--accent-light);
  border-color: var(--primary);
  color: var(--primary);
}
.cat-nav-item.cat-nav-best-sellers {
  color: #7a5200;
  font-weight: 600;
  background: #fffbf0;
  border-color: #e6a800;
}
.cat-nav-item.cat-nav-best-sellers:hover {
  background: #fff3cc;
  color: #5c3d00;
}
.cat-nav-item.cat-nav-best-sellers.active {
  background: #e6a800;
  color: #fff;
  border-color: #e6a800;
}
.cat-nav-divider {
  width: 1px;
  height: 18px;
  background: var(--border-light);
  margin: 0 4px;
  align-self: center;
}

/* Delivery info banner below quickbar */
.delivery-info-section {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: var(--accent-light);
  color: var(--accent);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  font-size: 13px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

.delivery-info-section strong { color: var(--primary); }

@media (max-width: 640px) {
  .delivery-info-section { font-size: 11px; padding: 5px 8px; gap: 6px; }
  .breadcrumb { font-size: 10px; }
}


/* Cart bar — sits inside the quickbar as a compact pill */
.catalogue-cart-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--primary);
  color: #fff;
  padding: 3px 8px;
  font-size: 12px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  line-height: 1.4;
}

.catalogue-cart-bar strong { color: #fff; }

.cart-bar-btn {
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.35);
  flex-shrink: 0;
  padding: 2px 8px;
  font-size: 12px;
  line-height: 1.4;
}

.cart-bar-btn:hover {
  background: rgba(255,255,255,0.25);
}

.cart-bar-delivery {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  margin-left: 6px;
  vertical-align: middle;
}

.cart-bar-delivery.fee {
  background: #FEF3C7;
  color: #92400E;
  border: 1px solid #FCD34D;
}

.cart-bar-delivery.free {
  background: #D1FAE5;
  color: #065F46;
  border: 1px solid #6EE7B7;
}

/* Cart page */
.cart-page-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 16px;
  align-items: start;
}

@media (max-width: 860px) {
  .cart-page-layout { grid-template-columns: 1fr; }
}


.bs-search-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-light);
  gap: 12px;
}

.bs-search-result:last-child { border-bottom: none; }

.bs-search-result--added { opacity: 0.5; }

.bs-search-result-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.bs-search-result-code {
  font-size: 11px;
  color: var(--text-secondary);
  font-family: monospace;
}

.bs-search-result-name {
  font-size: 14px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cat-nav-icon {
  font-size: 14px;
  line-height: 1;
  flex-shrink: 0;
}

.cat-nav-img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  border-radius: 3px;
  flex-shrink: 0;
}

.cat-nav-label {
  line-height: 1.3;
}

.cat-nav-child {
  font-size: 11px;
}

.cat-nav-child.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}

/* ── Best Sellers accordion ─────────────────────────────────────────────────── */
.bs-toolbar {
  display: flex;
  justify-content: flex-end;
  padding: 8px 0 4px;
}

.bs-section {
  margin-bottom: 6px;
}

.bs-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 14px;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 0;
}

.bs-section-title { flex: 1; }

.bs-section-count {
  font-size: 11px;
  font-weight: 400;
  opacity: 0.8;
  white-space: nowrap;
}

.bs-view-all-btn {
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.35);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.bs-view-all-btn:hover {
  background: rgba(255,255,255,0.32);
}

.bs-section-body {
  padding: 10px 0 4px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
/* If the parent banner is hidden, drop the body's top padding so we don't
   leave a phantom gap where the banner used to be. */
.bs-section--no-banner > .bs-section-body { padding-top: 0; }
.bs-section--no-banner > .bs-section-body > .bs-sub-header:first-child { margin-top: 0; }

.bs-sub-header {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--accent-light);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 5px 14px;
  margin-top: 4px;
  margin-bottom: 2px;
}

.bs-sub-indicator {
  width: 3px;
  height: 14px;
  border-radius: 2px;
  background: var(--primary);
  flex-shrink: 0;
}

.bs-sub-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
}

.item-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.15s, border-color 0.15s;
}

.item-card:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--border);
}

.item-card--qbd {
  background: var(--success-light);
  border-color: #86efac;
}
.item-card--qbd:hover { border-color: #4ade80; }
.item-card-price--qbd { color: var(--success) !important; }
.item-card-price-was {
  font-size: 0.75em;
  font-weight: 500;
  color: var(--muted);
  text-decoration: line-through;
  margin-left: 4px;
}
.item-card-qbd-row {
  line-height: 1;
}
.item-card-price-row { padding-top: 0 !important; }
.item-card-price { line-height: 1.1; }
.qbd-badge--active {
  background: var(--success);
  color: #fff;
}
.qbd-badge--active:hover { filter: brightness(1.05); }

.item-card-image {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: contain;
  background: var(--bg);
  padding: 16px;
}

.item-card-image-wrap {
  width: 100%;
  aspect-ratio: 2/1;
  background: #fff;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.item-card-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.item-card-image-placeholder {
  width: 100%;
  aspect-ratio: 2/1;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: var(--accent-mid);
}

.item-card-body {
  padding: 8px 10px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.item-card-name {
  font-size: 10px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}

.item-card-number {
  font-size: 10px;
  color: var(--text-secondary);
  font-weight: 400;
}

@media (hover: none) and (pointer: coarse) {
  .item-card-name { font-size: 12px; }
  .item-card-number { font-size: 11px; }
  .item-card-signin-btn { font-size: 12px !important; }
}

.stock-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 20px;
  margin-bottom: 1px;
}

.stock-in {
  background: #DCFCE7;
  color: #166534;
}

.stock-out {
  background: #FEE2E2;
  color: #991B1B;
}

.item-card-price-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 4px;
}

.item-card-price {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
}

.qbd-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 500;
  color: #166534;
  background: #DCFCE7;
  border-radius: 20px;
  padding: 2px 7px;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}

.qbd-badge:hover { filter: brightness(0.95); }

.qbd-info {
  font-size: 10px;
  opacity: 0.8;
}

.discount-popup {
  position: absolute;
  z-index: 9999;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  min-width: 300px;
  padding: 16px 20px;
  animation: popup-in 0.12s ease;
}

@keyframes popup-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.discount-popup-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.discount-popup-loading,
.discount-popup-empty {
  font-size: 12px;
  color: var(--text-secondary);
  padding: 4px 0;
}

.discount-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.discount-table th {
  text-align: left;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0 12px 8px 0;
  border-bottom: 1px solid var(--border-light);
}
.discount-table th:last-child,
.discount-table td:last-child { padding-right: 0; }

.discount-table td {
  padding: 8px 12px 8px 0;
  color: var(--text);
  border-bottom: 1px solid var(--border-light);
}

.discount-table tr:last-child td { border-bottom: none; }

.discount-table th:not(:first-child),
.discount-table td:not(:first-child) {
  text-align: right;
}
.discount-table td:not(:first-child) {
  font-weight: 600;
  color: var(--primary);
}

.discount-tier-highlight td:not(:first-child) {
  color: var(--success);
}

.item-card-per {
  font-size: 10px;
  font-weight: 400;
  color: var(--text-secondary);
}

.item-card-case {
  font-size: 10px;
  color: var(--text-light);
}

.item-card-sep {
  color: var(--text-light);
}

.item-card-case-price {
  font-size: 10px;
  font-weight: 400;
  color: var(--text-secondary);
  margin-top: 1px;
}

.item-card-footer {
  padding: 6px 10px;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  background: #FAFCFE;
}

.item-card-footer .btn-sm {
  flex-shrink: 0;
  padding-left: 10px;
  padding-right: 10px;
}

/* Lock every interactive element in the footer to exactly 28px so the row
   height never shifts between "added" and "not added" states */
.item-card-footer .btn,
.item-card-footer .qty-btn,
.item-card-footer .qty-input,
.item-card-footer .item-card-bin {
  height: 28px;
  line-height: 1;
  padding-top: 0;
  padding-bottom: 0;
}

/* Bin / remove-from-cart icon button (visible when product is in basket) */
.item-card-bin {
  flex-shrink: 0;
  width: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-light);
  cursor: pointer;
  margin-right: 6px;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.item-card-bin:hover {
  color: #c0392b;
  border-color: #c0392b;
  background: #fef2f2;
}
.item-card-footer .btn-full { font-size: 13px; }

/* The "Add" button next to the qty stepper is only visible while the user is
   editing the qty input (focus state). Collapses out of the way otherwise so
   the qty stepper takes the full footer width. */
.item-card-footer .item-card-add-edit {
  width: 0;
  min-width: 0;
  margin-left: 0;
  padding-left: 0;
  padding-right: 0;
  opacity: 0;
  overflow: hidden;
  border-width: 0;
  transition: width 0.18s ease, margin 0.18s ease, padding 0.18s ease, opacity 0.15s ease;
  white-space: nowrap;
}
.item-card-footer--editing .item-card-add-edit {
  width: auto;
  margin-left: 8px;
  padding-left: 14px;
  padding-right: 14px;
  opacity: 1;
  border-width: 1.5px;
}
.item-card-footer--editing .qty-control {
  flex: 1 1 auto;
}
.item-card-footer--editing .qty-control .qty-btn {
  width: 0;
  min-width: 0;
  padding: 0;
  border-width: 0;
  opacity: 0;
  overflow: hidden;
  transition: width 0.18s ease, padding 0.18s ease, opacity 0.15s ease;
}
.item-card-footer--editing .qty-input {
  padding-left: 8px;
  padding-right: 8px;
}

.item-card--oos .item-card-footer {
  opacity: 0.45;
  pointer-events: none;
}

.qty-control {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.qty-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  font-weight: 600;
  line-height: 1;
}

.qty-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--accent-light); }

.qty-input {
  flex: 1;
  min-width: 0;
  height: 28px;
  text-align: center;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 2px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  outline: none;
  font-family: inherit;
}

.qty-input:focus { border-color: var(--accent); }

/* Hide the native number-input spinner arrows in all browsers */
.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
}
.qty-input { -moz-appearance: textfield; appearance: textfield; }

/* ─── Cart ────────────────────────────────────────────────── */

.cart-empty {
  text-align: center;
  padding: 28px 16px;
  color: var(--text-light);
}

.cart-empty-icon { font-size: 32px; margin-bottom: 10px; }
.cart-empty p { font-size: 13px; }

.cart-items {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ── Cart tile (mirrors review screen LineItem) ── */
.cart-tile {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  background: #fff;
  border-bottom: 1px solid var(--border-light);
  padding: 6px 10px;
}

.cart-tile:last-child {
  border-bottom: none;
}

/* Left — product image */
.cart-tile-img-wrap {
  flex-shrink: 0;
  width: 72px;
  height: 72px;
}

.cart-tile-img {
  width: 72px;
  height: 72px;
  border-radius: 10px;
  border: 1px solid var(--border-light);
  object-fit: contain;
  background: var(--bg);
}

.cart-tile-img-fallback {
  width: 72px;
  height: 72px;
  border-radius: 10px;
  border: 1px solid var(--border-light);
  background: var(--bg);
  align-items: center;
  justify-content: center;
  font-size: 26px;
}

/* Middle — info */
.cart-tile-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.cart-tile-name-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px;
  line-height: 1.35;
}

.cart-tile-number {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}

.cart-tile-sep {
  font-size: 13px;
  color: var(--text-light);
}

.cart-tile-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.cart-tile-price-row {
  display: flex;
  align-items: baseline;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.cart-tile-price {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.1;
}

.cart-tile-price--qbd { color: var(--success); }

.cart-tile-price-was {
  font-size: 0.75em;
  font-weight: 500;
  color: var(--muted);
  text-decoration: line-through;
  margin-left: 4px;
}

.cart-tile-price-label {
  font-size: 12px;
  color: var(--text-secondary);
}

.cart-tile-qbd-row {
  line-height: 1;
}

.cart-tile--qbd {
  border-color: #86efac;
  background: var(--success-light);
}

.cart-tile-case-inline {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Right — stepper + total + remove */
.cart-tile-right {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.cart-tile-controls {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.cart-tile-stepper {
  display: flex;
  align-items: center;
  gap: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  height: 34px;
}

.cart-tile-step-btn {
  width: 32px;
  height: 34px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.1s;
}

.cart-tile-step-btn:hover { background: rgba(0,59,113,0.08); }

.cart-tile-qty {
  width: 46px;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px 4px;
  background: #fff;
  -moz-appearance: textfield;
}

.cart-tile-qty::-webkit-inner-spin-button,
.cart-tile-qty::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.cart-tile-qty:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(26,94,168,0.10);
}

.cart-tile-total {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
}

.cart-tile-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-light);
  padding: 4px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, background 0.15s;
}

.cart-tile-remove:hover {
  color: var(--error);
  background: rgba(220, 38, 38, 0.08);
}

.cart-page-right {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: sticky;
  top: 68px;
}

#cart-footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cart-empty-btn {
  color: var(--text-secondary);
}

.cart-empty-btn:hover {
  color: var(--error);
}

.cart-total-panel {
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cart-page-header {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 16px;
  align-items: center;
}

.cart-page-header > .cart-page-header-left {
  grid-row: 1;
  grid-column: 1;
  justify-self: start;
}

.cart-page-header > .cart-page-header-empty {
  grid-row: 1;
  grid-column: 1;
  justify-self: end;
}

.cart-page-header > .cart-page-header-delivery {
  grid-row: 1;
  grid-column: 2;
  justify-self: stretch;
  width: 100%;
}

@media (max-width: 860px) {
  .cart-page-header { grid-template-columns: 1fr; }
  .cart-page-header > .cart-page-header-empty,
  .cart-page-header > .cart-page-header-delivery { grid-column: 1; }
}

.cart-page-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.cart-page-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cart-page-header-left h2 {
  margin: 0;
}

.cart-header-delivery {
  font-size: 12px;
  color: var(--text-secondary);
}

.cart-header-delivery strong {
  color: var(--primary);
}

.cart-header-delivery--free {
  color: var(--success);
  font-weight: 700;
  font-size: 12px;
}

.cart-header-delivery--page {
  background: #FEF3C7;
  color: #92400E;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  width: 340px;
  text-align: center;
  display: inline-block;
  box-sizing: border-box;
}

.cart-header-delivery--page strong {
  color: #78350F;
  font-weight: 800;
  font-size: 14px;
}

.cart-header-delivery--page.cart-header-delivery--free {
  background: #D1FAE5;
  color: #065F46;
}

.cart-header-delivery--page.cart-header-delivery--free strong {
  color: #064E3B;
  font-weight: 800;
}


/* Delivery progress bar */
.delivery-progress-wrap {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.delivery-progress-track {
  height: 6px;
  background: var(--border-light);
  border-radius: 99px;
  overflow: hidden;
}

.delivery-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  transition: width 0.4s ease, background 0.3s ease;
}

.delivery-progress-fill.delivery-progress-met {
  background: var(--success);
}

.delivery-progress-label {
  font-size: 13px;
  color: var(--text-secondary);
}

.delivery-label-met {
  color: var(--success);
  font-weight: 600;
}

/* Cart breakdown rows */
.cart-breakdown {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cart-breakdown-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cart-breakdown-label {
  font-size: 13px;
  color: var(--text-secondary);
}

.cart-breakdown-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

#cart-delivery-row {
  margin: 0 -22px;
  padding: 8px 22px;
}

.cart-delivery-row--charged {
  background: #FEF3C7;
  border-radius: 0;
  color: #92400E;
}

.cart-delivery-row--charged .cart-breakdown-label,
.cart-delivery-row--charged .cart-breakdown-value {
  color: #92400E;
  font-weight: 700;
}

.cart-delivery-fee {
  color: #92400E;
  background: #FEF3C7;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
}

.cart-delivery-free {
  color: var(--success);
  font-weight: 700;
}

.cart-breakdown-total {
  padding-top: 8px;
  border-top: 1px solid var(--border-light);
  margin-top: 2px;
}

.cart-total-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.cart-total-amount {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
}

/* ─── Order Confirmation ──────────────────────────────────── */
.confirm-page {
  text-align: center;
  padding: 64px 24px;
  max-width: 500px;
  margin: 0 auto;
}

.confirm-icon {
  width: 80px;
  height: 80px;
  background: var(--success-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  font-size: 36px;
  border: 2px solid rgba(5,150,105,0.2);
}

.confirm-page h2 {
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
}

.confirm-page p {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.confirm-order-number {
  display: inline-block;
  background: var(--accent-light);
  color: var(--primary);
  font-weight: 700;
  font-size: 18px;
  padding: 10px 28px;
  border-radius: 6px;
  margin: 16px 0 32px;
  border: 1px solid var(--border);
  letter-spacing: 0.5px;
}

/* ─── Loading & Empty States ──────────────────────────────── */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  flex-direction: column;
  gap: 16px;
  color: var(--text-secondary);
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 56px 24px;
  color: var(--text-secondary);
}
.empty-state-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--bg-secondary, #f0f4f8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin-bottom: 20px;
  border: 1px solid var(--border-light);
}
.empty-state h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}
.empty-state p {
  font-size: 13px;
  line-height: 1.6;
  max-width: 280px;
  color: var(--text-secondary);
}

/* ─── Table ───────────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table th {
  text-align: left;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-secondary);
  border-bottom: 2px solid var(--border);
}

.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text);
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg); }

/* ─── Chips / Tags ────────────────────────────────────────── */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.chip-blue { background: var(--accent-light); color: var(--primary); }
.chip-green { background: var(--success-light); color: var(--success); }
.chip-yellow { background: var(--warning-light); color: var(--warning); }

/* ─── Modal ───────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 24px;
}

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 500px;
  width: 100%;
  box-shadow: var(--shadow-lg);
}

.modal h3 { font-size: 20px; font-weight: 700; margin-bottom: 20px; color: var(--text); }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; }

/* ─── Breadcrumbs ─────────────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 10px;
  flex-wrap: wrap;
  padding-left: 14px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

.breadcrumb-sep { opacity: 0.35; }
.breadcrumb a { color: var(--accent); }
.breadcrumb-current { color: var(--text); font-weight: 600; }

/* ─── Footer ──────────────────────────────────────────────── */
.portal-footer {
  border-top: 1px solid var(--border-light);
  padding: 20px 28px;
  padding-bottom: calc(20px + env(safe-area-inset-bottom));
  text-align: center;
  background: var(--surface);
}

.portal-footer p {
  font-size: 12px;
  color: var(--text-light);
}

.portal-footer a {
  color: var(--accent);
  font-weight: 500;
}

/* ─── Misc ────────────────────────────────────────────────── */
.divider {
  border: none;
  border-top: 1px solid var(--border-light);
  margin: 16px 0;
}

.text-muted { color: var(--text-secondary); font-size: 13px; }
.text-sm { font-size: 13px; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }

/* ── Order Details View ─────────────────────────────────────────────────────── */
.order-details-layout {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 16px 40px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.od-section { }
.od-submit {
  margin-top: 4px;
}
.form-label-opt {
  font-weight: 400;
  color: var(--text-light);
}


/* ── Delivery Address Card ──────────────────────────────────────────────────── */
.ship-to-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px 14px;
}
.ship-to-card-content {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ship-to-icon { font-size: 16px; flex-shrink: 0; }
.ship-to-text { flex: 1; min-width: 0; overflow: visible; }
.ship-to-name { font-weight: 600; font-size: 14px; color: var(--text); }
.ship-to-line { font-size: 13px; color: var(--text-secondary); margin-top: 2px; line-height: 1.4; }
.ship-to-loading { font-size: 12px; color: var(--text-secondary); flex-shrink: 0; }
.ship-to-change-btn {
  background: none;
  border: 1px solid var(--primary);
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  flex-shrink: 0;
  white-space: nowrap;
}
.ship-to-change-btn:hover { background: var(--primary); color: #fff; }

/* ── Address Picker Modal ───────────────────────────────────────────────────── */
.address-picker-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.address-picker-sheet {
  background: var(--surface);
  border-radius: 16px;
  width: 100%;
  max-width: 520px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0,0,0,0.25);
}
.address-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border-light);
}
.address-picker-title { font-weight: 700; font-size: 16px; color: var(--text); }
.address-picker-close {
  background: none;
  border: none;
  font-size: 18px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1;
}
.address-picker-close:hover { background: var(--bg); }
.address-picker-list {
  overflow-y: auto;
  padding: 8px 12px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.address-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  background: none;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 12px 14px;
  cursor: pointer;
  transition: background 0.1s, border-color 0.1s;
}
.address-option:hover { background: var(--bg); }
.address-option--selected { border-color: var(--primary); background: var(--accent-light, #EBF2FB); }
.address-option-radio {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.address-option-radio--selected {
  border-color: var(--primary);
  background: var(--primary);
  box-shadow: inset 0 0 0 3px var(--surface);
}
.address-option-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.address-option-name { font-weight: 600; font-size: 14px; color: var(--text); }
.address-option-detail { font-size: 12px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }



/* ── Order Details action row (total + button) ─────────────────────────────── */
.od-action-row {
  display: flex;
  align-items: center;
  gap: 16px;
}
.od-action-total {
  flex: 1 1 50%;
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.od-total-heading {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin-bottom: 2px;
}
.od-total-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}
.od-total-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}
.od-action-row .od-submit {
  flex: 1 1 50%;
  white-space: nowrap;
}

/* ── Optional info section — thinner inputs ────────────────────────────────── */
.od-section .form-input { padding: 8px 12px; }

/* ── Date trigger button ────────────────────────────────────────────────────── */
.date-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
  text-align: left;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.date-trigger:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(26,94,168,0.10);
}
.date-trigger:hover { border-color: var(--primary); }
.date-trigger-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  color: var(--text-secondary);
}
.date-trigger-placeholder { color: var(--text-light); flex: 1; }
.date-trigger span:not(.date-trigger-placeholder):not(.date-trigger-clear) { flex: 1; }
.date-trigger-clear {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--border);
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}
.date-trigger-clear:hover { background: var(--border-light); color: var(--text); }

/* ── Calendar popup ─────────────────────────────────────────────────────────── */
#date-picker-modal { align-items: center; }
.cal-panel {
  background: var(--surface);
  border-radius: 14px;
  padding: 20px;
  width: 320px;
  max-width: 94vw;
  box-shadow: 0 8px 40px rgba(0,0,0,0.18);
}
.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.cal-month-label {
  font-weight: 700;
  font-size: 16px;
  color: var(--text);
}
.cal-nav {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 34px;
  height: 34px;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s;
}
.cal-nav:hover { background: var(--bg); }
.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  margin-bottom: 6px;
}
.cal-weekdays span {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 4px 0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.cal-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 14px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text);
  transition: background 0.12s, color 0.12s;
}
.cal-day:hover:not(.cal-day--past) { background: var(--bg); }
.cal-day--today {
  font-weight: 700;
  color: var(--primary);
}
.cal-day--selected {
  background: var(--primary) !important;
  color: #fff !important;
  font-weight: 700;
}
.cal-day--past {
  color: var(--text-light);
  cursor: default;
  pointer-events: none;
}
.cal-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 16px;
  gap: 8px;
}
#view-login, #view-catalogue, #view-order-details, #view-confirm {
  display: none;
}

/* ─── Product detail modal ──────────────────────────────────────────────── */
.item-card-clickable { cursor: pointer; }

.product-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(13, 28, 60, 0.55);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: pm-fade-in 0.15s ease;
}
@keyframes pm-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.product-modal {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 640px;
  width: 100%;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  animation: pm-slide-up 0.2s ease;
}
@keyframes pm-slide-up {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.product-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.06);
  font-size: 22px;
  line-height: 1;
  color: var(--text);
  cursor: pointer;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}
.product-modal-close:hover { background: rgba(0,0,0,0.12); }

.product-modal-loading,
.product-modal-error {
  padding: 64px 24px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
}

.pm-image-wrap {
  width: 100%;
  height: 240px;
  background: #fff;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.pm-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  cursor: zoom-in;
  transition: opacity 0.15s;
}
.pm-image:hover { opacity: 0.88; }

/* Lightbox */
#portal-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100001;
  background: rgba(0,0,0,0.92);
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}
#portal-lightbox.active { display: flex; }
#portal-lightbox img {
  max-width: 92vw;
  max-height: 92vh;
  object-fit: contain;
  border-radius: 6px;
  pointer-events: none;
}
#portal-lightbox-close {
  position: fixed;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
#portal-lightbox-close:hover { background: rgba(255,255,255,0.28); }
.pm-image-placeholder {
  font-size: 64px;
  opacity: 0.3;
}

.pm-body { padding: 20px; }

.pm-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.pm-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}
.pm-number { font-weight: 600; color: var(--text); }
.pm-meta-sep { color: var(--text-light); }

.pm-price-card {
  display: flex;
  align-items: stretch;
  gap: 16px;
  background: var(--accent-light);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 16px;
}
.pm-price-card--qbd {
  background: var(--success-light);
  border-color: #86efac;
}

.pm-price-left { flex: 1; min-width: 0; }
.pm-price-divider {
  width: 1px;
  background: var(--border);
  align-self: stretch;
}
.pm-price-right {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  justify-content: center;
}

.pm-price-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.pm-price-amount {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
}
.pm-price-card--qbd .pm-price-amount { color: var(--success); }
.pm-price-unit {
  font-size: 11px;
  color: var(--text-secondary);
}
.pm-price-original {
  font-size: 11px;
  color: var(--success);
  margin-top: 2px;
}
.pm-case-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}
.pm-case-sep { color: var(--text-light); }

.pm-qty-control {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px;
}
.pm-qty-btn {
  width: 30px;
  height: 30px;
  border: none;
  background: transparent;
  font-size: 18px;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  border-radius: 4px;
}
.pm-qty-btn:hover { background: var(--bg); }
.pm-qty-input {
  width: 48px;
  height: 30px;
  text-align: center;
  border: none;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  background: transparent;
}
.pm-qty-input:focus { outline: none; }

.pm-add-btn {
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.pm-oos-note {
  margin-top: 12px;
  font-size: 12px;
  color: var(--error);
  font-weight: 600;
}

.pm-stock {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 4px;
}
.pm-stock--in { background: #DCFCE7; color: #166534; }
.pm-stock--out { background: #FEE2E2; color: #991B1B; }

.pm-po {
  font-size: 11px;
  color: #92400E;
}
.pm-po-label {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}

.pm-section { margin-top: 16px; }
.pm-section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.pm-tiers {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.pm-tier {
  display: flex;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  font-size: 13px;
}
.pm-tier-label { color: var(--text); }
.pm-tier-price { font-weight: 600; color: var(--primary); }
.pm-tier--active {
  background: var(--success-light);
  border: 1px solid #86efac;
}
.pm-tier--active .pm-tier-label,
.pm-tier--active .pm-tier-price { color: var(--success); }

.pm-spec {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 13px;
  border-bottom: 1px solid var(--border-light);
}
.pm-spec:last-child { border-bottom: none; }
.pm-spec span:first-child { color: var(--text-secondary); }
.pm-spec span:last-child { color: var(--text); font-weight: 600; }

@media (max-width: 540px) {
  .product-modal-overlay { padding: 0; }
  .product-modal {
    max-height: 100vh;
    height: 100vh;
    border-radius: 0;
  }
  .pm-image-wrap { border-radius: 0; }
  .pm-price-card {
    flex-direction: column;
    gap: 12px;
  }
  .pm-price-divider {
    width: auto;
    height: 1px;
  }
  .pm-price-right {
    width: 100%;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
  }
}

/* ─── Sign-in popup ──────────────────────────────────────────────────────── */
.signin-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 9000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  animation: fadein 0.15s ease;
}
.signin-popup-modal {
  background: var(--surface);
  border-radius: 16px;
  width: 100%;
  max-width: 500px;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  animation: popup-in 0.18s ease;
  overflow: hidden;
  margin: auto;
}
/* Navy header — mirrors auth-brand-panel */
.signin-popup-header {
  background: var(--primary);
  padding: 12px 24px;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}
.signin-popup-header::before {
  content: '';
  position: absolute;
  top: -80px; right: -80px;
  width: 260px; height: 260px;
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
}
.signin-popup-header::after {
  content: '';
  position: absolute;
  bottom: -60px; left: -60px;
  width: 200px; height: 200px;
  background: rgba(255,255,255,0.04);
  border-radius: 50%;
}
/* Reuse auth-brand-logo inside the popup header */
.signin-popup-header .auth-brand-logo { margin-bottom: 0; position: relative; z-index: 1; }
.signin-popup-header .auth-brand-logo img { height: 30px; }
.signin-popup-header .auth-brand-logo-text strong { font-size: 14px; }
.signin-popup-title {
  padding: 18px 24px 0;
  background: var(--surface);
}
.signin-popup-title h2 {
  font-size: 19px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  margin: 0;
}
.signin-popup-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: rgba(255,255,255,0.12);
  border: none;
  font-size: 18px;
  color: rgba(255,255,255,0.8);
  cursor: pointer;
  line-height: 1;
  padding: 3px 7px;
  border-radius: 6px;
  z-index: 2;
}
.signin-popup-close:hover { background: rgba(255,255,255,0.22); color: white; }
.signin-popup-body {
  padding: 22px 24px 20px;
}

/* Small screens — compress popup header further */
@media (max-width: 480px) {
  .signin-popup-overlay { padding: 10px; }
  .signin-popup-header { padding: 10px 16px; }
  .signin-popup-header .auth-brand-logo { margin-bottom: 0; }
  .signin-popup-header .auth-brand-logo img { height: 24px; }
  .signin-popup-header .auth-brand-logo-text strong { font-size: 13px; }
  .signin-popup-title { padding: 14px 16px 0; }
  .signin-popup-title h2 { font-size: 16px; }
  .signin-popup-body { padding: 18px 16px 16px; }
}
.signin-popup-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.signin-popup-body .signin-popup-form-row .form-group {
  margin-bottom: 0;
}

/* ─── Admin login page ──────────────────────────────────────── */
.admin-auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 20px;
}
.admin-auth-card {
  width: 100%;
  max-width: 420px;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.18);
  overflow: hidden;
  background: var(--surface);
}

/* ─── Popup form — slightly smaller fields & buttons ────────── */
.signin-popup-body .btn-lg {
  padding: 10px 18px;
  font-size: 13.5px;
}
.signin-popup-body .btn {
  font-size: 13px;
  padding: 9px 16px;
}
.signin-popup-body .form-group {
  margin-bottom: 13px;
}
.signin-popup-body .form-label {
  font-size: 11.5px;
  margin-bottom: 5px;
}
.signin-popup-body .form-input {
  padding: 8px 11px;
  font-size: 13px;
}
.signin-popup-body .req-field-error {
  font-size: 10.5px !important;
}
