/* Miniaturas y carga de fotos de producto. */
.inv-thumb {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid var(--border-color);
  vertical-align: middle;
  cursor: pointer;
  background: hsl(222, 20%, 8%);
  opacity: 0;
  transition: opacity 0.3s ease-out;
}

.inv-thumb.loaded {
  opacity: 1;
}

.photo-preview-box {
  width: 100%;
  min-height: 180px;
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  background: hsl(222, 20%, 8%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 16px;
}

.photo-preview-img {
  max-width: 100%;
  max-height: 300px;
  object-fit: contain;
}

.photo-preview-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 24px;
  text-align: center;
}

.photo-preview-empty i, .photo-preview-empty svg {
  width: 40px;
  height: 40px;
  opacity: 0.5;
}

.photo-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.photo-actions .btn-secondary {
  flex: 1;
  justify-content: center;
  white-space: nowrap;
}

/* Los botones del modal de foto son tres y con el texto partido en dos
   líneas se montaban entre sí en pantallas angostas: se mantienen en una
   línea y, si no entran, "Quitar foto" baja a una fila propia. */
#modal-product-photo .modal-actions {
  flex-wrap: wrap;
  align-items: center;
}

#modal-product-photo .modal-actions button {
  white-space: nowrap;
}

@media (max-width: 480px) {
  #modal-product-photo .modal-actions #btn-photo-remove {
    flex-basis: 100%;
    margin-right: 0;
    justify-content: center;
  }
}

.inv-thumb-empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  border-style: dashed;
}

.inv-thumb-empty i, .inv-thumb-empty svg {
  width: 18px;
  height: 18px;
  opacity: 0.6;
}

.pos-thumb {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid var(--border-color);
  background: hsl(222, 20%, 8%);
  flex-shrink: 0;
}

.pos-thumb-empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  border-style: dashed;
}

.pos-thumb-empty i, .pos-thumb-empty svg {
  width: 16px;
  height: 16px;
  opacity: 0.5;
}

.pos-selected-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
}

.pos-selected-thumb {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  object-fit: cover;
  border: 1px solid var(--border-color);
  background: hsl(222, 20%, 8%);
  cursor: zoom-in;
}

.main-header,
.scanner-box,
.inventory-table-container,
.returns-form-card,
.returns-result-card,
.logs-card,
.settings-card,
.return-sale-card,
.result-card {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--blur-val)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--blur-val)) saturate(180%);
  border: 1px solid var(--glass-border);
  border-top: 1px solid rgba(255, 255, 255, 0.13);
  box-shadow: var(--shadow-lg);
}
