.b3s {
  --b3p:    var(--p, var(--color-primary, var(--primary-gradient-color, #1a7a3c)));
  --b3pl:   var(--pl, rgba(26, 122, 60, .10));
  --b3sur:  var(--sur, #fff);
  --b3sur2: var(--sur2, #f6f7fa);
  --b3txt:  var(--txt, #0f1117);
  --b3txt2: var(--txt2, #4a5068);
  --b3txt3: var(--txt3, #9098b1);
  --b3brd:  var(--brd, #e3e5ed);
  --b3red:  var(--red, #d42020);
  display: block;
  margin: 4px 0 0;
  font-family: inherit;
}

.b3s *, .b3s *::before, .b3s *::after { box-sizing: border-box; }

.b3s-grp { padding: 14px 0; border-top: 1px solid var(--b3brd); }
.b3s-grp:first-child { border-top: 0; }

.b3s-lbl {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 800;
  color: var(--b3txt);
  line-height: 1.5;
}

.b3s-tag {
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1.6;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--b3sur2);
  color: var(--b3txt3);
}

.b3s-tag--req { background: rgba(212, 32, 32, .10); color: var(--b3red); }

.b3s-row {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  margin: 0 0 7px;
  padding: 11px 13px;
  border: 1.5px solid var(--b3brd);
  border-radius: 11px;
  background: var(--b3sur);
  color: var(--b3txt);
  font-family: inherit;
  font-size: 14px;
  text-align: start;
  cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease;
}

.b3s-row:hover { border-color: var(--b3p); }
.b3s-row.is-on { border-color: var(--b3p); background: var(--b3pl); }

.b3s-mark {
  width: 19px;
  height: 19px;
  flex: none;
  position: relative;
  border: 2px solid var(--b3txt3);
  transition: border-color .15s ease, border-width .15s ease, background-color .15s ease;
}

.b3s-mark--rd { border-radius: 50%; }
.b3s-mark--cb { border-radius: 6px; }

.b3s-row.is-on .b3s-mark { border-color: var(--b3p); background: var(--b3p); }
.b3s-row.is-on .b3s-mark--rd { border-width: 6px; background: var(--b3sur); }

.b3s-row.is-on .b3s-mark--cb::after {
  content: "";
  position: absolute;
  inset-inline-start: 5px;
  top: 1px;
  width: 5px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.b3s-nm { flex: 1; min-width: 0; font-weight: 700; }

.b3s-pr {
  font-size: 13px;
  font-weight: 800;
  color: var(--b3p);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.b3s-free {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--b3txt3);
  white-space: nowrap;
}

.b3s-qty {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: none;
  padding: 2px;
  border: 1px solid var(--b3brd);
  border-radius: 9px;
  background: var(--b3sur2);
}

.b3s-qty button {
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--b3txt2);
  font-family: inherit;
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.b3s-qty button:hover:not(:disabled) { background: var(--b3brd); color: var(--b3p); }
.b3s-qty button:disabled { opacity: .3; cursor: not-allowed; }

.b3s-qty span {
  min-width: 22px;
  text-align: center;
  font-size: 13.5px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.b3s-ta {
  display: block;
  width: 100%;
  min-height: 52px;
  padding: 11px 13px;
  border: 1.5px solid var(--b3brd);
  border-radius: 11px;
  background: var(--b3sur);
  color: var(--b3txt);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.6;
  resize: vertical;
  transition: border-color .15s ease;
}

.b3s-ta:focus { outline: none; border-color: var(--b3p); }
.b3s-ta::placeholder { color: var(--b3txt3); }

.b3s-cnt {
  margin: 4px 0 0;
  font-size: 11px;
  color: var(--b3txt3);
  text-align: end;
  font-variant-numeric: tabular-nums;
}

.b3s-file { display: block; }

.b3s-drop,
.b3s-shot {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1.5px solid var(--b3brd);
  border-radius: 11px;
  background: var(--b3sur);
  color: var(--b3txt);
  font-family: inherit;
  text-align: start;
}

.b3s-drop {
  border-style: dashed;
  cursor: pointer;
  transition: border-color .15s ease;
}

.b3s-drop:hover { border-color: var(--b3p); }
.b3s-drop.is-busy { border-style: solid; cursor: default; }

.b3s-drop__i {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--b3sur2);
  font-size: 20px;
  line-height: 1;
}

.b3s-drop__c,
.b3s-shot__c {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.b3s-drop__t,
.b3s-shot__t {
  font-size: 13px;
  font-weight: 700;
  color: var(--b3txt);
}

.b3s-drop__s { font-size: 11px; color: var(--b3txt3); }

.b3s-spin {
  width: 20px;
  height: 20px;
  border: 2.5px solid var(--b3brd);
  border-top-color: var(--b3p);
  border-radius: 50%;
  animation: b3sspin .7s linear infinite;
}

@keyframes b3sspin { to { transform: rotate(360deg); } }

.b3s-thumb {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--b3sur2);
}

.b3s-mini {
  position: relative;
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--b3sur2);
}

.b3s-acts { display: flex; gap: 12px; flex-wrap: wrap; }

.b3s-again {
  padding: 0;
  border: 0;
  background: none;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--b3p);
  text-align: start;
  cursor: pointer;
}

.b3s-again--mute { color: var(--b3txt3); }

.b3s-x {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--b3sur2);
  color: var(--b3txt3);
  font-family: inherit;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}

.b3s-x:hover { background: var(--b3red); color: #fff; }

.b3s-cta {
  width: 100%;
  margin-top: 8px;
  padding: 11px;
  border: 0;
  border-radius: 9px;
  background: var(--b3p);
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.b3s-low {
  margin: 6px 0 0;
  font-size: 11px;
  line-height: 1.6;
  color: #b45309;
}

.b3s-mk {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  overflow: hidden;
  background: var(--sur2, #f6f7fa);
  touch-action: none;
  cursor: grab;
}

.b3s-mk:active { cursor: grabbing; }

.b3s-mk canvas {
  display: block;
  max-width: 100%;
  max-height: 54vh;
  width: auto;
  height: auto;
}

.b3s-mini {
  position: relative;
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--b3sur2, #f6f7fa);
}

.b3s-mini canvas { display: block; width: 100%; height: 100%; object-fit: cover; }

.b3s-md__b { overflow: hidden; }

.b3s-mk__b { display: block; width: 100%; height: auto; }
.b3s-mini .b3s-mk__b { height: 100%; object-fit: cover; }

.b3s-mk__a { position: absolute; overflow: hidden; }

.b3s-mk .b3s-mk__a {
  cursor: grab;
  outline: 1.5px dashed rgba(255, 255, 255, .95);
  outline-offset: -1px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, .18);
}

.b3s-mk .b3s-mk__a:active { cursor: grabbing; }

.b3s-mk__u {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform-origin: center;
  pointer-events: none;
  user-select: none;
}

.b3s-warn {
  margin: 7px 0 0;
  min-height: 18px;
  font-size: 12px;
  font-weight: 700;
  color: var(--b3red);
}

.b3s-grp.is-bad .b3s-row { border-color: var(--b3red); }
.b3s-grp.is-bad .b3s-ta { border-color: var(--b3red); }
.b3s-grp.is-bad .b3s-drop { border-color: var(--b3red); }

.b3s-md {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  transition: opacity .18s ease;
}

.b3s-md.is-in { opacity: 1; }

.b3s-md * { box-sizing: border-box; }

.b3s-md__bg {
  position: absolute;
  inset: 0;
  background: rgba(9, 11, 16, .62);
  backdrop-filter: blur(3px);
}

.b3s-md__w {
  position: relative;
  width: 100%;
  max-width: 420px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  overflow: hidden;
  background: var(--sur, #fff);
  color: var(--txt, #0f1117);
  font-family: inherit;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .3);
  transform: scale(.96);
  transition: transform .18s ease;
}

.b3s-md.is-in .b3s-md__w { transform: scale(1); }

.b3s-md__h {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--brd, #e3e5ed);
}

.b3s-md__t { flex: 1 1 auto; font-size: 14.5px; font-weight: 800; }

.b3s-md__x {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--sur2, #f6f7fa);
  color: var(--txt3, #9098b1);
  font-family: inherit;
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
}
.b3s-md__b { padding: 16px; overflow: visible; }

.b3s-md__hint {
  margin: 10px 0 0;
  text-align: center;
  font-size: 11.5px;
  color: var(--txt3, #9098b1);
}

.b3s-md__c {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px 14px;
}

.b3s-md__r { flex: 1 1 auto; min-width: 0; accent-color: var(--p, #1a7a3c); }

.b3s-md__vw {
  flex: 0 0 auto;
  padding: 0 9px;
  height: 32px;
  border: 1.5px solid var(--brd, #e3e5ed);
  border-radius: 8px;
  background: none;
  color: var(--txt2, #4a5068);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.b3s-md__vw.is-on {
  border-color: var(--p, #1a7a3c);
  background: var(--p, #1a7a3c);
  color: #fff;
}

body.dark-mode .b3s-md__vw { border-color: #3a3a3a; color: #c9cdd6; }


.b3s-md__zb {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1.5px solid var(--brd, #e3e5ed);
  border-radius: 8px;
  background: none;
  color: var(--txt2, #4a5068);
  font-family: inherit;
  font-size: 17px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.b3s-md__rs {
  flex: 0 0 auto;
  padding: 0 4px;
  border: 0;
  background: none;
  color: var(--txt3, #9098b1);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
}

.b3s-md__f { padding: 0 16px 16px; }

.b3s-md__save {
  width: 100%;
  padding: 13px;
  border: 0;
  border-radius: 10px;
  background: var(--p, #1a7a3c);
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.b3s-line {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: 7px 0 3px;
  padding-inline-start: 10px;
  border-inline-start: 2px solid rgba(144, 152, 177, .28);
}

.b3s-line__i {
  display: flex;
  align-items: baseline;
  gap: 5px;
  flex-wrap: wrap;
  font-size: 12px;
  line-height: 1.6;
  color: var(--txt2, #4a5068);
}

.b3s-line__i b {
  font-weight: 600;
  font-size: 11px;
  letter-spacing: .1px;
  color: var(--txt3, #9098b1);
  flex: none;
}

.b3s-line__i i {
  font-style: normal;
  font-weight: 700;
  font-size: 11.5px;
  color: var(--p, #1a7a3c);
  font-variant-numeric: tabular-nums;
  margin-inline-start: auto;
  padding-inline-start: 8px;
  white-space: nowrap;
}

/* !important ضروري: بعض التصاميم تفرض width/height/display عامة على
   button و canvas داخل جداول السلة، فتمطّ الكبسة وتُصغّر المصغّرة. */
.b3s-line .b3s-line__f,
.b3s-line__f {
  display: inline-flex !important;
  flex-wrap: nowrap !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: 100% !important;
  height: auto !important;
  align-items: center;
  gap: 6px;
  vertical-align: middle;
  margin-inline-start: 2px;
  padding: 3px 9px 3px 3px !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: rgba(0, 0, 0, .05) !important;
  color: var(--p, #1a7a3c) !important;
  font-family: inherit;
  font-size: 11.5px !important;
  font-weight: 700;
  line-height: 1.4 !important;
  cursor: pointer;
  box-shadow: none !important;
  text-align: start !important;
}

.b3s-line__f .b3s-mini { width: 26px; height: 26px; border-radius: 50%; }

.b3s-line__t {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
}

/* وزن عالٍ عمداً: تنسيق التصاميم يُحمَّل بعد هذا الملف فيغلب أي قاعدة
   بنفس الوزن، وبعضها يفرض width:100% على canvas داخل جداول السلة. */
.b3s-line .b3s-line__f canvas.b3s-line__t,
.b3s-line canvas.b3s-line__t,
canvas.b3s-line__t {
  width: auto !important;
  height: 30px !important;
  max-width: 54px !important;
  min-width: 0 !important;
  max-height: 30px !important;
  border-radius: 6px !important;
  background: transparent !important;
  display: inline-block !important;
  vertical-align: middle !important;
  flex-shrink: 0 !important;
  object-fit: contain !important;
}

canvas.b3v__b { display: block; width: 100%; height: auto; }


.b3v {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity .16s ease;
}

.b3v.is-in { opacity: 1; }

.b3v__bg {
  position: absolute;
  inset: 0;
  background: rgba(9, 11, 16, .72);
  backdrop-filter: blur(3px);
}

.b3v__w {
  position: relative;
  width: 100%;
  max-width: 460px;
  transform: scale(.96);
  transition: transform .16s ease;
}

.b3v.is-in .b3v__w { transform: scale(1); }

.b3v__x {
  position: absolute;
  top: -14px;
  inset-inline-end: -6px;
  z-index: 2;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: #111;
  font-family: inherit;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .28);
}

.b3v__s {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .35);
}

.b3v__b { display: block; width: 100%; height: auto; }
.b3v__a { position: absolute; overflow: hidden; }

.b3v__u {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform-origin: center;
}

body.dark-mode .b3s-line__f { background: rgba(255, 255, 255, .09); color: #4ade80; }
body.dark-mode .b3v__s { background: #1e1e1e; }
body.dark-mode .b3v__x { background: #2a2a2a; color: #f0f0f0; }


body.dark-mode .b3s {
  --b3sur:  #1e1e1e;
  --b3sur2: #2a2a2a;
  --b3txt:  #f0f0f0;
  --b3txt2: #c9cdd6;
  --b3txt3: #8b93a5;
  --b3brd:  #3a3a3a;
  --b3pl:   rgba(255, 255, 255, .07);
}

body.dark-mode .b3s-tag--req { background: rgba(212, 32, 32, .20); color: #ff8a8a; }
body.dark-mode .b3s-qty button:hover:not(:disabled) { background: #3a3a3a; }
body.dark-mode .b3s-low { color: #fbbf24; }
body.dark-mode .b3s-mk { background: #2a2a2a; }
body.dark-mode .b3s-md__w { background: #1e1e1e; color: #f0f0f0; }
body.dark-mode .b3s-md__h { border-color: #3a3a3a; }
body.dark-mode .b3s-md__x { background: #2a2a2a; color: #8b93a5; }
body.dark-mode .b3s-md__zb { border-color: #3a3a3a; color: #c9cdd6; }
body.dark-mode .b3s-md__hint,
body.dark-mode .b3s-md__rs { color: #8b93a5; }
body.dark-mode .b3s-line__i { color: #c9cdd6; }
body.dark-mode .b3s-line__i b { color: #8b93a5; }
body.dark-mode .b3s-line__i i { color: #4ade80; }
.b3s-line__f {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  vertical-align: middle;
  padding: 2px 7px 2px 3px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .05);
  color: var(--p, #1a7a3c);
  font-size: 11.5px;
  font-weight: 700;
  text-decoration: none;
}

.b3s-line__f img {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
}

body.dark-mode .b3s-line__f { background: rgba(255, 255, 255, .09); color: #4ade80; }
.b3up {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .2s ease;
}

.b3up.is-in { opacity: 1; }

.b3up__bg {
  position: absolute;
  inset: 0;
  background: rgba(9, 11, 16, .5);
  backdrop-filter: blur(2px);
}

.b3up__c {
  position: relative;
  width: 240px;
  padding: 20px;
  border-radius: 14px;
  background: #fff;
  text-align: center;
  font-family: inherit;
  box-shadow: 0 18px 44px rgba(0, 0, 0, .28);
  transform: translateY(6px);
  transition: transform .2s ease;
}

.b3up.is-in .b3up__c { transform: translateY(0); }

.b3up__t {
  font-size: 13.5px;
  font-weight: 800;
  color: #0f1117;
}

.b3up__bar {
  height: 6px;
  margin: 14px 0 8px;
  border-radius: 999px;
  background: #e9ebf1;
  overflow: hidden;
}

.b3up__bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--p, #1a7a3c);
  transition: width .18s ease;
}

.b3up__n {
  font-size: 12px;
  font-weight: 800;
  color: var(--p, #1a7a3c);
  font-variant-numeric: tabular-nums;
}

body.dark-mode .b3up__c { background: #1e1e1e; }
body.dark-mode .b3up__t { color: #f0f0f0; }
body.dark-mode .b3up__bar { background: #3a3a3a; }
