:root {
  color-scheme: light;
  --bg: #b91f16;
  --surface: #ffffff;
  --surface-strong: #fff4f0;
  --text: #172019;
  --muted: #76514c;
  --line: #f0c7bd;
  --primary: #d73520;
  --primary-dark: #a91f13;
  --accent: #f5a524;
  --warning: #f2aa3c;
  --shadow: 0 18px 40px rgba(71, 12, 7, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(255, 236, 224, 0.12), rgba(185, 31, 22, 0) 320px),
    var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Tahoma, sans-serif;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 18px clamp(18px, 4vw, 56px);
  background: rgba(255, 248, 244, 0.96);
  border-bottom: 1px solid rgba(240, 199, 189, 0.9);
  backdrop-filter: blur(14px);
}

.brand-lockup {
  display: flex;
  min-width: 0;
  gap: 14px;
  align-items: center;
}

.brand-logo {
  width: clamp(64px, 8vw, 92px);
  height: auto;
  flex: 0 0 auto;
  filter: drop-shadow(0 8px 14px rgba(122, 29, 19, 0.14));
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 820px;
  margin-bottom: 0;
  font-size: clamp(22px, 3vw, 34px);
  line-height: 1.15;
  letter-spacing: 0;
}

.header-subtitle {
  max-width: 620px;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: clamp(14px, 1.7vw, 16px);
  font-weight: 700;
}

h2 {
  margin-bottom: 6px;
  font-size: 24px;
}

h3 {
  margin-bottom: 8px;
  font-size: 19px;
}

p {
  color: var(--muted);
}

main {
  padding: 28px clamp(18px, 4vw, 56px) 56px;
}

.shop-hero {
  margin-bottom: 24px;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff8f4;
  box-shadow: var(--shadow);
}

.shop-hero img {
  display: block;
  width: 100%;
  max-height: 390px;
  object-fit: cover;
}

.promo-section {
  margin-bottom: 24px;
}

.promo-slider {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(280px, 360px);
  gap: 14px;
  overflow-x: auto;
  padding: 4px 2px 14px;
  scroll-snap-type: x mandatory;
}

.promo-slide {
  display: grid;
  gap: 0;
  align-content: start;
  min-height: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  padding: 0;
  background: var(--surface);
  color: var(--text);
  text-align: left;
  box-shadow: var(--shadow);
  scroll-snap-align: start;
}

.promo-slide img {
  width: 100%;
  aspect-ratio: 1 / 0.72;
  object-fit: cover;
}

.promo-slide span {
  color: var(--muted);
  font-size: 13px;
}

.promo-slide small,
.promo-expiry {
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 800;
}

.promo-slide del {
  color: var(--muted);
}

.promo-slide b,
.promo-price {
  color: var(--primary);
}

.promo-media {
  position: relative;
  overflow: hidden;
  background: #fff7f2;
}

.promo-media img {
  display: block;
  transition: transform 180ms ease;
}

.promo-chip {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 8px;
  background: linear-gradient(135deg, #e83a24, #8c150d);
  color: #ffffff;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0;
  text-shadow: 0 1px 2px rgba(60, 0, 0, 0.42);
  box-shadow:
    0 10px 22px rgba(71, 12, 7, 0.34),
    0 0 0 3px rgba(255, 255, 255, 0.18);
}

.promo-slide .promo-chip {
  color: #ffffff;
}

.promo-content {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.promo-meta {
  display: inline-flex;
  width: fit-content;
  min-height: 26px;
  align-items: center;
  padding: 0 9px;
  border-radius: 8px;
  background: #fff0e5;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 900;
}

.promo-price-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.promo-now {
  font-size: 22px;
  font-weight: 950;
}

.nav-tabs,
.category-filter,
.location-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.nav-tab,
.portal-link,
.filter-btn,
.ghost-btn,
.primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid var(--line);
  padding: 0 14px;
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.small-action {
  min-height: 34px;
  padding: 0 10px;
  font-size: 13px;
}

.nav-tab.active,
.filter-btn.active,
.primary-btn {
  border-color: var(--primary);
  background: linear-gradient(180deg, #e7422b, var(--primary));
  color: #ffffff;
}

.portal-link {
  border-color: var(--primary);
  color: var(--primary);
  background: #fff4f0;
}

body[data-portal="customer"] .admin-only,
body[data-portal="admin"] .customer-only {
  display: none !important;
}

body[data-portal="admin"].auth-locked .app-main,
body[data-portal="admin"].auth-locked .admin-only,
body[data-portal="admin"].auth-locked .auth-only {
  display: none !important;
}

body[data-portal="admin"]:not(.auth-locked) .login-view {
  display: none;
}

.login-view {
  min-height: calc(100vh - 122px);
  display: grid;
  place-items: center;
  padding: 28px clamp(18px, 4vw, 56px) 56px;
}

.login-card {
  width: min(100%, 480px);
  display: grid;
  gap: 18px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 248, 244, 0.98);
  box-shadow: var(--shadow);
}

.login-hint {
  display: grid;
  gap: 6px;
  padding: 12px;
  border-radius: 8px;
  background: #fff0d7;
  color: #7a1d13;
  font-size: 13px;
}

.auth-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: #fff0d7;
  color: #7a1d13;
  font-weight: 800;
  font-size: 13px;
}

.primary-btn:hover {
  background: var(--primary-dark);
}

.primary-btn:disabled,
.primary-btn:disabled:hover {
  cursor: not-allowed;
  border-color: #d6c7c2;
  background: #b8aaa5;
  color: #fff7f3;
}

.primary-btn.small {
  min-height: 36px;
}

.ghost-btn:hover,
.nav-tab:hover,
.filter-btn:hover {
  border-color: var(--primary);
  background: #fff4f0;
}

.ghost-btn.danger {
  border-color: rgba(217, 79, 47, 0.4);
  color: var(--accent);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  margin-bottom: 20px;
}

.section-head.compact {
  margin-bottom: 14px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 18px;
}

.product-card,
.panel,
.order-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.product-card {
  overflow: hidden;
}

.product-unavailable {
  position: relative;
}

.product-card.highlight-product {
  outline: 4px solid var(--accent);
  outline-offset: 3px;
}

.product-image-wrap {
  position: relative;
  overflow: hidden;
}

.product-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--surface-strong);
}

