/* Barra de carrito fija (hrb-core / cart-bar).
   Usa los tokens del child theme (--hrb-*) con valores de respaldo: si el tema
   cambia, la barra sigue funcionando y legible. Colores, radio y tipografía del
   botón "Comprar" vienen de Personalizar > Global > Botones (clase .ast-button). */

.hrb-cartbar[hidden] {
	display: none;
}

.hrb-cartbar {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 99;
	padding: .75rem 16px calc(.75rem + env(safe-area-inset-bottom)); /* respeta la barra de gestos del iPhone */
	background: var(--hrb-bg, #fff);
	box-shadow: 0 -10px 28px -14px rgba(51, 49, 43, .28); /* separación por sombra, sin borde superior */
}

.hrb-cartbar.is-new {
	animation: hrb-cartbar-in .45s var(--hrb-ease, cubic-bezier(.22, 1, .36, 1)) both;
}

@keyframes hrb-cartbar-in {
	from { transform: translateY(100%); }
	to   { transform: none; }
}

.hrb-cartbar__inner {
	display: flex;
	align-items: center;
	gap: 1rem;
	max-width: 1200px;
	margin: 0 auto;
}

/* Miniaturas superpuestas. */
.hrb-cartbar__items {
	display: flex;
	flex-shrink: 0;
}

.hrb-cartbar__thumb {
	width: 44px;
	height: 44px;
	overflow: hidden;
	border: 2px solid var(--hrb-bg, #fff);
	border-radius: var(--hrb-radius-sharp, 2px);
	background: var(--hrb-bg-warm, #FAF8F4);
}

.hrb-cartbar__thumb + .hrb-cartbar__thumb {
	margin-left: -14px;
}

.hrb-cartbar__thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.hrb-cartbar__summary {
	display: flex;
	flex-direction: column;
	min-width: 0;
	line-height: 1.3;
}

.hrb-cartbar__count {
	font-size: .7rem;
	font-weight: 700;
	letter-spacing: .18em;
	text-transform: uppercase;
	color: var(--hrb-gold-text, #8a6619);
}

.hrb-cartbar__total {
	font-weight: 700;
	color: var(--hrb-dark, #33312B);
}

/* "+N": productos que no entran en las 3 miniaturas. */
.hrb-cartbar__more {
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: .75rem;
	font-weight: 700;
	color: var(--hrb-gold-text, #8a6619);
	background: #F5F0E4;
}

.hrb-cartbar__cta {
	margin-left: auto;
	white-space: nowrap;
}

/* Con la barra visible: que no tape el final de la página ni el botón "ir arriba",
   y sin el "Ver carrito" que WooCommerce agrega junto al botón (ya está en la barra). */
body:has(.hrb-cartbar:not([hidden])) {
	padding-bottom: 84px;
}

body:has(.hrb-cartbar:not([hidden])) #ast-scroll-top {
	bottom: 96px;
}

body:has(.hrb-cartbar:not([hidden])) ul.products a.added_to_cart {
	display: none;
}

@media (max-width: 600px) {
	.hrb-cartbar__inner {
		gap: .75rem;
	}

	.hrb-cartbar__thumb {
		width: 40px;
		height: 40px;
	}

}

@media (prefers-reduced-motion: reduce) {
	.hrb-cartbar.is-new {
		animation: none;
	}
}
