/* ── Sell Page Theme (scoped under .sell-page) ── */
.sell-page {
  --sell-accent: #16a34a;
  --sell-accent-soft: #f0fdf4;
  --sell-accent-border: #bbf7d0;
  --sell-accent-dark: #15803d;
}

.sell-page.has-cart {
  padding-bottom: 80px;
}

.sell-page .is-hidden {
  display: none !important;
}

/* ── Header ── */
.sell-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  flex-wrap: wrap;
  margin-top: var(--space-md);
}

.sell-page-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sell-page-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--sell-accent-soft);
  color: var(--sell-accent-dark);
  flex-shrink: 0;
  overflow: hidden;
}

.sell-page-icon svg {
  width: 22px;
  height: 22px;
}

.sell-page-header .page-title {
  margin: 0;
}

.sell-page-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ── Meta Card ── */
.sell-meta-card {
  margin-top: var(--space-md);
  padding: 12px 16px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.sell-meta-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: var(--space-md);
}

.sell-field-label {
  display: block;
  margin-bottom: 4px;
  font-family: var(--font-bn);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-muted);
}

.sell-field-select,
.sell-field-input {
  width: 100%;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-bn);
  font-size: var(--text-sm);
  color: var(--color-text-primary);
  background: var(--color-surface);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.sell-field-select {
  appearance: none;
  background: var(--color-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 10px center;
  padding-right: 28px;
}

.sell-field-select:focus,
.sell-field-input:focus {
  border-color: var(--sell-accent);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15);
}

/* ── Hero Search ── */
.sell-search-hero {
  margin-top: var(--space-md);
  padding: 10px 12px;
  background: linear-gradient(180deg, var(--sell-accent-soft), #ffffff);
  border: 1px solid var(--sell-accent-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: visible;
}

.sell-search-toolbar {
  display: flex;
  align-items: stretch;
  gap: 10px;
}

.sell-search-wrap {
  position: relative;
  overflow: visible;
  flex: 1;
  min-width: 0;
  z-index: 20;
}

.sell-search-wrap .buy-search-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 280px;
  overflow-y: auto;
  z-index: 60;
  box-shadow: var(--shadow-lg);
}

.sell-search-wrap .buy-search-empty {
  padding: 12px;
  font-size: var(--text-xs);
}

.sell-page .buy-search-item-thumb {
  background: var(--sell-accent-soft);
  color: var(--sell-accent-dark);
}

.sell-search-box {
  flex: 1;
  min-width: 0;
  position: relative;
}

.sell-search-box svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--color-text-muted);
  pointer-events: none;
}

.sell-search-box input {
  width: 100%;
  height: 48px !important;
  padding: 0 12px 0 36px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: var(--text-md) !important;
  font-family: var(--font-bn);
  color: var(--color-text-primary);
  background: var(--color-surface);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.sell-search-box input::placeholder {
  color: var(--color-text-muted);
}

.sell-search-box input:focus {
  border-color: var(--sell-accent) !important;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15) !important;
}

.sell-barcode-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 56px;
  padding: 6px 10px;
  border: 1px solid var(--sell-accent-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--sell-accent-dark);
  font-family: var(--font-bn);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.sell-barcode-btn:hover {
  background: var(--sell-accent-soft);
  border-color: var(--sell-accent);
}

.sell-barcode-btn svg {
  width: 20px;
  height: 20px;
}

.sell-search-hint {
  margin-top: 6px;
  margin-bottom: 0;
  font-family: var(--font-bn);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.sell-search-quick-band {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--sell-accent-border);
}

.sell-quick-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0;
  margin-bottom: 6px;
}

.sell-quick-label {
  font-family: var(--font-bn);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-secondary);
}

.sell-quick-more-btn {
  font-family: var(--font-bn);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--sell-accent-dark);
  background: none;
  border: none;
  padding: 4px 8px;
  cursor: pointer;
  border-radius: var(--radius-sm);
}

.sell-quick-more-btn:hover {
  background: var(--sell-accent-soft);
}

/* ── Quick Product Chips ── */
.sell-quick-products {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}

.sell-quick-products::-webkit-scrollbar {
  height: 4px;
}

.sell-quick-products::-webkit-scrollbar-thumb {
  background: var(--sell-accent-border);
  border-radius: 4px;
}

