/* ===== RESET Y BASE ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  padding: 0;
  background: linear-gradient(135deg, #f5f7f9 0%, #e8ecf1 100%);
  min-height: 100vh;
  color: #333;
}

/* ===== CONTENEDOR PRINCIPAL ===== */
.overall-progress-section {
  max-width: 1200px;
  margin: 20px auto 30px;
  padding: 20px 25px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(10px);
}

/* ===== HEADER ===== */
.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  flex-wrap: wrap;
  gap: 15px;
  padding: 15px 20px;
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
  border-radius: 12px;
  border: 1px solid rgba(26, 151, 10, 0.1);
}

.logo {
  height: 55px;
  object-fit: contain;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}
.logo:hover {
  transform: scale(1.05);
}

/* ===== BARRA DE BÚSQUEDA ===== */
.search-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex: 0 1 auto;
  min-width: 300px;
}

.search-bar input {
  padding: 12px 18px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  width: 100%;
  font-size: 15px;
  flex: 1;
  transition: all 0.3s ease;
  background: white;
}
.search-bar input:focus {
  border-color: #1a970a;
  outline: none;
  box-shadow: 0 0 0 4px rgba(26, 151, 10, 0.15);
}

.search-bar button {
  padding: 12px 28px;
  background: linear-gradient(135deg, #1a970a, #09a811);
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: bold;
  font-size: 15px;
  transition: all 0.3s ease;
  white-space: nowrap;
  box-shadow: 0 4px 15px rgba(26, 151, 10, 0.3);
}
.search-bar button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(26, 151, 10, 0.4);
  background: linear-gradient(135deg, #0f7a05, #07a010);
}
.search-bar button:disabled {
  background: #95a5a6;
  cursor: not-allowed;
  box-shadow: none;
}
.search-bar button.blocked {
  position: relative;
  overflow: hidden;
}
.search-bar button.blocked::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  height: 4px;
  background: linear-gradient(90deg, #3498db, #2ecc71);
  animation: countdown 10s linear forwards;
}

@keyframes countdown {
  from { width: 100%; }
  to { width: 0%; }
}

.countdown-text {
  margin-left: 10px;
  font-size: 14px;
  color: #e74c3c;
  font-weight: 600;
}

/* ===== TÍTULO ===== */
h2 {
  text-align: center;
  margin: 30px 0 25px;
  font-size: 2.2rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2px;
  position: relative;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
  animation: subtleGlow 3s ease-in-out infinite alternate;
  background: linear-gradient(135deg, #1a970a, #2c3e50);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

@keyframes subtleGlow {
  0% {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    transform: translateY(0);
  }
  100% {
    text-shadow: 2px 2px 20px rgba(26, 151, 10, 0.3);
    transform: translateY(-2px);
  }
}

h2::after {
  content: '';
  display: block;
  width: 120px;
  height: 4px;
  background: linear-gradient(90deg, #1a970a, #09a811, #1a970a);
  margin: 15px auto 0;
  border-radius: 2px;
  animation: lineGrow 1.5s ease-out;
}

@keyframes lineGrow {
  from { width: 0; opacity: 0; }
  to { width: 120px; opacity: 1; }
}

/* ===== LÍNEA DE TIEMPO HORIZONTAL ===== */
.horizontal-timeline-container {
  position: relative;
  margin-bottom: 40px;
  padding: 30px 25px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.06);
  margin-top: 20px;
  border: 1px solid rgba(26, 151, 10, 0.08);
}

.horizontal-timeline {
  display: flex;
  justify-content: space-between;
  position: relative;
  z-index: 2;
}

.timeline-connector {
  position: absolute;
  top: 62px;
  left: 40px;
  right: 40px;
  height: 5px;
  background: #e8ecef;
  z-index: 1;
  border-radius: 3px;
  overflow: hidden;
}

.connector-progress {
  height: 100%;
  background: linear-gradient(90deg, #1a970a, #09a811, #2ecc71);
  width: 0%;
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 3px;
  box-shadow: 0 0 20px rgba(26, 151, 10, 0.3);
}

.ht-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 2;
  transition: transform 0.3s ease;
  flex: 1;
}
.ht-item:hover {
  transform: translateY(-5px);
}

.ht-icon-wrapper {
  width: 65px;
  height: 65px;
  border-radius: 50%;
  background: #fff;
  border: 4px solid #e0e4e8;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 12px;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.progress-ring {
  position: absolute;
  top: -4px;
  left: -4px;
  width: 65px;
  height: 65px;
  transform: rotate(-90deg);
}

.progress-circle-bg {
  fill: none;
  stroke: transparent;
  stroke-width: 4;
}

.progress-circle-value {
  fill: none;
  stroke: #1a970a;
  stroke-width: 4;
  stroke-dasharray: 190.9;
  stroke-dashoffset: 190.9;
  transition: stroke-dashoffset 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.ht-icon {
  font-size: 26px;
  color: #b0b8c0;
  transition: all 0.5s ease;
}

.ht-text {
  font-weight: 600;
  color: #b0b8c0;
  text-align: center;
  transition: all 0.3s ease;
  margin-top: 5px;
  font-size: 14px;
}

.ht-tooltip {
  position: absolute;
  bottom: -30px;
  background: #2c3e50;
  color: white;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  white-space: nowrap;
  z-index: 10;
  font-weight: 500;
}
.ht-tooltip::after {
  content: '';
  position: absolute;
  top: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 6px solid #2c3e50;
}
.ht-item:hover .ht-tooltip {
  opacity: 1;
  visibility: visible;
  bottom: -28px;
}

.ht-item.active .ht-icon-wrapper {
  border-color: #1a970a;
  background: linear-gradient(135deg, #e8f5e6, #d4edcf);
  transform: scale(1.12);
  box-shadow: 0 8px 30px rgba(26, 151, 10, 0.35);
}
.ht-item.active .ht-icon {
  color: #1a970a;
  animation: pulse 1.5s infinite;
}
.ht-item.active .ht-text {
  color: #1a970a;
  font-weight: 700;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

/* ===== TARJETA DE ESTADO ===== */
.order-status-card {
  background: white;
  border-radius: 16px;
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  margin-bottom: 30px;
  border: 1px solid rgba(26, 151, 10, 0.08);
}

.card-header {
  background: linear-gradient(135deg, #f8f9fa, #ffffff);
  padding: 20px 25px;
  border-bottom: 2px solid rgba(26, 151, 10, 0.1);
}

.status-text {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.status-text.consultando { color: #3498db; }
.status-text.registrado { color: #2ecc71; }
.status-text.entregado {
  color: #27ae60;
  animation: glowGreen 2s ease-in-out infinite;
}

@keyframes glowGreen {
  0%, 100% { text-shadow: 0 0 10px rgba(39, 174, 96, 0.2); }
  50% { text-shadow: 0 0 30px rgba(39, 174, 96, 0.5); }
}
.status-text.no-registrado { color: #e74c3c; }
.status-text.esperando { color: #f39c12; }

/* ===== CONTENIDO DE LA TARJETA ===== */
.card-content {
  display: flex;
  padding: 25px;
  gap: 35px;
}
.info-column { flex: 1.2; }
.monitoring-column { flex: 1; }

.order-details {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.detail-group {
  display: flex;
  align-items: center;
  border-bottom: 1px dashed #e8ecef;
  padding: 10px 0;
  transition: all 0.3s ease;
}

/* ✅ Títulos se ponen verdes cuando hay datos */
.detail-group.has-data .detail-label {
  color: #1a970a;
  font-weight: 700;
}

/* ✅ Los valores SIEMPRE se mantienen en gris oscuro */
.detail-value {
  color: #2c3e50;
  font-weight: 500;
}

.detail-label {
  font-weight: 600;
  width: 180px;
  margin: 0;
  color: #7f8c8d;
  font-size: 14px;
  transition: all 0.3s ease;
}
.detail-value {
  margin: 0;
  flex: 1;
  color: #2c3e50;
  font-weight: 500;
  transition: all 0.3s ease;
}

/* ===== LÍNEA DE TIEMPO VERTICAL (MONITOREO) ===== */
.order-tracking {
  border-left: 3px solid #e8ecef;
  padding-left: 28px;
  position: relative;
}
.order-tracking::before {
  content: '';
  position: absolute;
  left: -1px;
  top: 0;
  bottom: 0;
  width: 10px;
  background: linear-gradient(to bottom, #8fe084, #4de655, #2cd627, #1dda05);
  border-radius: 5px;
  opacity: 0.6;
  animation: linePulse 3s ease-in-out infinite;
}

@keyframes linePulse {
  0%, 100% { opacity: 0.6; transform: scaleY(1); }
  50% { opacity: 1; transform: scaleY(1.03); }
}

.tracking-label {
  font-weight: 700;
  color: #2c3e50;
  margin-top: 0;
  margin-bottom: 20px;
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.tracking-label i { color: #1a970a; }

.tracking-timeline {
  list-style: none;
  padding: 0;
  margin: 0;
  position: relative;
}
.tracking-timeline::before {
  content: '';
  position: absolute;
  left: -28px;
  top: 5px;
  bottom: 5px;
  width: 3px;
  background: rgba(26, 151, 10, 0.1);
  border-radius: 2px;
}

.timeline-item {
  position: relative;
  padding-bottom: 22px;
  padding-left: 5px;
}
.timeline-item:last-child { padding-bottom: 0; }

.timeline-item::after {
  content: '';
  position: absolute;
  left: -26px;
  top: 20px;
  bottom: -22px;
  width: 4px;
  background: linear-gradient(to bottom, #1a970a, #09a811);
  opacity: 0.2;
  border-radius: 2px;
  transition: all 0.6s ease;
}
.timeline-item:last-child::after { display: none; }

.timeline-item.completed::after {
  opacity: 1;
  background: linear-gradient(to bottom, #1a970a, #09a811, #2ecc71);
  animation: lineFlow 2.5s ease-in-out infinite;
}

@keyframes lineFlow {
  0%, 100% { background: linear-gradient(to bottom, #1a970a, #09a811); }
  50% { background: linear-gradient(to bottom, #09a811, #2ecc71); }
}

.timeline-dot {
  position: absolute;
  left: -32px;
  top: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #e0e4e8;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  border: 3px solid white;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  z-index: 2;
}
.timeline-item.completed .timeline-dot {
  background: linear-gradient(135deg, #1a970a, #09a811);
  animation: dotPulse 2.5s infinite;
  box-shadow: 0 0 25px rgba(26, 151, 10, 0.5);
}

@keyframes dotPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 15px rgba(26, 151, 10, 0.4); }
  50% { transform: scale(1.25); box-shadow: 0 0 35px rgba(26, 151, 10, 0.7); }
}
.timeline-item:hover .timeline-dot {
  transform: scale(1.35);
  transition: transform 0.3s ease;
}

.timeline-content {
  display: flex;
  flex-direction: column;
  padding-left: 5px;
}
.timeline-status {
  font-weight: 600;
  margin-bottom: 3px;
  color: #2c3e50;
  font-size: 15px;
}
.timeline-date {
  font-size: 14px;
  color: #95a5a6;
  font-weight: 500;
}
.timeline-item.completed .timeline-date {
  color: #1a970a;
  font-weight: 600;
}

/* ===== SECCIÓN DE IMAGEN ===== */
.guia-image-section {
  max-width: 1200px;
  margin: 0 auto 30px;
  padding: 0 20px;
}

.guia-image-title {
  font-size: 20px;
  font-weight: 700;
  color: #2c3e50;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.guia-image-title i { color: #1a970a; }

.guia-image-container {
  background: white;
  border-radius: 16px;
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.06);
  padding: 25px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 280px;
  border: 2px dashed #e8ecef;
  transition: all 0.3s ease;
  position: relative;
}
.guia-image-container.has-image {
  border: 2px solid rgba(26, 151, 10, 0.3);
}

.guia-image-placeholder {
  text-align: center;
  color: #b0b8c0;
}
.guia-image-placeholder i {
  font-size: 48px;
  margin-bottom: 15px;
  display: block;
  color: #d0d5da;
}
.guia-image-placeholder p {
  font-size: 16px;
  font-weight: 500;
}
.guia-image-placeholder .sub-text {
  font-size: 14px;
  color: #b0b8c0;
  margin-top: 5px;
  font-weight: 400;
}

.guia-image {
  max-width: 100%;
  max-height: 500px;
  display: none;
  border-radius: 8px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}
.guia-image.show { display: block; }

.image-actions {
  margin-top: 20px;
  display: none;
  gap: 15px;
  flex-wrap: wrap;
  justify-content: center;
}
.image-actions.show { display: flex; }

.btn-download {
  padding: 12px 30px;
  background: linear-gradient(135deg, #1a970a, #09a811);
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
  font-size: 15px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 15px rgba(26, 151, 10, 0.3);
}
.btn-download:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(26, 151, 10, 0.4);
}
.btn-download i { font-size: 18px; }
.btn-download:disabled {
  background: #95a5a6;
  cursor: not-allowed;
  box-shadow: none;
}

/* ===== BADGES ===== */
.status-badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.status-badge.entregado {
  background: #d4edcf;
  color: #1a970a;
}
.status-badge.pendiente {
  background: #fff3cd;
  color: #f39c12;
}
.status-badge.no-imagen {
  background: #f8d7da;
  color: #e74c3c;
}

/* ===== ERROR ===== */
.error-message {
  background: #ffecec;
  color: #e74c3c;
  padding: 15px 20px;
  border-radius: 10px;
  margin-bottom: 20px;
  border-left: 5px solid #e74c3c;
  font-weight: 500;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .card-content {
    flex-direction: column;
    padding: 20px;
    gap: 25px;
  }
  .order-tracking {
    border-left: none;
    border-top: 3px solid #e8ecef;
    padding-left: 0;
    padding-top: 20px;
    margin-top: 10px;
  }
  .order-tracking::before {
    left: 0;
    top: -1px;
    bottom: auto;
    width: 100%;
    height: 10px;
    background: linear-gradient(to right, #8fe084, #4de655, #2cd627, #1dda05);
    border-radius: 0 0 5px 5px;
  }
  .tracking-timeline::before {
    left: 10px;
  }
  .timeline-item {
    padding-left: 30px;
  }
  .timeline-dot {
    left: 2px;
  }
  .timeline-item::after {
    left: 10px;
  }
  .detail-label {
    width: 140px;
    font-size: 13px;
  }
}

@media (max-width: 768px) {
  .header-top {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    gap: 15px;
    padding: 15px;
  }
  .logo {
    margin: 0 auto;
    height: 45px;
  }
  .search-bar {
    width: 100%;
    min-width: unset;
    flex-direction: column;
  }
  .search-bar input { width: 100%; }
  .search-bar button { width: 100%; justify-content: center; }

  .horizontal-timeline {
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
  }
  .timeline-connector { display: none; }
  .ht-item {
    flex: 0 0 calc(50% - 15px);
    margin-bottom: 15px;
  }
  h2 { font-size: 1.6rem; }
  .status-text { font-size: 20px; }
  .detail-group {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .detail-label { width: 100%; }
}

@media (max-width: 480px) {
  .ht-item { flex: 0 0 100%; }
  .overall-progress-section {
    padding: 12px 15px;
    margin: 10px;
  }
  .card-content { padding: 15px; }
  .guia-image-container {
    padding: 15px;
    min-height: 200px;
  }
}