/* ieGlobal CRM — Apple macOS dark */

:root {
  color-scheme: dark;
  --bg: #000000;
  --bg-elevated: #1c1c1e;
  --bg-elevated-2: #2c2c2e;
  --surface: rgba(28, 28, 30, 0.78);
  --surface-solid: #1c1c1e;
  --ink: #f5f5f7;
  --ink-secondary: #ebebf5;
  --muted: #98989d;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --accent: #0a84ff;
  --accent-press: #409cff;
  --ok: #30d158;
  --warn: #ffd60a;
  --danger: #ff453a;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.45), 0 0 0 0.5px rgba(255, 255, 255, 0.06);
  --radius: 20px;
  --radius-sm: 14px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Helvetica Neue", Helvetica, Arial, sans-serif;
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

#app {
  min-height: 100vh;
  background:
    radial-gradient(900px 480px at 15% -5%, rgba(10, 132, 255, 0.12), transparent 55%),
    radial-gradient(700px 400px at 95% 5%, rgba(94, 92, 230, 0.08), transparent 50%),
    var(--bg);
}

.screen {
  max-width: 480px;
  margin: 0 auto;
  padding: 28px 20px 52px;
  animation: fadeUp 0.35s var(--ease);
}

.screen.wide { max-width: 1100px; }
.screen.shop-screen {
  max-width: none;
  width: 100%;
  padding: 10px 16px 24px;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.logo-wrap {
  text-align: center;
  padding: 40px 12px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.logo-hero {
  width: min(320px, 78vw);
  height: auto;
  filter: drop-shadow(0 12px 40px rgba(10, 132, 255, 0.18));
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 2px 18px;
}
.brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.topbar-end {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.logo-bar {
  height: 72px;
  width: auto;
  max-width: 280px;
  object-fit: contain;
  filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.4));
}
.logo-bar-lg,
.shop-screen .logo-bar:not(.logo-bar-compact) {
  height: 96px;
  max-width: 360px;
}
.logo-bar-compact {
  height: 40px;
  max-width: 150px;
}
.topbar-compact {
  padding: 4px 2px 8px;
  gap: 8px;
}
.topbar-compact .sync-btn {
  padding: 6px 10px;
  font-size: 0.75rem;
}
.topbar-compact .rep-name {
  font-size: 0.75rem;
}
.topbar-compact .rep-name .btn {
  margin-top: 0;
  padding: 4px 8px;
  font-size: 0.7rem;
}
.sync-btn {
  flex-shrink: 0;
  border-radius: 980px;
  padding: 8px 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  background: var(--bg-elevated-2);
  border: 1px solid var(--line-strong);
}
.sync-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent-press);
}
.sync-btn.busy,
.sync-btn:disabled {
  opacity: 0.65;
  cursor: wait;
}

.rep-name {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.01em;
  white-space: nowrap;
  padding: 0 2px;
}
.rep-chip {
  display: none;
}

.card {
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 22px;
  margin-top: 12px;
  box-shadow: var(--shadow);
  backdrop-filter: saturate(180%) blur(28px);
  -webkit-backdrop-filter: saturate(180%) blur(28px);
}

.card h1 {
  font-size: 1.625rem;
  font-weight: 650;
  letter-spacing: -0.03em;
  margin: 0 0 6px;
  text-align: center;
  color: var(--ink);
}

.sub {
  text-align: center;
  color: var(--muted);
  margin: 0 0 22px;
  font-size: 0.9375rem;
  line-height: 1.45;
  letter-spacing: -0.01em;
}

.label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 7px;
  letter-spacing: -0.01em;
}

.pin-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 22px 0 12px;
}
.pin-digit {
  width: 54px;
  height: 62px;
  text-align: center;
  font-size: 1.55rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated-2);
  color: var(--ink);
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease), background 0.18s var(--ease);
}
.pin-digit:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(10, 132, 255, 0.28);
  background: #3a3a3c;
}

