/**
 * Paluwe Beauty - Estilos del Carrito de Compras y Checkout a WhatsApp
 * Compatible con Modo Claro (Crema) y Modo Oscuro
 */

.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.35s var(--ease-smooth), visibility 0.35s;
}

.cart-overlay.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.cart-drawer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 500px;
  margin: 0 auto;
  max-height: 90vh;
  background: var(--bg-dark);
  border-top: 1px solid var(--card-glass-border);
  border-radius: 24px 24px 0 0;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -20px 50px rgba(0, 0, 0, 0.3);
  transform: translateY(100%);
  transition: transform 0.4s var(--ease-smooth);
  z-index: 1001;
}

@media (min-width: 768px) {
  .cart-drawer {
    top: 0;
    bottom: 0;
    right: 0;
    left: auto;
    width: 440px;
    max-height: 100vh;
    border-radius: 24px 0 0 24px;
    border-left: 1px solid var(--card-glass-border);
    border-top: none;
    transform: translateX(100%);
  }
}

.cart-overlay.open .cart-drawer {
  transform: translateY(0);
}

@media (min-width: 768px) {
  .cart-overlay.open .cart-drawer {
    transform: translateX(0);
  }
}

/* Cabecera del Carrito */
.cart-header {
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--divider-color);
  background: var(--header-bg);
}

.cart-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cart-title-row h3 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 19px;
  color: var(--text-primary);
  font-weight: 700;
}

.cart-items-counter {
  background: var(--paluwe-rose-soft);
  color: var(--paluwe-red);
  border: 1px solid rgba(217, 27, 66, 0.2);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 11.5px;
  font-weight: 700;
}

.btn-close-cart {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--chip-bg);
  border: 1px solid var(--chip-border);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  transition: all var(--transition-fast);
}

.btn-close-cart:hover {
  background: var(--paluwe-rose-soft);
  color: var(--paluwe-red);
  transform: rotate(90deg);
}

/* Lista de Artículos */
.cart-items-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--bg-dark);
}

.cart-item-card {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--card-glass-border);
  border-radius: var(--radius-md);
  align-items: center;
  box-shadow: var(--shadow-sm);
}

.cart-item-img {
  width: 60px;
  height: 70px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--bg-surface-elevated);
}

.cart-item-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.cart-item-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.cart-item-tags {
  display: flex;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
}

.cart-item-tag {
  background: var(--chip-bg);
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--text-secondary);
}

.cart-item-price {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--paluwe-red);
  margin-top: 2px;
}

/* Control de Cantidad */
.cart-item-controls {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.qty-stepper {
  display: flex;
  align-items: center;
  background: var(--chip-bg);
  border-radius: var(--radius-full);
  border: 1px solid var(--chip-border);
  overflow: hidden;
}

.btn-qty {
  width: 26px;
  height: 26px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  transition: background var(--transition-fast);
}

.btn-qty:hover {
  background: var(--paluwe-rose-soft);
  color: var(--paluwe-red);
}

.qty-number {
  min-width: 24px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
}

.btn-item-remove {
  background: transparent;
  border: none;
  color: #ef4444;
  font-size: 11.5px;
  cursor: pointer;
  padding: 2px 4px;
  transition: opacity var(--transition-fast);
  font-weight: 600;
}

.btn-item-remove:hover {
  opacity: 0.7;
}

/* Carrito Vacío */
.cart-empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}
.cart-empty-icon {
  font-size: 42px;
  margin-bottom: 10px;
}

/* Formulario Express del Cliente */
.cart-customer-section {
  padding: 14px 20px;
  background: var(--bg-surface-elevated);
  border-top: 1px solid var(--divider-color);
  border-bottom: 1px solid var(--divider-color);
}

.customer-fields-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.customer-input {
  width: 100%;
  padding: 8px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--card-glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 12px;
  outline: none;
}

.customer-input::placeholder {
  color: var(--text-dim);
}

.customer-input:focus {
  border-color: var(--paluwe-red);
}

.customer-input.full-width {
  grid-column: span 2;
}

/* Footer y Total del Carrito */
.cart-footer {
  padding: 16px 20px;
  background: var(--bg-surface);
  border-top: 1px solid var(--divider-color);
}

.cart-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.cart-total-label {
  font-size: 13.5px;
  color: var(--text-secondary);
  font-weight: 600;
}

.cart-total-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--paluwe-red);
  font-family: inherit;
}

.btn-checkout-whatsapp {
  width: 100%;
  padding: 14px;
  font-size: 15px;
  font-weight: 700;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  border: none;
  background: linear-gradient(135deg, #25D366, #128C7E);
  color: #fff !important;
  box-shadow: 0 6px 25px rgba(37, 211, 102, 0.4);
  transition: all var(--transition-fast);
}

.btn-checkout-whatsapp:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(37, 211, 102, 0.6);
}

.whatsapp-icon-btn {
  font-size: 20px;
}
