/* Estilos generales (aspecto moderno) */
body {
  background-color: #f8f9fa;
  font-family: "Roboto", sans-serif;
  padding: 0;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

/* new code: Animación de rebote para el logo en el overlay */
@keyframes bounce {

  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }

  40% {
    transform: translateY(-20px);
  }

  60% {
    transform: translateY(-10px);
  }
}

/* new code: Estilos para el logo */
#loadingLogo {
  width: 250px;
  margin-bottom: 10px;
}

/* Estilos de imágenes */
.imagenhover {
  width: 100px;
}

.imgdetaild {
  height: 46px;
  aspect-ratio: 1;
}

/* Estilos de tabla mejorados para mejor legibilidad */
table {
  font-size: 0.9rem;
  border-collapse: separate;
  border-spacing: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  border-radius: 8px;
  overflow: hidden;
}

table thead th {
  background-color: #007bff;
  color: #fff;
  font-weight: 600;
  text-align: center;
  padding: 12px 8px;
  border: none;
}

/* Estilo especial para la columna "Tu Precio" */
table thead th:nth-child(4) {
  background-color: #28a745;
}

table tbody tr {
  border-bottom: 1px solid #e9ecef;
  transition: all 0.2s ease;
}

table tbody tr:hover {
  background-color: #f1f3f4;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

table tbody td {
  vertical-align: middle;
  font-size: 12px;
  padding: 8px 6px;
}

/* Estilos mejorados para celdas de precio con ofertas */
.price-cell {
  min-height: 60px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 3px;
}

.offer-price {
  margin-bottom: 4px;
}

.normal-price {
  font-weight: 500;
  font-size: 13px;
  line-height: 1.2;
}

/* Estilos para badges de competitividad */
.badge {
  font-size: 0.7em;
  padding: 3px 6px;
  border-radius: 8px;
  margin-left: 4px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.badge i {
  font-size: 0.8em;
}

/* Estilos mejorados para indicadores de diferencia de precio */
.subioobajo {
  font-size: 11px;
  font-weight: 600;
  margin-left: 4px;
}

/* Estilos para celdas de farmacia con mejor legibilidad */
table tbody td:nth-child(n+5):nth-child(-n+14) {
  background-color: #fafbfc;
  border-left: 2px solid #e9ecef;
  min-width: 180px;
  max-width: 200px;
  word-wrap: break-word;
  position: relative;
}

/* Animación sutil para ofertas */
.offer-badge {
  animation: subtle-glow 2s ease-in-out infinite alternate;
}

@keyframes subtle-glow {
  from {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  }
  to {
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
  }
}

/* Estilos para indicadores de mejor precio */
.best-price-indicator {
  position: absolute;
  top: 5px;
  right: 5px;
  background: linear-gradient(135deg, #ffd700, #ffed4e);
  color: #856404;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: bold;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Estilo para precio más competitivo */
.most-competitive {
  border-left: 3px solid #28a745 !important;
  background-color: #f8fff8 !important;
}

/* Estilos para popover de precio */
.price-popover {
  display: inline-block;
  cursor: pointer;
  width: 100%;
  display: flex;
  flex-direction: column;
  font-size: 12px;
}

a {
  font-size: 10px;
}

.subioobajo {
  font-size: 10px;
}

.btn-svg-container {
  padding: 0 15px;
  gap: 20px;
}

tr {
  font-size: 11px;
}

.btn-svg {
  background-color: white;
  border: 1px solid #007bff;
  box-shadow: none;
  transition: background-color 0.3s ease;
  display: flex;
  text-align: start;
  gap: 20px;
  justify-content: center;
  align-items: center;
  border-radius: 5px;
  width: 180px;
  padding: 10px;
  margin-top: 20px;
  box-shadow: 0 1px 5px rgba(0, 115, 255, 0.2);
  transition: box-shadow 0.3s ease-in-out;
}

.btn-svg:hover {
  background-color: white;
  border: 1px solid #007bff;
  box-shadow: 0 6px 30px rgba(0, 115, 255, 0.3);
}

/* new code: Estilos para el formulario de login minimalista */
/* new code: Contenedor principal del login */
#loginContainer {
  max-width: 400px;
  margin: 100px auto;
  /* Centrado vertical y horizontal */
  padding: 30px;
  background-color: #ffffff;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  /* Sombra sutil */
  border-radius: 8px;
  font-family: 'Roboto', sans-serif;
  /* Fuente moderna */
}

/* new code: Estilo del encabezado */
#loginContainer img {
  width: 200px;
  margin: 0 20%;
  margin-bottom: 27px;
}

#loginContainer h3 {
  text-align: center;
  margin-bottom: 20px;
  font-weight: 500;
  color: #333;
}

/* new code: Estilos para las etiquetas de los inputs */
#loginContainer .form-label {
  display: block;
  margin-bottom: 5px;
  font-size: 0.9rem;
  color: #555;
}