.sell-quick-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  flex-shrink: 0;
  max-width: 160px;
  padding: 6px 12px;
  border: 1px solid var(--sell-accent-border);
  border-radius: 999px;
  background: var(--color-surface);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.sell-quick-chip:hover {
  background: var(--sell-accent-soft);
  border-color: var(--sell-accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.sell-quick-chip-name {
  font-family: var(--font-bn);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 130px;
}

.sell-quick-chip-price {
  font-family: var(--font-en);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--sell-accent-dark);
}

/* ── Cart Table ── */
.sell-cart-section {
  margin-top: var(--space-md);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.sell-cart-count {
  font-family: var(--font-bn);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: var(--space-sm);
}

.sell-cart-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 100px 90px 72px 90px 36px;
  gap: 8px;
  padding: 10px 14px;
  background: linear-gradient(180deg, var(--sell-accent-soft), #ffffff);
  border: 1px solid var(--color-border);
  border-bottom: none;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  font-family: var(--font-bn);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-secondary);
}

.sell-cart-head span:not(:first-child) {
  text-align: center;
}

.sell-cart-scroll {
  min-height: 0;
}

.sell-cart-head:not(.is-hidden) + .sell-cart-scroll {
  border: 1px solid var(--color-border);
  border-top: none;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.sell-cart-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  background: var(--color-surface);
}

.sell-cart-list.is-hidden {
  display: none;
}

.sell-cart-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 100px 90px 72px 90px 36px;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--color-border-light);
}

.sell-cart-row:last-child {
  border-bottom: none;
}

.sell-cart-row-product {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.sell-cart-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--sell-accent-soft);
  color: var(--sell-accent-dark);
  font-family: var(--font-bn);
  font-size: var(--text-sm);
  font-weight: 700;
  flex-shrink: 0;
}

.sell-cart-row-info {
  min-width: 0;
}

.sell-cart-row-name {
  font-family: var(--font-bn);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sell-cart-row-code {
  font-family: var(--font-en);
  font-size: 11px;
  color: var(--color-text-muted);
}

.sell-cart-row-qty {
  display: flex;
  justify-content: center;
}

.sell-qty-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-surface);
}

.sell-qty-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: var(--color-surface);
  color: var(--color-text-secondary);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.sell-qty-btn:hover {
  background: var(--sell-accent-soft);
  color: var(--sell-accent-dark);
}

.sell-qty-btn.minus:hover {
  background: #fef2f2;
  color: #dc2626;
}

.sell-qty-value {
  min-width: 28px;
  text-align: center;
  font-family: var(--font-en);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-text-primary);
}

.sell-cart-row-price,
.sell-cart-row-discount {
  display: flex;
  justify-content: center;
}

.sell-cart-price-input,
.sell-line-discount-input {
  width: 72px;
  height: 34px;
  padding: 0 6px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-en);
  font-size: var(--text-sm);
  font-weight: 600;
  text-align: right;
  outline: none;
}

.sell-cart-price-input:focus,
.sell-line-discount-input:focus {
  border-color: var(--sell-accent);
  box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.12);
}

.sell-cart-row-total {
  font-family: var(--font-en);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--sell-accent-dark);
  text-align: center;
}

.sell-cart-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.sell-cart-remove:hover {
  background: #fef2f2;
  color: #dc2626;
}

.sell-cart-remove svg {
  width: 16px;
  height: 16px;
}

.sell-add-more-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 10px;
  padding: 12px;
  border: 2px dashed var(--sell-accent-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  font-family: var(--font-bn);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--sell-accent-dark);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.sell-add-more-btn:hover {
  border-color: var(--sell-accent);
  background: var(--sell-accent-soft);
}

/* ── Empty State ── */
.sell-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px var(--space-md);
  background: linear-gradient(180deg, var(--sell-accent-soft), #ffffff);
  border: 2px dashed var(--sell-accent-border);
  border-radius: var(--radius-lg);
  text-align: center;
}

.sell-empty-state.is-hidden {
  display: none;
}

.sell-empty-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: #dcfce7;
  border-radius: 50%;
  margin-bottom: var(--space-sm);
  color: var(--sell-accent);
  overflow: hidden;
  flex-shrink: 0;
}

.sell-empty-icon-wrap svg {
  width: 24px;
  height: 24px;
}

.sell-empty-title {
  font-family: var(--font-bn);
  font-size: var(--text-md);
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: 4px;
}

.sell-empty-subtext {
  font-family: var(--font-bn);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-md);
}

.sell-empty-quick {
  margin-top: var(--space-md);
  width: 100%;
}

.sell-empty-quick-label {
  font-family: var(--font-bn);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: 8px;
}

/* ── Summary Panel (no internal scroll) ── */
.sell-summary-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
  position: sticky;
  top: 12px;
  padding: 10px 12px;
  background: #fafafa;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.sell-summary-panel .buy-payment-row {
  margin-bottom: 6px;
}

.sell-checkout-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-shrink: 0;
  padding: 8px 10px;
  margin-bottom: 8px;
  background: var(--color-surface);
  border: 1px solid var(--sell-accent-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.sell-checkout-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.sell-checkout-header-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--sell-accent-soft);
  color: var(--sell-accent);
  flex-shrink: 0;
}

.sell-checkout-header-icon svg {
  width: 16px;
  height: 16px;
}

