/* ╔══════════════════════════════════════════════════════╗
 * ║ detailsAddProduct.css — Modal "Adicionar Item"      ║
 * ║ BH3 Distribuidora | Loja Online CONSART             ║
 * ╚══════════════════════════════════════════════════════╝ */

/* Overlay */
.dap-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

/* Caixa principal */
.dap-dialog {
  width: min(720px, 94vw);
  max-height: 92vh;
  background: #ffffff;
  border-radius: 24px;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.4);
  padding: 20px 22px 22px;
  position: relative;
  overflow: hidden;
}

/* Botão fechar */
.dap-close-btn {
  position: absolute;
  top: 10px;
  right: 12px;
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  border-radius: 999px;
  transition: background 0.16s ease-out, color 0.16s ease-out;
}

.dap-close-btn:hover {
  background: rgba(148, 163, 184, 0.16);
  color: #0f172a;
}

/* Layout interno */
.dap-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.4fr);
  gap: 18px;
}

/* Coluna imagem */
.dap-image-col {
  display: flex;
  align-items: center;
  justify-content: center;
}

.dap-image-wrapper {
  width: 100%;
  max-width: 260px;
  height: 260px;
  border-radius: 20px;
  background: radial-gradient(circle at 20% 0, #e0f2fe, #f8fafc);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.dap-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.dap-image-placeholder {
  font-size: 40px;
}

/* Coluna info */
.dap-info-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Cabeçalho */
.dap-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dap-category {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9ca3af;
  margin: 0;
}

.dap-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.dap-code {
  font-size: 0.8rem;
  color: #64748b;
  margin: 0;
}

/* Preço */
.dap-price-block {
  margin-top: 6px;
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  background: linear-gradient(
    135deg,
    rgba(219, 234, 254, 0.98),
    rgba(224, 231, 255, 0.98)
  );
  box-shadow: 0 14px 34px rgba(37, 99, 235, 0.4);
}

.dap-price-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #1d4ed8;
}

.dap-price-value {
  font-size: 1.4rem;
  font-weight: 800;
  color: #1d4ed8;
}

.dap-unit-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #1e293b;
}

/* Quantidade */
.dap-qty-row {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dap-qty-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6b7280;
}

.dap-qty-control {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  padding: 4px 8px;
  gap: 4px;
}

.dap-qty-btn {
  border: none;
  background: #f8fafc;
  color: #1f2937;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s ease-out, box-shadow 0.12s ease-out,
    transform 0.08s ease-out;
}

.dap-qty-btn:hover {
  background: #e5edff;
  box-shadow: 0 4px 12px rgba(129, 140, 248, 0.55);
  transform: translateY(-1px);
}

.dap-qty-input {
  width: 60px;
  border: none;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 600;
  color: #0f172a;
  outline: none;
  background: transparent;
}

.dap-qty-input::-webkit-outer-spin-button,
.dap-qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.dap-qty-input[type='number'] {
  appearance: textfield;
  -moz-appearance: textfield;
}

.dap-qty-unit {
  font-size: 0.85rem;
  font-weight: 600;
  color: #6b7280;
  margin-left: 4px;
}

/* Total */
.dap-total-row {
  margin-top: 6px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.dap-total-label {
  font-size: 0.8rem;
  color: #64748b;
}

.dap-total-value {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
}

/* Ações */
.dap-actions {
  margin-top: 16px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.dap-btn-primary,
.dap-btn-secondary {
  border-radius: 999px;
  border: none;
  padding: 9px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: transform 0.12s ease-out, box-shadow 0.12s ease-out,
    background 0.12s ease-out, color 0.12s ease-out, filter 0.12s ease-out;
}

/* Cancelar */
.dap-btn-secondary {
  background: #ffffff;
  color: #475569;
  border: 1px solid #e2e8f0;
}

.dap-btn-secondary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.18);
}

/* Confirmar */
.dap-btn-primary {
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  color: #ffffff;
  box-shadow: 0 14px 30px rgba(79, 70, 229, 0.45);
}

.dap-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 36px rgba(79, 70, 229, 0.55);
  filter: brightness(1.03);
}

.dap-btn-icon {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

/* Responsivo */
@media (max-width: 720px) {
  .dap-dialog {
    padding: 18px 16px 18px;
  }

  .dap-layout {
    grid-template-columns: 1fr;
  }

  .dap-image-col {
    order: -1;
  }

  .dap-image-wrapper {
    max-width: 240px;
    height: 220px;
  }
}