.sold-out-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 6px;
  padding: 16px;
  background: rgba(82, 16, 10, 0.72);
  color: #ffffff;
  text-align: center;
}

.sold-out-overlay strong {
  font-size: 28px;
  font-weight: 900;
}

.sold-out-overlay span {
  font-size: 14px;
  font-weight: 800;
}

.product-unavailable img {
  filter: grayscale(0.55) brightness(0.72);
}

.product-body {
  padding: 16px;
}

.admin-product-card {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.admin-product-card img {
  width: 120px;
  height: 120px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--surface);
}

.admin-product-card p {
  margin-bottom: 8px;
}

.product-meta,
.product-actions,
.order-head,
.summary div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.product-meta {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
}

.branch-stock-note {
  margin-bottom: 8px;
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 800;
}

.product-actions {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.weight-select {
  width: 100%;
  min-height: 36px;
  padding: 6px 10px;
}

.product-buy-row {
  display: grid;
  grid-template-columns: minmax(108px, 1fr) minmax(92px, auto);
  gap: 8px;
  align-items: center;
}

.product-buy-row .primary-btn {
  width: 100%;
  min-width: 92px;
}

.product-buy-row .primary-btn:only-child {
  grid-column: 1 / -1;
}

.checkout-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(320px, 1.1fr);
  gap: 20px;
  align-items: start;
}

.customer-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.75fr) minmax(360px, 1.25fr);
  gap: 20px;
  align-items: start;
}

.product-admin-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.8fr) minmax(420px, 1.2fr);
  gap: 20px;
  align-items: start;
}

.branch-manager-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.8fr) minmax(420px, 1.2fr);
  gap: 20px;
  align-items: start;
}

.panel {
  padding: 20px;
}

.cart-list,
.orders-list,
.tracking-list,
.customers-list,
.admin-products-list,
.branches-list {
  display: grid;
  gap: 12px;
}

.cart-item {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.cart-item span,
.order-head span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.qty-control {
  display: grid;
  grid-template-columns: 34px 34px 34px;
  align-items: center;
  text-align: center;
}

.qty-control button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  font-weight: 800;
}

.summary {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.summary div {
  margin-bottom: 10px;
}

.summary .total {
  font-size: 20px;
}

.discount-row strong {
  color: var(--primary);
}

.bundle-discount-row {
  color: #b21f14;
}

.checkout-form {
  display: grid;
  gap: 14px;
}

.saved-customer-field {
  display: none !important;
}

.bot-trap-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  background: #ffffff;
  color: var(--text);
}

textarea {
  resize: vertical;
}

.location-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.hidden-location {
  display: none;
}

.form-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-product-tools {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.admin-product-search {
  display: grid;
  gap: 7px;
  color: var(--text);
  font-weight: 900;
}

.admin-product-search input {
  min-height: 42px;
  background: #ffffff;
}

.admin-category-filter {
  border-radius: 8px;
  justify-content: flex-start;
}

.admin-branch-scope[hidden] {
  display: none;
}

#branch-form-panel[hidden] {
  display: none;
}

.map-mock {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 180px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(35, 107, 70, 0.12) 1px, transparent 1px),
    linear-gradient(rgba(35, 107, 70, 0.12) 1px, transparent 1px),
    #edf5ef;
  background-size: 36px 36px;
  color: var(--primary-dark);
  font-weight: 800;
}

.service-status,
.branch-summary {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.service-status span,
.branch-summary span,
.branch-card span {
  color: var(--muted);
  font-size: 13px;
}

.service-status.ok {
  border-color: rgba(35, 107, 70, 0.35);
  background: #eff9ef;
}

.service-status.warn {
  border-color: rgba(217, 79, 47, 0.35);
  background: #fff1ed;
}

.branch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.branch-region-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0;
}

.branch-search-field {
  display: grid;
  gap: 7px;
  margin-top: 12px;
  color: var(--text);
  font-weight: 900;
}

.branch-search-field input {
  min-height: 42px;
  background: #ffffff;
}

.branch-region-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--text);
  font-weight: 900;
}

.branch-region-tab span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  min-height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: #fff1dc;
  color: var(--primary-dark);
  font-size: 12px;
}

.branch-region-tab.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #ffffff;
}

.branch-region-tab.active span {
  background: #ffffff;
  color: var(--primary-dark);
}

.branch-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #fffaf7, #ffffff);
}

