.byfa-cart-controls {
  --byfa-color-primary: #f97316;
  --byfa-color-primary-hover: #ea580c;
  --byfa-color-primary-soft: rgba(249, 115, 22, .1);
  --byfa-color-surface: #fff;
  --byfa-color-soft: #f8fafc;
  --byfa-color-border: #e2e8f0;
  --byfa-color-text: #111827;
  --byfa-color-text-2: #475569;
  --byfa-color-muted: #64748b;
  --byfa-color-danger: #dc2626;
  width: min(500px, 100%);
  min-width: 0;
}

.byfa-cart-add-button,
.byfa-cart-quantity {
  width: 100%;
  min-height: 48px;
  box-sizing: border-box;
}

.byfa-cart-add-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border: 0;
  border-radius: 10px;
  color: #fff;
  background: var(--byfa-color-primary, #f97316);
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.5;
  cursor: pointer;
  transition: background-color .18s ease, transform .16s ease, opacity .18s ease;
}

.byfa-cart-add-button:hover { background: var(--byfa-color-primary-hover, #ea580c); }
.byfa-cart-add-button:active { transform: scale(.985); }
.byfa-cart-add-button[disabled] { cursor: wait; opacity: .86; }

.byfa-cart-loading-dots {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 18px;
}

.byfa-cart-loading-dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  animation: byfa-cart-dot-bounce .9s infinite ease-in-out;
}

.byfa-cart-loading-dots i:nth-child(2) { animation-delay: .12s; }
.byfa-cart-loading-dots i:nth-child(3) { animation-delay: .24s; }
@keyframes byfa-cart-dot-bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .45; } 30% { transform: translateY(-4px); opacity: 1; } }

