/* Carrito flotante de ROBLE. A diferencia de CV/Bolsas (icono flotante sobre el WhatsApp),
   aquí el icono vive en el header (arriba a la derecha) porque ROBLE es una sola página larga
   y el WhatsApp flotante ya ocupa la esquina inferior — el panel se abre pegado al header. */

.cart-fab {
  position: relative; width: 40px; height: 40px; border-radius: 50%; border: none;
  background: #f2f0ea; color: #14140f; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s ease;
}
.cart-fab:hover { background: #e6e3da; }
.cart-fab svg { display: block; }

.cart-badge {
  position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 4px;
  border-radius: 999px; background: #4a7c3f; color: #fff; font-size: 0.66rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center; line-height: 1;
  box-shadow: 0 0 0 2px #fff; opacity: 0; transform: scale(0.6); transition: opacity 0.15s ease, transform 0.15s ease;
}
.cart-badge.visible { opacity: 1; transform: scale(1); }
.cart-badge.oculto { opacity: 0; }

.cart-panel {
  position: fixed; top: 66px; right: 18px; z-index: 145; width: min(340px, calc(100vw - 36px));
  max-height: min(70vh, 520px); background: #fff; border-radius: 16px;
  box-shadow: 0 16px 48px rgba(20, 20, 15, 0.18); border: 1px solid #e6e3da;
  display: flex; flex-direction: column; overflow: hidden;
  transform-origin: top right; transform: scale(0.94) translateY(-6px); opacity: 0; pointer-events: none;
  transition: transform 0.16s ease, opacity 0.16s ease;
}
.cart-panel.open { transform: scale(1) translateY(0); opacity: 1; pointer-events: auto; }

.cart-panel-head {
  display: flex; align-items: center; justify-content: space-between; padding: 0.9rem 1.1rem;
  font-weight: 700; color: #14140f; border-bottom: 1px solid #f1f0ec;
}
.cart-panel-close { background: none; border: none; font-size: 1.3rem; line-height: 1; color: #9a988e; cursor: pointer; padding: 0 0.2rem; }
.cart-panel-close:hover { color: #14140f; }

.cart-items { flex: 1; overflow-y: auto; padding: 0.6rem 0.8rem; display: flex; flex-direction: column; gap: 0.6rem; }
.cart-empty { color: #9a988e; font-size: 0.88rem; text-align: center; padding: 1.5rem 0.5rem; }

.cart-item { display: flex; gap: 0.7rem; padding: 0.6rem; border-radius: 12px; background: #faf9f6; border: 1px solid #f1f0ec; }
.cart-item-img { width: 52px; height: 52px; border-radius: 9px; object-fit: cover; flex-shrink: 0; background: #eee; }
.cart-item-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.15rem; }
.cart-item-nombre { font-weight: 600; font-size: 0.86rem; color: #14140f; line-height: 1.25; }
.cart-item-detalle { font-size: 0.72rem; color: #9a988e; }
.cart-item-precio { font-size: 0.78rem; color: #14140f; }
.cart-item-qty { display: flex; align-items: center; gap: 0.4rem; margin-top: 0.3rem; }
.cart-item-qty button { width: 22px; height: 22px; border-radius: 6px; border: 1px solid #e6e3da; background: #fff; color: #14140f; cursor: pointer; line-height: 1; font-size: 0.9rem; }
.cart-item-qty span { font-size: 0.82rem; min-width: 1.1rem; text-align: center; }
.cart-item-quitar { background: none !important; border: none !important; color: #b3453a !important; font-size: 0.7rem !important; width: auto !important; cursor: pointer; margin-left: auto; }

.cart-panel-footer { padding: 0.8rem 1.1rem 1rem; border-top: 1px solid #f1f0ec; display: flex; flex-direction: column; gap: 0.6rem; }
.cart-descuento { font-size: 0.78rem; color: #4a7c3f; font-weight: 600; }
.cart-total { font-weight: 700; font-size: 1rem; color: #14140f; }
.cart-btn-pedir { background: #25d366; color: #fff; border: none; border-radius: 10px; padding: 0.7rem; font-weight: 700; font-size: 0.9rem; cursor: pointer; }

@media (max-width: 480px) {
  .cart-panel { right: 12px; left: 12px; width: auto; }
}

/* ===== Pago con Mercado Pago ===== */
.cart-entrega { display: flex; flex-direction: column; gap: 0.4rem; margin-top: 0.3rem; }
.cart-entrega-titulo { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: #5c5a52; }
.cart-entrega input { padding: 0.55rem 0.65rem; border: 1px solid #e6e3da; border-radius: 8px; font: inherit; font-size: 0.85rem; }
.cart-entrega input:focus { outline: 2px solid #4a7c3f; outline-offset: -1px; }
.cart-entrega-error { font-size: 0.78rem; color: #991b1b; min-height: 0; }
.cart-btn-mp { background: #009ee3; color: #fff; border: none; border-radius: 10px; padding: 0.75rem; font-weight: 700; font-size: 0.92rem; cursor: pointer; }
.cart-btn-mp:hover { background: #0086c3; }
.cart-btn-mp:disabled { opacity: 0.7; cursor: wait; }
.cart-mp-nota { font-size: 0.72rem; color: #5c5a52; text-align: center; margin-top: -0.2rem; }
.cart-btn-pedir.secundario { background: #fff; color: #128c4b; border: 1px solid #25d366; }