.branch-card-head,
.branch-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.branch-card p {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.status-pill.available {
  background: #e7f7eb;
  color: #166534;
}

.status-pill.unavailable {
  background: #fff0e8;
  color: #a83218;
}

.region-pill {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  min-height: 26px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #fff1dc;
  color: #7a1d13;
  font-size: 12px;
  font-weight: 900;
}

.branch-map-preview {
  position: relative;
  min-height: 140px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(217, 79, 47, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.72) 24%, transparent 24%) 0 0 / 34px 34px,
    linear-gradient(rgba(255, 255, 255, 0.72) 24%, transparent 24%) 0 0 / 34px 34px,
    linear-gradient(135deg, #fff7ef, #ffe3d7);
  color: var(--primary-dark);
  font-weight: 900;
  text-align: center;
}

.branch-map-marker {
  width: 26px;
  height: 26px;
  border: 6px solid var(--primary);
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: #fff;
  box-shadow: 0 12px 24px rgba(117, 24, 10, 0.2);
}

.branch-map-marker + span {
  margin-top: -18px;
}

.pin {
  position: absolute;
  width: 24px;
  height: 24px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: var(--accent);
  box-shadow: 0 8px 18px rgba(217, 79, 47, 0.35);
}

.pin::after {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  background: #ffffff;
}

.status {
  border-radius: 999px;
  padding: 6px 10px;
  background: #fff0d7;
  color: #8a3a00;
  font-weight: 800;
}

.order-card {
  padding: 16px;
}

.order-editor {
  margin: 12px 0;
  padding: 12px;
  border: 1px solid rgba(215, 53, 32, 0.18);
  border-radius: 8px;
  background: #fff8f4;
}

.order-editor summary {
  cursor: pointer;
  color: var(--primary);
  font-weight: 900;
}

.order-edit-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.order-edit-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.order-edit-row span,
.order-edited-note {
  color: var(--muted);
  font-size: 13px;
}

.actual-weight-field {
  display: grid;
  gap: 5px;
  max-width: 180px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.actual-weight-field input {
  min-height: 34px;
  padding: 7px 9px;
}

.order-add-product {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(110px, 0.35fr) auto;
  gap: 8px;
  margin-top: 12px;
}

.order-add-product select {
  width: 100%;
  min-width: 0;
}

.tracking-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.tracking-status {
  display: grid;
  gap: 12px;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid rgba(215, 53, 32, 0.18);
  border-radius: 8px;
  background: var(--surface-strong);
}

.tracking-status span {
  color: var(--muted);
  font-size: 13px;
}

.tracking-distance {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.tracking-distance strong {
  color: var(--primary);
  font-size: 24px;
  font-weight: 900;
}

.tracking-points {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.tracking-points div {
  display: grid;
  gap: 3px;
  padding: 10px;
  border-radius: 8px;
  background: #ffffff;
}

.tracking-points strong {
  color: var(--text);
  font-size: 14px;
}

.tracking-points small {
  color: var(--muted);
  font-size: 12px;
}

.tracking-cancel-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px dashed rgba(217, 79, 47, 0.34);
  border-radius: 8px;
  background: #fff8f4;
}

.tracking-cancel-panel span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.order-card.cancelled {
  background: #fbfbfa;
}

.order-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.cancel-request {
  display: grid;
  gap: 4px;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid rgba(242, 170, 60, 0.5);
  border-radius: 8px;
  background: #fff8eb;
}

.cancel-request span,
.cancel-request small {
  color: var(--muted);
}

.cancel-request.approved {
  border-color: rgba(35, 107, 70, 0.35);
  background: #edf7f0;
}

.cancel-request.rejected {
  border-color: rgba(97, 112, 100, 0.35);
  background: #f4f5f2;
}

.order-report {
  display: grid;
  gap: 14px;
}

.report-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.report-head h3,
.cancel-log-list h3 {
  margin: 0 0 4px;
  font-size: 18px;
}

.report-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.report-filters {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.report-filters label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.report-filters input,
.report-filters select {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 8px 10px;
  font: inherit;
}

.report-branch-lock {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: #fff1e8;
  color: var(--brand-dark);
  font-weight: 900;
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.report-card,
.cancel-log-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.report-card {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.report-card.highlight {
  border-color: rgba(215, 53, 32, 0.22);
  background: linear-gradient(180deg, #ffffff, #fff7f1);
  box-shadow: 0 14px 30px rgba(76, 21, 14, 0.08);
}

.report-card > div:first-child,
.cancel-log-item > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.report-card span,
.cancel-log-item span,
.cancel-log-item small {
  color: var(--muted);
  font-size: 12px;
}

.report-card dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.report-card dl div {
  padding: 8px;
  border-radius: 8px;
  background: #fff8f3;
}

.report-card dt {
  color: var(--muted);
  font-size: 12px;
}

.report-card dd {
  margin: 2px 0 0;
  color: var(--text);
  font-weight: 800;
}

.report-table-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.report-table-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  overflow: hidden;
}

.report-table-card h3 {
  margin: 0;
  padding: 14px 14px 10px;
  font-size: 16px;
}

.report-table-wrap {
  overflow-x: auto;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
  font-size: 13px;
}

.report-table th,
.report-table td {
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

.report-table th {
  background: #fff6ef;
  color: var(--brand-dark);
  font-weight: 900;
}

.report-table td:last-child,
.report-table th:last-child {
  text-align: right;
}

.cancel-log-list {
  display: grid;
  gap: 10px;
}

.cancel-log-item {
  display: grid;
  gap: 6px;
  padding: 12px;
}

.cancel-log-item p {
  margin: 0;
  color: var(--text);
}

.cancel-log-item.pending {
  border-color: rgba(242, 170, 60, 0.5);
  background: #fff8eb;
}

.cancel-log-item.approved {
  border-color: rgba(35, 107, 70, 0.35);
  background: #edf7f0;
}

.cancel-log-item.rejected {
  border-color: rgba(97, 112, 100, 0.35);
  background: #f4f5f2;
}

.customer-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.customer-head,
.customer-stats {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.customer-head span,
.customer-stats {
  color: var(--muted);
  font-size: 13px;
}

.customer-card p {
  margin-bottom: 8px;
}

.search-field {
  margin-bottom: 14px;
}

.product-search-field {
  display: grid;
  gap: 7px;
  margin: -4px 0 18px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: 8px;
  background: rgba(255, 250, 247, 0.96);
  box-shadow: 0 12px 26px rgba(71, 12, 7, 0.1);
  color: #4b120c;
  font-weight: 900;
}

.product-search-field input {
  min-height: 44px;
  border-color: rgba(215, 53, 32, 0.18);
  background: #ffffff;
}

.order-items {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0;
}

.order-items span {
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 700;
}

.order-total {
  font-size: 22px;
  font-weight: 900;
  color: var(--primary);
}

.empty {
  padding: 24px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 20px);
  padding: 12px 16px;
  border-radius: 8px;
  background: #5b120d;
  color: #ffffff;
  opacity: 0;
  pointer-events: none;
  transition: 180ms ease;
  box-shadow: var(--shadow);
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.order-alert-popup {
  position: fixed;
  right: 24px;
  bottom: 86px;
  z-index: 80;
  display: grid;
  gap: 7px;
  width: min(360px, calc(100vw - 32px));
  padding: 17px 16px 16px;
  border: 1px solid rgba(215, 53, 32, 0.24);
  border-radius: 8px;
  background: #fff8f4;
  box-shadow: 0 18px 44px rgba(71, 12, 7, 0.24);
  opacity: 0;
  transform: translateY(18px);
  transition: 200ms ease;
}

.order-alert-popup.show {
  opacity: 1;
  transform: translateY(0);
}

.order-alert-popup strong {
  color: var(--primary);
  font-size: 18px;
  font-weight: 900;
}

.order-alert-popup span {
  color: var(--text);
  font-weight: 900;
}

.order-alert-popup small {
  color: var(--muted);
  font-weight: 700;
}

.order-alert-close {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: #ffffff;
  color: var(--text);
  cursor: pointer;
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
}

/* Delivery app style refinements */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 0%, rgba(255, 255, 255, 0.14), transparent 28%),
    radial-gradient(circle at 86% 14%, rgba(245, 165, 36, 0.14), transparent 26%);
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  isolation: isolate;
  overflow: hidden;
  color: #fffaf4;
  border-bottom: 1px solid rgba(255, 229, 207, 0.46);
  background:
    linear-gradient(115deg, rgba(96, 8, 12, 0.98) 0%, rgba(174, 26, 18, 0.98) 46%, rgba(238, 77, 31, 0.96) 100%);
  box-shadow: 0 18px 46px rgba(71, 12, 7, 0.24);
}

.app-header::before,
.app-header::after {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
}

.app-header::before {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0 8px, transparent 8px 34px),
    linear-gradient(90deg, rgba(255, 241, 226, 0.12), transparent 36%, rgba(255, 210, 143, 0.12));
  background-size: 46px 46px, 100% 100%;
  mix-blend-mode: screen;
}

.app-header::after {
  inset: auto 0 0;
  height: 5px;
  background: linear-gradient(90deg, #ffd271, #f6fff0, #ffb35c);
  opacity: 0.95;
}

.app-header > * {
  position: relative;
  z-index: 1;
}

.app-header .eyebrow {
  display: inline-flex;
  width: fit-content;
  padding: 4px 10px;
  border-radius: 999px;
  color: #8d160f;
  background: rgba(255, 248, 235, 0.94);
  box-shadow: 0 8px 18px rgba(71, 12, 7, 0.14);
}

.app-header .brand-lockup h1 {
  color: #ffffff;
  text-shadow: 0 2px 12px rgba(62, 8, 6, 0.3);
}

.app-header .header-subtitle {
  color: #fff1e4;
  text-shadow: 0 1px 8px rgba(62, 8, 6, 0.24);
}

.app-main {
  position: relative;
  z-index: 1;
  padding-bottom: 96px;
}

.app-nav {
  align-items: center;
  justify-content: flex-end;
}

.app-nav .nav-tab,
.app-nav .portal-link,
.app-nav .ghost-btn {
  gap: 7px;
  border-color: rgba(255, 255, 255, 0.54);
  background: rgba(255, 250, 247, 0.96);
  color: #5a120d;
  font-weight: 900;
  box-shadow: 0 10px 22px rgba(71, 12, 7, 0.18);
}

.app-nav .nav-tab.active {
  color: #ffffff;
  border-color: rgba(255, 223, 156, 0.72);
  background: linear-gradient(180deg, #ff7a32, #b71912);
  box-shadow: 0 12px 28px rgba(61, 8, 6, 0.3);
}

body[data-portal="admin"] .app-header {
  gap: 14px;
  padding-block: 14px;
}

body[data-portal="admin"] .brand-lockup h1 {
  font-size: clamp(18px, 1.8vw, 24px);
  line-height: 1.22;
}

body[data-portal="admin"] .header-subtitle {
  max-width: 480px;
  font-size: 14px;
}

body[data-portal="admin"] .app-nav {
  gap: 6px;
  flex-wrap: nowrap;
}

body[data-portal="admin"] .compact-menu {
  display: inline-flex;
  min-width: 64px;
  min-height: 54px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 7px 9px;
  gap: 4px;
  border-radius: 18px;
  font-size: 12px;
  line-height: 1.1;
}

body[data-portal="admin"] .compact-menu.ghost-btn {
  border-color: rgba(215, 53, 32, 0.18);
  background: #fffaf7;
}

.admin-menu-icon {
  display: inline-grid;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 999px;
  color: currentColor;
}

.admin-menu-icon svg {
  display: block;
  width: 21px;
  height: 21px;
  fill: currentColor;
}

.admin-menu-label {
  max-width: 58px;
  overflow: hidden;
  color: currentColor;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-portal="admin"] .auth-chip {
  max-width: 138px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-icon {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 999px;
  background: #fff1dc;
  font-size: 17px;
  line-height: 1;
}

.nav-tab.active .nav-icon {
  background: rgba(255, 255, 255, 0.2);
}

.nav-cart {
  color: #82180f;
}

.nav-cart .nav-icon {
  background: #ffe2bc;
}

.nav-tracking {
  color: #0f5a39;
}

.nav-tracking .nav-icon {
  background: #dcf8e7;
}

.nav-admin {
  color: #4a2618;
}

.nav-admin .nav-icon {
  background: #f8e1cb;
}

.brand-logo {
  width: clamp(58px, 7vw, 78px);
}

h1 {
  font-size: clamp(22px, 2.4vw, 30px);
}

.nav-tab,
.portal-link,
.filter-btn {
  border-radius: 999px;
}

.quick-order-panel {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 8px;
  background: rgba(255, 248, 244, 0.96);
  box-shadow: var(--shadow);
}

.quick-order-panel > div {
  min-width: 0;
}

.quick-order-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
}

.quick-order-actions .small-action,
.quick-order-actions .primary-btn {
  min-height: 42px;
  white-space: nowrap;
}

.shop-hero {
  border-color: rgba(255, 255, 255, 0.52);
  border-radius: 8px;
  box-shadow: 0 28px 60px rgba(71, 12, 7, 0.22);
}

.shop-hero img {
  filter: saturate(1.05) contrast(1.02);
}

.quick-order-panel span {
  display: inline-flex;
  margin-bottom: 4px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #fff0d7;
  color: #8a3a00;
  font-size: 12px;
  font-weight: 800;
}

.quick-order-panel strong {
  display: block;
}

.quick-branch-summary {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  font-weight: 800;
}

.quick-branch-summary span,
.quick-branch-summary em {
  display: block;
  font-style: normal;
}

.quick-branch-summary span {
  color: #5d2a1e;
  font-weight: 950;
}

.quick-branch-summary em {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

.shop-branch-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0 0 18px;
  padding: 14px 16px;
  border: 1px solid rgba(217, 79, 47, 0.22);
  border-radius: 8px;
  background: rgba(255, 250, 247, 0.94);
  box-shadow: 0 12px 26px rgba(71, 12, 7, 0.1);
}

.shop-branch-status.visually-merged {
  display: none;
}

.shop-branch-status.visually-merged > button {
  min-height: 42px;
  background: #fffaf7;
}

.shop-branch-status strong,
.shop-branch-status span,
.shop-branch-status small {
  display: block;
}

.shop-branch-status span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.shop-branch-status strong {
  color: #4b120c;
  font-size: 18px;
  font-weight: 950;
}

.shop-branch-status small {
  color: var(--muted);
  line-height: 1.45;
}

.shop-branch-status.ok {
  border-color: rgba(35, 107, 70, 0.35);
  background: #eff9ef;
}

.shop-branch-status.warn {
  border-color: rgba(217, 79, 47, 0.35);
  background: #fff1ed;
}

.shop-branch-status > button {
  flex: 0 0 auto;
}

.category-filter {
  padding: 6px;
  border-radius: 999px;
  background: rgba(255, 250, 247, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.46);
  box-shadow: 0 14px 32px rgba(71, 12, 7, 0.12);
}

.category-menu {
  width: 100%;
  overflow-x: auto;
  flex-wrap: nowrap;
  align-items: stretch;
  padding-bottom: 10px;
  scrollbar-width: thin;
}

.filter-btn {
  min-height: 36px;
  border-color: transparent;
  font-weight: 900;
}

.category-menu .filter-btn {
  flex: 0 0 112px;
  flex-direction: column;
  gap: 8px;
  min-height: 88px;
  padding: 10px 12px;
  border-radius: 18px;
  line-height: 1.2;
}

.category-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 16px;
  background: linear-gradient(145deg, #fff4ea, #ffe0d3);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 8px 16px rgba(71, 12, 7, 0.12);
}

.category-icon::before,
.category-icon::after {
  content: "";
  position: absolute;
  display: block;
}

.category-icon-featured::before {
  width: 22px;
  height: 22px;
  background: #ffb02e;
  clip-path: polygon(50% 0, 61% 34%, 98% 34%, 68% 55%, 80% 92%, 50% 70%, 20% 92%, 32% 55%, 2% 34%, 39% 34%);
}

.category-icon-all::before {
  width: 21px;
  height: 21px;
  border-radius: 5px;
  background:
    linear-gradient(#d73520 0 0) left top / 9px 9px no-repeat,
    linear-gradient(#ff9b4a 0 0) right top / 9px 9px no-repeat,
    linear-gradient(#ffd978 0 0) left bottom / 9px 9px no-repeat,
    linear-gradient(#8f1a12 0 0) right bottom / 9px 9px no-repeat;
}

.category-icon-promotion::before {
  content: "%";
  position: static;
  color: #b21f14;
  font-size: 22px;
  font-weight: 950;
}

.category-icon-bundle3::before,
.category-icon-bundle2::before {
  content: "99";
  position: static;
  color: #b21f14;
  font-size: 15px;
  font-weight: 950;
}

.category-icon-bundle3::after,
.category-icon-bundle2::after {
  right: 6px;
  bottom: 5px;
  padding: 1px 4px;
  border-radius: 999px;
  background: #b21f14;
  color: #fff8ef;
  font-size: 9px;
  font-weight: 900;
}

.category-icon-bundle3::after {
  content: "3x";
}

.category-icon-bundle2::after {
  content: "2x";
}

.category-icon-pork::before {
  width: 25px;
  height: 18px;
  border-radius: 48% 52% 44% 56%;
  background: linear-gradient(135deg, #e0574d, #ffb4a8 52%, #d73520);
  transform: rotate(-12deg);
}

.category-icon-pork::after {
  width: 20px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 248, 244, 0.82);
  transform: rotate(-12deg);
}

.category-icon-chicken::before {
  width: 23px;
  height: 16px;
  border-radius: 52% 48% 56% 44%;
  background: linear-gradient(135deg, #ffd8c9, #f17f66);
  transform: rotate(-22deg);
}

.category-icon-chicken::after {
  right: 7px;
  bottom: 7px;
  width: 12px;
  height: 5px;
  border-radius: 999px;
  background: #f6d1bd;
  transform: rotate(-28deg);
}

.category-icon-eggs::before,
.category-icon-eggs::after {
  width: 15px;
  height: 21px;
  border-radius: 50% 50% 45% 45%;
  background: linear-gradient(180deg, #fff9ef, #f3c58a);
  box-shadow: 0 2px 4px rgba(71, 12, 7, 0.12);
}

.category-icon-eggs::before {
  left: 9px;
  transform: rotate(-10deg);
}

.category-icon-eggs::after {
  right: 8px;
  transform: rotate(10deg);
}

.category-icon-frozen::before {
  content: "*";
  position: static;
  color: #2d86c8;
  font-size: 28px;
  font-weight: 950;
  line-height: 1;
}

.category-icon-seasoning::before {
  width: 14px;
  height: 24px;
  border-radius: 5px 5px 7px 7px;
  background: linear-gradient(180deg, #ffd978 0 28%, #d73520 28% 100%);
}

.category-icon-seasoning::after {
  top: 7px;
  width: 18px;
  height: 5px;
  border-radius: 999px;
  background: #fff8ef;
}

.section-head {
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 248, 244, 0.72);
}

.section-head.compact {
  padding: 0;
  background: transparent;
}

.product-grid {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.product-card,
.panel,
.order-card,
.tracking-card {
  border-color: rgba(240, 199, 189, 0.85);
}

.product-card {
  overflow: hidden;
  background:
    linear-gradient(180deg, #ffffff, #fff9f5);
  box-shadow: 0 16px 34px rgba(71, 12, 7, 0.14);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 46px rgba(71, 12, 7, 0.22);
}

.product-card img {
  aspect-ratio: 1 / 0.72;
}

.product-grid.product-grid-promotion {
  grid-template-columns: repeat(auto-fill, minmax(220px, 280px));
  justify-content: start;
  align-items: start;
}

.product-grid.product-grid-promotion .product-card {
  width: 100%;
  max-width: 280px;
}

.product-grid.product-grid-promotion .product-card img {
  max-height: 220px;
  object-fit: cover;
}

.featured-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffd978, var(--accent));
  color: #5b2100;
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(90, 33, 0, 0.18);
}

.featured-empty {
  grid-column: 1 / -1;
  min-height: 110px;
}

.promo-section {
  position: relative;
  overflow: hidden;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 250, 247, 0.96), rgba(255, 232, 221, 0.9)),
    radial-gradient(circle at 12% 0%, rgba(245, 165, 36, 0.24), transparent 36%);
  box-shadow: 0 22px 52px rgba(71, 12, 7, 0.22);
}

.promo-section::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(215, 53, 32, 0.06), rgba(215, 53, 32, 0)),
    repeating-linear-gradient(135deg, rgba(215, 53, 32, 0.06) 0 2px, transparent 2px 18px);
}

.promo-section > * {
  position: relative;
  z-index: 1;
}

.promo-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  margin-bottom: 8px;
  padding: 0 12px;
  border-radius: 8px;
  background: linear-gradient(135deg, #d73520, #9f1d13);
  color: #ffffff;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
  box-shadow: 0 10px 22px rgba(122, 29, 19, 0.2);
}

.promo-headline {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(215, 53, 32, 0.18);
  border-radius: 8px;
  background: #ffffff;
  color: var(--primary-dark);
  box-shadow: 0 12px 24px rgba(71, 12, 7, 0.1);
}

.promo-slide {
  border-color: rgba(255, 255, 255, 0.76);
  background: linear-gradient(180deg, #ffffff, #fff6ef);
  box-shadow: 0 16px 34px rgba(71, 12, 7, 0.16);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.promo-slide:hover {
  transform: translateY(-3px);
  box-shadow: 0 24px 48px rgba(71, 12, 7, 0.24);
}

.promo-slide:hover .promo-media img {
  transform: scale(1.035);
}

.promo-slide strong {
  font-size: 17px;
  line-height: 1.3;
}

.promo-slide small {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  width: fit-content;
  padding: 0 10px;
  border-radius: 8px;
  background: rgba(245, 165, 36, 0.16);
}

.promo-slide del {
  font-size: 13px;
}

.promo-slider::-webkit-scrollbar {
  height: 8px;
}

.promo-slider::-webkit-scrollbar-track {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.52);
}

.promo-slider::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(169, 31, 19, 0.38);
}

body[data-portal="customer"] #shop-view h2,
body[data-portal="customer"] #shop-view h3 {
  color: #3f110c;
  font-weight: 950;
}

body[data-portal="customer"] #shop-view p,
body[data-portal="customer"] #shop-view .header-subtitle,
body[data-portal="customer"] #shop-view .product-body p {
  color: #5b2b24;
  font-weight: 700;
}

body[data-portal="customer"] #shop-view .section-head:not(.compact) {
  background: rgba(255, 250, 247, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.62);
  box-shadow: 0 14px 30px rgba(71, 12, 7, 0.12);
}

body[data-portal="customer"] #shop-view .section-head h2,
body[data-portal="customer"] #shop-view .promo-section h2 {
  color: #4b120c;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
}

body[data-portal="customer"] #shop-view .filter-btn {
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid rgba(215, 53, 32, 0.08);
  background: linear-gradient(180deg, #ffffff, #fff8f2);
  color: #5b1b13;
  box-shadow: 0 8px 18px rgba(71, 12, 7, 0.08);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
  white-space: nowrap;
}

body[data-portal="customer"] #shop-view .category-menu .filter-btn {
  min-height: 92px;
  padding: 10px 12px;
  border-color: rgba(215, 53, 32, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 245, 238, 0.96));
}

body[data-portal="customer"] #shop-view .category-filter {
  align-items: center;
  gap: 10px;
  max-width: 100%;
  padding: 8px;
  border-color: rgba(215, 53, 32, 0.1);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 243, 236, 0.96));
  box-shadow: 0 16px 34px rgba(71, 12, 7, 0.14);
}