.byfa-cart-quantity {
  display: grid;
  grid-template-columns: 48px minmax(44px, 1fr) 48px;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--byfa-color-border, #e2e8f0);
  border-radius: 12px;
  background: var(--byfa-color-surface, #fff);
  box-shadow: 0 7px 20px rgba(15, 23, 42, .08);
}

.byfa-cart-quantity__button {
  align-self: stretch;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 0;
  border: 0;
  color: var(--byfa-color-primary, #f97316);
  background: transparent;
  cursor: pointer;
  transition: background-color .16s ease, color .16s ease, transform .14s ease;
}

.byfa-cart-quantity__button:hover { background: var(--byfa-color-primary-soft, rgba(249, 115, 22, .1)); }
.byfa-cart-quantity__button:active { transform: scale(.92); }
.byfa-cart-quantity__button[disabled] { cursor: wait; opacity: .48; }
.byfa-cart-quantity__button svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.byfa-cart-quantity__value { display: flex; align-items: center; justify-content: center; min-width: 0; color: var(--byfa-color-text, #111827); font-size: 18px; font-weight: 950; line-height: 1; font-variant-numeric: tabular-nums; }

.byfa-cable-roll-cart-row {
  display: flex;
  flex-flow: row nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  width: 100%;
  min-width: 0;
  direction: rtl;
}

.byfa-cable-roll-cart-row .byfa-cart-quantity { flex: 0 0 120px; width: 120px; grid-template-columns: 40px 40px 40px; min-height: 44px; box-shadow: none; }
.byfa-cable-roll-cart-row .byfa-cart-quantity__button svg { width: 18px; height: 18px; }
.byfa-cable-roll-cart-row .byfa-cart-quantity__value { font-size: 15px; }
.byfa-cable-roll-cart-meta { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; min-width: 0; color: var(--byfa-color-muted, #64748b); line-height: 1.35; text-align: right; }
.byfa-cable-roll-cart-meta span { font-size: 10px; font-weight: 700; white-space: nowrap; }
.byfa-cable-roll-cart-meta b { color: var(--byfa-color-text, #111827); font-size: 10.5px; font-weight: 900; white-space: nowrap; }

.byfa-cart-manage-row { display: grid; grid-template-columns: minmax(0, 1fr) 44px; align-items: stretch; gap: 8px; width: 100%; min-width: 0; direction: rtl; }
.byfa-cart-manage-row .byfa-cart-add-button { grid-column: 1; min-width: 0; }
.byfa-cart-delete-button { grid-column: 2; display: inline-flex; align-items: center; justify-content: center; width: 44px; min-width: 44px; min-height: 44px; padding: 0; border: 1px solid var(--byfa-color-border, #e2e8f0); border-radius: 12px; color: var(--byfa-color-danger, #dc2626); background: var(--byfa-color-surface, #fff); cursor: pointer; transition: border-color .18s ease, background-color .18s ease, transform .16s ease; }
.byfa-cart-delete-button:hover { border-color: rgba(220, 38, 38, .32); background: rgba(220, 38, 38, .07); }
.byfa-cart-delete-button:active { transform: scale(.95); }
.byfa-cart-delete-button svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.byfa-cable-purchase-mode { display: block; margin: 0 0 12px; padding: 0; }
.byfa-cable-purchase-mode__title { margin: 0 0 10px; color: var(--byfa-color-text, #111827); font-size: 14px; font-weight: 900; line-height: 1.5; }
.byfa-cable-purchase-mode__switch { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.byfa-cable-purchase-mode__option { position: relative; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; min-width: 0; min-height: 58px; padding: 9px 10px 9px 46px; border: 1px solid var(--byfa-color-border, #e2e8f0); border-radius: 12px; color: var(--byfa-color-text, #111827); background: var(--byfa-color-surface, #fff); text-align: right; opacity: .72; cursor: pointer; transition: border-color .18s ease, background-color .18s ease, box-shadow .18s ease, transform .15s ease; }
.byfa-cable-purchase-mode__option:active { transform: scale(.985); }
.byfa-cable-purchase-mode__option span { font-size: 13px; font-weight: 900; line-height: 1.45; }
.byfa-cable-purchase-mode__option small { color: var(--byfa-color-muted, #64748b); font-size: 10px; font-weight: 700; line-height: 1.5; }
.byfa-cable-purchase-mode__option::after { position: absolute; top: 50%; left: 11px; display: grid; width: 25px; height: 25px; place-items: center; border: 1px solid var(--byfa-color-border, #e2e8f0); border-radius: 50%; color: #fff; background: var(--byfa-color-surface, #fff); font-size: 17px; font-weight: 950; line-height: 1; content: ""; transform: translateY(-50%); }
.byfa-cable-purchase-mode__option--active { border-color: var(--byfa-color-primary, #f97316); background: var(--byfa-color-primary-soft, rgba(249, 115, 22, .08)); box-shadow: 0 0 0 1px rgba(249, 115, 22, .07); opacity: 1; }
.byfa-cable-purchase-mode__option--active::after { border-color: var(--byfa-color-primary, #f97316); background: var(--byfa-color-primary, #f97316); content: "✓"; transform: translateY(-50%) scale(1.04); }
.byfa-cable-purchase-mode__hint { margin: 8px 2px 0; color: var(--byfa-color-muted, #64748b); font-size: 11px; font-weight: 700; line-height: 1.6; }
.byfa-cable-purchase-mode__hint strong { color: var(--byfa-color-text, #111827); font-weight: 900; }

.byfa-cable-picker { display: grid; gap: 10px; width: 100%; min-width: 0; max-width: 100%; padding: 10px 0; overflow: hidden; direction: rtl; }
.byfa-meter-wheel { isolation: isolate; display: grid; grid-template-columns: 42px minmax(0, 1fr) 42px; align-items: center; gap: 6px; width: 100%; min-width: 0; max-width: 100%; overflow: hidden; direction: rtl; }
.byfa-meter-wheel__button { display: grid; width: 42px; height: 50px; place-items: center; padding: 0; border: 0; border-radius: 0; color: var(--byfa-color-primary, #f97316); background: transparent; font-size: 29px; font-weight: 900; line-height: 1; touch-action: none; user-select: none; cursor: pointer; transition: color .18s ease, transform .18s ease, opacity .18s ease; }
.byfa-meter-wheel__button:hover { color: var(--byfa-color-primary-hover, #ea580c); }
.byfa-meter-wheel__button:active { transform: scale(.93); }
.byfa-meter-wheel__button:disabled { opacity: .38; cursor: not-allowed; transform: none; }
.byfa-meter-wheel__viewport { position: relative; width: 100%; min-width: 0; max-width: 100%; height: 82px; overflow: hidden; border: 0; outline: 0; background: transparent; perspective: 260px; perspective-origin: 50% 45%; touch-action: pan-y; contain: layout paint; user-select: none; cursor: grab; }
.byfa-meter-wheel__viewport:active { cursor: grabbing; }
.byfa-meter-wheel__viewport::before, .byfa-meter-wheel__viewport::after { position: absolute; top: 0; bottom: 0; z-index: 5; width: 12%; pointer-events: none; content: ""; }
.byfa-meter-wheel__viewport::before { right: 0; background: linear-gradient(to left, var(--byfa-color-surface, #fff), transparent); }
.byfa-meter-wheel__viewport::after { left: 0; background: linear-gradient(to right, var(--byfa-color-surface, #fff), transparent); }
.byfa-meter-wheel__focus { display: none; }
.byfa-meter-ruler { position: absolute; z-index: 1; inset: 0; overflow: hidden; pointer-events: none; transform-style: preserve-3d; mask-image: linear-gradient(to right, transparent 0, #000 13%, #000 87%, transparent 100%); }
.byfa-meter-ruler__tick { position: absolute; top: 62%; left: 50%; width: 1px; height: 6px; margin-left: -.5px; border-radius: 999px; background: rgba(100, 116, 139, .34); opacity: var(--byfa-ruler-opacity, 0); transform: translate3d(var(--byfa-ruler-x, 0), 0, var(--byfa-ruler-z, 0)) rotateY(var(--byfa-ruler-rotate, 0deg)) scale(var(--byfa-ruler-scale, 1)); transform-origin: 50% 0; }
.byfa-meter-ruler__tick--mid { height: 8px; background: rgba(100, 116, 139, .42); }
.byfa-meter-ruler__tick--major { width: 2px; height: 13px; margin-left: -1px; background: rgba(71, 85, 105, .58); }
.byfa-meter-ruler__indicator { position: absolute; top: 61%; left: 50%; z-index: 3; width: 2px; height: 16px; margin-left: -1px; border-radius: 999px; background: var(--byfa-color-primary, #f97316); box-shadow: 0 0 0 3px rgba(249, 115, 22, .09), 0 2px 8px rgba(249, 115, 22, .26); pointer-events: none; transform-origin: 50% 0; }
.byfa-meter-wheel__stage { position: absolute; z-index: 2; inset: 0; transform-style: preserve-3d; }
.byfa-meter-wheel__item { position: absolute; top: 44%; left: 50%; display: grid; width: 40px; height: 52px; margin: -26px 0 0 -20px; place-items: center; padding: 0; border: 0; color: #94a3b8; background: transparent; font-size: 12px; font-weight: 750; font-variant-numeric: tabular-nums; line-height: 1; opacity: var(--byfa-meter-opacity, 0); transform: translate3d(var(--byfa-meter-x, 0), 0, var(--byfa-meter-z, 0)) rotateY(var(--byfa-meter-rotate, 0deg)) scale(var(--byfa-meter-scale, 1)); transform-style: preserve-3d; backface-visibility: hidden; cursor: pointer; }
.byfa-meter-wheel__item[aria-current="true"] { color: var(--byfa-color-primary, #f97316); font-size: 21px; font-weight: 950; cursor: default; }
.byfa-meter-wheel__item[disabled] { visibility: hidden; pointer-events: none; }
.byfa-meter-wheel__unit { position: absolute; right: 50%; bottom: 4px; z-index: 4; color: var(--byfa-color-text-2, #64748b); font-size: 9px; font-weight: 850; line-height: 1; pointer-events: none; transform: translateX(50%) scale(1); transition: color .07s ease, transform .07s ease; }
.byfa-meter-wheel__viewport--feedback .byfa-meter-wheel__unit { color: var(--byfa-color-primary, #f97316); transform: translateX(50%) scale(1.14); }
.byfa-meter-wheel__viewport--feedback .byfa-meter-ruler__indicator { animation: byfa-meter-ruler-pulse .18s cubic-bezier(.22, 1, .36, 1); }
@keyframes byfa-meter-ruler-pulse { 0% { transform: scaleY(.72); } 55% { transform: scaleY(1.28); } 100% { transform: scaleY(1); } }

.byfa-cable-picker__actions { display: grid; grid-template-columns: minmax(0, 1fr) 44px; align-items: stretch; gap: 8px; width: 100%; min-width: 0; direction: rtl; }
.byfa-cable-picker__actions--single { grid-template-columns: minmax(0, 1fr); }
.byfa-cable-picker__actions .byfa-cart-add-button { grid-column: 1; min-width: 0; }
.byfa-cable-picker__reset { grid-column: 2; display: inline-flex; align-items: center; justify-content: center; width: 44px; min-width: 44px; min-height: 44px; padding: 0; border: 1px solid var(--byfa-color-border, #e2e8f0); border-radius: 12px; color: var(--byfa-color-danger, #dc2626); background: var(--byfa-color-surface, #fff); cursor: pointer; transition: border-color .18s ease, background-color .18s ease, transform .16s ease; }
.byfa-cable-picker__reset:hover { border-color: rgba(220, 38, 38, .32); background: rgba(220, 38, 38, .07); }
.byfa-cable-picker__reset:active { transform: scale(.95); }
.byfa-cable-picker__reset svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

@media (max-width: 700px) {
  .byfa-cart-controls { width: 100%; }
  .byfa-cable-purchase-mode__option { min-height: 56px; padding: 8px 9px 8px 42px; }
  .byfa-meter-wheel { grid-template-columns: 40px minmax(0, 1fr) 40px; gap: 5px; }
  .byfa-meter-wheel__button { width: 40px; height: 54px; }
  .byfa-meter-wheel__viewport { height: 84px; }
}

@media (max-width: 380px) {
  .byfa-cable-roll-cart-row { gap: 6px; }
  .byfa-cable-roll-cart-row .byfa-cart-quantity { flex-basis: 96px; width: 96px; grid-template-columns: 32px 32px 32px; }
  .byfa-cable-purchase-mode__option span { font-size: 12px; }
  .byfa-cable-purchase-mode__option small { font-size: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  .byfa-meter-wheel__button { transition: none; }
  .byfa-meter-wheel__viewport--feedback .byfa-meter-ruler__indicator { animation: none; }
}
