/* Haussen · Retiro en tienda — checkout. Usa los tokens de Woodmart (color primario, fuentes, radios). */

.hrt-entrega {
	--hrt-accent: var(--wd-primary-color, #c62437);
	--hrt-ink: var(--wd-title-color, #242424);
	--hrt-muted: #6f6f6f;
	--hrt-line: rgba(0, 0, 0, 0.1);
	--hrt-radius: var(--wd-brd-radius, 8px);
	--hrt-ok: #276b39;
	margin: 0 0 34px;
	padding: 0;
	border: 0;
	min-width: 0;
}

.hrt-entrega__title {
	display: block;
	width: 100%;
	margin: 0 0 18px;
	padding: 0;
	font-family: var(--wd-title-font, "DM Sans", Arial, Helvetica, sans-serif);
	font-size: 22px;
	font-weight: 700;
	line-height: 1.3;
	text-transform: uppercase;
	color: var(--hrt-ink);
}

.hrt-entrega__options {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 10px;
}

.hrt-option {
	position: relative;
	display: flex;
	align-items: center;
	gap: 14px;
	margin: 0;
	padding: 14px 52px 14px 14px;
	border: 2px solid var(--hrt-line);
	border-radius: var(--hrt-radius);
	background: #fff;
	cursor: pointer;
	transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
	-webkit-tap-highlight-color: transparent;
}

.hrt-option:hover {
	border-color: rgba(0, 0, 0, 0.22);
}

/* El radio real sigue en el DOM (teclado y lectores de pantalla); se dibuja uno propio. */
.hrt-option__input {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	margin: 0 !important;
	opacity: 0;
	pointer-events: none;
}

.hrt-option__icon {
	flex: 0 0 44px;
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: #f3f3f3;
	color: var(--hrt-ink);
	transition: background-color 0.15s ease, color 0.15s ease;
}

.hrt-option__text {
	min-width: 0;
}

.hrt-option__name {
	display: block;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.3;
	color: var(--hrt-ink);
}

.hrt-option__desc {
	display: block;
	margin-top: 3px;
	font-size: 13px;
	line-height: 1.35;
	color: var(--hrt-muted);
}

.hrt-option__check {
	position: absolute;
	top: 50%;
	right: 18px;
	width: 20px;
	height: 20px;
	margin-top: -10px;
	border: 2px solid #8a8a8a; /* 3,4:1 sobre blanco (WCAG 1.4.11) */
	border-radius: 50%;
	background: #fff;
	transition: border-color 0.15s ease, background-color 0.15s ease;
}

.hrt-option.is-selected,
.hrt-option:has(.hrt-option__input:checked) {
	border-color: var(--hrt-accent);
	background: #fffafa;
	box-shadow: 0 6px 18px rgba(198, 36, 55, 0.08);
}

.hrt-option.is-selected .hrt-option__icon,
.hrt-option:has(.hrt-option__input:checked) .hrt-option__icon {
	background: var(--hrt-accent);
	color: #fff;
}

.hrt-option.is-selected .hrt-option__check,
.hrt-option:has(.hrt-option__input:checked) .hrt-option__check {
	border-color: var(--hrt-accent);
	background: var(--hrt-accent);
	box-shadow: inset 0 0 0 4px #fff;
}

.hrt-option:has(.hrt-option__input:focus-visible) {
	outline: 2px solid var(--hrt-accent);
	outline-offset: 2px;
}

/* Foco visible también en navegadores sin :has(). */
.hrt-option__input:focus-visible ~ .hrt-option__check {
	outline: 2px solid var(--hrt-accent);
	outline-offset: 2px;
}

/* Fuera del mínimo de envío gratis el bloque va oculto (atributo hidden). */
/* Como fila del formulario (antes de la dirección): ancho completo y mismo aire que el resto de las filas. */
.hrt-entrega-fila[hidden] {
	display: none !important;
}

.hrt-entrega-fila .hrt-entrega {
	margin: 10px 0 24px;
}

.hrt-entrega[hidden] {
	display: none !important;
}

/* Panel de retiro */
.hrt-pickup {
	margin-top: 10px;
	padding: 16px 18px;
	border-radius: var(--hrt-radius);
	background: #f7f7f7;
	animation: hrt-in 0.2s ease;
}

.hrt-pickup[hidden] {
	display: none;
}

@keyframes hrt-in {
	from { opacity: 0; transform: translateY(-4px); }
	to { opacity: 1; transform: none; }
}

.hrt-pickup p {
	margin: 0;
}

/* Aviso «te avisaremos por WhatsApp»: mismo estilo de ícono que el resto (fondo blanco, trazo oscuro). */
.hrt-notice {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	margin: 0 !important;
	color: #444;
	line-height: 1.45;
}

.hrt-notice__icon {
	flex: 0 0 32px;
	display: grid;
	place-items: center;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: #fff;
	color: var(--hrt-ink);
	box-shadow: 0 0 0 1px var(--hrt-line);
}

.hrt-notice__icon svg {
	width: 18px;
	height: 18px;
}

.hrt-notice > span:last-child {
	padding-top: 5px;
}

.hrt-notice strong {
	color: var(--hrt-ink);
	font-weight: 600;
}

/* Modo retiro: se ocultan la dirección y «enviar a otra dirección». Con factura, la dirección de facturación
   se mantiene (Bsale la exige) y se rotula como tal. La clase del body cubre el primer pintado. */
form.checkout.hrt-retiro:not(.hrt-factura) #billing_country_field,
form.checkout.hrt-retiro:not(.hrt-factura) #billing_address_1_field,
form.checkout.hrt-retiro:not(.hrt-factura) #billing_address_2_field,
form.checkout.hrt-retiro:not(.hrt-factura) #billing_city_field,
form.checkout.hrt-retiro:not(.hrt-factura) #billing_state_field,
form.checkout.hrt-retiro:not(.hrt-factura) #billing_postcode_field,
body.hrt-modo-retiro form.checkout:not(.hrt-ready) #billing_country_field,
body.hrt-modo-retiro form.checkout:not(.hrt-ready) #billing_address_1_field,
body.hrt-modo-retiro form.checkout:not(.hrt-ready) #billing_address_2_field,
body.hrt-modo-retiro form.checkout:not(.hrt-ready) #billing_city_field,
body.hrt-modo-retiro form.checkout:not(.hrt-ready) #billing_state_field,
body.hrt-modo-retiro form.checkout:not(.hrt-ready) #billing_postcode_field,
form.checkout.hrt-retiro .woocommerce-shipping-fields,
body.hrt-modo-retiro form.checkout:not(.hrt-ready) .woocommerce-shipping-fields {
	display: none !important;
}

/* Con retiro (gratis) no aplican la barra de Woodmart «te falta $X para envío gratis» ni el «Enviar a <dirección de la
   tienda>» del resumen. */
body.hrt-modo-retiro .wd-shipping-progress-bar,
body.hrt-modo-retiro .woocommerce-shipping-destination {
	display: none !important;
}

/* Pago exprés (Apple Pay / Google Pay de Klap Elements) arma el pedido con la dirección de la billetera y no pasa
   por este selector: con retiro en tienda se oculta. */
body.hrt-modo-retiro #haussen-klap-express {
	display: none !important;
}

form.checkout.hrt-retiro.hrt-factura #billing_address_1_field::before {
	content: "Dirección de la empresa";
	display: block;
	margin: 6px 0 12px;
	font-family: var(--wd-title-font, "DM Sans", Arial, Helvetica, sans-serif);
	font-size: 16px;
	font-weight: 700;
	color: var(--wd-title-color, #242424);
}

/* Línea de envío en el resumen del pedido */
.hrt-rate-where {
	display: block;
	margin-top: 2px;
	font-size: 12px;
	font-weight: 400;
	opacity: 0.75;
}

@media (max-width: 575px) {
	.hrt-entrega__title {
		font-size: 18px;
	}

	.hrt-option {
		padding: 12px 46px 12px 12px;
		gap: 12px;
	}

	.hrt-option__icon {
		flex-basis: 40px;
		width: 40px;
		height: 40px;
	}

	.hrt-option__check {
		right: 14px;
	}

	.hrt-pickup {
		padding: 16px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.hrt-pickup,
	.hrt-option,
	.hrt-option__icon,
	.hrt-option__check {
		animation: none;
		transition: none;
	}
}