body[data-portal="customer"] #shop-view .filter-btn:hover {
  border-color: rgba(215, 53, 32, 0.26);
  box-shadow: 0 12px 24px rgba(71, 12, 7, 0.14);
  transform: translateY(-1px);
}

body[data-portal="customer"] #shop-view .filter-btn.active {
  border-color: rgba(169, 31, 19, 0.35);
  background: linear-gradient(180deg, #e7422b, #b91f16);
  color: #ffffff;
  box-shadow: 0 14px 26px rgba(169, 31, 19, 0.26);
}

body[data-portal="customer"] #shop-view .filter-btn.active .category-icon {
  background: linear-gradient(145deg, #ffffff, #ffe7d8);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 10px 20px rgba(71, 12, 7, 0.18);
}

body[data-portal="customer"] #shop-view .section-head:not(.compact) {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 8px;
}

body[data-portal="customer"] #shop-view .category-filter {
  display: flex;
  gap: 8px;
  max-width: 100%;
  overflow-x: auto;
  flex-wrap: nowrap;
  align-items: center;
  padding: 4px 2px 8px;
  border: 0;
  background: transparent;
  box-shadow: none;
  scrollbar-width: thin;
}

body[data-portal="customer"] #shop-view .category-menu {
  width: 100%;
}

body[data-portal="customer"] #shop-view .category-menu .filter-btn {
  flex: 0 0 auto;
  flex-direction: row;
  gap: 7px;
  min-height: 42px;
  min-width: auto;
  padding: 0 13px;
  border-radius: 999px;
  border: 1px solid rgba(215, 53, 32, 0.14);
  background: #ffffff;
  box-shadow: none;
}

