/**
 * ═══════════════════════════════════════════════════════════════
 * CART PAGE CSS - Estilos para la página completa del carrito
 * ═══════════════════════════════════════════════════════════════
 *
 * Estructura:
 * - Breadcrumbs de navegación
 * - Header de la página
 * - Layout de 2 columnas (productos + resumen)
 * - Cards de productos detallados
 * - Resumen sticky con totales
 * - Cupones y ayuda
 * - Estados vacío y carga
 * - Responsive mobile/desktop
 * - Dark mode compatible
 */

/* ═══════════════════════════════════════════════════════════════
   CONTAINER PRINCIPAL
   ═══════════════════════════════════════════════════════════════ */

.cart-page-container {
  max-width: var(--container-normal, 1200px);
  margin: 0 auto;
  padding: 2rem;
  min-height: calc(100vh - var(--header-height, 80px));
}

/* ═══════════════════════════════════════════════════════════════
   BREADCRUMBS
   ═══════════════════════════════════════════════════════════════ */

.cart-breadcrumbs {
  margin-bottom: 1.5rem;
}

.breadcrumb-list {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.875rem;
}

.breadcrumb-item a {
  color: var(--text-secondary, #6b7280);
  text-decoration: none;
  transition: color 0.2s;
}

.breadcrumb-item a:hover {
  color: var(--primary-color, #0066cc);
}

.breadcrumb-item.active {
  color: var(--text-primary, #1a1a1a);
  font-weight: 600;
}

.breadcrumb-separator {
  color: var(--text-tertiary, #9ca3af);
}

/* ═══════════════════════════════════════════════════════════════
   HEADER DE LA PÁGINA
   ═══════════════════════════════════════════════════════════════ */

.cart-page-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid var(--border-color, #e5e7eb);
}

.cart-page-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary, #1a1a1a);
  margin: 0 0 0.5rem 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.cart-page-title svg {
  stroke: var(--primary-color, #0066cc);
}

.cart-page-subtitle {
  font-size: 1rem;
  color: var(--text-secondary, #6b7280);
  margin: 0;
}

/* ═══════════════════════════════════════════════════════════════
   LAYOUT DE 2 COLUMNAS
   ═══════════════════════════════════════════════════════════════ */

.cart-page-layout {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 2rem;
  align-items: start;
}

/* ═══════════════════════════════════════════════════════════════
   ESTADO VACÍO
   ═══════════════════════════════════════════════════════════════ */

.cart-empty-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
  background: var(--bg-secondary, #f9fafb);
  border-radius: 16px;
  border: 2px dashed var(--border-color, #e5e7eb);
}

.cart-empty-state svg {
  stroke: var(--text-tertiary, #9ca3af);
  margin-bottom: 1.5rem;
}

.cart-empty-state h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary, #1a1a1a);
  margin: 0 0 0.5rem 0;
}

.cart-empty-state p {
  font-size: 1rem;
  color: var(--text-secondary, #6b7280);
  margin: 0 0 2rem 0;
}

.btn-browse-shop {
  padding: 1rem 2rem;
  background: var(--primary-color, #0066cc);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-browse-shop:hover {
  background: var(--primary-hover, #0052a3);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}

/* ═══════════════════════════════════════════════════════════════
   COLUMNA DE PRODUCTOS
   ═══════════════════════════════════════════════════════════════ */

.cart-products-column {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cart-products-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cart-page-product {
  display: flex;
  gap: 1.5rem;
  padding: 1.5rem;
  background: var(--bg-primary, #ffffff);
  border-radius: 12px;
  border: 1px solid var(--border-color, #e5e7eb);
  transition: all 0.2s;
}

.cart-page-product:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border-color: var(--primary-color, #0066cc);
}

/* Imagen del producto */
.product-page-image {
  width: 120px;
  height: 120px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-secondary, #f9fafb);
  border: 1px solid var(--border-color, #e5e7eb);
}

.product-page-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Información del producto */
.product-page-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.product-page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.product-page-name {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary, #1a1a1a);
  margin: 0 0 0.5rem 0;
  line-height: 1.4;
}

.product-page-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 0;
}

.product-brand {
  font-size: 0.875rem;
  color: var(--text-secondary, #6b7280);
}

.product-badge-event,
.product-badge-discount {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
}

.product-badge-event {
  background: #fee;
  color: #c00;
}

.product-badge-discount {
  background: #e0f2fe;
  color: #0284c7;
}

.btn-remove-product-page {
  width: 36px;
  height: 36px;
  border: none;
  background: #fee;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.btn-remove-product-page:hover {
  background: #fdd;
  transform: scale(1.05);
}

.btn-remove-product-page svg {
  stroke: #c00;
}

/* Footer del producto */
.product-page-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.product-page-quantity {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-secondary, #f9fafb);
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 8px;
  padding: 0.25rem;
}

.btn-qty {
  width: 36px;
  height: 36px;
  border: none;
  background: white;
  border-radius: 6px;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary, #1a1a1a);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-qty:hover {
  background: var(--primary-color, #0066cc);
  color: white;
}

.qty-input-page {
  width: 50px;
  height: 36px;
  border: none;
  background: transparent;
  text-align: center;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary, #1a1a1a);
}

.qty-input-page:focus {
  outline: none;
}

.product-page-pricing {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.product-price-original {
  font-size: 0.875rem;
  color: #69707a;
  text-decoration: line-through;
}

.product-price-final {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-color, #0066cc);
}

.product-savings {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--cl-success);
}

/* Botón limpiar carrito */
.cart-actions-bottom {
  display: flex;
  justify-content: flex-end;
  padding-top: 1rem;
}

.btn-clear-cart {
  padding: 0.75rem 1.5rem;
  background: transparent;
  color: #ef4444;
  border: 2px solid #ef4444;
  border-radius: 8px;
  font-size: 0.9375rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-clear-cart:hover {
  background: #ef4444;
  color: white;
}

/* ═══════════════════════════════════════════════════════════════
   COLUMNA DE RESUMEN (STICKY)
   ═══════════════════════════════════════════════════════════════ */

.cart-summary-column {
  position: sticky;
  top: calc(var(--header-height, 80px) + 2rem);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cart-summary-card,
.cart-coupon-card,
.cart-help-card {
  background: var(--bg-primary, #ffffff);
  border-radius: 12px;
  border: 1px solid var(--border-color, #e5e7eb);
  padding: 1.5rem;
}

.cart-summary-title,
.coupon-title,
.help-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary, #1a1a1a);
  margin: 0 0 1rem 0;
}

.cart-summary-totals {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.cart-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9375rem;
}

.cart-summary-row.savings {
  color: #10b981;
  font-weight: 600;
}

.cart-summary-row.total {
  padding-top: 1rem;
  border-top: 2px solid var(--border-color, #e5e7eb);
  font-size: 1.25rem;
  font-weight: 700;
}

.cart-summary-divider {
  height: 1px;
  background: var(--border-color, #e5e7eb);
  margin: 0.5rem 0;
}

.shipping-notice {
  background: #eff6ff;
  padding: 0.75rem;
  border-radius: 8px;
  margin-top: 0.5rem;
}

.notice-text {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: #1e40af;
  font-weight: 500;
}

.btn-checkout {
  width: 100%;
  padding: 1rem;
  background: var(--primary-color, #0066cc);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 1rem;
}

.btn-checkout:hover {
  background: var(--primary-hover, #0052a3);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 102, 204, 0.3);
}

.btn-continue-shopping-page {
  width: 100%;
  padding: 0.875rem;
  background: transparent;
  color: var(--primary-color, #0066cc);
  border: 2px solid var(--primary-color, #0066cc);
  border-radius: 10px;
  font-size: 0.9375rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  display: block;
  transition: all 0.2s;
  margin-top: 0.75rem;
}

.btn-continue-shopping-page:hover {
  background: var(--primary-color, #0066cc);
  color: white;
}

.cart-trust-signals {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color, #e5e7eb);
}

.trust-signal {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-secondary, #6b7280);
}

.trust-signal svg {
  stroke: #10b981;
  flex-shrink: 0;
}

/* Card de cupón */
.coupon-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.coupon-title svg {
  stroke: var(--primary-color, #0066cc);
}

.coupon-form {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.coupon-input {
  flex: 1;
  padding: 0.75rem;
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 8px;
  font-size: 0.9375rem;
  text-transform: uppercase;
}

.btn-apply-coupon {
  padding: 0.75rem 1.5rem;
  background: var(--primary-color, #0066cc);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-apply-coupon:hover {
  background: var(--primary-hover, #0052a3);
}

.coupon-hint {
  font-size: 0.875rem;
  margin: 0;
  min-height: 1.25rem;
}

/* Card de ayuda */
.help-text {
  font-size: 0.9375rem;
  color: var(--text-secondary, #6b7280);
  margin: 0 0 1rem 0;
}

.btn-whatsapp-help {
  width: 100%;
  padding: 0.875rem;
  background: #25d366;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.9375rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-whatsapp-help:hover {
  background: #1da851;
  transform: translateY(-2px);
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 992px) {
  .cart-page-container {
    padding: 1.5rem 1rem;
  }

  .cart-page-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .cart-summary-column {
    position: static;
  }

  .cart-page-product {
    flex-direction: column;
    gap: 1rem;
  }

  .product-page-image {
    width: 100%;
    height: 200px;
  }

  .product-page-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .product-page-quantity {
    justify-content: center;
  }

  .product-page-pricing {
    justify-content: center;
  }
}

@media (max-width: 640px) {
  .cart-page-title {
    font-size: 1.5rem;
  }

  .cart-page-product {
    padding: 1rem;
  }

  .product-page-image {
    height: 150px;
  }

  .coupon-form {
    flex-direction: column;
  }

  .btn-apply-coupon {
    width: 100%;
  }
}

/* ═══════════════════════════════════════════════════════════════
   DARK MODE
   ═══════════════════════════════════════════════════════════════ */

@media (prefers-color-scheme: dark) {
  .cart-empty-state {
    background: var(--bg-hover, rgba(255, 255, 255, 0.05));
  }

  .shipping-notice {
    background: rgba(59, 130, 246, 0.1);
  }

  .btn-remove-product-page {
    background: rgba(239, 68, 68, 0.15);
  }

  .btn-remove-product-page:hover {
    background: rgba(239, 68, 68, 0.25);
  }
}

/* ═══════════════════════════════════════════════════════════════
   ANIMACIONES
   ═══════════════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
  .cart-page-product,
  .btn-checkout,
  .btn-browse-shop,
  .btn-whatsapp-help,
  .btn-qty,
  .btn-remove-product-page {
    transition: none;
  }
}
