.stock-card .stock-photo img,
.stock-group-card .stock-photo img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain !important;
  padding: 8px;
  background: #f5f5f7;
}

.stock-group-card .stock-card-body h3 {
  margin-bottom: 6px;
}

.stock-group-meta,
.stock-risk-note {
  margin-top: 6px;
  color: var(--muted);
  font-size: .74rem;
}

.stock-risk-note {
  color: #9a641a;
}

.stock-qty .qty-number,
.stock-table-qty .qty-number {
  white-space: nowrap;
}

.stock-qty .qty-integer {
  font-size: 1em;
}

.stock-qty .qty-fraction {
  margin-left: 1px;
  color: #77777d;
  font-size: .62em;
  font-weight: 650;
}

.stock-qty .qty-unit {
  font-size: .82em;
}

.stock-table-qty .qty-fraction {
  margin-left: 1px;
  color: #8a8a90;
  font-size: .72em;
  font-weight: 600;
}

.stock-table-qty .qty-unit {
  color: #626268;
  font-weight: 650;
}

.stock-section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 12px;
}

.stock-section-heading .title,
.stock-section-heading .subtitle {
  margin-bottom: 0 !important;
}

.stock-secondary-section {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #e2e2e6;
}

.stock-soon-section > .stock-section-heading {
  padding: 12px 14px;
  border-radius: 14px;
  background: #fff5df;
}

.stock-depleted-section > .stock-section-heading {
  padding: 12px 14px;
  border-radius: 14px;
  background: #f0f0f2;
}

.stock-group-table td,
.stock-group-table th {
  vertical-align: middle !important;
}

.stock-group-row[data-stock-href] {
  cursor: pointer;
  transition: background .14s ease;
}

.stock-group-row[data-stock-href]:hover {
  background: #f7f7f9;
}

.stock-zero-toggle-field {
  display: flex;
  align-items: center;
  margin-bottom: 0 !important;
}

.stock-zero-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  color: #55555b;
  font-size: .78rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.stock-zero-toggle:has(.stock-zero-checkbox:disabled) {
  opacity: .45;
  cursor: not-allowed;
}

.stock-zero-checkbox {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.stock-zero-track {
  position: relative;
  width: 38px;
  height: 22px;
  flex: 0 0 38px;
  border-radius: 999px;
  background: #d4d4d8;
  transition: background .16s ease;
}

.stock-zero-track:after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.18);
  transition: transform .16s ease;
}

.stock-zero-checkbox:checked + .stock-zero-track {
  background: #4a4a4f;
}

.stock-zero-checkbox:checked + .stock-zero-track:after {
  transform: translateX(16px);
}

.stock-zero-checkbox:focus-visible + .stock-zero-track {
  outline: 2px solid #3273dc;
  outline-offset: 2px;
}

.stock-active-filter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -6px 0 18px;
  padding: 8px 10px 8px 14px;
  border: 1px solid #f1d7aa;
  border-radius: 14px;
  background: #fff6e5;
  color: #76501d;
  font-size: .8rem;
  font-weight: 750;
}

.stock-material-detail {
  margin-top: 18px;
}

.stock-material-detail-header {
  display: grid;
  grid-template-columns: minmax(280px, 1.05fr) minmax(360px, 1.35fr) auto;
  align-items: center;
  gap: 28px;
  margin: 0 0 14px;
  padding: 4px 2px;
}

.stock-material-name-column,
.stock-material-stats-column,
.stock-material-back-column {
  min-width: 0;
}

.stock-material-name-column .eyebrow {
  margin-bottom: 4px;
}

.stock-material-name-column .title {
  margin: 0 !important;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stock-material-stats-column {
  padding-left: 26px;
  border-left: 1px solid #dedee3;
}

.stock-material-total-line,
.stock-archive-count {
  margin: 0;
  line-height: 1.45;
}

.stock-material-total-line {
  color: #34343a;
  font-size: .94rem;
  font-weight: 700;
}

.stock-material-total-line .qty-number {
  white-space: nowrap;
}

.stock-archive-count {
  margin-top: 3px;
  color: #77777e;
  font-size: .78rem;
  font-weight: 650;
}

.stock-material-back-column {
  display: flex;
  justify-content: flex-end;
}

.stock-material-back-column .button {
  white-space: nowrap;
}

.stock-archive-visibility {
  display: flex;
  justify-content: flex-end;
  margin: -2px 0 10px;
}

.stock-archive-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.stock-archive-button {
  gap: 3px;
}

.stock-archive-action-label {
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .055em;
  text-transform: uppercase;
}

.stock-ean-with-copy {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.stock-ean-copy-button {
  width: 28px;
  height: 28px;
  display: inline-grid;
  flex: 0 0 28px;
  place-items: center;
  padding: 0;
  border: 1px solid #dedee3;
  border-radius: 8px;
  background: #f8f8fa;
  color: #77777e;
  cursor: pointer;
  transition: background .14s ease, color .14s ease, border-color .14s ease, transform .14s ease;
}

.stock-ean-copy-button:hover {
  border-color: #bfc6d0;
  background: #fff;
  color: #30343a;
}

.stock-ean-copy-button:active {
  transform: scale(.94);
}

.stock-ean-copy-button.is-copied {
  border-color: #b9dfc4;
  background: #edf8f0;
  color: #287542;
}

@media (max-width: 1000px) {
  .stock-material-detail-header {
    grid-template-columns: minmax(240px, 1fr) minmax(300px, 1.25fr);
    gap: 18px 24px;
  }

  .stock-material-back-column {
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) {
  .stock-filters {
    flex-wrap: wrap;
  }
}

@media (max-width: 700px) {
  .stock-section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .stock-zero-toggle-field {
    width: 100%;
  }

  .stock-material-detail-header {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .stock-material-name-column .title {
    white-space: normal;
  }

  .stock-material-stats-column {
    padding: 11px 0 0;
    border-top: 1px solid #dedee3;
    border-left: 0;
  }

  .stock-material-back-column,
  .stock-archive-visibility {
    justify-content: flex-start;
  }
}
