/**
 * Estilos para Sistema de Verificación de Entrega
 * Verificación directa en detalles del pedido
 * Sin dependencia de Bootstrap
 */

/* ===========================
   Contenedor Principal
   =========================== */
.cluster-verification-form-wrapper {
  margin: 30px 0;
  padding: 0;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  background: #fff;
  animation: slideInUp 0.3s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* ===========================
   Header
   =========================== */
.cluster-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  background: linear-gradient(135deg, #f8f9fa 0%, #f0f1f2 100%);
  border-bottom: 2px solid #dee2e6;
  border-radius: 4px 4px 0 0;
}

.cluster-section-header h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: #212529;
}

/* ===========================
   Badges de Estado
   =========================== */
.cluster-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 0.33rem;
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
}

.cluster-status-badge.cluster-status-pending {
  background-color: #fff3cd;
  color: #856404;
  border: 1px solid #ffe8a1;
}

.cluster-status-badge.cluster-status-success,
.cluster-status-pill.cluster-status-pill--approved {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.cluster-status-badge svg {
  flex-shrink: 0;
}

/* Soporte para clases Bootstrap (fallback) */
.cluster-status-badge.bg-warning {
  background-color: #fff3cd !important;
  color: #856404 !important;
}

.cluster-status-badge.bg-success {
  background-color: #d4edda !important;
  color: #155724 !important;
}

/* ===========================
   Formulario
   =========================== */
.cluster-verification-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1.5rem;
}

.cluster-verification-form fieldset {
  border: none;
  padding: 0;
  margin: 0;
}

.cluster-verification-form fieldset legend {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #212529;
  padding: 0;
}

/* ===========================
   Sección de Productos
   =========================== */
.cluster-products-section {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 0.375rem;
  padding: 1.5rem;
}

.cluster-products-section.requested {
  margin-bottom: 0;
}

.cluster-products-section.received {
  background: rgba(0, 102, 204, 0.05);
  border-color: rgba(0, 102, 204, 0.3);
}

.cluster-products-section.received legend {
  color: #0066cc;
}

.cluster-products-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* ===========================
   Filas de Productos
   =========================== */
.cluster-product-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: white;
  border: 1px solid #dee2e6;
  border-radius: 0.375rem;
  gap: 1rem;
  transition: all 0.3s ease;
}

.cluster-product-row:hover {
  box-shadow: 0 2px 8px rgba(0, 102, 204, 0.15);
  border-color: #0066cc;
}

.cluster-product-name {
  flex: 1;
  font-weight: 500;
  color: #333;
  font-size: 14px;
  margin: 0;
}

.cluster-product-qty {
  width: 100px;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 3px;
  font-size: 14px;
  text-align: center;
  font-weight: 500;
}

.cluster-product-qty.requested {
  background: #f5f5f5;
  cursor: not-allowed;
  color: #666;
}

.cluster-product-qty.received-input {
  background: #fff;
  cursor: text;
  color: #333;
  border-color: #0066cc;
}

.cluster-product-qty.received-input:focus {
  outline: none;
  border-color: #0052a3;
  box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.1);
}

/* ===========================
   Mensajes de Ayuda
   =========================== */
.cluster-helper-text {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin: 0 0 1rem 0;
  padding: 0.75rem;
  background: rgba(0, 102, 204, 0.05);
  border-radius: 0.375rem;
  border-left: 3px solid #0066cc;
  font-size: 12px;
  color: #666;
}

.cluster-helper-text svg {
  flex-shrink: 0;
  margin-top: 0.125rem;
}

/* ===========================
   Estado Aprobado
   =========================== */
.cluster-approval-body {
  padding: 1.5rem;
  background: rgba(40, 167, 69, 0.05);
  border-left: 4px solid #28a745;
}

.cluster-approval-message {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin: 0;
  color: #155724;
  font-size: 14px;
}

.cluster-approval-message svg {
  flex-shrink: 0;
  color: #28a745;
}