/* new code: Estilos para los campos de entrada */
#loginContainer .form-control {
  width: 100%;
  padding: 10px 15px;
  margin-bottom: 15px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
  transition: border-color 0.3s;
}

#loginContainer .form-control:focus {
  border-color: #2b5bfb;

  outline: none;
}

/* new code: Estilo para el botón de login */
#loginContainer .btn-primary {
  background-color: #2b5bfb;

  border: none;
  padding: 10px 15px;
  font-size: 1rem;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s;
}

#loginContainer .btn-primary:hover {
  background-color: #4990e2;
}

/* new code: Estilo para el mensaje de error */
#loginContainer #loginError {
  font-size: 0.9rem;
  text-align: center;
  margin-top: 10px;
  color: #d9534f;
}


/* Nuevo código: Establece altura máxima y scroll vertical en el contenedor de la tabla */
#tableContainer {
  max-height: 400px;
  /* Ajusta la altura según tus necesidades */
  overflow-y: auto;
}

#productTable thead th {
  position: sticky;
  top: 0;
  background-color: #ffffff;
  z-index: 2;
}

/* Overlay de carga */
#loadingOverlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.7);
  align-items: center;
  justify-content: center;
  font-size: 1.5em;
  z-index: 1000;
  display: none;
  text-align: center;
  flex-direction: column;
  flex-direction: column;
}


#tableHead1 {
  display: flex;
  justify-content: space-between;
  margin-bottom: 13px;
}

/* ========================================
   ESTILOS PARA MODAL DE OPCIONES DE DESCARGA
   ======================================== */

/* Modal principal */
.download-options-modal .modal-content {
  border-radius: 15px;
  border: none;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  overflow: hidden;
}

.download-options-modal .modal-header {
  background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
  color: white;
  border: none;
  padding: 20px 25px;
}

.download-options-modal .modal-title {
  font-weight: 600;
  font-size: 1.25rem;
}

.download-options-modal .btn-close-white {
  filter: brightness(0) invert(1);
}

/* Cuerpo del modal */
.download-options-modal .modal-body {
  padding: 25px;
  background-color: #f8f9fa;
}

/* Tarjetas de opciones de descarga */
.download-option-card {
  border: 2px solid #e9ecef;
  border-radius: 12px;
  padding: 20px 15px;
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
  margin-bottom: 15px;
  background: white;
  position: relative;
  overflow: hidden;
  height: 150px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.download-option-card:hover {
  border-color: #007bff;
  background-color: #f8f9fa;
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 123, 255, 0.15);
}

.download-option-card.selected {
  border-color: #007bff;
  background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 123, 255, 0.3);
}

/* Iconos de las opciones */
.download-option-icon {
  font-size: 2.5rem;
  margin-bottom: 10px;
  display: block;
  line-height: 1;
}

.download-option-card h6 {
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 1rem;
}

.download-option-card p.small {
  margin-bottom: 0;
  opacity: 0.8;
  font-size: 0.85rem;
  line-height: 1.3;
}

.download-option-card.selected p.small {
  opacity: 0.9;
}

/* Efecto de brillo en hover */
.download-option-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.download-option-card:hover::before {
  left: 100%;
}

/* Separador */
.download-options-modal hr {
  border-top: 2px solid #dee2e6;
  margin: 20px 0;
}

/* Campos de formulario en el modal */
.download-options-modal .form-label {
  font-weight: 600;
  color: #495057;
  margin-bottom: 8px;
}

.download-options-modal .form-select,
.download-options-modal .form-control {
  border: 2px solid #e9ecef;
  border-radius: 8px;
  padding: 10px 12px;
  transition: all 0.3s ease;
}

.download-options-modal .form-select:focus,
.download-options-modal .form-control:focus {
  border-color: #007bff;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Footer del modal */
.download-options-modal .modal-footer {
  border: none;
  padding: 20px 25px;
  background-color: #f8f9fa;
}

.download-options-modal .modal-footer .btn {
  padding: 10px 20px;
  font-weight: 600;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.download-options-modal .modal-footer .btn-success {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  border: none;
}

.download-options-modal .modal-footer .btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(40, 167, 69, 0.3);
}

.download-options-modal .modal-footer .btn-success:disabled {
  background: #6c757d;
  transform: none;
  box-shadow: none;
}

/* Animación de entrada del modal */
.download-options-modal .modal-dialog {
  animation: slideInDown 0.3s ease-out;
}

@keyframes slideInDown {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Responsive para móviles */
@media (max-width: 768px) {
  .download-options-modal .modal-body {
    padding: 20px 15px;
  }
  
  .download-option-card {
    height: 130px;
    padding: 15px 10px;
  }
  
  .download-option-icon {
    font-size: 2rem;
    margin-bottom: 8px;
  }
  
  .download-option-card h6 {
    font-size: 0.9rem;
  }
  
  .download-option-card p.small {
    font-size: 0.8rem;
  }
}