/* ─────────────────────────────────────────────────────────────────
   Gummies VTM+ — Carrito de compras
───────────────────────────────────────────────────────────────── */

body.cart-lock { overflow: hidden; }

/* ── FAB ── */
#cart-fab {
  position: fixed;
  right: clamp(1rem, 4vw, 2rem);
  bottom: clamp(1rem, 4vw, 2rem);
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--green);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px var(--green-glow);
  z-index: 800;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

#cart-fab:hover {
  background: var(--green-light);
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(94,160,48,0.35);
}

#cart-fab svg {
  width: 24px;
  height: 24px;
  stroke: #ffffff;
  fill: none;
}

.cart-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  border-radius: 50%;
  background: #ffffff;
  color: var(--green);
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 800;
  display: none;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg);
}

.cart-badge.is-visible { display: flex; }

/* ── Overlay ── */
#cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20,16,8,0.45);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 850;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

#cart-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

/* ── Drawer ── */
#cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: clamp(320px, 92vw, 420px);
  background: var(--surface-md);
  border-left: 1.5px solid var(--border);
  border-radius: 20px 0 0 20px;
  box-shadow: -10px 0 40px rgba(0,0,0,0.15);
  z-index: 860;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s ease;
}

#cart-drawer.is-open { transform: translateX(0); }

.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem 1.5rem 1.1rem;
  border-bottom: 1.5px solid var(--border);
  flex-shrink: 0;
}

.cart-header h2 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text);
}

#cart-close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  font-size: 1rem;
  border: 1.5px solid var(--border);
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

#cart-close:hover {
  border-color: var(--green);
  color: var(--green);
  transform: rotate(90deg);
}

/* ── Selector de productos (armar el pack) ── */
.cart-picker {
  flex-shrink: 0;
  padding: 0.9rem 1.5rem 0.6rem;
  border-bottom: 1.5px solid var(--border);
}

.cart-picker-title {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 0.55rem;
}

.cart-picker-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.picker-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.55rem;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  text-align: left;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease;
}

.picker-item:hover {
  border-color: var(--green);
  background: var(--green-dim);
  transform: translateY(-1px);
}

.picker-emoji { font-size: 1.05rem; flex-shrink: 0; }

.picker-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }

.picker-name {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.picker-price { font-size: 0.64rem; color: var(--text-muted); }

.picker-plus {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Items ── */
#cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.cart-empty {
  margin: auto 0;
  text-align: center;
  padding: 2rem 0.5rem;
}

.cart-empty p:first-child {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.4rem;
}

.cart-empty-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.cart-item {
  display: grid;
  grid-template-columns: 38px 1fr auto auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 16px;
}

.cart-item-emoji {
  font-size: 1.4rem;
  text-align: center;
}

.cart-item-info { min-width: 0; }

.cart-item-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item-price {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.cart-item-qty {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--surface-md);
  border: 1.5px solid var(--border);
  border-radius: 50px;
  padding: 0.2rem;
}

.qty-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 700;
  transition: background 0.2s ease, color 0.2s ease;
}

.qty-btn:hover {
  background: var(--green);
  color: #fff;
}

.qty-value {
  min-width: 16px;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
}

.cart-item-remove {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-faint);
  font-size: 0.8rem;
  transition: color 0.2s ease, background 0.2s ease;
}

.cart-item-remove:hover {
  color: var(--coral);
  background: rgba(232,92,80,0.1);
}

/* ── Footer / resumen ── */
.cart-footer {
  flex-shrink: 0;
  padding: 1.25rem 1.5rem 1.5rem;
  border-top: 1.5px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cart-summary {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.cart-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.cart-summary-discount span:last-child { color: var(--green); font-weight: 700; }

.cart-summary-total {
  padding-top: 0.6rem;
  border-top: 1px dashed var(--border);
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
}

.cart-summary-total span:last-child {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--green);
}

#cart-checkout { width: 100%; }

#cart-checkout:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.cart-note {
  text-align: center;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-faint);
}

/* ── Modal de datos del cliente ── */
#cart-modal {
  position: fixed;
  inset: 0;
  z-index: 870;
  background: rgba(20,16,8,0.5);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

#cart-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface-md);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  transform: translateY(14px);
  transition: transform 0.25s ease;
  box-shadow: 0 20px 60px rgba(0,0,0,0.18);
}

#cart-modal.is-open .modal-card { transform: translateY(0); }

.modal-card h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 0.3rem;
}

.modal-card input {
  width: 100%;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 50px;
  padding: 0.7rem 1.1rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.modal-card input::placeholder { color: var(--text-faint); }

.modal-card input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-dim);
}

.modal-card #modal-confirmar,
.modal-card #modal-cancelar {
  margin-top: 0.2rem;
}

/* ── Responsive ── */
@media (max-width: 480px) {
  #cart-drawer { width: 100vw; border-radius: 0; border-left: none; }
  #cart-fab { width: 52px; height: 52px; }
}
