:root {
  --blue: #2498ed;
  --blue-dark: #145da0;
  --green: #17ad8c;
  --red: #e53935;
  --ink: #142033;
  --muted: #66748a;
  --line: #dbe6f1;
  --soft: #f3f8fc;
  --white: #fff;
  --shadow: 0 18px 40px rgba(20, 32, 51, 0.12);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; overflow-x: hidden; }
body {
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: #eef5f9;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.b2b-shell { min-height: 100vh; padding-bottom: 94px; overflow-x: hidden; }
.b2b-shell.is-locked {
  padding-bottom: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 18%, rgba(36, 152, 237, .18), transparent 32%),
    linear-gradient(135deg, #eef8fb 0%, #f8fbfe 48%, #edf5fb 100%);
}
.b2b-shell.is-locked .b2b-main,
.b2b-shell.is-locked .b2b-cart,
.b2b-shell.is-locked .b2b-cart-fab,
.b2b-shell.is-locked #btnCartOpenTop,
.b2b-shell.is-locked #btnAdminOpen {
  display: none;
}
.b2b-shell:not(.is-locked) .b2b-gate { display: none; }
.b2b-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px clamp(16px, 4vw, 40px);
  background: linear-gradient(135deg, #2299ee, #176bb8);
  color: var(--white);
  box-shadow: 0 10px 26px rgba(23, 107, 184, 0.22);
}
.b2b-brand { display: flex; gap: 12px; align-items: center; }
.b2b-logo-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #53c7ff, #9355df);
  font-weight: 800;
  font-size: 24px;
  box-shadow: 0 12px 24px rgba(0,0,0,.18);
}
.b2b-brand strong { display:block; font-size: 17px; }
.b2b-brand small { display:block; opacity:.86; font-size: 12px; margin-top: 2px; }

.b2b-main { width: min(1180px, 100%); margin: 0 auto; padding: 20px clamp(14px, 3vw, 28px); }
.b2b-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 18px;
  margin-bottom: 14px;
}
.b2b-eyebrow { margin: 0 0 8px; color: var(--blue-dark); font-weight: 800; font-size: 12px; text-transform: uppercase; }
.b2b-hero h1 { margin: 0; font-size: clamp(24px, 5vw, 42px); line-height: 1.05; letter-spacing: 0; max-width: 720px; }
.b2b-hero-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.b2b-hero-metrics div {
  min-width: 104px;
  padding: 12px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(20, 32, 51, .07);
}
.b2b-hero-metrics span { display:block; font-size: 20px; font-weight: 800; }
.b2b-hero-metrics small { color: var(--muted); font-weight: 600; }

.b2b-top-actions { display: flex; gap: 8px; align-items: center; }
.b2b-btn--ghost { background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.35); }
.b2b-btn--cart {
  background: #fff;
  color: var(--blue-dark);
  border: 1px solid rgba(255,255,255,.45);
  box-shadow: 0 10px 22px rgba(20, 32, 51, .14);
}
.b2b-btn--cart span {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  margin-left: 6px;
  border-radius: 8px;
  background: #e8f4ff;
  color: var(--blue-dark);
  font-size: 12px;
}
.b2b-gate {
  min-height: calc(100vh - 72px);
  display: grid;
  place-items: center;
  padding: 24px;
}
.b2b-gate-card {
  width: min(440px, 100%);
  display: grid;
  gap: 13px;
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(219,230,241,.9);
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 24px 60px rgba(20,32,51,.14);
}
.b2b-gate-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 8px;
  background: linear-gradient(135deg, #53c7ff, #9355df);
  color: #fff;
  font-size: 29px;
  font-weight: 800;
  box-shadow: 0 14px 28px rgba(36,152,237,.22);
}
.b2b-gate-card h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.08;
}
.b2b-gate-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}
.b2b-gate-card label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.b2b-access-request {
  margin-top: 2px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.b2b-invite-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
}
.b2b-invite-panel[hidden] { display: none; }
.b2b-invite-panel strong { color: var(--blue-dark); }
.b2b-invite-panel span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}
.b2b-access-request summary {
  cursor: pointer;
  color: var(--blue-dark);
  font-weight: 800;
  list-style-position: inside;
}
.b2b-access-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}
.b2b-access-request button { width: 100%; }
.b2b-access-request small {
  display: block;
  margin-top: 9px;
  color: var(--muted);
  line-height: 1.35;
}
.b2b-gate-card input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 13px 14px;
  color: var(--ink);
  outline: none;
}
.b2b-gate-card input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(36, 152, 237, .14);
}
.b2b-controlbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 150px 140px 140px 150px;
  gap: 10px;
  margin: 16px 0 10px;
}
.b2b-filter-toggle {
  display: none;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid #b8d7f1;
  border-radius: 6px;
  background: linear-gradient(180deg, #ffffff, #eef7ff);
  color: var(--blue-dark);
  padding: 11px 12px;
  font-weight: 800;
  box-shadow: 0 8px 0 rgba(20, 32, 51, .08);
}
.b2b-filter-toggle span {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--blue);
  color: #fff;
  font-size: 12px;
}
.b2b-search, .b2b-select-wrap, .b2b-note, .b2b-modal-card label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.b2b-search input, .b2b-select-wrap select, .b2b-note textarea, .b2b-modal-card input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  padding: 13px 14px;
  color: var(--ink);
  outline: none;
}
.b2b-search input:focus, .b2b-select-wrap select:focus, .b2b-modal-card input:focus, .b2b-note textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(36, 152, 237, .14);
}