body[data-portal="customer"] #shop-view .category-menu .filter-btn span:last-child {
  font-size: 14px;
  line-height: 1;
}

body[data-portal="customer"] #shop-view .category-icon {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: #fff1e4;
  box-shadow: none;
  transform: scale(0.72);
}

body[data-portal="customer"] #shop-view .filter-btn:hover {
  transform: none;
  box-shadow: none;
}

body[data-portal="customer"] #shop-view .filter-btn.active {
  border-color: #b91f16;
  background: #b91f16;
  color: #ffffff;
  box-shadow: none;
}

body[data-portal="customer"] #shop-view .filter-btn.active .category-icon {
  background: #ffffff;
  box-shadow: none;
}

body[data-portal="customer"] #shop-view .product-card strong,
body[data-portal="customer"] #shop-view .promo-slide strong,
body[data-portal="customer"] #shop-view .quick-order-panel strong {
  color: #33100b;
  font-weight: 950;
}

body[data-portal="customer"] #shop-view .product-actions strong,
body[data-portal="customer"] #shop-view .promo-now,
body[data-portal="customer"] #shop-view .promo-price {
  color: #b21f14;
}

body[data-portal="customer"] #shop-view .promo-slide del,
body[data-portal="customer"] #shop-view .product-actions del {
  color: #7a514a;
}

