/**
 * Formulario de servicios en la pagina del producto.
 *
 * Tarjetas compactas en fila, al estilo de Electronic Express: el check vive
 * en la esquina y la casilla real queda oculta pero accesible.
 *
 * Para cambiar el color de acento, edita --a4l-accent aqui abajo. Es el unico
 * lugar donde hace falta tocarlo.
 */

.a4l-services {
	--a4l-accent: #d62828;
	--a4l-accent-soft: #fdf3f3;
	--a4l-border: #d8d8d8;
	--a4l-muted: #6b6b6b;

	margin: 0 0 24px;
}

.a4l-hidden {
	display: none !important;
}

/* Cada seccion es una rejilla: el titulo ocupa todo el ancho y las opciones
   se acomodan solas en 1, 2 o 3 columnas segun el espacio. */
.a4l-block {
	display: grid;
	grid-template-columns: repeat( auto-fit, minmax( 210px, 1fr ) );
	gap: 10px;
	margin-bottom: 18px;
}

.a4l-title,
.a4l-note {
	grid-column: 1 / -1;
}

.a4l-title {
	margin: 0;
	font-size: 14px;
	font-weight: 700;
	letter-spacing: 0.02em;
	text-transform: none;
}

/* ---------------- Tarjeta de opcion ---------------- */

.a4l-option {
	position: relative;
	display: block;
	padding: 12px 30px 12px 14px;
	margin: 0;
	border: 2px solid var(--a4l-border);
	border-radius: 6px;
	cursor: pointer;
	overflow: hidden;
	transition: border-color 0.15s ease, background-color 0.15s ease;
}

.a4l-option:hover {
	border-color: #a8a8a8;
}

/* La casilla real se oculta a la vista pero sigue existiendo para el teclado
   y para los lectores de pantalla. */
.a4l-option input {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
	pointer-events: none;
}

.a4l-option:has( input:checked ) {
	border-color: var(--a4l-accent);
	background: var(--a4l-accent-soft);
}

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

.a4l-option:has( input:disabled ) {
	cursor: default;
}

/* Opcion que no se puede elegir, por ejemplo entrega fuera del radio. */
.a4l-option--blocked {
	opacity: 0.55;
	background: #f4f4f4;
	cursor: not-allowed;
}

.a4l-option--blocked:hover {
	border-color: var(--a4l-border);
}

/* Check en la esquina superior derecha. */
.a4l-option:has( input:checked )::after {
	content: "";
	position: absolute;
	top: 0;
	right: 0;
	border-width: 0 30px 30px 0;
	border-style: solid;
	border-color: transparent var(--a4l-accent) transparent transparent;
}

.a4l-option:has( input:checked )::before {
	content: "\2713";
	position: absolute;
	top: 1px;
	right: 4px;
	z-index: 1;
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	line-height: 1.2;
}

/* ---------------- Contenido de la tarjeta ---------------- */

.a4l-option-text {
	display: block;
	font-size: 13px;
	line-height: 1.45;
	color: var(--a4l-muted);
}

.a4l-option-text strong {
	display: block;
	margin-bottom: 2px;
	font-size: 14px;
	font-weight: 700;
	color: inherit;
}

.a4l-option-text em {
	display: block;
	font-style: normal;
	font-size: 12px;
	color: var(--a4l-muted);
}

/* "Starting at $75.00" en la opcion de entrega. */
.a4l-starting {
	display: block;
	margin-bottom: 2px;
	font-size: 13px;
	font-weight: 700;
	color: inherit;
}

.a4l-price {
	font-weight: 700;
	white-space: nowrap;
	color: inherit;
}

/* Desglose "Instalacion GRATIS + kit requerido".
   Va con span y no con ul/li: wpautop parte los elementos de bloque y sacaria
   la lista fuera de la tarjeta. */
.a4l-included {
	display: block;
	margin-top: 8px;
	padding-top: 8px;
	border-top: 1px solid rgba( 0, 0, 0, 0.08 );
	font-size: 12px;
}

.a4l-included-row {
	display: flex;
	justify-content: space-between;
	gap: 10px;
	padding: 2px 0;
}

.a4l-included-name::before {
	content: "\2713";
	margin-right: 5px;
	color: #1a7f37;
	font-weight: 700;
}

