/* ==========================================================================
   TANZAM storefront
   Practical wholesale catalogue: light, dense, product-first.
   ========================================================================== */

:root {
  --bg: #f6f7f7;
  --surface: #ffffff;
  --surface-alt: #f1f4f3;
  --text: #131c19;
  --text-soft: #47534f;
  --muted: #7b8783;
  --line: #e2e7e5;
  --line-strong: #cfd6d3;
  --brand: #0e7c5a;
  --brand-dark: #0a5f45;
  --brand-soft: #e7f4ef;
  --whatsapp: #25d366;
  --whatsapp-dark: #1da851;
  --danger: #b4322a;
  --danger-soft: #fdeceb;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(19, 28, 25, .06), 0 6px 20px rgba(19, 28, 25, .06);
  --shadow-lg: 0 10px 40px rgba(19, 28, 25, .16);
  --header-h: 104px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
button { font-family: inherit; font-size: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.01em; }
p { margin: 0; }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease, transform .05s ease;
  white-space: nowrap;
  line-height: 1.2;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--brand-dark); }
.btn-outline { background: var(--surface); color: var(--brand); border-color: var(--line-strong); }
.btn-outline:hover:not(:disabled) { border-color: var(--brand); color: var(--brand-dark); }
.btn-ghost { background: transparent; color: var(--text-soft); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-alt); color: var(--text); }
.btn-whatsapp { background: var(--whatsapp); color: #fff; }
.btn-whatsapp:hover:not(:disabled) { background: var(--whatsapp-dark); }
.btn-block { width: 100%; }
.btn-small { padding: 7px 12px; font-size: 12px; }
.btn-tiny { padding: 5px 10px; font-size: 11.5px; }
.icon-btn {
  background: transparent;
  border: 0;
  font-size: 26px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  padding: 0 4px;
  border-radius: 6px;
}
.icon-btn:hover { color: var(--text); background: var(--surface-alt); }

/* ---------------------------------------------------------------- header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line);
}

.header-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  max-width: 1500px;
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}
.brand-logo {
  height: 44px;
  width: 44px;
  flex: 0 0 44px;
  object-fit: contain;
  border-radius: 5px;
  background: #fff;
}
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text strong { font-size: 19px; letter-spacing: .06em; color: var(--brand); line-height: 1.1; }
.brand-text small {
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 240px;
}

.header-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.btn-currency { font-size: 12px; border: 1px solid var(--line); padding: 7px 10px; }
.btn-account { color: var(--brand); font-weight: 700; text-align: left; }
.account-meta { display: flex; flex-direction: column; gap: 1px; line-height: 1.1; }
.account-label {
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
}
#accountName { max-width: 76px; overflow: hidden; text-overflow: ellipsis; }
.account-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--whatsapp); display: inline-block;
}
.order-count {
  background: var(--brand-dark);
  color: #fff;
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 11.5px;
  font-weight: 700;
  min-width: 20px;
  text-align: center;
}

/* -------------------------------------------------------------- filters */
.filter-bar {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 0 12px 10px;
  max-width: 1500px;
  margin: 0 auto;
  flex-wrap: wrap;
}
.filter-field { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.filter-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  font-weight: 700;
}
.filter-price { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; }
#categorySelect { min-width: 190px; }

.control {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 13px;
  color: var(--text);
  width: 100%;
  font-family: inherit;
  min-height: 36px;
}
select.control {
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 4.5L6 8.5L10 4.5' stroke='%237b8783' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px;
  padding-right: 28px;
}
.control:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: var(--brand); }
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; }
#minPrice, #maxPrice { width: 118px; }

.filter-toggle { display: none; }

/* ------------------------------------------------------------ catalogue */
.catalogue {
  max-width: 1500px;
  margin: 0 auto;
  padding: 12px 12px 40px;
}
.catalogue-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.meta-line { font-size: 12.5px; color: var(--text-soft); font-weight: 600; }
.meta-rate { font-size: 11.5px; color: var(--muted); }

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

/* --------------------------------------------------------------- cards */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: box-shadow .15s ease, border-color .15s ease;
}
.card:hover { box-shadow: var(--shadow); border-color: var(--line-strong); }