.sell-checkout-header-count {
  font-family: var(--font-bn);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sell-grand-total {
  font-family: var(--font-en);
  font-size: 22px;
  font-weight: 700;
  color: var(--sell-accent-dark);
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.sell-summary-details {
  flex-shrink: 1;
  min-height: 0;
  overflow: hidden;
  margin-bottom: 6px;
}

.sell-details-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  font-family: var(--font-bn);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.sell-details-toggle:hover {
  background: var(--sell-accent-soft);
  border-color: var(--sell-accent-border);
}

.sell-details-toggle svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.sell-summary-details.is-open .sell-details-toggle svg {
  transform: rotate(180deg);
}

.sell-details-body {
  padding: 8px 2px 4px;
}

.sell-details-body[hidden] {
  display: none;
}

.sell-vat-row .sell-vat-inputs {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sell-vat-percent-input {
  width: 48px !important;
  height: 32px !important;
  text-align: center;
}

.sell-summary-panel .buy-payment-input {
  width: 88px;
  height: 32px;
}

.sell-summary-pay-footer {
  flex-shrink: 0;
  margin-top: auto;
  padding-top: 6px;
  border-top: 1px solid var(--color-border-light);
}

.sell-payment-methods-title {
  font-family: var(--font-bn);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-secondary);
  margin: 0 0 6px;
}

.sell-payment-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 8px;
}

.sell-payment-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 48px;
  padding: 6px 4px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  font-family: var(--font-bn);
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.sell-payment-tile svg {
  width: 18px;
  height: 18px;
}

.sell-payment-tile:hover {
  border-color: #93c5fd;
  background: #f8fafc;
}

.sell-payment-tile.is-active[data-method="cash"] {
  border-color: var(--sell-accent);
  background: var(--sell-accent-soft);
  color: var(--sell-accent-dark);
}

.sell-payment-tile.is-active[data-method="card"] {
  border-color: #7c3aed;
  background: #f5f3ff;
  color: #6d28d9;
}

.sell-payment-tile.is-active[data-method="bank"] {
  border-color: #3b82f6;
  background: #eff6ff;
  color: #1d4ed8;
}

.sell-payment-tile.is-active[data-method="bkash"] {
  border-color: #db2777;
  background: #fdf2f8;
  color: #be185d;
}

.sell-paid-due-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 4px;
}

.sell-paid-field,
.sell-due-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.sell-paid-field label,
.sell-due-field label {
  font-family: var(--font-bn);
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
}

.sell-paid-input {
  width: 100% !important;
}

.sell-due-field .buy-payment-value {
  height: 32px;
  display: flex;
  align-items: center;
  font-size: var(--text-sm);
}

.sell-full-pay-link {
  display: block;
  width: 100%;
  margin-bottom: 6px;
  padding: 0;
  border: none;
  background: none;
  font-family: var(--font-bn);
  font-size: 11px;
  font-weight: 600;
  color: var(--sell-accent-dark);
  text-align: center;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.sell-full-pay-link:hover {
  color: var(--sell-accent);
}

.sell-page .buy-payment-value.is-due.has-due {
  color: #dc2626;
  font-weight: 700;
}

.sell-complete-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 0;
  min-height: 44px;
  padding: 10px 14px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--color-brand);
  color: var(--color-brand-dark);
  font-family: var(--font-bn);
  font-size: var(--text-sm);
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-brand);
  transition: background 0.2s ease, transform 0.15s ease;
  flex-shrink: 0;
}

.sell-complete-btn svg {
  width: 18px;
  height: 18px;
}

.sell-complete-btn:hover:not(:disabled) {
  background: var(--color-brand-hover);
}

.sell-complete-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.sell-main-grid .buy-cart-column {
  min-height: 0;
}

/* ── Sticky Checkout Bar (mobile) ── */
.sell-checkout-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: 12px var(--space-md);
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
}

.sell-checkout-bar.is-hidden {
  display: none;
}

.sell-checkout-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sell-checkout-count {
  font-family: var(--font-bn);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.sell-checkout-total {
  font-family: var(--font-en);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--sell-accent-dark);
}

.sell-checkout-btn {
  white-space: nowrap;
  padding: 10px 20px !important;
}

.sell-checkout-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── Search results overrides ── */
.sell-page .buy-search-item.is-out-of-stock {
  opacity: 0.55;
  cursor: not-allowed;
}

.sell-page .buy-search-item-meta.is-low-stock {
  color: #dc2626;
}

.sell-page .buy-search-item.is-highlighted {
  background: var(--sell-accent-soft);
  border-color: var(--sell-accent);
}

/* ── Modal ── */
.sell-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.sell-modal-actions .btn-brand,
.sell-modal-actions .btn-outline {
  flex: 1;
  min-width: 140px;
  justify-content: center;
}

.sell-page .buy-modal-icon {
  background: #dcfce7;
  color: var(--sell-accent);
}

