/**
 * Insignias de descuento en tarjetas y listados de presupuesto.
 */

.byo-rq-card-badges {
	position: absolute;
	inset: 0;
	z-index: 4;
	pointer-events: none;
}

.byo-rq-badge {
	position: absolute;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	margin: 0;
	background: #e8412a;
	color: #ffffff !important;
	font-family: 'Barlow', sans-serif;
	font-weight: 700;
	line-height: 1;
	border-radius: 0;
	box-shadow: none;
	text-decoration: none !important;
	white-space: nowrap;
}

.byo-rq-badge--percent {
	top: 12px;
	left: 12px;
	padding: 6px 8px;
	font-size: 13px;
	letter-spacing: 0.02em;
}

.byo-rq-badge--label {
	top: 12px;
	right: 12px;
	padding: 6px 10px;
	font-size: 11px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.byo-rq-badge__icon {
	display: block;
	flex: 0 0 auto;
	width: 14px;
	height: 14px;
}

.byo-rq-badge__text {
	display: inline-block;
}

/* Oculta el badge plano de Blocs ("Destacado"/"Oferta") si hay descuento, para no solapar. */
.byomedic-pg__media:has(.byo-rq-card-badges) .byomedic-pg__badges,
.byomedic-pc__media:has(.byo-rq-card-badges) .byomedic-pc__badges {
	display: none !important;
}

/* El catálogo oculta .byomedic-pg__badges; nuestras insignias deben verse. */
.byo-rq-catalog .byo-rq-card-badges,
.byo-rq-catalog .byo-rq-badge {
	display: flex !important;
}

.byo-rq-catalog .byo-rq-badge--percent,
.byo-rq-catalog .byo-rq-badge--label {
	display: inline-flex !important;
}

/* Loop nativo WooCommerce / Astra (resultados de búsqueda). */
.woocommerce ul.products li.product {
	position: relative;
}

.woocommerce ul.products li.product .byo-rq-card-badges,
.woocommerce-loop-product__link .byo-rq-card-badges,
.astra-shop-thumbnail-wrap .byo-rq-card-badges {
	position: absolute;
	inset: 0;
	z-index: 4;
}

.woocommerce ul.products li.product .astra-shop-thumbnail-wrap {
	position: relative;
}

/* Cesta, mini listado y resumen. */
.byo-rq-item-discount,
.byo-rq-summary-item-discount {
	display: block;
	margin-top: 4px;
	color: #e8412a;
	font-family: 'Barlow', sans-serif;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.02em;
	line-height: 1.3;
}

.byo-rq-table .product-name .byo-rq-item-discount {
	margin-top: 6px;
}

.byo-rq-order-item-discount {
	margin: 6px 0 0;
	color: #e8412a;
}

@media (max-width: 600px) {
	.byo-rq-badge--percent {
		top: 8px;
		left: 8px;
		padding: 5px 7px;
		font-size: 12px;
	}

	.byo-rq-badge--label {
		top: 8px;
		right: 8px;
		padding: 5px 8px;
		font-size: 10px;
	}
}


/* Ficha de producto: insignias sobre la galería BYO. */
.byo-product-gallery__main {
	position: relative;
}

.byo-product-gallery__main .byo-rq-card-badges {
	z-index: 5;
}
