/**
 * Carrito — popup (bottom sheet móvil + mini-carrito desktop) + steppers.
 */

/* ============================================================
   Popup / mini-carrito
   ============================================================ */
.sh-cart-popup { position: fixed; inset: 0; z-index: 100000; visibility: hidden; pointer-events: none; }
.sh-cart-popup.is-open { visibility: visible; pointer-events: auto; }

.sh-cart-popup-overlay {
	position: absolute; inset: 0;
	background: rgba(0, 0, 0, 0.45);
	opacity: 0; transition: opacity 0.25s ease;
}
.sh-cart-popup.is-open .sh-cart-popup-overlay { opacity: 1; }

.sh-cart-popup-panel {
	position: absolute;
	background: #fff;
	display: flex; flex-direction: column;
	box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.18);
	max-height: 86vh;
}
.sh-cart-popup-close {
	position: absolute; top: 8px; right: 10px; z-index: 2;
	width: 34px; height: 34px; border: none; background: transparent;
	font-size: 26px; line-height: 1; color: #64748b; cursor: pointer;
}
.sh-cart-popup-toast {
	display: none; align-items: center; gap: 8px;
	padding: 12px 18px; background: #ecfdf5; color: #047857; font-weight: 700;
	border-bottom: 1px solid #a7f3d0;
}
.sh-cart-popup.sh-just-added .sh-cart-popup-toast { display: flex; }
.sh-cart-popup-toast::before { content: "✓"; display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: #10b981; color: #fff; font-size: 13px; }

/* Móvil: bottom sheet */
.sh-cart-popup-panel {
	left: 0; right: 0; bottom: 0;
	border-radius: 18px 18px 0 0;
	transform: translateY(100%); transition: transform 0.3s ease;
}
.sh-cart-popup.is-open .sh-cart-popup-panel { transform: translateY(0); }

/* Desktop: mini-carrito arriba a la derecha */
@media (min-width: 1024px) {
	.sh-cart-popup-panel {
		left: auto; right: 20px; bottom: auto; top: 84px;
		width: 390px; max-width: calc(100vw - 40px);
		border-radius: 14px;
		transform: translateY(-12px); opacity: 0; transition: transform 0.22s ease, opacity 0.22s ease;
	}
	.sh-cart-popup.is-open .sh-cart-popup-panel { transform: translateY(0); opacity: 1; }
}

body.sh-cart-popup-open { overflow: hidden; }

/* ---- Contenido del mini-carrito ---- */
.sh-mini-cart-contents { overflow-y: auto; }
.sh-mc { display: flex; flex-direction: column; }
.sh-mc-head {
	display: flex; align-items: baseline; gap: 8px;
	padding: 16px 18px 10px; border-bottom: 1px solid var(--border, #e5e7eb);
}
.sh-mc-title { font-weight: 800; font-size: 1.05rem; }
.sh-mc-count { font-size: 0.85rem; color: var(--muted-foreground, #64748b); }

.sh-mc-empty { padding: 34px 18px; text-align: center; color: var(--muted-foreground, #64748b); }
.sh-mc-empty svg { color: #cbd5e1; margin-bottom: 8px; }

.sh-mc-items { list-style: none; margin: 0; padding: 6px 0; overflow-y: auto; }
.sh-mc-item { display: flex; gap: 12px; padding: 12px 18px; border-bottom: 1px solid #f1f5f9; }
.sh-mc-thumb { flex: 0 0 56px; width: 56px; height: 56px; object-fit: cover; border-radius: 8px; border: 1px solid #eef2f7; }
.sh-mc-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.sh-mc-name { font-weight: 600; font-size: 0.92rem; line-height: 1.25; }
.sh-mc-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.sh-mc-price { font-weight: 700; font-size: 0.92rem; white-space: nowrap; }
.sh-mc-remove { border: none; background: transparent; color: #b91c1c; font-size: 0.78rem; cursor: pointer; padding: 0; text-decoration: underline; }

.sh-mc-foot { padding: 14px 18px 18px; border-top: 1px solid var(--border, #e5e7eb); }
.sh-mc-subtotal { display: flex; justify-content: space-between; font-weight: 800; font-size: 1.05rem; margin-bottom: 4px; }
.sh-mc-note { margin: 0 0 12px; font-size: 0.78rem; color: var(--muted-foreground, #64748b); }
.sh-mc-btn { display: block; width: 100%; text-align: center; padding: 13px; border-radius: 12px; font-weight: 700; text-decoration: none; cursor: pointer; border: none; margin-bottom: 8px; }
.sh-mc-btn-primary { background: var(--primary, #b8863b); color: #fff; }
.sh-mc-btn-ghost { background: #fff; color: var(--foreground, #111); border: 1.5px solid var(--border, #d1d5db); }
.sh-mc-continue { display: block; width: 100%; text-align: center; padding: 8px; background: none; border: none; color: var(--muted-foreground, #64748b); cursor: pointer; font-size: 0.9rem; }

/* ============================================================
   Steppers +/- (reutilizable)
   ============================================================ */
.sh-stepper { display: inline-flex; align-items: center; border: 1.5px solid var(--border, #d1d5db); border-radius: 10px; overflow: hidden; }
.sh-stepper-btn {
	width: 32px; height: 32px; border: none; background: #f8fafc; color: var(--foreground, #111);
	font-size: 18px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center;
	transition: background 0.15s;
}
.sh-stepper-btn:hover { background: #eef2f7; }
.sh-stepper-btn:disabled { opacity: 0.5; cursor: default; }
.sh-stepper-val { min-width: 34px; text-align: center; font-weight: 700; font-size: 0.95rem; }

/* Fila de cantidad en la ficha */
.sh-qty-row { display: flex; align-items: center; gap: 14px; margin: 6px 0 14px; }
.sh-qty-row .sh-qty-label { margin: 0; font-weight: 600; color: var(--foreground, #111); }

/* Stepper de la ficha (más grande) */
.sh-stepper-pdp { margin: 0; }
.sh-stepper-pdp .sh-stepper-btn { width: 42px; height: 42px; font-size: 20px; }
.sh-stepper-pdp .sh-stepper-val { min-width: 46px; font-size: 1.05rem; }
.sh-qty-label { display: block; font-size: 0.85rem; color: var(--muted-foreground, #64748b); margin-bottom: 2px; }

/* Ocultar el input de cantidad nativo de WooCommerce cuando usamos el stepper propio */
.product-actions-wrapper .quantity, .secondary-cart-wrapper .quantity { display: none !important; }

/* ============================================================
   Página de carrito: +/- alrededor del input nativo
   ============================================================ */
.sh-cart-qty { display: inline-flex; align-items: center; gap: 6px; }
.sh-cart-qty .quantity { display: inline-flex !important; }
.sh-cart-qty .quantity input.qty {
	width: 46px; text-align: center; height: 34px; border: 1.5px solid var(--border, #d1d5db);
	border-radius: 8px; -moz-appearance: textfield;
}
.sh-cart-qty .quantity input.qty::-webkit-outer-spin-button,
.sh-cart-qty .quantity input.qty::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.sh-qty-step {
	width: 34px; height: 34px; border: 1.5px solid var(--border, #d1d5db); background: #f8fafc;
	border-radius: 8px; font-size: 18px; line-height: 1; cursor: pointer; color: var(--foreground, #111);
	display: inline-flex; align-items: center; justify-content: center;
}
.sh-qty-step:hover { background: #eef2f7; }
.sh-cart-item.sh-updating { opacity: 0.55; pointer-events: none; }
.sh-btn-update-cart { display: none !important; }
