/* Portado de React: Carrito.module.css (clases con prefijo "carrito-") */
.carrito-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000; /* por encima del menú y del botón de WhatsApp */
  background: rgba(17, 24, 39, 0.35);
  display: flex;
  justify-content: flex-end;
  animation: aparecer 0.2s ease;
}

.carrito-panel {
  width: min(420px, 100%);
  height: 100%;
  background: var(--cream);
  display: flex;
  flex-direction: column;
  box-shadow: -10px 0 40px rgba(26, 58, 42, 0.15);
  animation: entrar 0.25s ease;
}

.carrito-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem;
  border-bottom: 1px solid rgba(82, 183, 136, 0.15);
}

.carrito-header h2 {
  font-family: 'Playfair Display', serif;
  font-weight: 400;
  font-size: 1.5rem;
  color: var(--green-deep);
}

.carrito-cerrar {
  font-size: 1.8rem;
  line-height: 1;
  background: none;
  border: none;
  color: var(--stone);
  cursor: pointer;
  padding: 0.25rem 0.5rem;
}

.carrito-vacio {
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--stone);
}

.carrito-link {
  display: inline-block;
  margin-top: 1rem;
  color: var(--green-mid);
  font-weight: 500;
}

.carrito-lista {
  list-style: none;
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 1.5rem;
}

.carrito-item {
  display: flex;
  gap: 1rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid rgba(82, 183, 136, 0.12);
}

.carrito-miniatura {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: 12px;
  background: var(--green-pale);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.carrito-miniatura img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 6px;
}

.carrito-detalle {
  flex: 1;
  min-width: 0;
}

.carrito-nombre {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--green-deep);
}

.carrito-unitario {
  font-size: 0.78rem;
  color: var(--stone);
  margin-top: 0.15rem;
}

.carrito-cantidad {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.6rem;
  border: 1px solid rgba(82, 183, 136, 0.35);
  border-radius: 2rem;
  padding: 0.15rem 0.5rem;
}

.carrito-cantidad button {
  width: 26px;
  height: 26px;
  border: none;
  background: none;
  font-size: 1rem;
  color: var(--green-deep);
  cursor: pointer;
}

.carrito-cantidad span {
  min-width: 1.2rem;
  text-align: center;
  font-size: 0.9rem;
}

.carrito-lado {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
}

.carrito-subtotal {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--green-deep);
}

.carrito-quitar {
  font-family: inherit;
  font-size: 0.75rem;
  background: none;
  border: none;
  color: var(--stone);
  text-decoration: underline;
  cursor: pointer;
}

.carrito-footer {
  padding: 1.5rem;
  border-top: 1px solid rgba(82, 183, 136, 0.15);
  background: var(--white);
}

.carrito-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  color: var(--green-deep);
}

.carrito-total strong {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 400;
}

.carrito-nota {
  font-size: 0.78rem;
  color: var(--stone);
  margin-top: 0.35rem;
}

.carrito-error {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  background: #fdecec;
  color: #9b1c1c;
  font-size: 0.85rem;
}

.carrito-pagar {
  width: 100%;
  margin-top: 1.25rem;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 1rem;
  border-radius: 2rem;
  border: none;
  background: var(--green-mid);
  color: var(--white);
  box-shadow: 0 4px 20px rgba(45, 106, 79, 0.25);
  cursor: pointer;
  transition: background 0.25s;
}

.carrito-pagar:hover:not(:disabled) {
  background: var(--green-deep);
}

.carrito-pagar:disabled {
  opacity: 0.7;
  cursor: wait;
}

.carrito-metodos {
  margin-top: 0.75rem;
  text-align: center;
  font-size: 0.72rem;
  color: var(--stone);
}

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

@keyframes entrar {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

@media (prefers-reduced-motion: reduce) {
  .carrito-overlay, .carrito-panel { animation: none; }
}
