/* Order Steps Progress Bar Styles */

/* Card del progreso de la orden */
.order-progress-card {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: box-shadow 0.3s ease;
}

.order-progress-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.order-progress-card .card-body {
  padding: 1.25rem;
}

/* Header con información de la orden */
.order-info-header {
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
}

.order-info-header code {
  font-size: 0.9rem;
  padding: 0.2rem 0.4rem;
  background-color: rgba(212, 175, 55, 0.1);
  border-radius: 4px;
}

.order-steps-container {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 20px;
  border: 1px solid #e9ecef;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

.order-steps-container::-webkit-scrollbar {
  height: 6px;
}

.order-steps-container::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.order-steps-container::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 10px;
}

.order-steps-container::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

.order-steps-header h6 {
  color: #1e3a5f;
  font-weight: 600;
}

.order-steps-progress-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  padding: 20px 0;
  flex-wrap: wrap;
  gap: 10px;
  min-width: max-content;
}

.order-step-item {
  flex: 1;
  min-width: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 2;
}

/* Ajustar posición del conector para que conecte correctamente */
.order-step-item {
  position: relative;
}

/* Línea conectora entre pasos usando ::before */
.order-step-item:not(:first-child)::before {
  content: '';
  position: absolute;
  top: 30px;
  left: calc(-50% + 30px);
  width: calc(100% - 60px);
  height: 3px;
  z-index: 1;
  transition: all 0.3s ease;
  background: #e9ecef; /* Por defecto pendiente */
}

/* Conector cuando el paso actual está completado */
.order-step-item.completed:not(:first-child)::before {
  background: #28a745;
}

/* Conector cuando el paso actual está en proceso */
.order-step-item.current:not(:first-child)::before {
  background: linear-gradient(to right, #28a745 0%, #007bff 100%);
}

/* Si el paso anterior está completado, el conector debe ser verde hasta el paso actual */
.order-step-item.completed + .order-step-item::before {
  background: #28a745;
}

.order-step-item.completed + .order-step-item.current::before {
  background: linear-gradient(to right, #28a745 0%, #007bff 100%);
}

.order-step-item.completed + .order-step-item.completed::before {
  background: #28a745;
}

/* Icono del paso */
.step-icon-wrapper {
  margin-bottom: 10px;
  position: relative;
}

.step-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  transition: all 0.3s ease;
  border: 3px solid;
  background: white;
  position: relative;
  z-index: 3;
}

/* Estados del paso */
.order-step-item.completed .step-icon {
  background: #28a745;
  border-color: #28a745;
  color: white;
}

.order-step-item.current .step-icon {
  background: #007bff;
  border-color: #007bff;
  color: white;
  animation: pulse 2s infinite;
}

.order-step-item.pending .step-icon {
  background: #e9ecef;
  border-color: #dee2e6;
  color: #6c757d;
}

/* Líneas conectoras según estado - ahora se manejan con ::before */
.step-connector.completed {
  background: #28a745;
}

.step-connector.current {
  background: linear-gradient(to right, #28a745 0%, #007bff 100%);
}

.step-connector.pending {
  background: #e9ecef;
}

/* Etiqueta del paso */
.step-label {
  text-align: center;
  margin-top: 8px;
}

.step-name {
  font-size: 0.875rem;
  font-weight: 500;
  display: block;
  transition: color 0.3s ease;
}

.order-step-item.completed .step-name {
  color: #28a745;
}

.order-step-item.current .step-name {
  color: #007bff;
  font-weight: 600;
}

.order-step-item.pending .step-name {
  color: #6c757d;
}

/* Mensaje del paso actual */
.order-steps-message {
  margin-top: 15px;
}

.order-steps-message .alert {
  border-radius: 8px;
  border: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Animación de pulso para paso actual */
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 123, 255, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(0, 123, 255, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(0, 123, 255, 0);
  }
}

/* Responsive */
@media (max-width: 768px) {
  .order-steps-container {
    padding: 15px;
  }
  
  .order-steps-progress-bar {
    padding: 15px 0;
    gap: 8px;
  }
  
  .order-step-item {
    min-width: 100px;
    flex-shrink: 0;
  }
  
  .step-icon {
    width: 50px;
    height: 50px;
    font-size: 20px;
    border-width: 2px;
  }
  
  .step-icon-wrapper {
    margin-bottom: 8px;
  }
  
  .step-name {
    font-size: 0.8rem;
  }
  
  .order-step-item:not(:first-child)::before {
    top: 25px;
    left: calc(-50% + 25px);
    width: calc(100% - 50px);
    height: 2px;
  }
}

@media (max-width: 576px) {
  .order-steps-container {
    padding: 12px;
  }
  
  .order-steps-progress-bar {
    padding: 12px 0;
    gap: 6px;
  }
  
  .order-step-item {
    min-width: 90px;
  }
  
  .step-icon {
    width: 45px;
    height: 45px;
    font-size: 18px;
    border-width: 2px;
  }
  
  .step-icon-wrapper {
    margin-bottom: 6px;
  }
  
  .step-name {
    font-size: 0.75rem;
  }
  
  .order-step-item:not(:first-child)::before {
    top: 22px;
    left: calc(-50% + 22px);
    width: calc(100% - 44px);
    height: 2px;
  }
}

/* Mejoras visuales */
.order-step-item.completed .step-icon i::before {
  content: "\f26b"; /* check-circle-fill */
}

.order-step-item.current .step-icon {
  transform: scale(1.1);
}

.order-step-item:hover .step-icon {
  transform: scale(1.05);
  transition: transform 0.2s ease;
}

.order-step-item.current:hover .step-icon {
  transform: scale(1.15);
}

/* Estilos para botones de acordeones en fila */
.accordion-buttons-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.accordion-btn {
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: fit-content;
}

.accordion-btn .btn-text {
  display: inline;
}

.accordion-btn i {
  flex-shrink: 0;
}

/* En móviles: mostrar solo íconos */
@media (max-width: 768px) {
  .accordion-buttons-container {
    gap: 0.375rem !important;
  }
  
  .accordion-btn {
    padding: 0.375rem 0.5rem !important;
    min-width: 44px !important;
    justify-content: center !important;
    white-space: nowrap !important;
  }
  
  .accordion-btn .btn-text {
    display: none !important;
  }
  
  .accordion-btn i {
    margin: 0 !important;
  }
  
  .accordion-btn .me-1,
  .accordion-btn .me-2 {
    margin-right: 0 !important;
    margin-left: 0 !important;
  }
  
  /* Asegurar que los íconos chevron también se ajusten */
  .accordion-btn .evidence-chevron,
  .accordion-btn .quotation-chevron,
  .accordion-btn .totals-chevron,
  .accordion-btn .products-chevron,
  .accordion-btn .shipment-chevron,
  .accordion-btn .pickup-chevron,
  .accordion-btn .pickup-details-chevron,
  .accordion-btn .payment-chevron {
    margin: 0 !important;
  }
}

/* Pantallas muy pequeñas */
@media (max-width: 576px) {
  .accordion-buttons-container {
    gap: 0.25rem !important;
  }
  
  .accordion-btn {
    padding: 0.375rem !important;
    min-width: 40px !important;
    font-size: 0.875rem !important;
  }
  
  .accordion-btn i {
    font-size: 1rem !important;
  }
  
  .accordion-btn .btn-text {
    display: none !important;
  }
}