.field {
  width: 100%;
  padding: 14px 15px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  font-size: 16px;
  background: var(--bg-elevated-2);
  color: var(--ink);
  letter-spacing: -0.01em;
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease), background 0.18s var(--ease);
}
.field::placeholder { color: #636366; }
.field:focus {
  outline: none;
  border-color: var(--accent);
  background: #3a3a3c;
  box-shadow: 0 0 0 4px rgba(10, 132, 255, 0.22);
}

.btn {
  width: 100%;
  border: 0;
  border-radius: 980px;
  padding: 13px 18px;
  font-weight: 600;
  font-size: 0.975rem;
  letter-spacing: -0.015em;
  cursor: pointer;
  margin-top: 10px;
  transition: transform 0.14s var(--ease), opacity 0.14s var(--ease), background 0.14s var(--ease), filter 0.14s var(--ease);
}
.btn:active { transform: scale(0.98); }
.btn.primary {
  background: var(--accent);
  color: #fff;
}
.btn.primary:hover { background: var(--accent-press); }
.btn.warm {
  background: #f5f5f7;
  color: #000;
}
.btn.warm:hover { filter: brightness(0.94); }
.btn.ghost {
  background: transparent;
  color: var(--accent);
  border: 0;
  font-weight: 500;
}
.btn.ghost:hover { opacity: 0.85; }
.btn:disabled { opacity: 0.35; cursor: default; }
.btn.small {
  width: auto;
  padding: 8px 14px;
  font-size: 0.8125rem;
  margin: 0;
}

.msg {
  text-align: center;
  color: var(--danger);
  min-height: 1.2em;
  margin-top: 12px;
  font-size: 0.875rem;
}
.msg.ok { color: var(--ok); }

.results {
  margin-top: 12px;
  display: grid;
  gap: 8px;
  max-height: 52vh;
  overflow: auto;
}
.result {
  text-align: left;
  width: 100%;
  border: 1px solid var(--line);
  background: var(--bg-elevated-2);
  border-radius: var(--radius-sm);
  padding: 13px 14px;
  cursor: pointer;
  transition: background 0.14s var(--ease), border-color 0.14s var(--ease), transform 0.14s var(--ease);
}
.result:hover {
  background: #3a3a3c;
  border-color: var(--line-strong);
}
.result:active { transform: scale(0.99); }
.result strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.result span {
  color: var(--muted);
  font-size: 0.8125rem;
}

.shop-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
.search-wrap {
  position: relative;
  z-index: 40;
}
.search-hint {
  margin: 8px 2px 0;
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: -0.01em;
}
.suggest-dd {
  display: block;
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  max-height: min(420px, 55vh);
  overflow: auto;
  background: #1c1c1e;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-sm);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.65);
  z-index: 50;
}
.suggest-dd[hidden] {
  display: none !important;
}
.suggest-item {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  column-gap: 12px;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  padding: 12px 14px;
  cursor: pointer;
  transition: background 0.12s var(--ease);
}
.suggest-item:last-child { border-bottom: 0; }
.suggest-item:hover,
.suggest-item:focus {
  background: rgba(10, 132, 255, 0.14);
  outline: none;
}
.suggest-item strong {
  grid-column: 1;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.suggest-item span {
  grid-column: 1;
  color: var(--muted);
  font-size: 0.75rem;
}
.suggest-item .suggest-price {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.875rem;
  letter-spacing: -0.02em;
}
.suggest-empty {
  margin: 0;
  padding: 16px;
  text-align: center;
  color: var(--muted);
  font-size: 0.875rem;
}
.cat-sidebar {
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  max-height: 32vh;
  overflow: auto;
  box-shadow: var(--shadow);
  backdrop-filter: saturate(160%) blur(24px);
  -webkit-backdrop-filter: saturate(160%) blur(24px);
}
.cat-title {
  font-weight: 600;
  font-size: 0.6875rem;
  margin: 4px 8px 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.cat-list { display: grid; gap: 2px; }
.cat-item {
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--ink-secondary);
  border-radius: 11px;
  padding: 9px 12px;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 450;
  line-height: 1.3;
  letter-spacing: -0.01em;
  transition: background 0.14s var(--ease), color 0.14s var(--ease);
}
.cat-item:hover { background: rgba(255, 255, 255, 0.06); }
.cat-item.active {
  background: rgba(10, 132, 255, 0.18);
  color: #64b5ff;
  font-weight: 600;
}

.product {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: var(--shadow);
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease), border-color 0.18s var(--ease);
}
.product:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
}
.product-media {
  position: relative;
  flex-shrink: 0;
}
.product-media .stock-pill {
  position: absolute;
  left: 8px;
  top: 8px;
  z-index: 2;
  margin: 0;
}
.thumb {
  width: 140px;
  height: 140px;
  object-fit: contain;
  background: #000;
  border: 1px solid var(--line);
  border-radius: 16px;
  flex-shrink: 0;
  display: block;
}
.products.img-md .thumb { width: 96px; height: 96px; }
.products.img-lg .thumb { width: 148px; height: 148px; }
.products.img-xl .thumb {
  width: 220px;
  height: 220px;
  border-radius: 18px;
}
.products.img-xl .product {
  flex-direction: column;
  align-items: stretch;
}
.products.img-xl .thumb {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  max-height: 280px;
}
.cat-heading {
  margin: 12px 2px 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink-secondary);
  letter-spacing: -0.01em;
}
.img-size-label {
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: -0.01em;
}
.img-size-toggle {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-elevated-2);
}
.img-size-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 6px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.02em;
}
.img-size-btn + .img-size-btn {
  border-left: 1px solid var(--line);
}
.img-size-btn.active {
  background: rgba(10, 132, 255, 0.22);
  color: var(--ink);
}
.thumb.empty {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 500;
  background: var(--bg-elevated-2);
}
.product .meta { flex: 1; min-width: 0; }
.product .meta h3 {
  margin: 0 0 2px;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: var(--ink);
}
.product .meta p {
  margin: 0;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: -0.01em;
}
.meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 7px;
}