.b2b-smart-filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 3px 0 11px;
  scrollbar-width: thin;
}
.b2b-smart-filters button {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 9px 11px;
  font-weight: 800;
  box-shadow: 0 7px 16px rgba(20, 32, 51, .05);
}
.b2b-smart-filters button.is-active {
  border-color: var(--blue);
  background: linear-gradient(180deg, #eaf6ff, #fff);
  color: var(--blue-dark);
}
.b2b-smart-filters span {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  margin-left: 5px;
  border-radius: 999px;
  background: #eef4fb;
  color: var(--muted);
  font-size: 11px;
}

.b2b-quick-order {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 420px) 190px;
  gap: 10px;
  align-items: center;
  margin: 10px 0 14px;
  padding: 12px;
  border: 1px solid rgba(219,230,241,.95);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(20, 32, 51, .06);
}
.b2b-quick-order strong { display: block; }
.b2b-quick-order p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.b2b-quick-order textarea {
  width: 100%;
  min-height: 52px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  outline: none;
}
.b2b-buyer-panel {
  display: grid;
  grid-template-columns: 1.25fr 1fr 1fr;
  gap: 10px;
  margin: 0 0 14px;
}
.b2b-buyer-card {
  display: grid;
  gap: 4px;
  min-width: 0;
  text-align: left;
  border: 1px solid rgba(219,230,241,.95);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 13px 14px;
  box-shadow: 0 8px 18px rgba(20, 32, 51, .06);
}
.b2b-buyer-card--main {
  border-color: rgba(36, 152, 237, .3);
  background: linear-gradient(135deg, #ffffff, #eef8ff);
}
.b2b-buyer-card span {
  color: var(--blue-dark);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}
.b2b-buyer-card strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
}
.b2b-buyer-card small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.b2b-cart-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, .9fr) auto;
  align-items: center;
  gap: 12px;
  margin: 12px 0 14px;
  padding: 13px;
  border: 1px solid rgba(219,230,241,.92);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(20, 32, 51, .07);
}
.b2b-cart-summary small,
.b2b-cart-summary span {
  display: block;
  color: var(--muted);
  font-weight: 700;
  font-size: 12px;
}
.b2b-cart-summary strong {
  display: block;
  margin: 3px 0;
  font-size: 20px;
}
.b2b-cart-summary-items {
  display: flex;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
}
.b2b-cart-summary-items span {
  flex: 0 0 auto;
  max-width: 128px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfd;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.b2b-cart-summary.is-empty .b2b-cart-summary-items {
  display: none;
}
.b2b-campaign {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 8px;
  background: linear-gradient(135deg, #fff7ed, #eef8ff);
  border: 1px solid #fed7aa;
  box-shadow: 0 10px 22px rgba(20, 32, 51, .06);
}
.b2b-active-chips { display:flex; flex-wrap:wrap; gap:6px; margin:-4px 0 12px; }
.b2b-active-chips span { border:1px solid #cfe0fb; background:#eef7ff; color:#145da0; border-radius:4px; padding:5px 7px; font-size:11px; font-weight:800; }

.b2b-loyalty {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  align-items: center;
  gap: 14px;
  margin: 0 0 14px;
  padding: 14px;
  border: 1px solid rgba(36, 152, 237, .22);
  border-radius: 8px;
  background: linear-gradient(135deg, #ffffff, #eef8ff);
  box-shadow: 0 12px 28px rgba(35, 63, 92, .08);
}
.b2b-loyalty small {
  display: block;
  color: var(--blue-dark);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}
.b2b-loyalty strong {
  display: block;
  margin-top: 3px;
  font-size: 18px;
}
.b2b-loyalty p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}
.b2b-loyalty-side {
  display: grid;
  gap: 8px;
}
.b2b-loyalty-side span {
  justify-self: end;
  color: var(--ink);
  font-weight: 800;
}
.b2b-progress {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #dbe8f3;
}
.b2b-progress i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), #17ad8c);
  transition: width .25s ease;
}
.b2b-loyalty.is-earned {
  border-color: rgba(23, 173, 140, .34);
  background: linear-gradient(135deg, #ffffff, #eafbf6);
}
.b2b-loyalty.is-earned .b2b-loyalty-side span { color: var(--green); }

.b2b-category-panel {
  display: grid;
  gap: 10px;
  margin: 4px 0 14px;
}
.b2b-category-rail {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 2px;
  scrollbar-width: thin;
}
.b2b-cat {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 8px;
  padding: 10px 13px;
  color: var(--ink);
  font-weight: 700;
}
.b2b-cat span {
  color: var(--muted);
  font-size: 11px;
  margin-left: 5px;
}
.b2b-cat.is-main {
  border-color: rgba(36, 152, 237, .28);
  background: linear-gradient(180deg, #ffffff, #eef7ff);
  box-shadow: 0 8px 18px rgba(35, 63, 92, .07);
}
.b2b-cat.is-active { color: var(--white); background: var(--blue); border-color: var(--blue); box-shadow: 0 10px 20px rgba(36, 152, 237, .22); }
.b2b-cat.is-active span { color: rgba(255,255,255,.8); }
.b2b-subcategory-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.b2b-subcat {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.84);
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--ink);
  text-align: left;
  box-shadow: 0 8px 18px rgba(35, 63, 92, .05);
}
.b2b-subcat strong { display:block; font-size: 13px; line-height: 1.2; }
.b2b-subcat small { display:block; margin-top: 5px; color: var(--muted); font-size: 11px; font-weight: 700; }
.b2b-subcat.is-active {
  border-color: rgba(36, 152, 237, .55);
  background: linear-gradient(180deg, #eaf6ff, #ffffff);
  box-shadow: 0 12px 24px rgba(36, 152, 237, .12);
}

.b2b-content {
  background: rgba(255,255,255,.66);
  border: 1px solid rgba(219,230,241,.85);
  border-radius: 8px;
  padding: 14px;
}
.b2b-section-head { display:flex; justify-content:space-between; gap:14px; align-items:center; margin-bottom: 12px; }
.b2b-section-head h2 { margin:0; font-size: 20px; }
.b2b-section-head p { margin:4px 0 0; color: var(--muted); font-size: 13px; }
.b2b-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.b2b-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 8px 22px rgba(20, 32, 51, .06);
}
.b2b-fav-btn {
  position: absolute;
  z-index: 3;
  top: 9px;
  right: 9px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(203, 213, 225, .9);
  border-radius: 8px;
  background: rgba(255, 255, 255, .92);
  color: #94a3b8;
  font-size: 16px;
  line-height: 1;
  box-shadow: 0 8px 16px rgba(20, 32, 51, .12);
}
.b2b-fav-btn.is-active {
  border-color: rgba(245, 158, 11, .42);
  background: #fff8e6;
  color: #d97706;
}
.b2b-card-img {
  border: 0;
  width: 100%;
  cursor: pointer;
  position: relative;
  aspect-ratio: 1 / 1;
  background: #f5f8fb;
  display: grid;
  place-items: center;
}
.b2b-card-img img { width: 100%; height: 100%; object-fit: contain; padding: 10px; }
.b2b-img-dots { position:absolute; left:8px; bottom:8px; display:flex; gap:4px; }
.b2b-img-dots i { width:6px; height:6px; border-radius:50%; background:#cbd5e1; }
.b2b-img-dots i.is-on { background:var(--blue); }
.b2b-no-img { display:grid; place-items:center; width:100%; height:100%; color:#94a3b8; font-weight:800; font-size:12px; }
.b2b-card-body { display:flex; flex-direction:column; gap:8px; padding: 12px; flex:1; }
.b2b-card-kod { display:flex; justify-content:space-between; gap:8px; color: var(--muted); font-size: 11px; font-weight: 700; }
.b2b-card-kod em { font-style: normal; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 48%; }
.b2b-card-title { border:0; background:transparent; padding:0; margin:0; text-align:left; color:var(--ink); font-size: 14px; line-height: 1.28; min-height: 54px; font-weight:800; cursor:pointer; }
.b2b-card-price { display:flex; justify-content:space-between; gap:8px; align-items:flex-end; margin-top:auto; }
.b2b-card-price strong { font-size: 18px; }
.b2b-card-price small { color: var(--muted); font-size: 11px; }
.b2b-add { width:100%; border:0; border-radius:8px; background: var(--green); color: white; padding: 11px; font-weight: 800; }
.b2b-add:active { transform: translateY(1px); }
.b2b-stock-empty {
  width: 100%;
  border: 1px solid rgba(15,23,42,.08);
  border-radius: 8px;
  background: #f1f5f9;
  color: #64748b;
  padding: 11px;
  text-align: center;
  font-weight: 800;
}
.b2b-card--family { grid-column: span 2; }
.b2b-card--family .b2b-card-img { aspect-ratio: 2 / 1; }
.b2b-variants {
  display: grid;
  gap: 7px;
  margin-top: 4px;
  max-height: 272px;
  overflow: auto;
  padding-right: 2px;
}
.b2b-variant-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #fbfdff;
}
.b2b-variant-row strong { display:block; font-size: 12px; }
.b2b-variant-row small { display:block; margin-top: 2px; color: var(--muted); font-size: 10px; }
.b2b-variant-row span { font-weight: 800; font-size: 12px; white-space: nowrap; }
.b2b-mini-add {
  border: 0;
  border-radius: 8px;
  background: var(--green);
  color: white;
  font-size: 12px;
  font-weight: 800;
  padding: 8px 10px;
}
.b2b-preadd {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, .8fr);
  align-items: stretch;
  gap: 8px;
}
.b2b-preadd--mini {
  grid-template-columns: 104px auto;
  gap: 6px;
  justify-content: end;
}
.b2b-preadd--mini .b2b-mini-add {
  white-space: nowrap;
  padding-inline: 9px;
}
.b2b-inline-qty {
  display: grid;
  grid-template-columns: 36px 1fr 36px;
  align-items: center;
  gap: 6px;
  width: 100%;
  border: 1px solid rgba(23, 173, 140, .28);
  border-radius: 8px;
  background: #ecfdf8;
  padding: 5px;
}
.b2b-inline-qty--mini {
  width: 112px;
  grid-template-columns: 30px 1fr 30px;
  padding: 4px;
}
.b2b-inline-qty button {
  border: 0;
  border-radius: 7px;
  background: var(--white);
  color: var(--green);
  height: 32px;
  font-weight: 900;
  box-shadow: 0 4px 10px rgba(20, 32, 51, .06);
}
.b2b-inline-qty--mini button { height: 28px; }
.b2b-inline-qty strong {
  text-align: center;
  color: var(--ink);
  font-size: 14px;
}
.b2b-more-variants {
  color: var(--muted);
  font-weight: 700;
  text-align: center;
}

.b2b-btn, .b2b-link-btn {
  border: 0;
  border-radius: 8px;
  padding: 11px 14px;
  font-weight: 800;
}
.b2b-btn--light { background: rgba(255,255,255,.18); color: white; border: 1px solid rgba(255,255,255,.4); }
.b2b-btn--primary { background: var(--blue); color: white; box-shadow: 0 12px 24px rgba(36,152,237,.22); }
.b2b-link-btn { background: #e8f4ff; color: var(--blue-dark); }

.b2b-cart {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  width: min(420px, 100%);
  height: 100vh;
  background: white;
  box-shadow: var(--shadow);
  transform: translateX(105%);
  transition: transform .22s ease;
  padding: 18px;
}
.b2b-cart.is-open { transform: translateX(0); }
.b2b-cart-head { display:flex; align-items:center; justify-content:space-between; border-bottom:1px solid var(--line); padding-bottom:12px; }
.b2b-cart-head strong { display:block; font-size: 20px; }
.b2b-cart-head small { color: var(--muted); }
.b2b-cart-head button, .b2b-modal-close { border:0; background:#f1f6fb; width:38px; height:38px; border-radius:8px; font-size:24px; color:var(--ink); }
.b2b-cart-items { flex:1; overflow:auto; padding: 12px 0; display:grid; align-content:start; gap:10px; }
.b2b-cart-line { display:grid; grid-template-columns: 58px minmax(0, 1fr) auto; gap:8px; align-items:center; border:1px solid var(--line); border-radius:8px; padding:10px; }
.b2b-cart-thumb { width:58px; height:58px; border:0; border-radius:8px; background:#f5f8fb; overflow:hidden; padding:0; }
.b2b-cart-thumb img { width:100%; height:100%; object-fit:contain; padding:5px; }
.b2b-cart-info { min-width:0; }
.b2b-cart-line strong { font-size: 13px; }
.b2b-cart-line small { color: var(--muted); }
.b2b-qty { display:flex; align-items:center; gap:6px; margin-top:8px; }
.b2b-qty button { border:1px solid var(--line); background:white; border-radius:8px; width:30px; height:30px; font-weight:800; }
.b2b-qty span { min-width:26px; text-align:center; font-weight:800; }
.b2b-cart-total { display:flex; justify-content:space-between; align-items:center; padding:14px 0; border-top:1px solid var(--line); font-size: 18px; }
.b2b-cart-total strong { font-size: 26px; }
.b2b-cart-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.b2b-cart-options label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}
.b2b-cart-options select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 10px;
  outline: none;
}
.b2b-cart-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}
.b2b-cart-fab {
  position: fixed;
  left: 50%;
  bottom: max(14px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 14px;
  border:0;
  border-radius: 8px;
  background: var(--ink);
  color:white;
  padding: 12px 18px;
  box-shadow: var(--shadow);
  min-width: min(360px, calc(100% - 28px));
  justify-content: space-between;
}
.b2b-cart-fab em {
  display: block;
  margin-top: 2px;
  color: rgba(255,255,255,.72);
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
}

.b2b-modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  background: rgba(20,32,51,.58);
  padding: 18px;
}
.b2b-modal[hidden] { display:none; }
.b2b-modal-card {
  position: relative;
  width: min(420px, 100%);
  background: white;
  border-radius: 8px;
  padding: 24px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 12px;
}
.b2b-modal-card h2 { margin:0; }
.b2b-modal-card p { margin:0; color:var(--muted); font-size: 13px; line-height:1.45; }
.b2b-modal-close { position:absolute; top:12px; right:12px; }
.b2b-status { color: var(--muted); font-size: 12px; min-height: 18px; }
.b2b-toast {
  position: fixed;
  left: 50%;
  bottom: 84px;
  transform: translateX(-50%);
  z-index: 90;
  background: var(--ink);
  color:white;
  padding: 12px 16px;
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.b2b-empty { padding: 36px; text-align:center; color: var(--muted); background:white; border:1px dashed var(--line); border-radius:8px; grid-column: 1/-1; }
.b2b-load-more {
  display: block;
  width: min(360px, 100%);
  margin: 16px auto 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--blue-dark);
  padding: 13px 16px;
  font-weight: 800;
}

.b2b-variant-info {
  display: block;
  min-width: 0;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 0;
  color: var(--ink);
}

.b2b-product-modal-card {
  position: relative;
  width: min(920px, 100%);
  max-height: min(820px, calc(100vh - 28px));
  overflow: auto;
  background: #fff;
  border-radius: 8px;
  padding: 22px;
  box-shadow: var(--shadow);
}
.b2b-detail {
  display: grid;
  grid-template-columns: minmax(260px, .9fr) minmax(0, 1fr);
  gap: 20px;
}
.b2b-detail-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  align-content: start;
}
.b2b-detail-gallery img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfd;
  padding: 8px;
}
.b2b-detail-gallery img.is-main { grid-column: 1 / -1; }
.b2b-detail-info h2 { margin: 7px 0 8px; font-size: clamp(22px, 4vw, 34px); line-height: 1.1; }
.b2b-detail-info p { color: var(--muted); line-height: 1.45; }
.b2b-detail-info small { color: var(--blue-dark); font-weight: 800; }
.b2b-detail-price {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  padding: 14px;
  border-radius: 8px;
  background: #f3f8fc;
  border: 1px solid var(--line);
}
.b2b-detail-price strong { font-size: 28px; }
.b2b-detail-price span { color: var(--muted); font-weight: 800; }