.card-media {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--surface-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  overflow: hidden;
}
.card-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
}
.card-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: var(--brand);
  color: #fff;
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 2px 6px;
  border-radius: 999px;
}

.card-body { padding: 8px 9px 10px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-cat { font-size: 9.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.card-name {
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.3;
  min-height: 2.6em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-prices { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
.price-primary { font-size: 15px; font-weight: 800; color: var(--text); letter-spacing: -.01em; }
.price-secondary { font-size: 11.5px; font-weight: 600; color: var(--brand); }

.qty-row { display: flex; align-items: center; gap: 6px; }
.qty-stepper {
  display: flex;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
}
.qty-stepper button {
  width: 30px;
  height: 32px;
  border: 0;
  background: var(--surface);
  color: var(--brand);
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
}
.qty-stepper button:hover { background: var(--brand-soft); }
.qty-stepper button:disabled { color: var(--line-strong); cursor: not-allowed; background: var(--surface); }
.qty-input {
  width: 40px;
  height: 32px;
  border: 0;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  padding: 0;
  background: var(--surface);
  color: var(--text);
}
.qty-input:focus { outline: 2px solid var(--brand); outline-offset: -2px; }
.card .btn-add { flex: 1; padding: 8px 8px; font-size: 12.5px; }

/* --------------------------------------------------------- states / misc */
.state-block {
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 32px 20px;
  text-align: center;
  color: var(--text-soft);
}
.state-block h3 { font-size: 16px; margin-bottom: 6px; color: var(--text); }
.state-block p { font-size: 13px; margin-bottom: 14px; }

.load-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 22px 0;
  color: var(--muted);
  font-size: 12.5px;
}
.spinner {
  width: 15px; height: 15px;
  border: 2px solid var(--line-strong);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
.sentinel { height: 1px; }

/* --------------------------------------------------------------- footer */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--line);
  margin-top: 10px;
}
.footer-grid {
  max-width: 1500px;
  margin: 0 auto;
  padding: 18px 14px 12px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
.footer-col h4 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--brand);
  margin-bottom: 8px;
}
.footer-col p { font-size: 12.5px; color: var(--text-soft); line-height: 1.6; }
.footer-location { margin-top: 8px; }
.footer-links { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.link {
  background: none;
  border: 0;
  padding: 0;
  color: var(--text-soft);
  font-size: 12.5px;
  text-align: left;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 3px;
  font-family: inherit;
}
.link:hover { color: var(--brand); text-decoration-color: var(--brand); }
.footer-note { margin-top: 8px; font-size: 11.5px; color: var(--muted); }
.footer-col .btn-whatsapp { margin-top: 10px; }

.shop-photo {
  position: sticky;
  top: calc(var(--header-h) + 16px);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface-alt);
  border: 1px solid var(--line);
  aspect-ratio: 4 / 3;
  width: min(100%, 250px);
  max-width: 250px;
  margin: 0 auto 10px -14px;
  box-shadow: var(--shadow);
}
.shop-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}
.shop-photo-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.footer-base {
  border-top: 1px solid var(--line);
  padding: 10px 14px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 11.5px;
  color: var(--muted);
  max-width: 1500px;
  margin: 0 auto;
  width: 100%;
}

/* -------------------------------------------------------------- overlay */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 22, 20, .45);
  z-index: 80;
  animation: fade .15s ease;
}
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }

/* --------------------------------------------------------------- drawer */
.drawer {
  position: fixed;
  z-index: 90;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  right: 0;
  top: 0;
  bottom: 0;
  width: min(400px, 100%);
  transform: translateX(102%);
  transition: transform .22s cubic-bezier(.22, .61, .36, 1);
}
.drawer.is-open { transform: translateX(0); }
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
}
.drawer-head h2 { font-size: 16px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 10px 12px; }
.drawer-foot {
  border-top: 1px solid var(--line);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--surface);
}