body[data-portal="customer"] #shop-view .promo-slide small,
body[data-portal="customer"] #shop-view .promo-expiry {
  background: rgba(255, 221, 184, 0.55);
  color: #742015;
  font-weight: 850;
}

body[data-portal="customer"] #shop-view .quick-order-panel span {
  color: #612100;
}

.cart-item {
  background: #fff8f4;
}

.qty-control button {
  border-color: rgba(215, 53, 32, 0.25);
  color: var(--primary);
}

.qty-control span {
  font-weight: 800;
}

@media (max-width: 820px) {
  .topbar,
  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .brand-lockup {
    align-items: flex-start;
  }

  .checkout-layout,
  .customer-layout,
  .product-admin-layout,
  .branch-manager-layout,
  .location-grid,
  .tracking-points,
  .order-add-product {
    grid-template-columns: 1fr;
  }

  .order-edit-row {
    display: grid;
  }

  .admin-product-card {
    grid-template-columns: 1fr;
  }

  .admin-product-card img {
    width: 100%;
    aspect-ratio: 4 / 3;
    height: auto;
  }

  .product-grid.product-grid-promotion {
    grid-template-columns: 1fr;
  }

  .product-grid.product-grid-promotion .product-card {
    max-width: none;
  }

  .product-grid.product-grid-promotion .product-card img {
    max-height: 260px;
  }

  .topbar {
    position: static;
  }

  .brand-lockup {
    gap: 12px;
  }

  .brand-logo {
    width: 64px;
  }

  .app-nav {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 30;
    justify-content: space-around;
    padding: 8px;
    border: 1px solid rgba(240, 199, 189, 0.9);
    border-radius: 999px;
    background: rgba(255, 248, 244, 0.96);
    box-shadow: 0 18px 40px rgba(71, 12, 7, 0.25);
  }

  .app-nav .nav-tab,
  .app-nav .portal-link,
  .app-nav .ghost-btn {
    min-height: 42px;
    flex: 1 1 0;
    padding: 0 8px;
    font-size: 13px;
  }

  body[data-portal="admin"] .app-nav {
    justify-content: flex-start;
    overflow-x: auto;
    border-radius: 22px;
    scrollbar-width: none;
  }

  body[data-portal="admin"] .app-nav::-webkit-scrollbar {
    display: none;
  }

  body[data-portal="admin"] .app-nav .auth-chip {
    display: none;
  }

  body[data-portal="admin"] .app-nav .compact-menu {
    min-width: 62px;
    min-height: 48px;
    flex: 0 0 62px;
    padding: 6px 7px;
    border-radius: 16px;
    font-size: 11px;
  }

  body[data-portal="admin"] .app-nav .admin-menu-icon {
    width: 22px;
    height: 22px;
  }

  body[data-portal="admin"] .app-nav .admin-menu-icon svg {
    width: 19px;
    height: 19px;
  }

  .quick-order-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .quick-order-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .quick-order-actions .small-action,
  .quick-order-actions .primary-btn {
    width: 100%;
  }

  .shop-branch-status {
    align-items: stretch;
    flex-direction: column;
  }

  .shop-branch-status.visually-merged {
    margin: -6px 12px 14px;
    width: auto;
    max-width: none;
  }

  .shop-branch-status > button {
    width: 100%;
  }

  .promo-slider {
    grid-auto-columns: minmax(250px, 82vw);
  }

  .promo-section {
    padding: 14px;
  }

  .promo-headline {
    width: fit-content;
  }

  .tracking-cancel-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .order-alert-popup {
    right: 16px;
    bottom: 82px;
    left: 16px;
    width: auto;
  }
}