.b2b-account-modal-card {
  position: relative;
  width: min(760px, 100%);
  max-height: min(820px, calc(100vh - 28px));
  overflow: auto;
  background: #fff;
  border-radius: 8px;
  padding: 22px;
  box-shadow: var(--shadow);
}
.b2b-account-head {
  padding: 2px 46px 14px 0;
  border-bottom: 1px solid var(--line);
}
.b2b-account-head small {
  display: block;
  color: var(--blue-dark);
  font-weight: 900;
  text-transform: uppercase;
  font-size: 11px;
}
.b2b-account-head h2 { margin: 5px 0 4px; }
.b2b-account-head p { margin: 0; color: var(--muted); }
.b2b-account-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 14px 0;
}
.b2b-account-stats div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfd;
  padding: 12px;
}
.b2b-account-stats span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}
.b2b-account-stats strong {
  display: block;
  margin-top: 4px;
  font-size: 17px;
}
.b2b-account-modal-card h3 {
  margin: 16px 0 8px;
}
.b2b-account-list {
  display: grid;
  gap: 8px;
}
.b2b-account-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px;
  background: #fff;
}
.b2b-account-row strong,
.b2b-account-row small {
  display: block;
}
.b2b-account-row small {
  color: var(--muted);
  margin-top: 3px;
}
.b2b-account-row button {
  border: 0;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  padding: 9px 12px;
  font-weight: 800;
}
.b2b-account-empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 18px;
  color: var(--muted);
  text-align: center;
  background: #fbfdff;
}