.stock-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: 980px;
  padding: 4px 10px;
  text-transform: uppercase;
}
.stock-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}
.stock-pill.high {
  color: #30d158;
  background: rgba(48, 209, 88, 0.14);
}
.stock-pill.low {
  color: #ffd60a;
  background: rgba(255, 214, 10, 0.12);
}
.stock-pill.out {
  color: #ff9f0a;
  background: rgba(255, 159, 10, 0.12);
}

.uom-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 4px;
}
.uom-btn {
  border: 1px solid var(--line-strong);
  background: var(--bg-elevated-2);
  color: var(--ink);
  border-radius: 11px;
  padding: 8px 10px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 72px;
  letter-spacing: -0.01em;
  transition: background 0.14s var(--ease), border-color 0.14s var(--ease), transform 0.14s var(--ease);
}
.uom-btn:hover { border-color: rgba(255, 255, 255, 0.28); }
.uom-btn:active { transform: scale(0.97); }
.uom-btn .uom-price {
  font-weight: 600;
  font-size: 0.78rem;
  color: var(--muted);
}
.uom-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.uom-btn.active .uom-price { color: rgba(255, 255, 255, 0.82); }

.price {
  font-weight: 650;
  margin-top: 8px;
  font-size: 1.08rem;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.price-uom {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
}

.qty {
  width: 56px;
  padding: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  font-size: 16px;
  text-align: center;
  background: var(--bg-elevated-2);
  color: var(--ink);
}
.qty:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.22);
}

.sticky {
  position: sticky;
  bottom: 14px;
  margin-top: 18px;
  background: rgba(28, 28, 30, 0.86);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
  backdrop-filter: saturate(180%) blur(28px);
  -webkit-backdrop-filter: saturate(180%) blur(28px);
}
.sticky .row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
}

