/* T-OPO-014 · Publicidad propia de TécnicosLaboratorio (cursos y servicios). Solo tokens del DS: nada de colores a mano.
   Los tamaños están reservados (altura fija por variante) para que ningún hueco desplace el contenido (CLS 0).
   Ninguna animación ni transición: la publicidad no se mueve ni aparece encima de nada. */
.tl-opo-ad { box-sizing: border-box; display: flex; flex-direction: column; overflow: hidden; background: var(--tl-color-bg-surface); border: var(--tl-border-width-thin) solid var(--tl-color-border-default); border-radius: var(--tl-radius-lg); color: var(--tl-color-text-heading); }
.tl-opo-ad__media { position: relative; flex: none; background: var(--tl-color-bg-soft); }
.tl-opo-ad__imagen { display: block; width: 100%; height: 100%; object-fit: cover; object-position: right center; }
/* T-OPO-019: imagen en diferido (data-src) hasta la primera interacción: la caja ya mide lo mismo y se ve el fondo suave de .tl-opo-ad__media; la imagen vacía se oculta para que Chrome no pinte el icono de imagen rota. Sin JS se oculta y se ve la de <noscript>. */
.tl-opo-ad__imagen[data-src] { visibility: hidden; }
@media (scripting: none) { .tl-opo-ad__imagen[data-src] { display: none; } }
.tl-opo-ad__insignia { position: absolute; top: var(--tl-space-2); left: var(--tl-space-2); padding: var(--tl-space-1) var(--tl-space-2); border-radius: var(--tl-radius-md); background: var(--tl-color-action-accent); color: var(--tl-color-text-heading); font-size: var(--tl-text-overline-size); font-weight: var(--tl-text-overline-weight); }
.tl-opo-ad__insignia--suelta { position: static; align-self: flex-start; margin: var(--tl-space-3) var(--tl-space-4) 0; }
.tl-opo-ad__cuerpo { display: flex; flex-direction: column; align-items: flex-start; gap: var(--tl-space-1); padding: var(--tl-space-3) var(--tl-space-4) var(--tl-space-4); min-width: 0; flex: 1; }
.tl-opo-ad__etiqueta { margin: 0; font-size: var(--tl-text-overline-size); font-weight: var(--tl-text-overline-weight); letter-spacing: var(--tl-text-overline-letter-spacing); text-transform: uppercase; color: var(--tl-color-text-muted); }
.tl-opo-ad__titulo { margin: 0; font-family: var(--tl-text-h3-family); font-size: var(--tl-text-title-sm-size); font-weight: var(--tl-text-h3-weight); color: var(--tl-color-text-heading); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tl-opo-ad__texto { margin: 0; color: var(--tl-color-text-muted); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.tl-opo-ad__precios { margin: 0; }
.tl-opo-ad__precio { font-weight: var(--tl-text-h3-weight); }
.tl-opo-ad__precio-antes { color: var(--tl-color-text-muted); }
.tl-opo-ad__cta { align-self: flex-start; margin-top: auto; flex: none; }
.tl-opo-ad__cuerpo > * { flex: none; max-width: 100%; }

/* Tamaños reservados */
.tl-opo-ad--tarjeta { width: 100%; max-width: 300px; height: 280px; }
.tl-opo-ad--tarjeta .tl-opo-ad__media { height: 80px; }
.tl-opo-ad--tarjeta .tl-opo-ad__titulo { -webkit-line-clamp: 1; }
.tl-opo-ad--tarjeta .tl-opo-ad__texto { -webkit-line-clamp: 2; }
.tl-opo-ad--tarjeta-alta { width: 100%; max-width: 300px; height: 520px; }
.tl-opo-ad--tarjeta-alta .tl-opo-ad__cta { margin-top: var(--tl-space-3); }
.tl-opo-ad--tarjeta-alta .tl-opo-ad__media { height: 300px; }
.tl-opo-ad--banner-horizontal { flex-direction: row; width: 100%; height: 140px; }
.tl-opo-ad--banner-horizontal .tl-opo-ad__titulo, .tl-opo-ad--banner-horizontal .tl-opo-ad__texto { -webkit-line-clamp: 1; }
.tl-opo-ad--banner-horizontal .tl-opo-ad__precios { display: none; }
.tl-opo-ad--banner-horizontal .tl-opo-ad__media { width: 160px; height: 100%; }
.tl-opo-ad--bloque-oferta { flex-direction: row; width: 100%; height: 240px; }
.tl-opo-ad--bloque-oferta .tl-opo-ad__media { width: 40%; height: 100%; }
.tl-opo-ad--linea { flex-direction: row; align-items: center; gap: var(--tl-space-3); width: 100%; height: 52px; padding: 0 var(--tl-space-3); border-radius: 0; border-width: 0 0 var(--tl-border-width-thin); }
.tl-opo-ad--linea .tl-opo-ad__imagen { width: 32px; height: 32px; border-radius: var(--tl-radius-md); }
.tl-opo-ad--linea .tl-opo-ad__col { flex: 1; min-width: 0; display: grid; }
.tl-opo-ad--linea .tl-opo-ad__titulo { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; font-size: var(--tl-text-body-size); }
.tl-opo-ad--linea .tl-opo-ad__etiqueta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.3; font-size: 0.625rem; }
.tl-opo-ad--linea .tl-opo-ad__cta { margin-top: 0; flex: none; white-space: nowrap; min-width: max-content; }
.tl-opo-ad--linea .tl-opo-ad__cerrar { flex: none; }
.tl-opo-ad__cerrar { flex: none; width: 32px; height: 32px; border: 0; background: transparent; color: var(--tl-color-text-muted); font-size: var(--tl-text-title-sm-size); cursor: pointer; }

/* Barra fija inferior: solo móvil. La reserva del alto la hace el contenedor (padding-bottom en el cuerpo). */
.tl-opo-ad-barra { display: none; }
@media (max-width: 767px) {
  .tl-opo-ad-barra { display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; }
  .tl-opo-ad-barra[hidden] { display: none; }
  .tl-opo-ad-barra-reserva { height: 52px; }
  .tl-opo-ad--tarjeta, .tl-opo-ad--tarjeta-alta { max-width: none; }
  .tl-opo-ad--banner-horizontal { flex-direction: column; height: 220px; }
  .tl-opo-ad--banner-horizontal .tl-opo-ad__media { width: 100%; height: 90px; }
  .tl-opo-ad--bloque-oferta { flex-direction: column; height: 360px; }
  .tl-opo-ad--bloque-oferta .tl-opo-ad__media { width: 100%; height: 160px; }
}
/* Rejilla de «antes del pie»: 4-6 productos; 2 por fila en móvil, desplazable. */
.tl-opo-ad-fila { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 300px); gap: var(--tl-space-4); overflow-x: auto; padding-bottom: var(--tl-space-2); }
@media (min-width: 768px) { .tl-opo-ad-fila { grid-auto-flow: row; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-columns: auto; overflow: visible; } }
/* Franja superior (promo global o pieza destacada): reservada, cerrable. */
.tl-opo-ad-franja { min-height: 52px; }
.tl-opo-ad-franja[hidden] { display: none; }

