fix(rail-ads): Position rails fixed at viewport edges

- Changed Rail Ads positioning from container-width-based formula to fixed 15px from viewport edges
- Rails no longer move inward when container width is reduced
- Fixes overlap issue when layout width setting changes

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
FrankZamora
2025-11-27 21:38:04 -06:00
parent 6e2ef67dc4
commit 1b9910165b

View File

@@ -322,16 +322,15 @@ final class AdsensePlacementRenderer
'transition' => 'top 0.2s ease-out',
]);
// Posicion rail izquierdo - usar max() para evitar valores negativos
// Usa CSS variable --roi-container-width-numeric de ThemeSettings (fallback 1320px)
// Formula: max(10px, calc((100vw - containerWidth) / 2 - (width + 20)px))
// Posicion rail izquierdo - FIJO en el borde del viewport
// Los Rails NO dependen del container width, siempre estan a 15px del borde
$cssRules[] = $this->cssGenerator->generate('.roi-rail-ad-left', [
'left' => 'max(10px, calc((100vw - var(--roi-container-width-numeric, 1320px)) / 2 - ' . ($width + 20) . 'px))',
'left' => '15px',
]);
// Posicion rail derecho - usar max() para consistencia
// Posicion rail derecho - FIJO en el borde del viewport
$cssRules[] = $this->cssGenerator->generate('.roi-rail-ad-right', [
'right' => 'max(10px, calc((100vw - var(--roi-container-width-numeric, 1320px)) / 2 - ' . ($width + 20) . 'px))',
'right' => '15px',
]);
// Media query para ocultar en pantallas < 1600px