/* Carrito del sitio: ícono de la cabecera, mini carrito, animación de agregado y avisos. */

/* ---- Ícono en la cabecera (themes/homiture/parts/header.html) ----
   Escritorio: píldora con ícono, "Carrito" y contador (más grande, fácil de ver).
   Móvil: solo el ícono con contador, junto al menú. */
.site-header__cart {
	position: relative; display: inline-flex; align-items: center; gap: .5rem;
	height: 46px; padding: 0 1rem 0 .85rem; border-radius: 999px;
	border: 1.5px solid var(--wp--preset--color--border, #e3e0d8); background: #fff;
	color: var(--wp--preset--color--text, #222826); text-decoration: none; font-weight: 600; font-size: .92rem;
	transition: background .15s, border-color .15s, color .15s;
}
.site-header__cart[hidden] { display: none; }
.site-header__cart svg { width: 24px; height: 24px; }
.site-header__cart:hover, .site-header__cart[aria-expanded="true"] { border-color: var(--wp--preset--color--primary, #30877c); color: var(--wp--preset--color--primary, #30877c); }
.site-header__cart-n {
	min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px;
	background: var(--wp--preset--color--primary, #30877c); color: #fff;
	font-size: .75rem; font-weight: 700; line-height: 22px; text-align: center;
}
.site-header__cart.is-empty .site-header__cart-n { background: var(--wp--preset--color--border-light, #efece5); color: var(--wp--preset--color--muted, #6b736f); }
.site-header__cart.is-bump { animation: hmtBump .5s cubic-bezier(.3,1.6,.5,1); }
.site-header__cart.is-bump .site-header__cart-n { animation: hmtBumpN .5s ease; }
@keyframes hmtBump { 0% { transform: scale(1); } 35% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes hmtBumpN { 0% { background: var(--wp--preset--color--accent, #eba607); transform: scale(1.35); } 100% { transform: scale(1); } }
@media (max-width: 900px) {
	.site-header__cart { width: 44px; height: 44px; padding: 0; justify-content: center; border: 0; background: transparent; }
	.site-header__cart-t { display: none; }
	.site-header__cart-n { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; line-height: 18px; font-size: .68rem; padding: 0 5px; }
}

/* ---- Mini carrito ----
   Escritorio: panel bajo el ícono. Móvil: hoja a todo el ancho que baja desde la
   cabecera, como el menú. */
.hmt-mc-bg { position: fixed; left: 0; right: 0; bottom: 0; top: 64px; z-index: 998; background: rgba(20,24,22,.28); opacity: 0; transition: opacity .2s; }
.hmt-mc-bg.is-on { opacity: 1; }
.hmt-mc-bg[hidden], .hmt-mc[hidden] { display: none; }
.hmt-mc {
	position: fixed; z-index: 999; right: 16px; width: 380px; max-width: calc(100vw - 24px);
	background: #fff; border-radius: 16px; box-shadow: 0 24px 60px rgba(20,24,22,.22), 0 0 0 1px rgba(20,24,22,.06);
	font-family: var(--wp--preset--font-family--body, Inter, system-ui, sans-serif); color: #222826;
	opacity: 0; transform: translateY(-8px); transition: opacity .2s ease, transform .2s ease;
}
.hmt-mc.is-on { opacity: 1; transform: none; }
.hmt-mc__head { display: flex; justify-content: space-between; align-items: flex-start; padding: 16px 18px 10px; }
.hmt-mc__head h2 { margin: 0; font-family: var(--wp--preset--font-family--heading, inherit); font-weight: 400; font-size: 1.3rem; line-height: 1.2; }
.hmt-mc__count { font-size: .78rem; color: #6b736f; }
.hmt-mc__x { border: 0; background: #f7f4ee; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; color: inherit; }
.hmt-mc__body { padding: 0 18px 18px; max-height: min(70vh, 560px); overflow: auto; }
.hmt-mc__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.hmt-mc__list li { display: grid; grid-template-columns: 56px 1fr auto 32px; gap: 10px; align-items: center; padding-bottom: 10px; border-bottom: 1px solid #efece5; }
.hmt-mc__rm {
	width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; display: grid; place-items: center;
	background: transparent; color: #8a918d; cursor: pointer; transition: background .15s, color .15s;
}
.hmt-mc__rm:hover, .hmt-mc__rm:focus-visible { background: #fbeceb; color: #b3261e; }
.hmt-mc__clear {
	display: block; margin: 10px auto 0; padding: .4rem .8rem; border: 0; background: none; cursor: pointer;
	color: #6b736f; font: inherit; font-size: .85rem; font-weight: 600; text-decoration: underline; text-underline-offset: 3px;
}
.hmt-mc__clear:hover, .hmt-mc__clear:focus-visible { color: #b3261e; }
.hmt-mc__list img, .hmt-mc__ph { width: 56px; height: 44px; object-fit: cover; border-radius: 8px; background: #f7f4ee; display: block; }
.hmt-mc__list b { display: block; font-size: .92rem; }
.hmt-mc__list small { color: #6b736f; font-size: .78rem; }
.hmt-mc__p { font-weight: 700; font-size: .88rem; white-space: nowrap; }
.hmt-mc__total { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 0; }
.hmt-mc__total span { font-size: .85rem; color: #6b736f; }
.hmt-mc__total strong { font-family: var(--wp--preset--font-family--heading, inherit); font-weight: 400; font-size: 1.45rem; }
.hmt-mc__acts { display: grid; gap: 8px; }
.hmt-mc__btn { display: flex; justify-content: center; align-items: center; min-height: 46px; border-radius: 999px; border: 1.5px solid #e3e0d8; color: #222826; text-decoration: none; font-weight: 600; font-size: .95rem; }
.hmt-mc__btn:hover { border-color: #222826; color: #222826; }
.hmt-mc__btn--primary { background: var(--wp--preset--color--primary, #30877c); border-color: transparent; color: #fff; }
.hmt-mc__btn--primary:hover { background: #266b62; color: #fff; border-color: transparent; }
.hmt-mc__empty p { margin: 0 0 6px; font-size: .92rem; color: #6b736f; }
.hmt-mc__empty b { color: #222826; }
@media (max-width: 900px) {
	.hmt-mc { left: 0; right: 0 !important; width: auto; max-width: none; border-radius: 0 0 18px 18px; transform: translateY(-14px); }
	.hmt-mc__body { max-height: calc(100vh - 180px); }
}

/* ---- Animación de agregado: miniatura que vuela al ícono ---- */
.hmt-fly { position: fixed; z-index: 100001; width: 64px; height: 64px; border-radius: 50%; pointer-events: none; background: var(--wp--preset--color--primary, #30877c) center / cover no-repeat; box-shadow: 0 10px 26px rgba(0,0,0,.28), 0 0 0 3px #fff; will-change: transform, opacity; }

/* ---- Aviso breve ---- */
.hmt-toast2 { position: fixed; left: 50%; bottom: 22px; z-index: 100000; display: flex; align-items: center; gap: 14px; max-width: calc(100vw - 24px); padding: 10px 10px 10px 18px; border-radius: 999px; background: #1f2a28; color: #fff; font-family: var(--wp--preset--font-family--body, Inter, system-ui, sans-serif); font-size: .9rem; box-shadow: 0 14px 34px rgba(0,0,0,.28); transform: translate(-50%, 20px); opacity: 0; pointer-events: none; transition: opacity .2s, transform .25s cubic-bezier(.2,.8,.2,1); }
.hmt-toast2.is-on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.hmt-toast2 span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hmt-toast2 a, .hmt-toast2 button { flex: 0 0 auto; border: 0; border-radius: 999px; padding: .45rem .9rem; background: var(--wp--preset--color--accent, #eba607); color: #1f2a28; font-weight: 700; font-size: .85rem; text-decoration: none; cursor: pointer; }
@media (max-width: 480px) { .hmt-toast2 { bottom: 84px; width: calc(100vw - 24px); justify-content: space-between; } }

/* Nota del formulario: qué resumen se adjunta. */
.hmt-journey-note { margin: .25rem 0 1rem; font-size: .82rem; color: var(--wp--preset--color--muted, #6b736f); }
.hmt-journey-note summary { cursor: pointer; }
.hmt-journey-note ul { margin: .4rem 0 0; padding-left: 1.1rem; }

@media (prefers-reduced-motion: reduce) {
	.site-header__cart.is-bump, .site-header__cart.is-bump .site-header__cart-n { animation: none; }
	.hmt-mc, .hmt-mc-bg, .hmt-toast2 { transition: none; }
}

/* Con el mini carrito abierto no debe asomar nada flotante encima (idioma, WhatsApp). */
body.hmt-mc-open .homiture-whatsapp-float,
body.hmt-mc-open #trp-floater-ls,
body.hmt-mc-open .trp-floater-ls-names { display: none !important; }