/* ── Responsive ── */
@media (min-width: 993px) {
  .sell-checkout-bar {
    display: none !important;
  }

  .sell-page.has-cart {
    padding-bottom: 0;
  }
}

@media (max-width: 992px) {
  .sell-page.has-cart {
    padding-bottom: 80px;
  }

  .sell-summary-panel {
    position: static;
    height: auto;
    max-height: none;
    overflow: visible;
  }

  .sell-payment-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .sell-payment-tile {
    min-height: 56px;
  }

  .sell-complete-btn {
    display: none;
  }

  .sell-cart-head,
  .sell-cart-row {
    grid-template-columns: minmax(0, 1fr) 88px 80px 64px 80px 32px;
    gap: 6px;
    padding: 10px;
  }
}

@media (max-width: 768px) {
  .sell-meta-grid {
    grid-template-columns: 1fr;
  }

  .sell-page-actions {
    width: 100%;
  }

  .sell-page-actions .btn-outline {
    flex: 1;
  }

  .sell-cart-head {
    display: none;
  }

  .sell-cart-head:not(.is-hidden) + .sell-cart-scroll {
    border-radius: var(--radius-lg);
    border-top: 1px solid var(--color-border);
  }

  .sell-cart-row {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
  }

  .sell-cart-list:not(.is-hidden) {
    padding: 8px;
    background: transparent;
    border: none;
    box-shadow: none;
  }

  .sell-cart-head:not(.is-hidden) + .sell-cart-scroll {
    border: none;
    box-shadow: none;
    background: transparent;
  }

  .sell-cart-row-qty,
  .sell-cart-row-price,
  .sell-cart-row-discount,
  .sell-cart-row-total {
    justify-content: flex-start;
  }

  .sell-qty-btn,
  .sell-cart-remove {
    width: var(--touch-min);
    height: var(--touch-min);
  }
}

/* ── Desktop viewport fit (≥1200px) ── */
@media (min-width: 1200px) {
  .page-sell .main-wrapper {
    padding: 12px;
    overflow: hidden;
  }

  .page-sell .app-layout {
    min-height: calc(100vh - var(--header-height) - 38px);
    overflow: hidden;
  }

  .sell-page {
    --sell-viewport-h: calc(100vh - var(--header-height) - 38px - 24px);
    height: var(--sell-viewport-h);
    max-height: var(--sell-viewport-h);
    overflow: hidden;
    padding: 16px;
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  .sell-page .buy-content {
    flex: 1;
    min-height: 0;
    gap: 8px;
  }

  .sell-page-header {
    margin-top: 0;
    flex-shrink: 0;
  }

  .sell-page-icon {
    width: 32px;
    height: 32px;
  }

  .sell-page-icon svg {
    width: 18px;
    height: 18px;
  }

  .sell-page-header .page-title {
    font-size: 18px;
  }

  .sell-meta-card {
    margin-top: 0;
    padding: 10px 12px;
    flex-shrink: 0;
  }

  .sell-meta-grid {
    gap: 10px;
  }

  .sell-field-input,
  .sell-field-select {
    height: 36px;
  }

  .sell-search-hero {
    margin-top: 0;
    padding: 8px 10px;
    flex-shrink: 0;
    overflow: visible;
  }

  .sell-search-wrap {
    overflow: visible;
  }

  .sell-search-box input {
    height: 40px !important;
  }

  .sell-barcode-btn {
    min-width: 52px;
    padding: 4px 8px;
  }

  .sell-main-grid {
    display: grid;
    flex: 1;
    min-height: 0;
    margin-top: 0;
    align-items: stretch;
    grid-template-columns: 1fr 280px;
  }

  .sell-cart-section {
    flex: 1;
    min-height: 0;
    height: 100%;
    margin-top: 0;
  }

  .sell-cart-head {
    flex-shrink: 0;
    padding: 8px 12px;
  }

  .sell-cart-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .sell-cart-row {
    padding: 10px 12px;
  }

  .sell-add-more-btn {
    flex-shrink: 0;
    margin-top: 8px;
    padding: 10px;
  }

  .sell-empty-state {
    min-height: 0;
    padding: 16px;
    margin-top: 0;
  }

  .sell-empty-icon-wrap {
    width: 44px;
    height: 44px;
    margin-bottom: 8px;
  }

  .sell-search-hint {
    display: none;
  }

  .sell-summary-panel {
    position: sticky;
    top: 0;
    height: 100%;
    max-height: 100%;
    overflow: hidden;
    align-self: stretch;
    padding: 10px;
  }

  .sell-grand-total {
    font-size: 20px;
  }

  .sell-complete-btn {
    min-height: 42px;
    font-size: var(--text-sm);
  }

  .sell-page.has-cart {
    padding-bottom: 0;
  }
}
