/* ========================================
    ESTILOS DEL CARRITO 
    ======================================== */

@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap");

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Roboto", sans-serif;
  background-color: #f5f5f5;
  color: #333;
  line-height: 1.6;
}

/* ======================================== 
    HEADER SIMPLIFICADO
    ======================================== */

.header {
  background: linear-gradient(135deg, #ffe600 0%, #ffed4e 100%);
  padding: 15px 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
}

.logo {
  font-size: 2rem;
  font-weight: 700;
  color: #333;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #666;
  font-size: 14px;
}

.breadcrumb a {
  color: #3483fa;
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

/* ======================================== 
    CONTENEDOR PRINCIPAL DEL CARRITO
    ======================================== */

.main-container {
  max-width: 1200px;
  margin: 30px auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: 1fr 350px;
  gap: 30px;
  align-items: start;
}

.cart-section {
  background: white;
  border-radius: 8px;
  padding: 25px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 25px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e5e5e5;
}

.cart-title {
  font-size: 24px;
  font-weight: 500;
  color: #333;
}

.clear-cart-btn {
  background: #f5f5f5;
  color: #666;
  border: 1px solid #ddd;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s ease;
}

.clear-cart-btn:hover {
  background: #ff3344;
  color: white;
  border-color: #ff3344;
}

/* ======================================== 
    ITEMS DEL CARRITO
    ======================================== */

.cart-items {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.cart-item {
  display: flex;
  gap: 20px;
  padding: 20px;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  background: #fafafa;
  transition: all 0.3s ease;
}

.cart-item:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.item-image {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}

.item-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.item-title {
  font-size: 18px;
  font-weight: 400;
  color: #333;
  margin-bottom: 8px;
  line-height: 1.4;
}

.item-price {
  font-size: 20px;
  font-weight: 300;
  color: #333;
  margin-bottom: 12px;
}

.item-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.quantity-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.quantity-btn {
  width: 35px;
  height: 35px;
  border: 1px solid #ddd;
  background: white;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all 0.3s ease;
}

.quantity-btn:hover {
  background: #f5f5f5;
  border-color: #3483fa;
}

.quantity-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.quantity-display {
  font-size: 16px;
  font-weight: 500;
  min-width: 30px;
  text-align: center;
}

.remove-item-btn {
  background: none;
  border: none;
  color: #ff3344;
  cursor: pointer;
  font-size: 14px;
  text-decoration: underline;
  transition: color 0.3s ease;
}

.remove-item-btn:hover {
  color: #d41d2e;
}

.item-subtotal {
  text-align: right;
  flex-shrink: 0;
  margin-left: 20px;
}

.subtotal-price {
  font-size: 22px;
  font-weight: 500;
  color: #333;
}

.unit-price {
  font-size: 14px;
  color: #666;
  margin-top: 4px;
}

/* ======================================== 
    RESUMEN DE COMPRA
    ======================================== */

.summary-section {
  background: white;
  border-radius: 8px;
  padding: 25px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 30px;
}

.summary-title {
  font-size: 20px;
  font-weight: 500;
  margin-bottom: 20px;
  color: #333;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 16px;
}

.summary-row.total {
  font-size: 24px;
  font-weight: 500;
  padding-top: 15px;
  border-top: 1px solid #e5e5e5;
  margin-top: 15px;
}

.shipping-info {
  background: #e8f5e8;
  padding: 12px;
  border-radius: 6px;
  margin: 15px 0;
  font-size: 14px;
  color: #00a650;
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkout-btn {
  width: 100%;
  background: #3483fa;
  color: white;
  border: none;
  padding: 15px;
  border-radius: 6px;
  font-size: 18px;
  font-weight: 500;
  cursor: pointer;
  margin-top: 20px;
  transition: all 0.3s ease;
}

.checkout-btn:hover {
  background: #2968c8;
  transform: translateY(-1px);
}

.checkout-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
}

.continue-shopping {
  width: 100%;
  background: white;
  color: #3483fa;
  border: 1px solid #3483fa;
  padding: 12px;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  margin-top: 15px;
  text-decoration: none;
  text-align: center;
  display: block;
  transition: all 0.3s ease;
}

.continue-shopping:hover {
  background: #3483fa;
  color: white;
}

/* ======================================== 
    ESTADO VACÍO
    ======================================== */

.empty-cart {
  text-align: center;
  padding: 60px 20px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.empty-icon {
  font-size: 5rem;
  color: #ddd;
  margin-bottom: 25px;
}

.empty-title {
  font-size: 24px;
  font-weight: 500;
  margin-bottom: 15px;
  color: #333;
}

.empty-message {
  color: #666;
  margin-bottom: 30px;
  font-size: 16px;
}

.start-shopping-btn {
  background: #3483fa;
  color: white;
  border: none;
  padding: 15px 30px;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: all 0.3s ease;
}

.start-shopping-btn:hover {
  background: #2968c8;
  transform: translateY(-1px);
}

/* ======================================== 
    MODAL DE CHECKOUT
    ======================================== */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  animation: fadeIn 0.3s ease;
}

.checkout-modal {
  background: white;
  padding: 30px;
  border-radius: 12px;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  animation: slideIn 0.3s ease;
}

.modal-header {
  text-align: center;
  margin-bottom: 25px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e5e5e5;
}

.modal-title {
  font-size: 24px;
  font-weight: 500;
  margin-bottom: 10px;
  color: #333;
}

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #333;
}

.form-input {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 16px;
  outline: none;
  transition: border-color 0.3s ease;
}

.form-input:focus {
  border-color: #3483fa;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.payment-methods {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.payment-method {
  padding: 15px;
  border: 2px solid #e5e5e5;
  border-radius: 6px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.payment-method:hover {
  border-color: #3483fa;
}

.payment-method.selected {
  border-color: #3483fa;
  background: #f0f7ff;
}

.payment-icon {
  font-size: 1.5rem;
  margin-bottom: 5px;
  color: #666;
}

.modal-actions {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #e5e5e5;
}

.modal-btn {
  padding: 12px 25px;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.modal-btn-primary {
  background: #3483fa;
  color: white;
}

.modal-btn-primary:hover {
  background: #2968c8;
}

.modal-btn-secondary {
  background: #f5f5f5;
  color: #666;
  border: 1px solid #ddd;
}

.modal-btn-secondary:hover {
  background: #e5e5e5;
}

/* ======================================== 
    ANIMACIONES
    ======================================== */

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

/* ======================================== 
    RESPONSIVE DESIGN
    ======================================== */

@media (max-width: 768px) {
  .main-container {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .summary-section {
    position: static;
    order: -1;
  }

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

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

  .item-subtotal {
    margin-left: 0;
    text-align: center;
  }

  .item-controls {
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .payment-methods {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  .cart-section,
  .summary-section {
    padding: 20px;
  }

  .checkout-modal {
    padding: 25px;
    margin: 20px;
    width: calc(100% - 40px);
  }
}