.cart-section {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
}

.cart-title {
  font-size: 2rem;
  color: var(--primary-color);
  margin-bottom: 30px;
  text-align: center;
}

.cart-list {
  list-style: none;
  padding: 0;
  margin: 20px 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cart-item {
  background: white;
  border-radius: 12px;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cart-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.cart-item-info {
  display: flex;
  gap: 20px;
  align-items: center;
  flex: 1;
}

.cart-item-info img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid var(--primary-color);
}

.cart-item-info h4 {
  margin: 0 0 8px 0;
  color: var(--primary-color);
  font-size: 1.1rem;
}

.cart-item-price {
  font-weight: bold;
  color: var(--color-accent);
  font-size: 1.1rem;
  margin: 0;
}

.cart-item-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.qty-btn {
  background: var(--primary-color);
  color: white;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.qty-btn:hover {
  background: var(--secondary-color);
  transform: scale(1.1);
}

.qty-btn:active {
  transform: scale(0.95);
}

.qty {
  font-weight: bold;
  font-size: 1.2rem;
  min-width: 40px;
  text-align: center;
  color: var(--font-color);
}

.remove-btn {
  background: #e74c3c;
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.2rem;
  transition: all 0.3s ease;
}

.remove-btn:hover {
  background: #c0392b;
  transform: scale(1.05);
}

.remove-btn:active {
  transform: scale(0.95);
}

.cart-total {
  font-size: 1.8rem;
  font-weight: bold;
  text-align: right;
  margin: 30px 0 20px 0;
  color: var(--primary-color);
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.clear-cart-btn {
  background: #e74c3c;
  color: white;
  border: none;
  padding: 14px 28px;
  border-radius: 8px;
  font-weight: bold;
  font-size: 1rem;
  cursor: pointer;
  float: right;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3);
}

.clear-cart-btn:hover {
  background: #c0392b;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(231, 76, 60, 0.4);
}

.clear-cart-btn:active {
  transform: translateY(0);
}

.finish-cart-btn {
  background-color: #28a745;
  color: white;
  padding: 12px 20px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  transition: background-color 0.3s ease, transform 0.1s ease;
}

.finish-cart-btn:hover {
  background-color: #218838;
}

.finish-cart-btn:active {
  transform: scale(0.97);
}

.empty-cart {
  text-align: center;
  padding: 60px 20px;
  font-size: 1.4rem;
  color: #999;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Responsive Design */
@media (max-width: 768px) {
  .cart-item {
    flex-direction: column;
    gap: 16px;
    align-items: stretch;
  }

  .cart-item-info {
    flex-direction: column;
    text-align: center;
  }

  .cart-item-info img {
    width: 100%;
    max-width: 200px;
    height: auto;
    margin: 0 auto;
  }

  .cart-item-actions {
    justify-content: center;
    flex-wrap: wrap;
  }

  .cart-total {
    text-align: center;
    font-size: 1.5rem;
  }

  .clear-cart-btn {
    float: none;
    width: 100%;
    margin-top: 20px;
  }
}

@media (max-width: 480px) {
  .cart-title {
    font-size: 1.5rem;
  }

  .cart-item-price {
    font-size: 1rem;
  }

  .qty-btn {
    width: 32px;
    height: 32px;
    font-size: 18px;
  }

  .qty {
    font-size: 1rem;
  }
}

.modal {
  display: none;
  position: fixed;
  z-index: 999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: white;
  border-radius: 12px;
  padding: 30px 40px;
  text-align: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  animation: popIn 0.3s ease;
  max-width: 400px;
  width: 90%;
}

.modal-content h3 {
  color: var(--primary-color);
  margin-bottom: 20px;
}

#order-summary {
  text-align: left;
  font-size: 1rem;
  color: #444;
  max-height: 250px;
  overflow-y: auto;
  margin-bottom: 20px;
}

#order-summary ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

#order-summary li {
  padding: 6px 0;
  border-bottom: 1px solid #ddd;
}

.modal-buttons {
  display: flex;
  justify-content: space-around;
  gap: 10px;
}

.modal-buttons button {
   padding: 10px 18px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s ease;
  border: none;
}

/* Botón CONFIRMAR (verde) */
.modal-buttons .finish-cart-btn {
  background: #28a745;
}

.modal-buttons .finish-cart-btn:hover {
  background: #218838;
}

/* Botón CANCELAR (rojo) */
.modal-buttons .clear-cart-btn {
  background: #e74c3c;
}

.modal-buttons .clear-cart-btn:hover {
  background: #c0392b;
}

#cancel-purchase {
  background: #e74c3c;
}

.modal-buttons button:hover {
  transform: scale(1.05);
}

@keyframes popIn {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.finish-cart-btn {
  background: #28a745;
  color: white;
  border: none;
  padding: 14px 28px; 
  border-radius: 8px; 
  font-weight: bold;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  float: right;       
  box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.finish-cart-btn:hover {
  background: #218838;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

.finish-cart-btn:active {
  transform: translateY(0);
}

.cart-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}