/* TABLA DEL CARRITO DE COMPRAS */

/*  CONTENEDOR PRINCIPAL */
.cart-table-container {
  max-height: 480px;
  overflow-y: auto;
  overflow-x: auto;
  border-radius: 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(18, 26, 119, 0.4) transparent;
  background-color: #ffffff;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.04);
  padding: 0.8rem;
  transition: all 0.3s ease-in-out;
}

.cart-table-container::-webkit-scrollbar {
  height: 6px;
  width: 6px;
}

.cart-table-container::-webkit-scrollbar-thumb {
  background-color: rgba(18, 26, 119, 0.5);
  border-radius: 6px;
}

/* TABLA GENERAL */
.cart-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  animation: fadeInRows 0.6s ease-in;
  min-width: 700px;
}

.cart-table thead th {
  position: sticky;
  top: 0;
  background-color: #f8f9fa;
  color: #121a77;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.8rem;
  border-bottom: 2px solid #dee2e6;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  z-index: 5;
  text-align: center;
  white-space: nowrap;
  padding: 8px 5px;
  letter-spacing: 0.3px;
}

/* DISTRIBUCIÓN DE COLUMNAS AJUSTADA */

.cart-table th:nth-child(1),
.cart-table td:nth-child(1) {
  width: 42%;
}

/* Precio */
.cart-table th:nth-child(2),
.cart-table td:nth-child(2) {
  width: 13%;

}

/* Cant */
.cart-table th:nth-child(3),
.cart-table td:nth-child(3) {
  width: 10%;

}

/* Subtotal */
.cart-table th:nth-child(4),
.cart-table td:nth-child(4) {
  width: 22%;

}

/* Ícono eliminar */
.cart-table th:nth-child(5),
.cart-table td:nth-child(5) {
  width: 7%;
  text-align: center;
}


.cart-table td {
  background-color: #fff;
  border: 1px solid #e9ecef;
  vertical-align: middle;
  padding: 12px;
  transition: all 0.2s ease-in-out;
  text-align: center;
  word-break: break-word;
}

.cart-table tbody tr:hover {
  background-color: rgba(18, 26, 119, 0.04);
  transform: scale(1.002);
}

.product-info {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  text-align: left;
  flex-wrap: nowrap;
  max-width: 100%;
  overflow: hidden;
}

.product-info img {
  flex-shrink: 0;
  width: 50px;
  height: 50px;
  object-fit: contain;
  border-radius: 8px;
  border: 1.5px solid rgba(18, 26, 119, 0.15);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.product-info img:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
  border-color: rgba(249, 115, 22, 0.4);
}

.product-details {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  line-height: 1.3;
  word-wrap: break-word;
}

.product-details strong {
  color: #121a77;
  font-size: 0.9rem;
  font-weight: 600;
  display: block;
}

.product-details small {
  font-size: 0.8rem;
  color: #555;
  display: block;
}

.product-details .product-code {
  font-size: 0.78rem;
  color: #f97316;
  font-weight: 500;
  letter-spacing: 0.4px;
  display: block;
}

.update-quantity {
  width: 52px;
  border-radius: 6px;
  border: 1px solid rgba(18, 26, 119, 0.3);
  text-align: center;
  color: #121a77;
  font-weight: 500;
  font-size: 0.83rem;
  transition: all 0.2s ease-in-out;
}

.update-quantity:hover {
  border-color: #f97316;
}

.btn-outline-danger.btn-sm {
  border: none;
  color: #ea580c;
  background-color: transparent;
  transition: all 0.25s ease;
  border-radius: 6px;
  padding: 4px 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

.btn-outline-danger.btn-sm i {
  font-size: 0.9rem;
}

.btn-outline-danger.btn-sm:hover {
  color: #fff;
  background-color: #ea580c;
  transform: scale(1.1);
}

/*  ANIMACIONES */
@keyframes fadeInRows {
  0% {
    opacity: 0;
    transform: translateY(5px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-out {
  animation: fadeOutRow 0.4s ease forwards;
}

@keyframes fadeOutRow {
  from {
    opacity: 1;
    transform: scale(1);
  }

  to {
    opacity: 0;
    transform: scale(0.95);
  }
}

/*  RESPONSIVE */
@media (max-width: 1024px) {
  .cart-table {
    min-width: 680px;
  }

  .cart-table thead th {
    font-size: 0.78rem;
    padding: 7px 4px;
  }

  .product-info img {
    width: 48px;
    height: 48px;
  }

  .update-quantity {
    width: 48px;
  }
}

@media (max-width: 768px) {
  .cart-table {
    min-width: 620px;
  }

  .cart-table thead th {
    font-size: 0.75rem;
    padding: 6px 4px;
  }

  .product-info img {
    width: 45px;
    height: 45px;
  }

  .update-quantity {
    width: 44px;
    font-size: 0.8rem;
  }
}

@media (max-width: 576px) {
  .cart-table {
    min-width: 540px;
    font-size: 0.82rem;
  }

  .cart-table thead th {
    font-size: 0.73rem;
    padding: 6px 3px;
  }

  .product-info img {
    width: 44px;
    height: 44px;
  }

  .update-quantity {
    width: 40px;
  }
}