.rt-ad {
	box-sizing: border-box;
	clear: both;
	max-width: 100%;
	text-align: center;
}

/*
 * Mantener la publicidad integrada con el contenido, sin crear bloques
 * excesivamente altos mientras AdSense decide si sirve un anuncio.
 */
.rt-ad--top,
.rt-ad--bottom,
.rt-ad--horizontal,
.rt-ad--in-content {
	width: min(100%, 760px);
	margin: 14px auto;
}

.rt-ad--top {
	margin-top: 12px;
	margin-bottom: 18px;
}

.rt-ad--bottom {
	margin-top: 18px;
	margin-bottom: 18px;
}

.rt-ad--in-content {
	width: min(100%, 680px);
	margin-top: 14px;
	margin-bottom: 14px;
}

.rt-ad--in-feed,
.rt-ad-grid-item {
	width: 100%;
}

.rt-ad-grid-item {
	grid-column: 1 / -1;
	margin: 2px 0 12px;
	list-style: none;
}

.rt-ad--square {
	width: min(100%, 300px);
	margin: 14px auto;
}

.rt-ad--vertical {
	width: min(100%, 160px);
	margin: 14px auto;
}

/* Reserva moderada: suficiente para evitar un salto brusco, pero sin dejar
 * un gran hueco blanco si AdSense tarda en responder. */
.rt-ad__slot {
	display: block;
	width: 100%;
	max-width: 100%;
	min-height: 72px;
}

.rt-ad--top .rt-ad__slot,
.rt-ad--bottom .rt-ad__slot,
.rt-ad--horizontal .rt-ad__slot {
	min-height: 90px;
}

.rt-ad--in-content .rt-ad__slot {
	min-height: 70px;
}

.rt-ad--square .rt-ad__slot {
	min-height: 250px;
}

.rt-ad--vertical .rt-ad__slot {
	min-height: 400px;
}

/* Si Google marca una unidad como no servida, el bloque desaparece por
 * completo: sin altura, márgenes ni columnas visuales vacías. */
.rt-ad.rt-ad--unfilled {
	display: none !important;
	height: 0 !important;
	min-height: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	overflow: hidden !important;
}

.rt-ad.rt-ad--unfilled .rt-ad__slot {
	display: none !important;
	height: 0 !important;
	min-height: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
}

.rt-ad--placeholder {
	border: 1px dashed #8dc891;
	color: #2f7137;
	font-size: 12px;
	line-height: 1.4;
	padding: 10px;
	background: rgba(92, 203, 103, 0.07);
}

#main {
	position: relative;
}

.rt-ad-rails {
	display: none;
}

.rt-ad--sidebar-slot {
	margin-top: 0;
	margin-bottom: 18px;
}

.doc-sec-content .rt-ad {
	margin-top: 14px;
	margin-bottom: 14px;
}

/* Ajuste específico del producto: los dos anuncios dentro/debajo de la
 * descripción se comportan como banners horizontales compactos. */
.rt-ad--product_content,
.rt-ad--product_before_related {
	width: min(100%, 680px);
	margin-top: 14px;
	margin-bottom: 14px;
}

.rt-ad--product_content .rt-ad__slot,
.rt-ad--product_before_related .rt-ad__slot {
	min-height: 70px;
}

@media (min-width: 1500px) {
	.rt-ad-rails {
		display: block;
		pointer-events: none;
	}

	.rt-ad-rail {
		position: absolute;
		top: 18px;
		width: 120px;
		pointer-events: auto;
	}

	.rt-ad-rail--left {
		left: max(14px, calc((100vw - 1280px) / 2 - 150px));
	}

	.rt-ad-rail--right {
		right: max(14px, calc((100vw - 1280px) / 2 - 150px));
	}

	.rt-ad-rail .rt-ad {
		width: 120px;
		margin: 0 auto 18px;
	}

	.rt-ad-rail .rt-ad__slot {
		min-height: 400px;
	}
}

@media (max-width: 1024px) {
	.rt-ad--vertical,
	.rt-ad-rails,
	.rt-ad--sidebar-slot.rt-ad--vertical {
		display: none;
	}

	.rt-ad--top,
	.rt-ad--bottom,
	.rt-ad--horizontal,
	.rt-ad--in-content,
	.rt-ad--square,
	.rt-ad--product_content,
	.rt-ad--product_before_related {
		width: 100%;
		margin: 12px auto;
	}

	.rt-ad__slot,
	.rt-ad--top .rt-ad__slot,
	.rt-ad--bottom .rt-ad__slot,
	.rt-ad--horizontal .rt-ad__slot,
	.rt-ad--in-content .rt-ad__slot,
	.rt-ad--product_content .rt-ad__slot,
	.rt-ad--product_before_related .rt-ad__slot {
		min-height: 70px;
	}
}