@media (max-width: 1024px) {
  main {
    padding: 18px 14px 84px;
  }

  .topbar {
    gap: 12px;
    padding: 12px 14px;
  }

  .brand-logo {
    width: 56px;
  }

  h1 {
    font-size: 20px;
    line-height: 1.2;
  }

  h2 {
    font-size: 20px;
  }

  h3 {
    font-size: 17px;
  }

  .header-subtitle,
  p,
  label,
  input,
  textarea,
  select,
  button {
    font-size: 14px;
  }

  .panel,
  .order-card,
  .tracking-card,
  .product-body {
    padding: 12px;
  }

  .section-head {
    gap: 10px;
    margin-bottom: 12px;
    padding: 10px;
  }

  .product-grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
  }

  .product-card img {
    aspect-ratio: 1 / 0.78;
  }

  .product-meta,
  .branch-stock-note,
  .cart-item span,
  .order-head span,
  .branch-card span {
    font-size: 12px;
  }

  .product-actions {
    gap: 8px;
    margin-top: 10px;
  }

  .nav-tab,
  .portal-link,
  .filter-btn,
  .ghost-btn,
  .primary-btn {
    min-height: 38px;
    padding: 0 11px;
  }

  input,
  textarea,
  select {
    padding: 9px 10px;
  }

  .quick-order-panel,
  .shop-branch-status,
  .product-search-field {
    padding: 10px 12px;
  }

  .checkout-form {
    gap: 10px;
  }
}

