.editable-cart.sale-cart-card {
  position: relative;
  display: grid;
  grid-template-columns: var(--sale-cart-photo-size, 48px) minmax(0, 1fr) var(--sale-cart-controls-size, 134px);
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  margin: 0 0 0.5rem;
  padding: 0.625rem;
  border: 1px solid var(--vf-line, #dbe5e7);
  border-radius: 0.875rem;
  background: var(--vf-surface, #fff);
}

.sale-cart-card > .sale-cart-photo {
  display: grid;
  place-items: center;
  width: var(--sale-cart-photo-size, 48px);
  height: var(--sale-cart-photo-size, 48px);
  overflow: hidden;
  border-radius: 0.625rem;
  background: var(--vf-brand-soft, #e2f6f3);
  color: var(--vf-accent-text, #08786f);
  font-weight: 800;
}

.sale-cart-info,
.sale-cart-controls { min-width: 0; }

.sale-cart-name,
.sale-cart-detail {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sale-cart-name {
  color: var(--vf-text, #15323b);
  font-size: 0.9375rem;
  line-height: 1.2;
}

.sale-cart-detail {
  color: var(--vf-text-3, #546f77);
  font-size: 0.6875rem;
}

.sale-cart-card > .service-line-summary {
  grid-column: 1 / -1;
  margin-top: 0;
}

.sale-cart-controls {
  display: grid;
  justify-items: stretch;
  gap: 0.25rem;
}

.sale-cart-stepper {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  min-width: 0;
  border: 1px solid var(--vf-line, #dbe5e7);
  border-radius: 0.75rem;
  background: var(--vf-surface-2, #f5f9f9);
  color: var(--vf-text, #15323b);
  text-align: center;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.sale-cart-stepper button {
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 0.6875rem;
  background: transparent;
  color: inherit;
  font-size: 1.125rem;
}

.sale-cart-stepper input:not([hidden]) {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: center;
  appearance: textfield;
}

.sale-cart-stepper input::-webkit-inner-spin-button { appearance: none; }

.sale-cart-service-quantity {
  min-height: 46px;
  display: grid;
  place-items: center end;
  color: var(--vf-text-3, #546f77);
  font-size: 0.75rem;
}

.sale-cart-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 0.25rem;
}

.sale-cart-remove {
  grid-column: 2;
  display: grid;
  place-items: center;
  min-height: 44px;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--vf-neg, #a73042) 36%, var(--vf-line, #dbe5e7));
  border-radius: 0.625rem;
  background: var(--vf-neg-soft, #fdecee);
  color: var(--vf-neg, #b3242b);
}

.sale-cart-remove :is(i, svg) {
  width: 1.125rem;
  height: 1.125rem;
}

.sale-item-discount-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 44px;
  gap: 0.25rem;
  padding: 0 0.25rem;
  border: 1px solid color-mix(in srgb, var(--vf-brand-deep, #0b9c8f) 48%, var(--vf-line, #dbe5e7));
  border-radius: 0.625rem;
  background: var(--vf-surface, #fff);
  color: var(--vf-accent-text, #08786f);
  font-size: 0.75rem;
  font-weight: 750;
  white-space: nowrap;
  cursor: pointer;
}

.sale-item-discount-trigger:is([data-item-discount-active], [aria-expanded="true"]) {
  border-color: var(--vf-brand-deep, #0b9c8f);
  background: var(--vf-brand-soft, #e2f6f3);
  color: var(--vf-accent-text, #08786f);
}

.sale-item-discount-trigger :is(i, svg) {
  flex: none;
  width: 1rem;
  height: 1rem;
}

.sale-item-discount-values {
  display: grid;
  gap: 0.125rem;
  min-width: 0;
  margin-top: 0.25rem;
  font-variant-numeric: tabular-nums;
  color: var(--vf-text, #15323b);
}

.sale-item-discount-values > strong {
  font-size: 0.9375rem;
  line-height: 1.2;
}

.sale-item-discount-breakdown {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.0625rem 0.25rem;
  font-size: 0.6875rem;
}

.sale-item-discount-breakdown > s { color: var(--vf-text-3, #546f77); }

.sale-item-discount-saving {
  padding-inline: 0.25rem;
  border-radius: 0.3125rem;
  background: var(--vf-brand-soft, #e2f6f3);
  color: var(--vf-accent-text, #08786f);
  font-weight: 700;
}

.sale-cart-unit-price {
  min-width: 0;
  margin-top: 0.25rem;
  color: var(--vf-text-3, #546f77);
  font-size: 0.75rem;
}

.sale-cart-unit-price summary {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  min-height: 28px;
  color: var(--vf-text-2, #3f5d66);
  cursor: pointer;
}

.sale-cart-unit-price summary::-webkit-details-marker { display: none; }
.sale-cart-unit-price summary :is(i, svg) { width: 0.875rem; height: 0.875rem; }

.sale-cart-unit-price label {
  display: grid;
  gap: 0.25rem;
  justify-items: start;
  margin-block: 0.25rem;
}

.sale-cart-card .sale-cart-unit-price input {
  width: 6rem;
  max-width: 100%;
  min-height: 2rem;
  margin: 0;
  padding: 0.1875rem 0.25rem;
  border: 1px solid var(--vf-line, #dbe5e7);
  border-radius: 0.375rem;
  background: var(--vf-surface-2, #f5f9f9);
  color: var(--vf-text, #15323b);
  font-size: 0.75rem;
}

.mobile-sale-page .sale-cart-card {
  overflow: hidden;
  transition: transform 0.2s;
}

.editable-cart > .sale-item-discount-editor {
  grid-column: 1 / -1;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0.625rem;
  border: 1px solid var(--vf-line, #dbe5e7);
  border-radius: 0.75rem;
  background: var(--vf-surface-2, #f5f9f9);
  color: var(--vf-text, #15323b);
}

.sale-item-discount-editor legend {
  max-width: 100%;
  padding-inline: 0.25rem;
  color: var(--vf-text-2, #3f5d66);
  font-size: 0.8125rem;
  font-weight: 700;
}

.sale-item-discount-fields {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 0.5rem;
}

.sale-item-discount-fields :is(input, select),
.sale-item-discount-actions button {
  min-width: 0;
  min-height: 44px;
  padding: 0.375rem 0.625rem;
  border: 1px solid var(--vf-line-strong, #c3d3d6);
  border-radius: 0.625rem;
  background: var(--vf-surface, #ffffff);
  color: var(--vf-text, #15323b);
}

.sale-item-discount-fields input {
  width: 100%;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}

.sale-item-discount-fields select {
  width: 100%;
  font-size: 0.8125rem;
}

.sale-item-discount-fields input[aria-invalid="true"] {
  border-color: var(--vf-neg, #a73042);
}

.sale-item-discount-preview,
.sale-item-discount-error {
  margin: 0.5rem 0;
  font-size: 0.8125rem;
}

.sale-item-discount-preview { color: var(--vf-text-2, #3f5d66); }
.sale-item-discount-error { color: var(--vf-neg-text, #a73042); }
.sale-item-discount-editor p:empty { display: none; }

.sale-item-discount-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-block-start: 0.5rem;
}

.sale-item-discount-actions button {
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
}

.sale-item-discount-actions .sale-item-discount-apply {
  border-color: var(--vf-brand, #16cdbb);
  background: var(--vf-brand, #16cdbb);
  color: #10342e;
}

.sale-item-discount-trigger:focus-visible,
.sale-cart-card :is(.sale-cart-stepper button, .sale-cart-stepper input, .sale-cart-remove, .sale-cart-unit-price summary, .sale-cart-unit-price input):focus-visible,
.sale-item-discount-editor :is(button, input, select):focus-visible {
  outline: 2px solid var(--vf-brand-deep, #0b9c8f);
  outline-offset: 2px;
}

@media (390px <= width < 768px) {
  .sale-cart-card { --sale-cart-photo-size: 54px; }
}

@media (min-width: 768px) {
  .sale-cart-card { --sale-cart-photo-size: 54px; --sale-cart-controls-size: 148px; }
}

@media (prefers-reduced-motion: reduce) {
  .mobile-sale-page .sale-cart-card { transition: none; }
}
