/* PrebMart web — same palette, shapes and type as the Android app (Theme.kt). */
:root {
  --brand: #0C831F; --brand-dark: #086417; --sunny: #F8CB46; --sunny-light: #FFF4CF; --ink: #1C1C1C; --warn: #E37400;
  --primary: #0C831F; --on-primary: #fff; --primary-container: #E5F3E7; --on-primary-container: #07390F;
  --secondary: #5B6270; --secondary-container: #EDEFF4;
  --tertiary: #256FD6; --tertiary-container: #E3EEFD; --on-tertiary-container: #0B2C5C;
  --bg: #F4F6FA; --on-bg: #1C1C1C; --muted: #666D78; --surface-variant: #EDEFF4;
  --outline: #B9BEC7; --outline-variant: #E3E6EC;
  --card: #FFFFFF; --container-high: #F0F2F6; --container-highest: #E8EBF0;
  --error: #D93025; --error-container: #FDECEA;
  --prime-fg: #5C4500; --prime-bg: #FFF4CF;
  --r-s: 10px; --r-m: 16px; --r-l: 20px;
  --nav-h: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --primary: #5FD27A; --on-primary: #00390F; --primary-container: #14361B; --on-primary-container: #B7F2C3;
    --secondary: #B9C0CC; --secondary-container: #2A2F37;
    --tertiary: #8DB8F5; --tertiary-container: #1C2E4A; --on-tertiary-container: #D6E6FD;
    --bg: #0F1113; --on-bg: #E6E8EB; --muted: #A3A9B3; --surface-variant: #262A30;
    --outline: #545A63; --outline-variant: #2E333A;
    --card: #1B1E23; --container-high: #23272D; --container-highest: #2C3037;
    --error: #F28B82; --error-container: #3B1B19; --warn: #F5A14A;
    --prime-fg: #FFE08A; --prime-bg: #3A3013; --ink: #E6E8EB;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--on-bg);
  font-family: Roboto, "Noto Sans", "Noto Sans Devanagari", "Noto Sans Bengali", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--primary); }
hr { border: 0; border-top: 1px solid var(--outline-variant); margin: 4px 0; width: 100%; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ---------- type */
.title-l { font-size: 22px; font-weight: 700; }
.title-m { font-size: 16px; font-weight: 700; }
.title-s { font-size: 14px; font-weight: 700; }
.headline { font-size: 24px; font-weight: 800; line-height: 1.25; }
.display { font-size: 32px; font-weight: 800; line-height: 1.15; }
.body-l { font-size: 16px; }
.body-m { font-size: 14px; }
.body-s { font-size: 12.5px; }
.label-m { font-size: 12.5px; font-weight: 600; }
.label-s { font-size: 11.5px; font-weight: 600; }
.muted { color: var(--muted); }
.bold { font-weight: 700; }
.center-text { text-align: center; }
.c-primary { color: var(--primary); } .c-brand { color: var(--brand); }
.c-error { color: var(--error); } .c-warn { color: var(--warn); } .c-tertiary { color: var(--tertiary); }
.ink { color: var(--ink); }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 0; }
.block { display: block; }
.left { text-align: left; }
p { margin: 0; }

/* ---------- layout helpers */
.row { display: flex; } .wrap { flex-wrap: wrap; } .center { align-items: center; } .between { justify-content: space-between; }
.grow { flex: 1 1 auto; min-width: 0; }
.gap4 { gap: 4px; } .gap6 { gap: 6px; } .gap8 { gap: 8px; } .gap12 { gap: 12px; } .gap16 { gap: 16px; }
.stack4 { display: flex; flex-direction: column; gap: 4px; }
.stack8 { display: flex; flex-direction: column; gap: 8px; }
.stack12 { display: flex; flex-direction: column; gap: 12px; }
.stack16 { display: flex; flex-direction: column; gap: 16px; }
.pad12 { padding: 12px; } .pad16 { padding: 16px; } .px16 { padding-left: 16px; padding-right: 16px; }
.mx16 { margin-left: 16px; margin-right: 16px; } .my8 { margin-top: 8px; margin-bottom: 8px; }
.mt4 { margin-top: 4px; } .mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; } .mb16 { margin-bottom: 16px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 640px) { .grid4 { grid-template-columns: repeat(6, minmax(0, 1fr)); } }