/* Fixed compact quote bar on shop (phones + laptops) */
.shop-screen .shop-sticky {
  position: fixed;
  left: 16px;
  right: 16px;
  transform: none;
  bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  width: auto;
  max-width: none;
  z-index: 40;
  margin: 0;
  padding: 10px 12px;
  border-radius: 16px;
}
.shop-screen .shop-sticky .shop-sticky-row {
  margin-bottom: 8px;
  font-size: 0.9rem;
}
.shop-screen .shop-sticky .sticky-actions {
  gap: 8px;
}
.shop-screen .shop-sticky .sticky-actions .btn {
  margin-top: 0;
  min-height: 42px;
  padding: 10px 14px;
}
.shop-screen .shop-sticky .sticky-secondary {
  flex: 0 0 auto;
  width: auto;
  min-width: 88px;
}
.shop-topbar .shop-back {
  flex: 0 0 auto;
  width: auto;
  min-height: 40px;
  padding: 8px 10px !important;
  font-size: 0.82rem !important;
  margin-top: 0;
}

.context {
  font-size: 0.8125rem;
  color: var(--muted);
  margin: 4px 0 0;
  letter-spacing: -0.01em;
}

.cart-line {
  background: var(--bg-elevated-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 8px;
}
.cart-line .context { color: var(--muted); }

@media (min-width: 860px) {
  .shop-layout {
    grid-template-columns: 248px 1fr;
    align-items: start;
  }
  .cat-sidebar {
    max-height: calc(100vh - 110px);
    position: sticky;
    top: 16px;
  }
}

/* Product grid — phone → tablet → laptop → wide */
.products {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
@media (min-width: 560px) {
  .products {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .products.img-lg .thumb { width: 120px; height: 120px; }
}
@media (min-width: 900px) {
  .products {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (min-width: 1200px) {
  .products {
    grid-template-columns: repeat(4, 1fr);
  }
}
@media (min-width: 1600px) {
  .products {
    grid-template-columns: repeat(5, 1fr);
  }
}

/* Smooth scrollbars (WebKit) */
.cat-sidebar::-webkit-scrollbar,
.results::-webkit-scrollbar { width: 8px; }
.cat-sidebar::-webkit-scrollbar-thumb,
.results::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 8px;
}

.action-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 14px 0 18px;
}
.action-item {
  text-align: left;
  background: var(--bg-elevated-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  cursor: pointer;
  color: inherit;
}
.action-item:hover {
  border-color: var(--line-strong);
  background: rgba(10, 132, 255, 0.12);
}

/* Skynamo-style customer hub (same palette) */
.hub-kicker {
  margin: 0 0 4px;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.hub-title {
  font-size: 1.35rem;
  line-height: 1.25;
  margin-bottom: 6px;
}
.hub-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 18px 0 14px;
}
.hub-btn {
  width: 100%;
  min-height: 48px;
  font-size: 1.05rem;
}
.shop-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 8px;
}
.shop-nav .btn {
  padding-left: 0;
}

.hub-link-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 8px 0 18px;
}
.hub-link {
  text-align: left;
  background: var(--bg-elevated-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 13px 16px;
  cursor: pointer;
  color: inherit;
  font: inherit;
}
.hub-link:hover {
  border-color: var(--line-strong);
  background: rgba(10, 132, 255, 0.12);
}
.stub-box {
  margin: 16px 0 18px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--line-strong);
  background: var(--bg-elevated-2);
}
.stub-box p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.4;
}
.hist-table-wrap {
  margin: 14px 0 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated-2);
}
.hist-table-full {
  max-height: min(70vh, 720px);
  overflow: auto;
}
.hist-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  white-space: nowrap;
}
.hist-table th,
.hist-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.hist-table th {
  color: var(--muted);
  font-weight: 600;
  background: rgba(0, 0, 0, 0.18);
  position: sticky;
  top: 0;
  z-index: 1;
}
.hist-table tbody tr:last-child td {
  border-bottom: none;
}
.hist-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0 8px;
}
.hist-tab {
  border: 1px solid var(--line);
  background: var(--bg-elevated-2);
  color: inherit;
  font: inherit;
  font-size: 0.85rem;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.hist-tab.active {
  border-color: var(--accent, #0a84ff);
  background: rgba(10, 132, 255, 0.16);
}
.hist-search-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}
.hist-search-row .field {
  flex: 1;
  margin: 0;
}
.hist-card {
  max-width: none;
}
.shop-hist-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 8px 0 0;
  padding: 0 2px 2px;
}
.shop-hist-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-right: 2px;
}
.shop-hist-chip {
  border: 1px solid var(--line);
  background: var(--bg-elevated-2);
  color: inherit;
  font: inherit;
  font-size: 0.8rem;
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
}
.shop-hist-chip:hover {
  border-color: var(--line-strong);
  background: rgba(10, 132, 255, 0.12);
}
.info-grid {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.info-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 8px;
  align-items: start;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.info-k {
  color: var(--muted);
  font-size: 0.85rem;
}
.info-row.locked .info-v {
  opacity: 0.95;
}
.info-row.locked .info-k::after {
  content: " · locked";
  font-size: 0.75em;
  opacity: 0.7;
}
textarea.field.area {
  min-height: 88px;
  resize: vertical;
  line-height: 1.4;
}
.field-hint {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
}
select.field {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) calc(50% - 3px), calc(100% - 12px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 36px;
}

/* Shop chrome — compact sticky header for phone + laptop */
.shop-chrome {
  position: sticky;
  top: 0;
  z-index: 30;
  margin: 0 0 10px;
  padding: 6px 0 8px;
  background: linear-gradient(180deg, rgba(0,0,0,0.98) 65%, rgba(0,0,0,0.78));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.shop-topbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.shop-deliver {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.shop-deliver-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.shop-deliver strong {
  font-size: 0.82rem;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.shop-deliver .context {
  font-size: 0.72rem;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.shop-search { margin-bottom: 8px; }
.shop-search-field {
  padding: 11px 13px;
  font-size: 16px; /* iOS zoom prevention */
}
.cart-btn {
  position: relative;
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 980px;
  border: 1px solid var(--line-strong);
  background: var(--bg-elevated-2);
  color: var(--ink);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.cart-btn.has-items {
  border-color: var(--accent);
  color: var(--accent-press);
}
.cart-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 980px;
  background: var(--accent);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  line-height: 1;
}
.cart-badge[hidden] { display: none !important; }
.cat-rail {
  display: none; /* replaced by .cat-panel */
}
.cat-chip { display: none; }

/* Full-width shop body: categories panel + catalogue */
.shop-body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: start;
}
.cat-panel {
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px 12px;
  min-width: 0;
}
.cat-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.cat-panel-title {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.cat-toggle {
  width: auto !important;
  margin: 0 !important;
  min-height: 32px;
  padding: 4px 10px !important;
  font-size: 0.75rem !important;
}
.cat-list-full {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 88px;
  overflow: hidden;
  transition: max-height 0.2s var(--ease);
}
.shop-body.cats-open .cat-list-full {
  max-height: none;
  overflow: visible;
}
.cat-pick {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: var(--bg-elevated-2);
  color: var(--ink-secondary);
  border-radius: 980px;
  padding: 7px 12px;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  text-align: left;
}
.cat-pick:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}
.cat-pick.active {
  background: rgba(10, 132, 255, 0.22);
  border-color: rgba(10, 132, 255, 0.45);
  color: #64b5ff;
  font-weight: 600;
}

/* Laptop+: left category sidebar using empty side space */
@media (min-width: 960px) {
  .shop-body {
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
    gap: 16px;
  }
  .cat-panel {
    position: sticky;
    top: 8px;
    max-height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
    padding: 12px;
  }
  .cat-toggle {
    display: none; /* always show all on laptop */
  }
  .cat-list-full,
  .shop-body .cat-list-full,
  .shop-body.cats-open .cat-list-full {
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 2px;
    max-height: none;
    overflow: auto;
    flex: 1;
    -webkit-overflow-scrolling: touch;
  }
  .cat-pick {
    width: 100%;
    border-radius: 10px;
    white-space: normal;
    line-height: 1.25;
    padding: 9px 12px;
  }
}
.shop-main-solo {
  min-width: 0;
  padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
}
.shop-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.shop-toolbar .cat-heading {
  margin: 0;
  flex: 1;
  min-width: 0;
}
.img-size-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.add-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
  flex-wrap: wrap;
}
.qty-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-elevated-2);
}
.qty-stepper .qty {
  width: 44px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.qty-btn {
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 1.1rem;
  cursor: pointer;
}
.qty-btn:hover { background: rgba(255,255,255,0.06); }
.sticky-actions {
  display: flex;
  gap: 8px;
}
.sticky-actions .btn { flex: 1; }
.cart-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.cart-head h1 { margin: 0; }
.cart-lines { margin-bottom: 16px; }
.cart-line {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.cart-thumb {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #000;
  flex-shrink: 0;
}
.cart-thumb.empty {
  display: grid;
  place-items: center;
  font-size: 0.65rem;
  color: var(--muted);
  background: var(--bg-elevated);
}
.cart-line-body { flex: 1; min-width: 0; }
.cart-line-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}
.cart-line-total {
  font-weight: 600;
  margin-left: auto;
}
.checkout-box {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
.products.img-xl .product-media {
  width: 100%;
}
.products.img-xl .product-media .thumb {
  width: 100%;
}

.back-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  padding: 0 2px;
}
.back-bar-split {
  flex-wrap: wrap;
}
.back-btn {
  min-height: 44px;
  padding: 10px 16px !important;
  border-radius: 12px !important;
  font-weight: 600 !important;
  letter-spacing: -0.01em;
  background: var(--bg-elevated-2) !important;
  border: 1px solid var(--line-strong) !important;
  color: var(--ink) !important;
  flex: 0 0 auto;
}
.back-btn:hover {
  border-color: var(--accent) !important;
  color: var(--accent-press) !important;
}
.back-btn.ghost {
  background: transparent !important;
}
.shop-topbar .back-btn {
  padding: 10px 12px !important;
}

@media (max-width: 559px) {
  .screen.shop-screen {
    padding: 8px 10px 16px;
  }
  .topbar-compact .rep-name-text {
    display: none;
  }
  .topbar-compact .logo-bar-compact {
    height: 34px;
    max-width: 120px;
  }
  .product {
    padding: 10px;
    gap: 10px;
    border-radius: 14px;
  }
  .products.img-xl .product {
    flex-direction: row;
    align-items: flex-start;
  }
  .products.img-xl .thumb,
  .products.img-xl .product-media .thumb {
    width: 96px;
    height: 96px;
    max-height: 96px;
    aspect-ratio: auto;
    border-radius: 12px;
  }
  .products.img-xl .product-media {
    width: auto;
    flex-shrink: 0;
  }
  .products.img-lg .thumb { width: 88px; height: 88px; }
  .product .meta h3 {
    font-size: 0.88rem;
  }
  .price {
    font-size: 0.98rem;
  }
  .uom-btn {
    min-width: 64px;
    padding: 6px 8px;
  }
  .shop-screen .shop-sticky {
    left: 8px;
    right: 8px;
    bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    padding: 8px 10px;
  }
  .shop-screen .shop-sticky .sticky-secondary {
    min-width: 72px;
    font-size: 0.82rem;
  }
}

/* —— Tablets / small laptops —— */
@media (min-width: 560px) and (max-width: 959px) {
  .screen.shop-screen {
    padding: 10px 14px 20px;
  }
  .products.img-xl .thumb,
  .products.img-xl .product-media .thumb {
    max-height: 200px;
  }
}

/* —— Laptops —— */
@media (min-width: 960px) {
  .screen.shop-screen {
    padding: 12px 20px 28px;
  }
  .shop-chrome {
    padding: 8px 0 10px;
  }
  .shop-deliver strong {
    font-size: 0.92rem;
  }
  .shop-screen .shop-sticky {
    left: 20px;
    right: 20px;
  }
  .logo-bar-compact {
    height: 48px;
    max-width: 180px;
  }
}

@media (min-width: 1280px) {
  .screen.shop-screen {
    padding: 12px 28px 28px;
  }
  .shop-screen .shop-sticky {
    left: 28px;
    right: 28px;
  }
}