.order-line {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.order-line:last-child { border-bottom: 0; }
.order-thumb {
  width: 52px; height: 52px;
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  border: 1px solid var(--line);
  object-fit: contain;
  padding: 3px;
  flex-shrink: 0;
  mix-blend-mode: multiply;
}
.order-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.order-name {
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.order-unit { font-size: 11px; color: var(--muted); }
.order-unit strong { color: var(--text-soft); }
.order-controls { display: flex; align-items: center; gap: 8px; margin-top: 3px; flex-wrap: wrap; }
.order-line-total { font-size: 12px; font-weight: 700; }
.order-line-total span { display: block; font-size: 10.5px; color: var(--brand); font-weight: 600; }
.remove-btn {
  background: none;
  border: 0;
  color: var(--danger);
  font-size: 11px;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-family: inherit;
}
.order-empty { text-align: center; color: var(--muted); padding: 40px 16px; font-size: 13px; }

.totals { display: flex; flex-direction: column; gap: 4px; }
.total-row { display: flex; align-items: baseline; justify-content: space-between; font-size: 12.5px; color: var(--text-soft); }
.total-row.grand { font-size: 15px; font-weight: 800; color: var(--text); border-top: 1px solid var(--line); padding-top: 7px; margin-top: 4px; }
.total-row .zmw { color: var(--brand); font-weight: 700; }

/* --------------------------------------------------------------- modals */
.modal {
  position: fixed;
  z-index: 90;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(420px, calc(100% - 24px));
  max-height: 88vh;
  display: none;
  flex-direction: column;
  overflow: hidden;
}
.modal.is-open { display: flex; }
.modal-wide { width: min(720px, calc(100% - 24px)); }
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
}
.modal-head h2 { font-size: 16px; }
.modal-note { font-size: 11.5px; color: var(--muted); padding: 10px 14px 0; }
.confirm-ref { padding: 14px 14px 0; font-size: 13px; }
.confirm-text { padding: 8px 14px 14px; font-size: 12.5px; color: var(--text-soft); }
.modal .btn { margin: 0 14px 10px; }
.modal .btn:last-child { margin-bottom: 14px; }
.modal .form-error { margin: 0 14px 8px; }

.auth-form { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 10px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field > span { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.form-error {
  background: var(--danger-soft);
  color: var(--danger);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 12px;
}
.auth-account {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  overflow-y: auto;
}
.signed-in-line { font-size: 13px; }
.signed-in-line.muted { color: var(--muted); font-size: 12px; }
.customer-orders { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 10px; }
.customer-orders-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.customer-orders-head h3 { font-size: 14px; }
.customer-orders-head .btn { margin: 0; }
.customer-orders-list { display: grid; gap: 8px; max-height: 42vh; overflow-y: auto; padding: 1px 2px 3px; }
.customer-order { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px; background: var(--surface); }
.customer-order-head,
.customer-order-total { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.customer-order-head { font-size: 11.5px; }
.customer-order-ref { font-weight: 800; }
.customer-order-date { color: var(--muted); text-align: right; }
.customer-order-stage { margin-top: 8px; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 12px; font-weight: 700; }
.customer-stage-badge { border-radius: 999px; padding: 3px 8px; background: var(--brand-soft); color: var(--brand-dark); }
.customer-stage-badge.is-pending { background: #fff3d6; color: #805900; }
.customer-stage-badge.is-cancelled { background: var(--danger-soft); color: var(--danger); }
.customer-stage-reason { color: var(--danger); font-weight: 600; }
.customer-order-lines { margin: 8px 0; padding: 0; list-style: none; display: grid; gap: 4px; font-size: 11.5px; color: var(--text-soft); }
.customer-order-line { display: flex; justify-content: space-between; gap: 8px; }
.customer-order-line span:first-child { min-width: 0; overflow-wrap: anywhere; }
.customer-order-total { border-top: 1px solid var(--line); padding-top: 7px; font-size: 11.5px; }
.customer-order-currencies { display: flex; justify-content: space-between; gap: 8px; margin-top: 3px; color: var(--muted); font-size: 11px; }
.customer-order .btn { width: 100%; margin: 8px 0 0; }
.customer-orders-message { color: var(--muted); font-size: 12px; padding: 8px 2px; }
.policy-body {
  padding: 16px 18px 22px;
  overflow-y: auto;
  font-size: 13px;
  color: var(--text-soft);
  line-height: 1.65;
}
.policy-body h2 { font-size: 18px; color: var(--text); margin-bottom: 10px; }
.policy-body h3 { font-size: 14px; color: var(--text); margin: 16px 0 6px; }
.policy-body p { margin-bottom: 10px; }
.policy-body ol, .policy-body ul { margin: 0 0 10px; padding-left: 20px; }
.policy-body li { margin-bottom: 6px; }
.policy-body strong { color: var(--text); }

/* ------------------------------------------------------- toast/activity */
.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%) translateY(12px);
  background: #16211d;
  color: #fff;
  border-radius: 999px;
  padding: 9px 18px;
  font-size: 12.5px;
  font-weight: 600;
  z-index: 120;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transition: opacity .18s ease, transform .18s ease;
  max-width: calc(100% - 32px);
  text-align: center;
}
.toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }

.activity {
  position: fixed;
  left: 12px;
  bottom: 12px;
  z-index: 70;
  background: #ff2d95;
  border: 1px solid #e01f80;
  color: #fff;
  border-radius: 999px;
  box-shadow: var(--shadow);
  padding: 6px 8px 6px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100% - 24px);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .2s ease, transform .2s ease;
}
.activity.is-visible { opacity: 1; transform: translateY(0); }
.activity-text {
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 46vw;
}
.activity .btn-primary {
  background: #fff;
  border-color: #fff;
  color: #c81e74;
}
.activity .btn-primary:hover {
  background: #ffe6f3;
  border-color: #ffe6f3;
}

/* ------------------------------------------------------------ responsive */
@media (min-width: 700px) {
  body { font-size: 14.5px; }
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .footer-grid { grid-template-columns: 1.1fr 1fr 1fr; padding: 24px 16px 16px; }
  .shop-photo { margin-left: -16px; }
  .brand-text small { max-width: 320px; }
}

@media (min-width: 1080px) {
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
  .card-name { font-size: 13px; }
  .catalogue { padding: 16px 16px 50px; }
  .header-main { padding: 10px 16px; }
  .filter-bar { padding: 0 16px 11px; }
}

@media (max-width: 820px) {
  .btn-currency { display: none; }
}

/* Mobile: keep the header compact, filters behind a single toggle. */
@media (max-width: 640px) {
  .brand-text strong { font-size: 17px; }
  .brand-text small { font-size: 9px; max-width: 130px; }
  .header-actions { gap: 4px; }
  .btn-order { padding: 8px 10px; font-size: 12px; }
  #signInBtn, .btn-account { padding: 8px 9px; font-size: 12px; }
  .header-main { padding: 8px 10px; }
  .brand-logo { height: 40px; width: 40px; flex-basis: 40px; }

  .filter-bar { padding: 0 10px 9px; gap: 6px; }
  #categorySelect { min-width: 0; flex: 1; }
  .filter-toggle { display: inline-flex; }
  .filter-price { display: none; width: 100%; }
  .filter-price.is-open { display: flex; }
  #minPrice, #maxPrice { width: 100%; }
  .filter-price .filter-field { flex: 1; }
  .catalogue { padding: 10px 10px 30px; }
  .card-name { min-height: 2.6em; font-size: 12px; }
  .price-primary { font-size: 14px; }

  /* Order drawer becomes a bottom sheet on phones. */
  .drawer {
    left: 0;
    right: 0;
    top: auto;
    width: 100%;
    max-height: 90vh;
    border-radius: 14px 14px 0 0;
    transform: translateY(102%);
  }
  .drawer.is-open { transform: translateY(0); }
  .activity { left: 8px; right: 8px; bottom: 8px; }
  .activity-text { max-width: none; flex: 1; }
  .shop-photo { width: min(100%, 180px); max-width: 180px; }

  /* Compact the quantity stepper + Add to Order so both fit one row on small cards. */
  .card-body { padding: 7px 8px 9px; }
  .qty-row { gap: 4px; }
  .qty-stepper button { width: 23px; height: 27px; font-size: 15px; }
  .qty-input { width: 28px; height: 27px; font-size: 12px; }
  .card .btn-add { flex: 1; min-width: 0; padding: 6px 4px; font-size: 11px; }
}

@media (max-width: 380px) {
  .qty-stepper button { width: 21px; height: 26px; font-size: 14px; }
  .qty-input { width: 24px; height: 26px; font-size: 11px; }
  .card .btn-add { font-size: 10px; padding: 6px 3px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