/* ---------- app frame: bottom tabs on phones, side rail on wide screens */
#app { min-height: 100vh; }
.frame { min-height: 100vh; }
.frame.has-tabs { padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); }
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; background: var(--card); border-top: 1px solid var(--outline-variant);
  height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
}
.tab {
  flex: 1 1 0; border: 0; background: none; cursor: pointer; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2px; color: var(--muted); font-size: 12px; font-weight: 500;
  text-decoration: none; position: relative; min-height: 44px;
}
.tab .pill { padding: 3px 18px; border-radius: 16px; display: flex; position: relative; }
.tab.on { color: var(--primary); font-weight: 700; }
.tab.on .pill { background: var(--primary-container); }
.badge {
  position: absolute; top: -4px; right: 6px; min-width: 18px; height: 18px; border-radius: 9px; padding: 0 5px;
  background: var(--error); color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.rail-logo { display: none; }
@media (min-width: 1024px) {
  .frame.has-tabs { padding-bottom: 0; padding-left: 220px; }
  .tabs {
    top: 0; bottom: 0; right: auto; width: 220px; height: auto; flex-direction: column; justify-content: flex-start;
    border-top: 0; border-right: 1px solid var(--outline-variant); padding: 16px 12px; gap: 4px;
  }
  .rail-logo { display: block; padding: 4px 8px 20px; }
  .tab { flex: 0 0 auto; flex-direction: row; justify-content: flex-start; gap: 12px; padding: 10px 12px; border-radius: 12px; font-size: 15px; }
  .tab .pill { padding: 0; background: none !important; }
  .tab.on { background: var(--primary-container); }
}

/* ---------- screen scaffold */
.screen { max-width: 760px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; }
.screen.wide { max-width: 1100px; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 8px;
  min-height: 60px; padding: 8px 12px; background: var(--bg);
}
.topbar.scrolled, .topbar { backdrop-filter: saturate(1.2); }
.topbar .title { font-size: 20px; font-weight: 700; margin: 0; flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .title.large { font-size: 24px; font-weight: 800; }
.topbar .actions { display: flex; align-items: center; gap: 4px; }
.screen-body { flex: 1 1 auto; padding-bottom: 24px; }
.screen-bottom {
  position: sticky; bottom: 0; z-index: 15; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 70%, transparent);
}
.frame.has-tabs .screen-bottom { bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); }
@media (min-width: 1024px) { .frame.has-tabs .screen-bottom { bottom: 0; } }

.icon-btn {
  width: 44px; height: 44px; border-radius: 22px; border: 0; background: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; color: var(--on-bg); flex: 0 0 auto;
}
.icon-btn:hover { background: var(--container-high); }
.icon { flex: 0 0 auto; }