.a4l-free {
	color: #1a7f37;
	font-weight: 700;
}

/* ---------------- Desplegable ---------------- */

/* El desplegable no es una tarjeta: ocupa el ancho completo de la seccion.
   Se fuerza una sola columna porque auto-fit colapsa las pistas vacias y
   dejaria el select del ancho de una tarjeta. */
.a4l-block--stack {
	grid-template-columns: 1fr;
}

.a4l-select {
	grid-column: 1 / -1;
	width: 100%;
	max-width: 100%;
	padding: 11px 12px;
	border: 2px solid var(--a4l-border);
	border-radius: 6px;
	background-color: #fff;
	font-size: 14px;
	line-height: 1.3;
	color: inherit;
	cursor: pointer;
}

.a4l-select:hover {
	border-color: #a8a8a8;
}

.a4l-select:focus-visible {
	outline: 2px solid var(--a4l-accent);
	outline-offset: 2px;
}

/* ---------------- Enlace de cambiar servicios (carrito) ---------------- */

/* En bloque y con clear a proposito: si fuera en linea, en el movil se cuela
   en la misma fila que el SKU y parece parte de el. */
.a4l-edit-link {
	display: block;
	float: none;
	clear: both;
	width: -moz-fit-content;
	width: fit-content;
	max-width: 100%;
	margin: 10px 0 6px;
	padding: 7px 13px;
	border: 1px solid #d62828;
	border-radius: 4px;
	background: none;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.3;
	text-align: center;
	text-decoration: none;
	color: #d62828;
	cursor: pointer;
}

.a4l-edit-link:hover,
.a4l-edit-link:focus {
	background: #d62828;
	color: #fff;
}

/* ---------------- Ventana de edicion del carrito ---------------- */

.a4l-modal {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.a4l-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba( 0, 0, 0, 0.55 );
}

.a4l-modal__dialog {
	position: relative;
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: 470px;
	max-height: 88vh;
	border-radius: 8px;
	background: #fff;
	box-shadow: 0 18px 50px rgba( 0, 0, 0, 0.3 );
	overflow: hidden;
}

.a4l-modal__head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
	padding: 15px 18px;
	border-bottom: 1px solid #e6e6e6;
}

.a4l-modal__head strong {
	display: block;
	font-size: 15px;
	line-height: 1.3;
}

.a4l-modal__head span {
	display: block;
	margin-top: 2px;
	font-size: 12px;
	color: #6b6b6b;
}

.a4l-modal__close {
	flex: 0 0 auto;
	padding: 0 4px;
	border: 0;
	background: none;
	font-size: 26px;
	line-height: 1;
	color: #777;
	cursor: pointer;
}

.a4l-modal__close:hover {
	color: #111;
}

.a4l-modal__body {
	flex: 1 1 auto;
	padding: 18px;
	overflow-y: auto;
}

/* En la ventana el espacio es mas estrecho: una sola columna se lee mejor. */
.a4l-modal__body .a4l-block {
	grid-template-columns: 1fr;
	margin-bottom: 16px;
}

.a4l-modal__body .a4l-services {
	margin-bottom: 0;
}

.a4l-modal__foot {
	flex: 0 0 auto;
	padding: 14px 18px;
	border-top: 1px solid #e6e6e6;
	background: #fafafa;
}

.a4l-modal__hint {
	margin: 0 0 10px;
	font-size: 12px;
	line-height: 1.4;
	color: #6b6b6b;
}

.a4l-modal__apply {
	width: 100%;
}

/* Mientras la ventana esta abierta, la pagina de atras no se desplaza. */
body.a4l-modal-open {
	overflow: hidden;
}

/* ---------------- Estimacion de entrega ---------------- */

.a4l-estimate-note {
	margin: 0;
	padding: 8px 0 0;
	font-size: 12px;
	line-height: 1.45;
	color: #6b6b6b;
}

/* ---------------- Avisos ---------------- */

.a4l-note {
	margin: 0;
	padding: 11px 13px;
	border-left: 3px solid var(--a4l-accent);
	background: var(--a4l-accent-soft);
	font-size: 13px;
	line-height: 1.5;
	color: #444;
}

@media ( max-width: 520px ) {
	.a4l-block {
		grid-template-columns: 1fr;
	}
}
