<!-- Contenedor general -->
<div style="width: 100%; overflow: hidden;">
    <iframe 
        id="iframe-vinos-ronchi"
        src="https://vinos-enteros.zohoecommerce.com/collections/paras/5864281000033538040" 
        style="width: 100%; border: none; min-height: 500px; display: block;" 
        scrolling="no">
    </iframe>
</div>

<!-- Script Vigilante + Limpieza Interna -->
<script>
(function() {
    const iframe = document.getElementById('iframe-vinos-ronchi');

    function ajustarAlturaYLimpiar() {
        try {
            const docInterno = iframe.contentWindow.document;
            
            if (docInterno && docInterno.body) {
                
                // 1. INYECCIÓN DE CSS PARA MATAR EL BORDE/FOOTER INTERNO
                if (!docInterno.getElementById('css-limpieza-iframe')) {
                    const estilo = docInterno.createElement('style');
                    estilo.id = 'css-limpieza-iframe';
                    estilo.innerHTML = `
                        /* Oculta el pie de página y encabezado originales */
                        header, footer, .theme-header, .theme-footer, .store-header { display: none !important; }
                        
                        /* Elimina márgenes inferiores que causan espacios en blanco */
                        body, html { margin-bottom: 0 !important; padding-bottom: 0 !important; overflow-x: hidden !important; }
                        
                        /* Oculta forzosamente cualquier riel de scrollbar (la línea gris) */
                        ::-webkit-scrollbar { display: none !important; width: 0 !important; height: 0 !important; }
                    `;
                    docInterno.head.appendChild(estilo);
                }

                // 2. AJUSTE DINÁMICO DE ALTURA
                const altoContenido = docInterno.documentElement.scrollHeight;
                
                if (Math.abs(parseInt(iframe.style.height || 0) - altoContenido) > 10) {
                    iframe.style.height = altoContenido + "px";
                }
            }
        } catch (e) {
            // Esperando permisos de carga...
        }
    }

    // 1. Intentar limpiar y ajustar cuando cargue el cascarón
    iframe.onload = ajustarAlturaYLimpiar;

    // 2. REVISIÓN DINÁMICA: Sigue revisando mientras aparecen los vinos
    let intentos = 0;
    const vigilante = setInterval(() => {
        ajustarAlturaYLimpiar();
        intentos++;
        if (intentos > 20) clearInterval(vigilante); // Se detiene tras 10 segundos
    }, 500);

    // 3. RESPONSIVE: Si cambian el tamaño de la ventana
    window.addEventListener('resize', ajustarAlturaYLimpiar);
})();
</script>