/* Colocación en las plantillas de T-OPO-013 */
.tl-opo-hueco .tl-opo-ad { margin-inline: auto; }
.tl-opo-hueco[data-hueco="rail-2"] { position: sticky; top: var(--tl-space-6); }
.tl-opo-hueco--entre { margin-block: var(--tl-space-4); }
@media (min-width: 1100px) { .tl-opo-hueco--entre { display: none; } }
.tl-opo-hueco-suelto { margin-block: var(--tl-space-5); display: grid; gap: var(--tl-space-4); }
.tl-opo-ad-resumen { grid-template-columns: 1fr; }
@media (min-width: 768px) { .tl-opo-ad-resumen { grid-template-columns: repeat(2, minmax(0, 1fr)); } .tl-opo-ad-resumen > .tl-opo-ad--bloque-oferta { grid-column: 1 / -1; } }
.tl-opo-ad-feed { display: contents; }
.tl-opo-temas .tl-opo-ad--tarjeta { max-width: none; }
.tl-opo-ad-banda { margin-block: var(--tl-space-8); }
.tl-opo-ad-banda > h2 { margin: 0 0 var(--tl-space-4); }
.tl-opo-ad-pausa { max-width: 40rem; margin-inline: auto; }

.tl-opo-rail .tl-opo-ad--tarjeta, .tl-opo-rail .tl-opo-ad--tarjeta-alta { max-width: none; }