.b2b-done-modal-card {
  position: relative;
  width: min(480px, 100%);
  background: #fff;
  border-radius: 8px;
  padding: 28px 22px 22px;
  box-shadow: var(--shadow);
  text-align: center;
}
.b2b-done-check {
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  margin: 6px auto 14px;
  border-radius: 50%;
  background: #e9fbf5;
  color: var(--green);
  font-size: 54px;
  line-height: 1;
}
.b2b-done-modal-card h2 {
  margin: 0;
  font-size: 26px;
}
.b2b-done-modal-card p {
  margin: 8px 0 18px;
  color: var(--muted);
}
.b2b-done-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}
.b2b-done-actions button:last-child {
  grid-column: 1 / -1;
}

.b2b-admin {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 80;
  width: min(520px, 100%);
  background: #f4f8fc;
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}
.b2b-admin[hidden] { display: none; }
.b2b-admin-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 16px;
  background: #142033;
  color: #fff;
}
.b2b-admin-head small { display:block; color: rgba(255,255,255,.72); font-weight: 700; }
.b2b-admin-head strong { display:block; margin-top:2px; }
.b2b-admin-head button {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 8px;
  background: rgba(255,255,255,.14);
  color: #fff;
  font-size: 22px;
}
.b2b-admin-body {
  overflow: auto;
  padding: 14px;
  display: grid;
  gap: 12px;
}
.b2b-admin-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  box-shadow: 0 8px 18px rgba(20, 32, 51, .06);
}
.b2b-admin-card h3 { margin: 0 0 10px; }
.b2b-admin-card p { margin: -4px 0 10px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.b2b-admin-save {
  margin: -2px 0 10px;
  padding: 9px 10px;
  border-radius: 6px;
  background: #eef7ff;
  color: var(--blue-dark);
  border: 1px solid #c8e2f8;
  font-size: 12px;
  font-weight: 800;
}
.b2b-admin-save.is-ok {
  background: #ecfdf5;
  color: #06764f;
  border-color: #b8efd8;
}
.b2b-admin-save.is-warn {
  background: #fff7ed;
  color: #9a4a00;
  border-color: #fed7aa;
}
.b2b-check, .b2b-admin-field {
  display: grid;
  gap: 6px;
  margin: 8px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.b2b-check {
  grid-template-columns: auto 1fr;
  align-items: center;
  color: var(--ink);
  font-size: 13px;
}
.b2b-admin-field input, .b2b-admin-field select, .b2b-admin-field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  outline: none;
}
.b2b-admin-list { display: grid; gap: 7px; max-height: 260px; overflow: auto; padding-right: 2px; }
.b2b-admin-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfdff;
}
.b2b-admin-row strong, .b2b-admin-row small { display:block; }
.b2b-admin-row small { color: var(--muted); margin-top:2px; }
.b2b-admin-actions { display:grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.b2b-admin-save-btn { width: 100%; margin-top: 10px; }
.b2b-btn--whatsapp { background: #17ad8c; color: #fff; }
.b2b-admin-summary { display:grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.b2b-admin-summary div { border:1px solid var(--line); border-radius:8px; padding:12px; background:#f8fbfd; }
.b2b-admin-summary b { display:block; font-size:24px; }
.b2b-admin-summary span { color:var(--muted); font-size:12px; font-weight:800; }

@media (max-width: 1020px) {
  .b2b-controlbar { grid-template-columns: minmax(0, 1fr) 1fr 1fr; }
  .b2b-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .b2b-quick-order { grid-template-columns: 1fr; }
  .b2b-buyer-panel { grid-template-columns: 1fr; }
  .b2b-cart-summary { grid-template-columns: 1fr; align-items: stretch; }
}

@media (max-width: 760px) {
  .b2b-shell { padding-bottom: 92px; }
  .b2b-topbar { padding: 10px 12px; }
  .b2b-top-actions { gap: 5px; min-width: 0; }
  .b2b-top-actions .b2b-btn {
    max-width: 78px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-left: 8px;
    padding-right: 8px;
  }
  .b2b-brand small { display:none; }
  .b2b-logo-mark { width: 38px; height: 38px; border-radius: 8px; }
  .b2b-gate { padding: 14px; align-items: start; }
  .b2b-gate-card { padding: 18px; }
  .b2b-access-grid { grid-template-columns: 1fr; gap: 9px; }
  .b2b-main { padding: 12px; }
  .b2b-hero { grid-template-columns: 1fr; }
  .b2b-hero h1 { font-size: 24px; }
  .b2b-hero-metrics { grid-template-columns: repeat(3, 1fr); }
  .b2b-hero-metrics div { min-width:0; padding:10px 8px; }
  .b2b-controlbar { grid-template-columns: 1fr 1fr; gap: 8px; }
  .b2b-search { grid-column: 1 / -1; }
  .b2b-controlbar label span { font-size: 11px; }
  .b2b-search input, .b2b-select-wrap select { padding: 11px 10px; }
  .b2b-buyer-panel {
    display: flex;
    overflow-x: auto;
    padding-bottom: 3px;
    scroll-snap-type: x mandatory;
  }
  .b2b-buyer-card {
    min-width: 78%;
    scroll-snap-align: start;
  }
  .b2b-cart-summary { gap: 9px; margin-top: 8px; }
  .b2b-cart-summary-items { overflow-x: auto; padding-bottom: 2px; }
  .b2b-cart-summary .b2b-btn { width: 100%; }
  .b2b-loyalty { grid-template-columns: 1fr; }
  .b2b-subcategory-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .b2b-content { padding: 10px; }
  .b2b-section-head { align-items:flex-start; }
  .b2b-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .b2b-card--family { grid-column: 1 / -1; }
  .b2b-card--family .b2b-card-img { aspect-ratio: 2.4 / 1; }
  .b2b-card-body { padding: 10px; }
  .b2b-card-title { min-height: 44px; font-size: 13px; }
  .b2b-card-price strong { font-size: 16px; }
  .b2b-variant-row { grid-template-columns: minmax(0, 1fr); align-items: stretch; }
  .b2b-variant-row span { justify-self: start; }
  .b2b-preadd { grid-template-columns: 1fr; }
  .b2b-preadd--mini { grid-template-columns: 1fr 1fr; }
  .b2b-inline-qty--mini { width: 100%; }
  .b2b-cart {
    width: 100%;
    height: 100dvh;
    padding: 14px 14px max(14px, env(safe-area-inset-bottom));
    overflow-y: auto;
  }
  .b2b-cart-items {
    flex: 0 1 auto;
    max-height: 34vh;
    overscroll-behavior: contain;
  }
  .b2b-note textarea { min-height: 54px; }
  .b2b-cart-total { padding: 10px 0; }
  .b2b-cart-total strong { font-size: 23px; }
  .b2b-cart-actions { margin-bottom: 7px; }
  .b2b-cart-line { grid-template-columns: 50px minmax(0,1fr); }
  .b2b-cart-line > strong { grid-column: 2; justify-self: start; }
  .b2b-cart-thumb { width:50px; height:50px; }
  .b2b-product-modal-card { width: 100%; height: calc(100vh - 24px); padding: 16px; }
  .b2b-detail { grid-template-columns: 1fr; }
  .b2b-detail-gallery { grid-template-columns: repeat(4, 1fr); }
  .b2b-detail-gallery img.is-main { grid-column: 1 / -1; }
  .b2b-account-modal-card { width: 100%; height: calc(100vh - 24px); padding: 16px; }
  .b2b-account-stats { grid-template-columns: 1fr; }
  .b2b-done-modal-card { width: 100%; }
  .b2b-admin { width: 100%; }
  .b2b-admin-actions { grid-template-columns: 1fr; }
}

@media (max-width: 430px) {
  .b2b-grid { grid-template-columns: 1fr; }
  .b2b-card--family .b2b-card-img { aspect-ratio: 1.8 / 1; }
  .b2b-top-actions .b2b-btn { padding: 9px 10px; }
}
.b2b-load-more[hidden] { display:none; }

@media (max-width: 980px) {
  .b2b-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .b2b-subcategory-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
}
@media (max-width: 720px) {
  .b2b-topbar { padding: 12px 14px; }
  .b2b-brand small { display:none; }
  .b2b-hero { grid-template-columns: 1fr; }
  .b2b-hero-metrics { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .b2b-hero-metrics div { min-width: 0; }
  .b2b-filter-toggle { display: flex; margin: 12px 0 10px; }
  .b2b-controlbar {
    display: none;
    grid-template-columns: 1fr;
    margin-top: 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 14px 30px rgba(20,32,51,.09);
  }
  .b2b-shell.filters-open .b2b-controlbar { display: grid; }
  .b2b-buyer-card { min-width: 82%; }
  .b2b-loyalty { grid-template-columns: 1fr; }
  .b2b-loyalty-side span { justify-self: start; }
  .b2b-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
  .b2b-card--family { grid-column: 1 / -1; }
  .b2b-card--family .b2b-card-img { aspect-ratio: 16 / 8; }
  .b2b-subcategory-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .b2b-variant-row { grid-template-columns: minmax(0, 1fr); }
  .b2b-variant-row > span { justify-self: start; }
  .b2b-preadd--mini {
    width: 100%;
    grid-template-columns: minmax(0, 1fr) minmax(112px, .8fr);
    justify-content: stretch;
  }
  .b2b-content { padding: 10px; }
  .b2b-section-head { align-items:flex-start; }
  .b2b-section-head .b2b-link-btn { display:none; }
  .b2b-cart-options, .b2b-cart-actions { grid-template-columns: 1fr; }
  .b2b-done-actions { grid-template-columns: 1fr; }
}
@media (max-width: 390px) {
  .b2b-grid { grid-template-columns: 1fr; }
  .b2b-subcategory-grid { grid-template-columns: 1fr; }
}