@media (max-width: 600px) {
  body {
    overflow-x: hidden;
  }

  main {
    padding: 12px 10px 76px;
  }

  .topbar {
    padding: 10px;
  }

  .brand-lockup {
    gap: 9px;
  }

  .brand-logo {
    width: 48px;
  }

  .eyebrow {
    font-size: 11px;
  }

  h1 {
    font-size: 18px;
  }

  h2 {
    font-size: 18px;
  }

  h3 {
    font-size: 16px;
  }

  .header-subtitle {
    display: none;
  }

  .shop-hero {
    margin-bottom: 12px;
  }

  .shop-hero img {
    max-height: 210px;
  }

  .quick-order-panel {
    gap: 8px;
    margin-bottom: 12px;
  }

  .quick-order-panel span {
    margin-bottom: 2px;
    padding: 3px 8px;
    font-size: 11px;
  }

  .promo-section {
    margin-bottom: 14px;
    padding: 10px;
  }

  .promo-slider {
    grid-auto-columns: minmax(210px, 74vw);
    gap: 10px;
  }

  body[data-portal="customer"] #shop-view .section-head:not(.compact) {
    padding: 10px;
  }

  body[data-portal="customer"] #shop-view .category-filter {
    gap: 6px;
    padding-bottom: 6px;
  }

  body[data-portal="customer"] #shop-view .category-menu .filter-btn {
    min-height: 36px;
    padding: 0 10px;
  }

  body[data-portal="customer"] #shop-view .category-icon {
    width: 20px;
    height: 20px;
  }

  body[data-portal="customer"] #shop-view .category-menu .filter-btn span:last-child {
    font-size: 13px;
  }

  .product-search-field {
    margin-bottom: 12px;
  }

  .product-search-field input,
  .admin-product-search input {
    min-height: 38px;
  }

  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }

  .product-body {
    padding: 10px;
  }

  .product-card img {
    aspect-ratio: 1 / 0.82;
  }

  .product-card h3 {
    margin-bottom: 5px;
  }

  .product-card p,
  .product-meta,
  .branch-stock-note {
    margin-bottom: 6px;
  }

  .product-buy-row {
    grid-template-columns: 1fr;
  }

  .primary-btn.small,
  .small-action {
    min-height: 34px;
  }

  .cart-item,
  .order-edit-row,
  .order-head,
  .tracking-distance {
    gap: 8px;
  }

  .cart-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 10px;
  }

  .qty-control {
    grid-template-columns: 30px 28px 30px;
  }

  .qty-control button {
    width: 30px;
    height: 30px;
  }

  .summary {
    margin-top: 12px;
    padding-top: 10px;
  }

  .summary .total {
    font-size: 18px;
  }

  .app-nav {
    left: 8px;
    right: 8px;
    bottom: 8px;
    gap: 5px;
    padding: 6px;
    border-radius: 18px;
  }

  .app-nav .nav-tab,
  .app-nav .portal-link,
  .app-nav .ghost-btn {
    min-height: 38px;
    padding: 0 6px;
    gap: 4px;
    font-size: 12px;
    box-shadow: none;
  }

  .nav-icon {
    display: none;
  }

  body[data-portal="admin"] .app-nav .compact-menu {
    min-width: 52px;
    min-height: 42px;
    flex-basis: 52px;
    border-radius: 12px;
    font-size: 10px;
  }

  body[data-portal="admin"] .app-nav .admin-menu-icon {
    width: 18px;
    height: 18px;
  }

  .admin-product-card,
  .branch-card,
  .customer-card {
    padding: 10px;
  }

  .admin-product-card img {
    max-height: 190px;
  }

  .branch-region-tabs,
  .admin-category-filter {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 6px;
  }

  .branch-region-tab,
  .admin-category-filter .filter-btn {
    flex: 0 0 auto;
  }
}