.cluster-approval-message strong {
  font-weight: 700;
}

/* ===========================
   Mensajes del Formulario
   =========================== */
.cluster-form-message {
  padding: 12px 15px;
  border-radius: 3px;
  margin-top: 15px;
  font-size: 14px;
  font-weight: 500;
  animation: fadeIn 0.3s ease;
}

.cluster-form-message.loading {
  background: #e3f2fd;
  color: #1976d2;
  border-left: 3px solid #1976d2;
}

.cluster-form-message.success {
  background: #d4edda;
  color: #155724;
  border-left: 3px solid #28a745;
}

.cluster-form-message.error {
  background: #f8d7da;
  color: #721c24;
  border-left: 3px solid #dc3545;
}

/* ===========================
   Botones y Acciones
   =========================== */
.cluster-form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 0;
  padding-top: 1.5rem;
  border-top: 1px solid #dee2e6;
  flex-wrap: wrap;
}

.cluster-form-actions .button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 10px 20px;
  font-size: 14px;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  border: none;
}

.cluster-form-actions .button svg {
  flex-shrink: 0;
}

.cluster-submit-btn {
  background: #0066cc;
  color: white;
  flex: 1;
  min-width: 150px;
  justify-content: center;
}

.cluster-submit-btn:hover {
  background: #0052a3;
  box-shadow: 0 2px 5px rgba(0, 102, 204, 0.3);
  color: white;
}

.cluster-submit-btn:active {
  transform: translateY(1px);
}

.cluster-cancel-btn {
  background: #f0f0f0;
  color: #333;
  border: 1px solid #ddd;
  flex: 0 1 auto;
  min-width: 120px;
}

.cluster-cancel-btn:hover {
  background: #e0e0e0;
  color: #333;
  text-decoration: none;
}

/* ===========================
   Estado de Carga
   =========================== */
.cluster-form-loading .cluster-submit-btn {
  pointer-events: none;
  opacity: 0.65;
}

.cluster-form-loading .cluster-submit-btn::after {
  content: '';
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-left: 0.5rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* ===========================
   Animaciones
   =========================== */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ===========================
   Responsive: Tablets
   =========================== */
@media (max-width: 768px) {
  .cluster-verification-form-wrapper {
    margin: 20px 0;
  }

  .cluster-section-header {
    padding: 1rem;
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }

  .cluster-section-header h2 {
    font-size: 1.1rem;
  }

  .cluster-verification-form {
    padding: 1rem;
  }

  .cluster-products-section {
    padding: 1rem;
  }

  .cluster-product-row {
    flex-wrap: wrap;
    padding: 0.75rem;
  }

  .cluster-product-name {
    flex: 1 0 100%;
    width: 100%;
    margin-bottom: 0.5rem;
  }

  .cluster-product-qty {
    width: 80px;
    font-size: 0.875rem;
  }

  .cluster-form-actions {
    flex-direction: column;
    gap: 0.5rem;
  }

  .cluster-form-actions .button {
    justify-content: center;
  }

  .cluster-submit-btn,
  .cluster-cancel-btn {
    flex: 1;
    min-width: auto;
  }
}

/* ===========================
   Responsive: Móviles
   =========================== */
@media (max-width: 480px) {
  .cluster-verification-form-wrapper {
    margin: 15px 0;
  }

  .cluster-section-header {
    padding: 0.75rem;
  }

  .cluster-section-header h2 {
    font-size: 1rem;
  }

  .cluster-verification-form {
    padding: 0.75rem;
  }

  .cluster-products-section {
    padding: 0.75rem;
  }

  .cluster-product-row {
    padding: 0.5rem;
  }

  .cluster-product-qty {
    width: 70px;
    padding: 6px;
    font-size: 12px;
  }

  .cluster-form-actions .button {
    padding: 8px 15px;
    font-size: 13px;
  }

  .cluster-status-badge {
    font-size: 0.75rem;
    padding: 0.4rem 0.75rem;
  }
}