/* ---------- states */
.loading { display: flex; justify-content: center; padding-top: 48px; }
.spinner { width: 36px; height: 36px; border-radius: 50%; border: 3.5px solid var(--primary-container); border-top-color: var(--primary); animation: spin .8s linear infinite; display: inline-block; }
.spinner.small { width: 22px; height: 22px; border-width: 2.5px; border-color: rgba(255,255,255,.4); border-top-color: currentColor; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { text-align: center; padding: 40px 32px; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.empty-title { font-size: 16px; font-weight: 700; }
.empty-sub { color: var(--muted); font-size: 14px; max-width: 420px; }
.empty-action { margin-top: 8px; }
.section-label { font-size: 16px; font-weight: 700; margin: 0; padding: 20px 16px 8px; }

/* ---------- buttons */
.btn {
  border: 0; border-radius: 26px; cursor: pointer; font-weight: 700; font-size: 14.5px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 22px; min-height: 44px; text-decoration: none;
}
.btn.block { width: 100%; min-height: 52px; }
.btn.small { min-height: 38px; padding: 0 16px; font-size: 13.5px; }
.btn.primary { background: var(--primary); color: var(--on-primary); }
.btn.primary:hover:not(:disabled) { filter: brightness(.95); }
.btn.outline { background: transparent; color: var(--primary); border: 1px solid var(--outline); }
.btn.tonal { background: var(--primary-container); color: var(--on-primary-container); }
.btn.danger { background: var(--error); color: #fff; }
.btn.danger-outline { background: transparent; color: var(--error); border: 1px solid var(--error); }
.btn:disabled { opacity: .5; cursor: default; }
.text-btn { border: 0; background: none; color: var(--primary); font-weight: 700; padding: 10px 12px; border-radius: 20px; cursor: pointer; min-height: 44px; }
.text-btn:hover { background: var(--primary-container); }
.text-btn.danger { color: var(--error); }
.text-btn:disabled { opacity: .5; }

/* ---------- cards */
.card { background: var(--card); border: 1px solid var(--outline-variant); border-radius: var(--r-m); overflow: hidden; }
.card.clickable { cursor: pointer; transition: border-color .15s; }
.card.clickable:hover { border-color: var(--outline); }
.order-card { margin: 6px 16px; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.avatar { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-weight: 800; flex: 0 0 auto; background: currentColor; }
.avatar { position: relative; overflow: hidden; }
.avatar.c-error { background: color-mix(in srgb, var(--error) 12%, transparent); }
.avatar.c-primary { background: color-mix(in srgb, var(--primary) 12%, transparent); }
.avatar.c-warn { background: color-mix(in srgb, var(--warn) 12%, transparent); }
.avatar.c-tertiary { background: color-mix(in srgb, var(--tertiary) 12%, transparent); }
.status-chip { border-radius: 99px; padding: 4px 10px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.status-chip.c-error { background: color-mix(in srgb, var(--error) 12%, transparent); }
.status-chip.c-primary { background: color-mix(in srgb, var(--primary) 12%, transparent); }
.status-chip.c-warn { background: color-mix(in srgb, var(--warn) 12%, transparent); }
.status-chip.c-tertiary { background: color-mix(in srgb, var(--tertiary) 12%, transparent); }
.info-pill { border-radius: 6px; padding: 3px 7px; font-size: 11.5px; font-weight: 700; white-space: nowrap; background: var(--surface-variant); color: var(--muted); }
.info-pill.tone-primary { background: var(--primary-container); color: var(--on-primary-container); }
.info-pill.tone-prime { background: var(--prime-bg); color: var(--prime-fg); }
.info-pill.tone-warn { background: color-mix(in srgb, var(--warn) 15%, transparent); color: var(--warn); }
.info-pill.tone-error { background: var(--error-container); color: var(--error); }
.bill-row { display: flex; justify-content: space-between; font-size: 14px; }
.bill-row.bold { font-weight: 700; }

/* ---------- products */
.product-img { border-radius: 12px; background: var(--surface-variant); display: flex; align-items: center; justify-content: center; overflow: hidden; flex: 0 0 auto; color: var(--muted); }
.product-img img { width: 100%; height: 100%; object-fit: cover; }
.product-row { display: flex; align-items: center; gap: 12px; padding: 10px 16px; }
.add-btn {
  min-width: 76px; height: 36px; border-radius: 10px; border: 1px solid var(--primary); color: var(--primary); cursor: pointer;
  background: color-mix(in srgb, var(--primary-container) 35%, transparent); font-weight: 800; font-size: 14px; padding: 0 18px;
}
.stepper { display: inline-flex; align-items: center; background: var(--primary); color: var(--on-primary); border-radius: 10px; height: 36px; }
.stepper button { width: 36px; height: 36px; border: 0; background: none; color: inherit; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.stepper button:disabled { opacity: .45; }
.stepper span { min-width: 20px; text-align: center; font-weight: 700; }
.cart-bar {
  width: 100%; height: 56px; border: 0; border-radius: 16px; background: var(--primary); color: var(--on-primary);
  display: flex; align-items: center; gap: 12px; padding: 0 16px; cursor: pointer; box-shadow: 0 6px 18px rgba(0,0,0,.18);
}
.cat-icon { border-radius: 16px; display: flex; align-items: center; justify-content: center; overflow: hidden; flex: 0 0 auto; }
.cat-icon img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }

/* ---------- forms */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; color: var(--muted); }
.field-box { display: flex; align-items: center; background: var(--card); border: 1px solid var(--outline); border-radius: 12px; }
.field-box:focus-within { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.field-box input, .field-box textarea { flex: 1 1 auto; border: 0; outline: 0; background: transparent; padding: 13px 14px; min-width: 0; font-size: 16px; }
.field-box textarea { resize: vertical; }
.field-box .prefix { padding-left: 14px; color: var(--muted); font-weight: 600; }
.field-hint { font-size: 12.5px; color: var(--muted); }
.field-error { font-size: 12.5px; color: var(--error); }
select { border: 1px solid var(--outline); border-radius: 10px; background: var(--card); padding: 10px 12px; min-height: 44px; }
.picker-row, .switch-row, .radio-row, .list-row {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px; min-height: 52px; width: 100%;
  border: 0; background: none; text-align: left; cursor: pointer;
}
.list-row:hover, .radio-row:hover { background: var(--container-high); }
div.list-row { cursor: default; }
div.list-row:hover { background: none; }
.list-icon { color: var(--muted); display: flex; }
.switch-row input[type=checkbox] {
  appearance: none; width: 48px; height: 28px; border-radius: 14px; background: var(--container-highest); border: 2px solid var(--outline);
  position: relative; cursor: pointer; flex: 0 0 auto; transition: background .15s;
}
.switch-row input[type=checkbox]::after { content: ''; position: absolute; top: 4px; left: 4px; width: 16px; height: 16px; border-radius: 50%; background: var(--outline); transition: all .15s; }
.switch-row input[type=checkbox]:checked { background: var(--primary); border-color: var(--primary); }
.switch-row input[type=checkbox]:checked::after { left: 22px; top: 2px; width: 20px; height: 20px; background: var(--on-primary); }
.radio-row input { width: 20px; height: 20px; accent-color: var(--primary); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  border: 1px solid var(--outline); background: var(--card); border-radius: 10px; padding: 7px 14px; cursor: pointer;
  white-space: nowrap; font-size: 13.5px; font-weight: 600; min-height: 36px;
}
.chip.on { background: var(--primary-container); border-color: var(--primary); color: var(--on-primary-container); }

/* ---------- dialog & toast */
.dialog { border: 0; border-radius: 28px; padding: 0; background: var(--card); color: var(--on-bg); max-width: min(92vw, 460px); width: 100%; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.dialog::backdrop { background: rgba(0,0,0,.4); }
.dialog-inner { padding: 24px; display: flex; flex-direction: column; gap: 16px; max-height: 85vh; }
.dialog-title { margin: 0; font-size: 22px; font-weight: 700; }
.dialog-body { overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 4px; flex-wrap: wrap; }
#pm-toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + 24px); transform: translateX(-50%) translateY(20px); z-index: 100;
  background: #2D3036; color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 14px; max-width: min(92vw, 520px);
  opacity: 0; pointer-events: none; transition: all .2s; box-shadow: 0 8px 24px rgba(0,0,0,.25);
}
#pm-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- logo */
.logo { display: inline-flex; align-items: center; gap: calc(var(--s) * .28); flex: 0 0 auto; }
.logo-tile { width: var(--s); height: var(--s); display: block; flex: 0 0 auto; }
.logo-name { font-weight: 900; font-size: calc(var(--s) * .72); letter-spacing: -0.5px; line-height: 1; }
@media (prefers-color-scheme: dark) { .logo-name .ink { color: #F2F3F5; } }

/* ---------- misc */
.sunny-header { background: var(--sunny); color: #1C1C1C; }
@media (prefers-color-scheme: dark) { .sunny-header { background: #3A3013; color: var(--on-bg); } }
.banner { margin: 8px 16px; padding: 12px 14px; border-radius: 12px; font-size: 14px; display: flex; gap: 10px; align-items: flex-start; }
.banner.info { background: var(--tertiary-container); color: var(--on-tertiary-container); }
.banner.warn { background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--on-bg); }
.banner.error { background: var(--error-container); color: var(--error); }
.banner.success { background: var(--primary-container); color: var(--on-primary-container); }
.scroll-x { display: flex; gap: 12px; overflow-x: auto; padding: 4px 16px 8px; scrollbar-width: thin; }
.divider { height: 1px; background: var(--outline-variant); margin: 0 16px; }
.boot { min-height: 100vh; display: flex; align-items: center; justify-content: center; }

/* =====================================================================
   WEBSITE LAYOUT (laptops & desktops, 1024px+): top header, wide pages, footer.
   Phones and tablets keep the app layout with bottom tabs.
   ===================================================================== */
:root { --site-h: 0px; }
.site-header, .site-footer, .site-hero-wrap, .desktop-only { display: none; }
.site-pre { white-space: pre-line; }

@media (min-width: 1024px) {
  :root { --site-h: 80px; }
  body { background: #fff; }
 @media (prefers-color-scheme: dark) { body { background: var(--bg); } }

  /* hide the app-only parts */
  .tabs, .screen-logo, .site-main .buyer-header, .site-main .buyer-promo, .mobile-only { display: none !important; }
  .frame.has-tabs { padding: 0; }
  .desktop-only { display: block; }
  #pm-toast { bottom: 32px; }

  /* ---------- header */
  .site-header { display: block; position: sticky; top: 0; z-index: 40; background: var(--card); border-bottom: 1px solid var(--outline-variant); }
  .site-header-inner { height: var(--site-h); max-width: 1440px; margin: 0 auto; padding: 0 28px; display: flex; align-items: center; gap: 20px; }
  .site-logo { text-decoration: none; padding-right: 20px; height: 100%; display: flex; align-items: center; border-right: 1px solid var(--outline-variant); flex: 0 0 auto; }
  .site-loc { border: 0; background: none; color: inherit; cursor: pointer; text-align: left; display: flex; flex-direction: column; gap: 2px; max-width: 260px; flex: 0 0 auto; padding: 6px 8px; border-radius: 10px; }
  .site-loc:hover { background: var(--container-high); }
  .site-loc-top { font-size: 17px; font-weight: 800; white-space: nowrap; }
  .site-loc-place { display: flex; align-items: center; gap: 2px; font-size: 13.5px; min-width: 0; }
  .site-search { flex: 1 1 auto; max-width: 720px; display: flex; align-items: center; gap: 10px; height: 50px; padding: 0 6px 0 16px; border-radius: 12px; background: var(--container-high); border: 1px solid var(--outline-variant); color: var(--muted); }
  .site-search:focus-within { border-color: var(--primary); background: var(--card); }
  .site-search input { flex: 1 1 auto; border: 0; outline: 0; background: transparent; font-size: 15px; color: var(--on-bg); min-width: 0; height: 100%; }
  .site-search input::-webkit-search-cancel-button { display: none; }
  .site-role { font-weight: 700; color: var(--muted); white-space: nowrap; }
  .site-nav { display: flex; align-items: center; gap: 4px; }
  .site-link { display: inline-flex; align-items: center; gap: 6px; padding: 10px 14px; border-radius: 10px; color: var(--on-bg); text-decoration: none; font-weight: 600; font-size: 15px; border: 0; background: none; cursor: pointer; white-space: nowrap; min-height: 44px; }
  .site-link:hover { background: var(--container-high); }
  .site-link.on { color: var(--primary); background: var(--primary-container); }
  .site-login { font-size: 17px; font-weight: 500; }
  .site-account { max-width: 200px; }
  .site-cart { display: inline-flex; align-items: center; gap: 10px; height: 52px; padding: 0 18px; border-radius: 10px; border: 0; cursor: pointer; font-weight: 800; font-size: 15px; background: var(--container-highest); color: var(--muted); flex: 0 0 auto; }
  .site-cart.full { background: var(--primary); color: #fff; }
  .site-cart.full:hover { filter: brightness(.95); }
  .site-cart-text { text-align: left; font-size: 13.5px; line-height: 1.25; }
  .site-menu { position: relative; }
  .site-dropdown { position: absolute; right: 0; top: calc(100% + 8px); min-width: 240px; background: var(--card); border: 1px solid var(--outline-variant); border-radius: 14px; box-shadow: 0 12px 32px rgba(0,0,0,.14); padding: 6px; z-index: 50; }
  .site-dropdown-head { padding: 10px 12px; border-bottom: 1px solid var(--outline-variant); margin-bottom: 4px; }
  .site-dropdown button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 0; background: none; border-radius: 10px; cursor: pointer; text-align: left; font-size: 14.5px; min-height: 44px; }
  .site-dropdown button:hover { background: var(--container-high); }

  /* ---------- page widths */
  .site-main { min-height: calc(100vh - var(--site-h) - 160px); }
  .screen { max-width: 960px; min-height: 0; padding: 0 32px; }
  .screen.wide { max-width: 1280px; }
  .screen.narrow { max-width: 720px; }
  .topbar { position: static; padding: 28px 0 12px; background: none; min-height: 0; }
  .topbar .title, .topbar .title.large { font-size: 28px; font-weight: 800; }
  .screen-bottom { padding-left: 0; padding-right: 0; }

  /* two columns: main + sticky side (cart, checkout) */
  .cols { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 28px; align-items: start; }
  .cols-side { position: sticky; top: calc(var(--site-h) + 16px); }
  .cols .section-label { padding: 0 2px 12px; font-size: 18px; }
  .cols .mx16 { margin-left: 0; margin-right: 0; }
  /* only page-level wrappers lose their side padding — never the inside of a card */
  .cols-main > .px16, .cols-side > .px16, .cols-main > .pad16, .cols-side > .pad16,
  .cols .orders-checkout > .px16, .cols .orders-checkout > .pad16 { padding-left: 0; padding-right: 0; }
  .cols .card.pad16 { padding: 18px 20px; }
  .cols-side .btn.block { border-radius: 12px; min-height: 54px; font-size: 16px; }
  .cols-side > .stack8.pad16 { padding-top: 16px; }
  /* cart lines: header row + line totals */
  .cart-head { display: flex; align-items: baseline; gap: 10px; padding: 16px 20px 6px; }
  .cart-head .title-m { font-size: 18px; }
  .cart-card .product-row { padding: 14px 20px; gap: 16px; }
  .cart-card .divider { margin: 0 20px; }
  .row-total { min-width: 84px; text-align: right; font-weight: 800; font-size: 16px; }
  .cols .orders-policy { padding: 0 4px; }

  /* card grids (orders, shops, products, people) */
  .site-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 4px 16px 16px; }
  .screen.wide .site-card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .site-card-grid > * { margin: 0 !important; }
  .site-card-grid.tight > * { border: 1px solid var(--outline-variant); border-radius: var(--r-m); background: var(--card); }
  .site-card-grid > .card.clickable:hover, .site-card-grid.tight > *:hover { box-shadow: 0 6px 18px rgba(0,0,0,.08); }

  /* ---------- buyer home: hero, promo cards, categories, shops */
  .page-home .buyer-home { max-width: 1280px; padding: 0 32px; }
  .page-home .buyer-home-body > .mt8 .section-label { font-size: 22px; padding: 28px 0 12px; }
  .page-home .buyer-cat-grid3 { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 18px 16px; padding: 0; }
  .page-home .buyer-cat-name { font-size: 14px; line-height: 18px; min-height: 36px; }
  .page-home .buyer-near-head { padding: 28px 0 12px; }
  .page-home .buyer-near-head h2 { font-size: 22px; }
  .site-main .buyer-store-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .site-main .buyer-store-grid > * { margin: 0 !important; }
  .site-main .buyer-store-grid > .card.clickable:hover { box-shadow: 0 8px 22px rgba(0,0,0,.08); }
  .site-main .buyer-cats-page .buyer-sec-title { padding-left: 0; }
  .site-main .buyer-cats-page .buyer-cat-grid4 { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 18px 16px; padding: 0; }

  /* ---------- shop page */
  .site-main .store-screen { max-width: 1280px; padding: 0 32px; background: transparent; }
  .site-main .store-topbar { top: var(--site-h); padding: 10px 0; border-bottom: 1px solid var(--outline-variant); background: var(--card); }
  .site-main .store-title { font-size: 24px !important; }
  .site-main .store-rail { top: calc(var(--site-h) + 64px); max-height: calc(100vh - var(--site-h) - 64px); width: 132px; flex-basis: 132px; background: transparent; }
  .site-main .store-main { padding-left: 16px; }
  .site-main .store-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 22px 16px; padding: 8px 4px 32px; }
  .site-main .store-card-pic { transition: box-shadow .15s; }
  .site-main .store-card:hover .store-card-pic { box-shadow: 0 6px 18px rgba(0,0,0,.10); }
  .site-main .store-bottom { background: transparent; }
  .site-main .store-cartbar-wrap { max-width: 520px; margin-left: auto; padding: 12px 0 20px; }

  /* ---------- seller */
  .site-main .seller-top { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; padding: 0 16px; align-items: stretch; }
  .site-main .seller-top > * { margin: 0 !important; }
  .site-main .seller-top .seller-account-wrap > * { height: 100%; margin: 0 !important; }
  .site-main .seller-stats { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
  .site-main .seller-fab, .site-main .prime-fab, .site-main .staff-fab { right: max(32px, calc((100vw - 1280px) / 2 + 32px)); bottom: 32px; }

  /* ---------- welcome / login as web pages */
  .site-main .auth-welcome { min-height: calc(100vh - var(--site-h)); }
  .site-main .auth-welcome-inner { max-width: 1100px; min-height: calc(100vh - var(--site-h) - 40px); display: grid; grid-template-columns: 1.2fr 1fr; align-items: center; gap: 64px; padding: 40px 32px; }
  .site-main .auth-lang-btn { display: none; }
  .site-main .auth-hero { align-items: flex-start; }
  .site-main .auth-hero .center-text { text-align: left; }
  .site-main .auth-hero .title-m { font-size: 22px; }
  .site-main .auth-tagline { font-size: 20px; }
  .site-main .auth-welcome-inner > .stack12 { background: var(--card); color: var(--on-bg); padding: 32px; border-radius: 24px; box-shadow: 0 18px 50px rgba(0,0,0,.10); }
  .site-main .auth-login { margin-top: 24px; background: var(--card); border: 1px solid var(--outline-variant); border-radius: 24px; padding: 32px 36px; }

  /* ---------- footer */
  .site-footer { display: block; margin-top: 56px; background: var(--container-high); border-top: 1px solid var(--outline-variant); }
  .site-footer-inner { max-width: 1280px; margin: 0 auto; padding: 40px 32px 24px; display: grid; grid-template-columns: 300px repeat(auto-fit, minmax(150px, 1fr)); gap: 32px; }
  .site-footer-col { display: flex; flex-direction: column; gap: 10px; }
  .site-footer-col a:not(.btn) { color: var(--muted); text-decoration: none; font-size: 14.5px; }
  .site-footer-col a:not(.btn):hover { color: var(--primary); }
  .site-footer-app .btn { align-self: flex-start; }
  .site-footer-bottom { max-width: 1280px; margin: 0 auto; padding: 16px 32px 28px; border-top: 1px solid var(--outline-variant); }
}
@media (min-width: 1024px) and (max-width: 1240px) {
  .site-main .buyer-store-grid, .screen.wide .site-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .site-loc { max-width: 200px; }
}
@media (min-width: 1024px) {
  .site-search { flex: 3 1 420px; }
  /* home order like a shop website: banner → categories → shops */
  .page-home .buyer-home-body { display: flex; flex-direction: column; }
  .page-home .buyer-home-body > * { order: 4; }
  .page-home .buyer-home-body > .site-hero-wrap { order: 1; }
  .page-home .buyer-home-body > .mt8 { order: 2; }
  .page-home .buyer-home-body > .buyer-cat-grid3 { order: 3; }
}
@media (min-width: 1024px) {
  .page-login .topbar .actions { display: none; }
}
@media (min-width: 1024px) {
  .page-distributor .topbar .actions { display: none; }
  .screen-bottom { background: none; display: flex; justify-content: flex-end; }
  .screen-bottom > * { width: auto; }
}

/* =====================================================================
   PrebMart's own website look (laptops): header + home
   ===================================================================== */
.pm-hero-wrap, .pm-how { display: none; }
@media (min-width: 1024px) {
  /* header */
  .site-header { border-top: 3px solid var(--brand); }
  .site-header-inner { gap: 16px; }
  .site-logo { border-right: 0; padding-right: 4px; }
  .site-loc { flex-direction: row; align-items: center; gap: 10px; max-width: 280px; padding: 6px 12px 6px 6px; border-radius: 999px;
    border: 1px solid var(--outline-variant); background: var(--card); }
  .site-loc:hover { border-color: var(--primary); background: var(--card); }
  .site-loc-pin { width: 34px; height: 34px; border-radius: 50%; background: var(--primary-container); color: var(--primary); display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
  .site-loc-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
  .site-loc-top { font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: none; }
  .site-loc-place { display: block; font-size: 14px; font-weight: 700; }
  .site-search { height: 48px; border-radius: 999px; background: var(--card); border: 1.5px solid var(--outline); padding: 0 4px 0 20px; gap: 6px; }
  .site-search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 15%, transparent); }
  .site-search-go { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; flex: 0 0 auto; }
  .site-search-go:hover { background: var(--brand-dark); }
  .site-search-clear { width: 36px; height: 36px; }
  .site-cart { height: 46px; padding: 0 18px 0 14px; border-radius: 999px; background: transparent; color: var(--primary); border: 1.5px solid var(--primary); font-weight: 700; }
  .site-cart.full { background: var(--primary-container); color: var(--on-primary-container); }
  .site-cart.full:hover { filter: none; background: color-mix(in srgb, var(--primary-container) 80%, var(--primary)); }
  .site-cart-icon { position: relative; display: flex; }
  .site-cart-badge { position: absolute; top: -8px; right: -10px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--sunny); color: #1C1C1C; font-size: 11.5px; font-weight: 800; display: flex; align-items: center; justify-content: center; border: 2px solid var(--card); }
  .site-cart-text { font-size: 15px; font-weight: 800; }

  /* home order: hero → categories → shops → how it works */
  .page-home .buyer-home-body > .pm-hero-wrap { order: 1; }
  .page-home .buyer-home-body > .pm-how { order: 5; }

  /* hero */
  .pm-hero-wrap { display: block; padding-top: 28px; }
  .pm-hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 32px; align-items: center; padding: 44px 48px; border-radius: 28px;
    background: #FBF6E9; border: 1px solid #EFE6CC; color: #1C1C1C; overflow: hidden; }
  @media (prefers-color-scheme: dark) { .pm-hero { background: #1E1B12; border-color: #2E2A1C; color: var(--on-bg); } }
  .pm-kicker { display: inline-block; padding: 6px 12px; border-radius: 999px; background: var(--primary-container); color: var(--on-primary-container); font-weight: 700; font-size: 13px; }
  .pm-hero-title { margin: 14px 0 0; font-size: 40px; line-height: 1.15; font-weight: 800; letter-spacing: -0.5px; max-width: 560px; }
  .pm-hero-sub { margin-top: 14px; font-size: 17px; line-height: 1.55; color: #4A4F57; max-width: 520px; }
  @media (prefers-color-scheme: dark) { .pm-hero-sub { color: var(--muted); } }
  .pm-promises { list-style: none; margin: 20px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
  .pm-promises li { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 12px; background: var(--card); border: 1px solid var(--outline-variant); font-weight: 600; font-size: 14px; color: var(--on-bg); }
  .pm-hero-cta { min-height: 50px; padding: 0 24px; border-radius: 12px; font-size: 15.5px; }
  .pm-hero-art { position: relative; height: 340px; }
  .pm-hero-disc { position: absolute; inset: 10px 30px 10px 50px; border-radius: 50%; background: radial-gradient(circle at 40% 40%, #DFF3E2, #BFE6C6); }
  .pm-hero-main { position: absolute; left: 50%; top: 50%; width: 78%; transform: translate(-46%, -50%); filter: drop-shadow(0 16px 24px rgba(0,0,0,.18)); }
  .pm-hero-side { position: absolute; width: 34%; filter: drop-shadow(0 10px 16px rgba(0,0,0,.18)); background: #fff; border-radius: 50%; padding: 8px; }
  .pm-hero-side.a { left: 0; bottom: 6px; transform: rotate(-8deg); }
  .pm-hero-side.b { right: 0; top: 0; width: 28%; transform: rotate(8deg); }

  /* round category icons */
  .page-home .buyer-cat-grid3 { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
  .page-home .buyer-cat-icon { border-radius: 50% !important; aspect-ratio: 1 !important; border: 1px solid var(--outline-variant); }
  .page-home .buyer-cat-tile:hover .buyer-cat-icon { border-color: var(--primary); filter: none; }

  /* how it works */
  .pm-how { display: block; padding-top: 36px; }
  .pm-sec-title { margin: 0 0 14px; font-size: 22px; font-weight: 800; }
  .pm-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; counter-reset: none; }
  .pm-step { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 22px; border-radius: 18px; border: 1px dashed var(--outline); background: var(--card); }
  .pm-step-num { position: absolute; top: 18px; right: 18px; width: 30px; height: 30px; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; }
  .pm-step-emoji { font-size: 30px; }
  .pm-step-title { font-size: 17px; font-weight: 800; }
  .pm-step-sub { font-size: 14px; color: var(--muted); }
}

/* ---------- checkout summary column (laptops) */
@media (min-width: 1024px) {
  .cols-side .orders-checkout { padding-top: 0; gap: 14px; }
  .cols-side .card { border-radius: 18px; }
  .cols-side .card > .stack12.pad16 { padding: 20px 22px 0; gap: 14px; }
  .cols-side .card > .stack12.pad16 > .title-s:first-child { font-size: 18px; font-weight: 800; }
  .cols-side .card .body-m { font-size: 15px; }
  .cols-side .card hr { margin: 2px -22px 0; width: auto; border-top-style: dashed; }
  /* "To pay" sits on a soft green band at the bottom of the card */
  .cols-side .card > .stack12.pad16 > .row:last-child { margin: 0 -22px; padding: 16px 22px; background: color-mix(in srgb, var(--primary-container) 70%, var(--card)); }
  .cols-side .card > .stack12.pad16 > .row:last-child .title-m { font-size: 19px; }
  /* the sticky phone bar becomes a plain full-width button here (the total is already in the card) */
  .cols-side .orders-bar { background: none; box-shadow: none; padding: 0; border-radius: 0; }
  .cols-side .orders-bar-total { display: none; }
  .cols-side .orders-bar-btn { min-height: 56px; border-radius: 14px; font-size: 17px; gap: 10px; box-shadow: 0 8px 20px color-mix(in srgb, var(--primary) 28%, transparent); }
  .cols-side .orders-bar-btn:hover:not(:disabled) { background: var(--brand-dark); filter: none; }
  .cols-side .desktop-only.px16 { padding: 0; }
  .cols-side .orders-policy { order: 3; display: flex; gap: 8px; align-items: flex-start; padding: 0 6px; font-size: 13px; line-height: 1.45; text-align: center; justify-content: center; }
  .cols-side .orders-checkout > .desktop-only { order: 2; }
  .cols-side .orders-checkout > .card { order: 1; }
}

.agree-line { margin-top: 10px; opacity: .75; }
.agree-line a { color: inherit; font-weight: 700; }

/* ------------------------------------------------------------ Buy again (home row) */
.ba { margin: 22px 0 18px; }
.ba-head { margin-bottom: 10px; }
.ba-head h2 { margin: 0; }
.ba-head p { margin: 2px 0 0; }
.ba-order { background: var(--card); border: 1px solid color-mix(in srgb, var(--outline-variant) 60%, transparent); border-radius: 18px; padding: 12px 12px 4px; margin-bottom: 12px; }
.ba-order-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.ba-order-title { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 10px; border: 0; background: none; padding: 0; text-align: left; cursor: pointer; color: inherit; font: inherit; }
.ba-order-icon { width: 36px; height: 36px; border-radius: 10px; background: var(--primary-container); color: var(--on-primary-container); display: grid; place-items: center; flex: none; }
.ba-order-text { min-width: 0; display: flex; flex-direction: column; }
.ba-order-no { font-weight: 800; font-size: 14.5px; }
.ba-order-no .muted { font-weight: 600; }
.ba-order-shop { font-size: 12.5px; color: var(--muted); }
.ba-order-title:hover .ba-order-no { color: var(--primary); }
.ba-addall { flex: none; height: 34px; padding: 0 14px; border-radius: 99px; border: 0; background: var(--primary); color: var(--on-primary); font-weight: 800; font-size: 13px; cursor: pointer; white-space: nowrap; }
.ba-addall:disabled { opacity: .6; cursor: default; }
.ba-took { color: var(--muted); }
.ba-strip { display: flex; gap: 12px; overflow-x: auto; padding: 2px 2px 8px; scroll-snap-type: x proximity; scrollbar-width: thin; }
.ba-card { flex: 0 0 140px; scroll-snap-align: start; background: var(--bg); border-radius: 14px; padding: 8px; display: flex; flex-direction: column; min-width: 0; }
.ba-pic { width: 100%; aspect-ratio: 1; border: 0; border-radius: 12px; background: var(--container-high); padding: 0; overflow: hidden; display: flex; align-items: center; justify-content: center; color: var(--muted); cursor: pointer; position: relative; }
.ba-pic img { width: 100%; height: 100%; object-fit: cover; }
.ba-pic.oos img { opacity: .45; }
.ba-oos { position: absolute; background: color-mix(in srgb, var(--card) 90%, transparent); color: var(--error); border-radius: 8px; padding: 3px 7px; font-size: 11px; font-weight: 700; }
.ba-name { margin: 8px 0 0; font-size: 13.5px; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.ba-unit { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.ba-shop { margin: 2px 0 0; font-size: 11.5px; color: var(--primary); font-weight: 600; }
.ba-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: auto; padding-top: 8px; }
.ba-price { font-weight: 800; font-size: 14.5px; }
.ba-add { height: 32px; min-width: 58px; padding: 0 10px; border-radius: 9px; border: 1.5px solid var(--primary); background: var(--card); color: var(--primary); font-weight: 800; font-size: 13px; cursor: pointer; }
.ba-step { width: 76px; height: 32px; border-radius: 9px; background: var(--primary); color: var(--on-primary); display: flex; align-items: center; }
.ba-step button { flex: 1 1 0; height: 100%; border: 0; background: none; color: inherit; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; }
.ba-step button:disabled { opacity: .4; cursor: default; }
.ba-step span { font-weight: 700; font-size: 13px; min-width: 14px; text-align: center; }
@media (min-width: 1024px) {
  .ba-orders { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
  .ba-orders .ba-order { margin-bottom: 0; }
  .ba-card { flex-basis: 150px; }
}
