{"id":273,"date":"2025-10-20T22:19:38","date_gmt":"2025-10-20T22:19:38","guid":{"rendered":"https:\/\/diseno.lbw.mx\/?page_id=273"},"modified":"2026-09-05T22:14:46","modified_gmt":"2026-09-06T04:14:46","slug":"requerimiento-de-calor-para-invernadero","status":"publish","type":"page","link":"https:\/\/lbw.mx\/?page_id=273","title":{"rendered":"Ventilaci\u00f3n\/ Calefacci\u00f3n"},"content":{"rendered":"[et_pb_section fb_built=\u00bb1&#8243; admin_label=\u00bbsection\u00bb _builder_version=\u00bb4.16&#8243; global_colors_info=\u00bb{}\u00bb][et_pb_row admin_label=\u00bbrow\u00bb _builder_version=\u00bb4.16&#8243; background_size=\u00bbinitial\u00bb background_position=\u00bbtop_left\u00bb background_repeat=\u00bbrepeat\u00bb global_colors_info=\u00bb{}\u00bb custom_padding=\u00bb29px|||||\u00bb][et_pb_column type=\u00bb4_4&#8243; _builder_version=\u00bb4.16&#8243; custom_padding=\u00bb|||\u00bb global_colors_info=\u00bb{}\u00bb custom_padding__hover=\u00bb|||\u00bb][et_pb_text admin_label=\u00bbText\u00bb _builder_version=\u00bb4.16&#8243; background_size=\u00bbinitial\u00bb background_position=\u00bbtop_left\u00bb background_repeat=\u00bbrepeat\u00bb global_colors_info=\u00bb{}\u00bb]    <div class=\"calc-invernadero-box\" style=\"background: #f8f9fa; border: 1px solid #e2e8f0; border-radius: 8px; padding: 24px; max-width: 640px; margin: 0 auto; font-family: system-ui, -apple-system, sans-serif;\">\n\n        <h3 style=\"margin-top: 0; color: #003366; font-size: 1.4rem; text-align: center;\">Calculadora de Calefacci\u00f3n y Ventilaci\u00f3n<\/h3>\n\n        <div style=\"background: #fff3cd; color: #856404; padding: 12px; border-radius: 6px; margin-bottom: 20px; font-size: 0.9rem; border: 1px solid #ffeeba;\">\n            <strong>Nota:<\/strong> Valida siempre el dimensionamiento final con un especialista de LB White antes de comprar equipo.\n        <\/div>\n\n        <div style=\"margin-bottom: 15px;\">\n            <label style=\"display: block; font-weight: 600; margin-bottom: 4px; color: #4a5568;\">Tipo de C\u00e1lculo:<\/label>\n            <select id=\"lbw_tipo_calculo\" style=\"width: 100%; padding: 10px 12px; border: 1px solid #cbd5e0; border-radius: 4px; background: #fff; font-size: 0.95rem; box-sizing: border-box;\">\n                <option value=\"Ventilaci\u00f3n\">Ventilaci\u00f3n<\/option>\n                <option value=\"Calefacci\u00f3n\">Calefacci\u00f3n<\/option>\n                <option value=\"Calefacci\u00f3n y Ventilaci\u00f3n\" selected>Calefacci\u00f3n y Ventilaci\u00f3n<\/option>\n            <\/select>\n        <\/div>\n\n        <div style=\"display: flex; gap: 12px; margin-bottom: 15px; flex-wrap: wrap;\">\n            <div style=\"flex: 1; min-width: 140px;\">\n                <label style=\"display: block; font-weight: 600; margin-bottom: 4px; color: #4a5568;\">Largo del t\u00fanel (m):<\/label>\n                <input type=\"number\" id=\"lbw_largo\" value=\"70\" style=\"width: 100%; padding: 10px 12px; border: 1px solid #cbd5e0; border-radius: 4px; font-size: 1rem; box-sizing: border-box;\">\n            <\/div>\n            <div style=\"flex: 1; min-width: 140px;\">\n                <label style=\"display: block; font-weight: 600; margin-bottom: 4px; color: #4a5568;\">Ancho del t\u00fanel (m):<\/label>\n                <input type=\"number\" id=\"lbw_ancho\" value=\"4\" style=\"width: 100%; padding: 10px 12px; border: 1px solid #cbd5e0; border-radius: 4px; font-size: 1rem; box-sizing: border-box;\">\n            <\/div>\n        <\/div>\n\n        <div style=\"display: flex; gap: 12px; margin-bottom: 15px; flex-wrap: wrap;\">\n            <div style=\"flex: 1; min-width: 140px;\">\n                <label style=\"display: block; font-weight: 600; margin-bottom: 4px; color: #4a5568;\">Alto a canal (m):<\/label>\n                <input type=\"number\" id=\"lbw_alto_canal\" value=\"6\" style=\"width: 100%; padding: 10px 12px; border: 1px solid #cbd5e0; border-radius: 4px; font-size: 1rem; box-sizing: border-box;\">\n            <\/div>\n            <div style=\"flex: 1; min-width: 140px;\">\n                <label style=\"display: block; font-weight: 600; margin-bottom: 4px; color: #4a5568;\">Cumbrera (m):<\/label>\n                <input type=\"number\" id=\"lbw_cumbrera\" value=\"0\" style=\"width: 100%; padding: 10px 12px; border: 1px solid #cbd5e0; border-radius: 4px; font-size: 1rem; box-sizing: border-box;\">\n            <\/div>\n        <\/div>\n\n        <div style=\"display: flex; gap: 12px; margin-bottom: 15px; flex-wrap: wrap;\">\n            <div style=\"flex: 1; min-width: 140px;\">\n                <label style=\"display: block; font-weight: 600; margin-bottom: 4px; color: #4a5568;\">N\u00famero de t\u00faneles:<\/label>\n                <input type=\"number\" id=\"lbw_num_tuneles\" value=\"100\" style=\"width: 100%; padding: 10px 12px; border: 1px solid #cbd5e0; border-radius: 4px; font-size: 1rem; box-sizing: border-box;\">\n            <\/div>\n            <div id=\"lbw_wrap_delta\" style=\"flex: 1; min-width: 140px;\">\n                <label style=\"display: block; font-weight: 600; margin-bottom: 4px; color: #4a5568;\">Delta t\u00e9rmico requerido (\u00b0C):<\/label>\n                <input type=\"number\" id=\"lbw_delta_termico\" value=\"10\" style=\"width: 100%; padding: 10px 12px; border: 1px solid #cbd5e0; border-radius: 4px; font-size: 1rem; box-sizing: border-box;\">\n            <\/div>\n        <\/div>\n\n        <div id=\"lbw_fs_ventilador\" style=\"margin-bottom: 15px;\">\n            <label style=\"display: block; font-weight: 600; margin-bottom: 4px; color: #4a5568;\">Tipo de Ventilador:<\/label>\n            <select id=\"lbw_tipo_ventilador\" style=\"width: 100%; padding: 10px 12px; border: 1px solid #cbd5e0; border-radius: 4px; background: #fff; font-size: 0.95rem; box-sizing: border-box;\">\n                <option value='Ventilador 20\"'>Ventilador 20&quot;<\/option>\n                <option value='Ventilador 28\"' selected>Ventilador 28&quot;<\/option>\n            <\/select>\n        <\/div>\n\n        <div id=\"lbw_fs_calefaccion\">\n            <div style=\"display: flex; gap: 12px; margin-bottom: 15px; flex-wrap: wrap;\">\n                <div style=\"flex: 1; min-width: 140px;\">\n                    <label style=\"display: block; font-weight: 600; margin-bottom: 4px; color: #4a5568;\">Tipo de Calefacci\u00f3n:<\/label>\n                    <select id=\"lbw_tipo_calefaccion\" style=\"width: 100%; padding: 10px 12px; border: 1px solid #cbd5e0; border-radius: 4px; background: #fff; font-size: 0.95rem; box-sizing: border-box;\">\n                        <option value=\"Calefacci\u00f3n Directa\">Calefacci\u00f3n Directa<\/option>\n                        <option value=\"Calefacci\u00f3n Indirecta\" selected>Calefacci\u00f3n Indirecta<\/option>\n                    <\/select>\n                <\/div>\n                <div style=\"flex: 1; min-width: 140px;\">\n                    <label style=\"display: block; font-weight: 600; margin-bottom: 4px; color: #4a5568;\">Tipo de Pl\u00e1stico:<\/label>\n                    <select id=\"lbw_tipo_plastico\" style=\"width: 100%; padding: 10px 12px; border: 1px solid #cbd5e0; border-radius: 4px; background: #fff; font-size: 0.95rem; box-sizing: border-box;\">\n                        <option value=\"Sencillo\" selected>Sencillo<\/option>\n                        <option value=\"Doble\">Doble<\/option>\n                    <\/select>\n                <\/div>\n            <\/div>\n\n            <div style=\"margin-bottom: 20px;\">\n                <label style=\"display: block; font-weight: 600; margin-bottom: 4px; color: #4a5568;\">Combustible:<\/label>\n                <select id=\"lbw_combustible\" style=\"width: 100%; padding: 10px 12px; border: 1px solid #cbd5e0; border-radius: 4px; background: #fff; font-size: 0.95rem; box-sizing: border-box;\">\n                    <option value=\"Gas LP Y\/O Natural\" selected>Gas LP Y\/O Natural<\/option>\n                    <option value=\"Diesel\">Diesel<\/option>\n                <\/select>\n            <\/div>\n        <\/div>\n\n        <div style=\"text-align: center; margin-bottom: 25px;\">\n            <button id=\"lbw_btn_calcular\" type=\"button\" style=\"background: #2ea3f2; color: #ffffff; border: none; padding: 12px 30px; font-size: 1.1rem; font-weight: bold; border-radius: 5px; cursor: pointer; transition: background 0.3s; width: 100%; max-width: 250px; box-shadow: 0 4px 6px rgba(0,0,0,0.1);\">\n                Calcular\n            <\/button>\n        <\/div>\n\n        <div id=\"lbw_card_calefactores\" style=\"background: #003366; color: #ffffff; padding: 20px; border-radius: 6px; text-align: center; margin-bottom: 12px;\">\n            <div style=\"font-size: 1.1rem; opacity: 0.9;\">\n                Cantidad de Calefactores: <br>\n                <strong id=\"lbw_res_calefactores\" style=\"font-size: 2.2rem; color: #fff; display: block; margin-top: 4px;\">0<\/strong>\n            <\/div>\n            <div id=\"lbw_res_calefactores_modelo\" style=\"font-size: 0.85rem; opacity: 0.85; margin-top: 8px;\">\u2014<\/div>\n        <\/div>\n\n        <div id=\"lbw_card_ventiladores\" style=\"background: #003366; color: #ffffff; padding: 20px; border-radius: 6px; text-align: center;\">\n            <div style=\"font-size: 1.1rem; opacity: 0.9;\">\n                Cantidad de Ventiladores: <br>\n                <strong id=\"lbw_res_ventiladores\" style=\"font-size: 2.2rem; color: #fff; display: block; margin-top: 4px;\">0<\/strong>\n            <\/div>\n            <div id=\"lbw_res_ventiladores_modelo\" style=\"font-size: 0.85rem; opacity: 0.85; margin-top: 8px;\">\u2014<\/div>\n        <\/div>\n\n        <div style=\"text-align: center; margin-top: 15px;\">\n            <a href=\"#\" id=\"lbw_toggle_detalle\" style=\"color: #003366; font-size: 0.85rem; font-weight: 600; text-decoration: underline;\">Ver detalle de c\u00e1lculo \u25be<\/a>\n        <\/div>\n        <div id=\"lbw_detalle\" style=\"display:none; margin-top: 12px; background: #fff; border: 1px solid #e2e8f0; border-radius: 6px; padding: 14px; font-size: 0.85rem; color: #4a5568;\">\n            <table style=\"width:100%; border-collapse: collapse;\" id=\"lbw_detalle_tabla\"><\/table>\n        <\/div>\n\n        <div id=\"lbw_captura\" style=\"display:none; margin-top: 25px; padding-top: 20px; border-top: 1px solid #e2e8f0;\">\n            <h4 style=\"margin: 0 0 4px; color: #003366; font-size: 1.05rem;\">Recibe estos resultados por correo<\/h4>\n            <p style=\"margin: 0 0 15px; color: #718096; font-size: 0.85rem;\">Te enviaremos un resumen de tu c\u00e1lculo y un especialista de LB White podr\u00e1 contactarte para ayudarte a validarlo.<\/p>\n\n            <div style=\"margin-bottom: 12px;\">\n                <label style=\"display: block; font-weight: 600; margin-bottom: 4px; color: #4a5568;\">Nombre completo:<\/label>\n                <input type=\"text\" id=\"lbw_nombre\" placeholder=\"Tu nombre completo\" style=\"width: 100%; padding: 10px 12px; border: 1px solid #cbd5e0; border-radius: 4px; font-size: 1rem; box-sizing: border-box;\">\n            <\/div>\n\n            <div style=\"margin-bottom: 12px;\">\n                <label style=\"display: block; font-weight: 600; margin-bottom: 4px; color: #4a5568;\">Correo electr\u00f3nico:<\/label>\n                <input type=\"email\" id=\"lbw_email\" placeholder=\"tucorreo@ejemplo.com\" style=\"width: 100%; padding: 10px 12px; border: 1px solid #cbd5e0; border-radius: 4px; font-size: 1rem; box-sizing: border-box;\">\n            <\/div>\n\n            <!-- Campo trampa anti-spam: debe quedar siempre vac\u00edo -->\n            <div style=\"position: absolute; left: -9999px;\" aria-hidden=\"true\">\n                <label for=\"lbw_website\">No llenar este campo<\/label>\n                <input type=\"text\" id=\"lbw_website\" name=\"lbw_website\" tabindex=\"-1\" autocomplete=\"off\">\n            <\/div>\n\n            <div style=\"text-align: center; margin-top: 18px;\">\n                <button id=\"lbw_btn_enviar\" type=\"button\" style=\"background: #28a745; color: #ffffff; border: none; padding: 12px 30px; font-size: 1.05rem; font-weight: bold; border-radius: 5px; cursor: pointer; width: 100%; max-width: 280px; box-shadow: 0 4px 6px rgba(0,0,0,0.1);\">\n                    Enviar resultados por correo\n                <\/button>\n            <\/div>\n            <div id=\"lbw_envio_msg\" style=\"margin-top: 12px; font-size: 0.85rem; text-align: center;\"><\/div>\n        <\/div>\n\n    <\/div>\n\n    <script>\n    var lbwCalcAjax = {\n        url: 'https:\/\/lbw.mx\/wp-admin\/admin-ajax.php',\n        nonce: '5d50ba46b9'\n    };\n    document.addEventListener('DOMContentLoaded', function() {\n\n        var ultimoResultado = null;\n\n        \/\/ ---- Constantes de cat\u00e1logo (equipo LB White) ----\n        var RENOVACIONES = 3.2;        \/\/ renovaciones de aire por hora\n        var CAP_VENT_20 = 7300;        \/\/ m3\/hr\n        var CAP_VENT_28 = 14400;       \/\/ m3\/hr\n        var K_SENCILLO = 6.9;          \/\/ coeficiente de transmisi\u00f3n, pl\u00e1stico sencillo\n        var K_DOBLE = 5.8;             \/\/ coeficiente de transmisi\u00f3n, pl\u00e1stico doble\n        var KCAL_POR_BTU = 0.252164;\n        var CAP_240PT = 818400;        \/\/ BTU\/hr - calefacci\u00f3n indirecta\n        var CAP_CP400DUAL = 338000;    \/\/ BTU\/hr - directa, Gas LP y\/o Natural\n        var CAP_K210 = 210000;         \/\/ BTU\/hr - directa, Diesel\n\n        var btn = document.getElementById('lbw_btn_calcular');\n        var selTipoCalculo = document.getElementById('lbw_tipo_calculo');\n        var fsVentilador = document.getElementById('lbw_fs_ventilador');\n        var fsCalefaccion = document.getElementById('lbw_fs_calefaccion');\n        var wrapDelta = document.getElementById('lbw_wrap_delta');\n        var toggleDetalle = document.getElementById('lbw_toggle_detalle');\n        var detalle = document.getElementById('lbw_detalle');\n        var tablaDetalle = document.getElementById('lbw_detalle_tabla');\n        var cardCalefactores = document.getElementById('lbw_card_calefactores');\n        var cardVentiladores = document.getElementById('lbw_card_ventiladores');\n        var captura = document.getElementById('lbw_captura');\n        var btnEnviar = document.getElementById('lbw_btn_enviar');\n        var envioMsg = document.getElementById('lbw_envio_msg');\n\n        function num(id) {\n            var v = parseFloat(document.getElementById(id).value);\n            return isNaN(v) ? 0 : v;\n        }\n\n        function fmt(n, dec) {\n            dec = dec || 0;\n            return Number(n).toLocaleString('es-MX', { minimumFractionDigits: dec, maximumFractionDigits: dec });\n        }\n\n        function actualizarVisibilidad() {\n            var tipoCalculo = selTipoCalculo.value;\n            var esVentilacionSolo = tipoCalculo === 'Ventilaci\u00f3n';\n            var esCalefaccionSolo = tipoCalculo === 'Calefacci\u00f3n';\n\n            fsVentilador.style.display = esCalefaccionSolo ? 'none' : 'block';\n            fsCalefaccion.style.display = esVentilacionSolo ? 'none' : 'block';\n            wrapDelta.style.display = esVentilacionSolo ? 'none' : 'block';\n\n            cardCalefactores.style.opacity = esVentilacionSolo ? '0.45' : '1';\n            cardVentiladores.style.opacity = esCalefaccionSolo ? '0.45' : '1';\n        }\n\n        function calcular() {\n            var tipoCalculo = selTipoCalculo.value;\n            var esVentilacionSolo = tipoCalculo === 'Ventilaci\u00f3n';\n            var esCalefaccionSolo = tipoCalculo === 'Calefacci\u00f3n';\n\n            var largo = num('lbw_largo');\n            var ancho = num('lbw_ancho');\n            var altoCanal = num('lbw_alto_canal');\n            var cumbrera = num('lbw_cumbrera');\n            var numTuneles = num('lbw_num_tuneles');\n            var deltaTermicoIn = num('lbw_delta_termico');\n            var tipoVentilador = document.getElementById('lbw_tipo_ventilador').value;\n            var tipoCalefaccion = document.getElementById('lbw_tipo_calefaccion').value;\n            var tipoPlastico = document.getElementById('lbw_tipo_plastico').value;\n            var combustible = document.getElementById('lbw_combustible').value;\n\n            \/\/ ---------- CALCULO VENTILACION ----------\n            var anchoTunel = esCalefaccionSolo ? 0 : ancho;\n            var largoTunel = esCalefaccionSolo ? 0 : largo;\n            var alturaTunel = esCalefaccionSolo ? 0 : (altoCanal + cumbrera);\n            var areaVent = anchoTunel * largoTunel * alturaTunel;\n            var numTunelesVent = esCalefaccionSolo ? 0 : numTuneles;\n            var volumenInv = areaVent * numTunelesVent;\n\n            var vent20 = (volumenInv * RENOVACIONES) \/ CAP_VENT_20;\n            var vent28 = (volumenInv * RENOVACIONES) \/ CAP_VENT_28;\n            var cantidadVentiladores = tipoVentilador === 'Ventilador 20\"' ? vent20 : vent28;\n\n            \/\/ ---------- CALCULO CALEFACCION ----------\n            var largoH = esVentilacionSolo ? 0 : largo;\n            var anchoTunelH = esVentilacionSolo ? 0 : ancho;\n            var a = anchoTunelH \/ 2;\n            var Hc = esVentilacionSolo ? 0 : altoCanal;\n            var b = esVentilacionSolo ? 0 : (tipoCalefaccion === 'Calefacci\u00f3n Directa' ? cumbrera : 0);\n            var numTunelesH = esVentilacionSolo ? 0 : numTuneles;\n\n            var areaCanal = anchoTunelH * Hc;\n            var paredNorte = areaCanal * numTunelesH;\n            var paredSur = numTunelesH * areaCanal;\n            var lateral1 = largoH * Hc;\n            var lateral2 = largoH * Hc;\n            var totalPared = paredNorte + paredSur + lateral1 + lateral2;\n\n            var o23 = ((a * a) + (b * b)) \/ 2;\n            var perimetro = Math.sqrt(o23) * 3.1416 * 2;\n            var mitadPerimetro = perimetro \/ 2;\n            var areaTechoTunel = mitadPerimetro * largoH;\n            var totalAreaTecho = areaTechoTunel * numTunelesH;\n            var totalAreaInvernadero = totalAreaTecho + totalPared;\n\n            var deltaTermico = esVentilacionSolo ? 0 : deltaTermicoIn;\n            var k = tipoPlastico === 'Sencillo' ? K_SENCILLO : K_DOBLE;\n\n            var qKcal = totalAreaInvernadero * deltaTermico * k;\n            var qBtu = qKcal \/ KCAL_POR_BTU;\n\n            var capacidadCalefactor, modeloCalefactor;\n            if (tipoCalefaccion === 'Calefacci\u00f3n Indirecta') {\n                capacidadCalefactor = CAP_240PT; modeloCalefactor = '240PT';\n            } else if (combustible === 'Gas LP Y\/O Natural') {\n                capacidadCalefactor = CAP_CP400DUAL; modeloCalefactor = 'CP400DUAL';\n            } else {\n                capacidadCalefactor = CAP_K210; modeloCalefactor = 'K210';\n            }\n\n            var numEquiposCalefaccion = capacidadCalefactor > 0 ? qBtu \/ capacidadCalefactor : 0;\n\n            \/\/ ---------- Salidas ----------\n            document.getElementById('lbw_res_calefactores').innerText = fmt(Math.round(numEquiposCalefaccion));\n            document.getElementById('lbw_res_calefactores_modelo').innerText = esVentilacionSolo\n                ? 'No aplica (solo ventilaci\u00f3n)'\n                : 'Modelo de referencia: ' + modeloCalefactor + ' (' + fmt(capacidadCalefactor) + ' BTU\/hr c\/u)';\n\n            document.getElementById('lbw_res_ventiladores').innerText = fmt(Math.round(cantidadVentiladores));\n            document.getElementById('lbw_res_ventiladores_modelo').innerText = esCalefaccionSolo\n                ? 'No aplica (solo calefacci\u00f3n)'\n                : 'Modelo seleccionado: ' + tipoVentilador;\n\n            \/\/ ---------- Detalle ----------\n            var filas = [\n                ['\u00c1rea total invernadero', fmt(totalAreaInvernadero, 2) + ' m\u00b2'],\n                ['Total paredes', fmt(totalPared, 2) + ' m\u00b2'],\n                ['Total techo', fmt(totalAreaTecho, 2) + ' m\u00b2'],\n                ['Delta t\u00e9rmico aplicado', fmt(deltaTermico, 1) + ' \u00b0C'],\n                ['Coeficiente k (' + tipoPlastico + ')', fmt(k, 1)],\n                ['Q = \u00e1rea \u00d7 k \u00d7 \u0394T', fmt(qKcal, 2) + ' kcal\/hr'],\n                ['Q en BTU\/hr', fmt(qBtu, 2) + ' BTU\/hr'],\n                ['Capacidad calefactor (' + modeloCalefactor + ')', fmt(capacidadCalefactor) + ' BTU\/hr'],\n                ['Volumen invernadero (ventilaci\u00f3n)', fmt(volumenInv, 2) + ' m\u00b3'],\n                ['Renovaciones de aire', fmt(RENOVACIONES, 1) + ' \/hr'],\n                ['Capacidad ' + tipoVentilador, fmt(tipoVentilador === 'Ventilador 20\"' ? CAP_VENT_20 : CAP_VENT_28) + ' m\u00b3\/hr']\n            ];\n\n            tablaDetalle.innerHTML = filas.map(function(f) {\n                return '<tr><td style=\"padding:4px 2px;border-bottom:1px dashed #e2e8f0;\">' + f[0] + '<\/td><td style=\"padding:4px 2px;border-bottom:1px dashed #e2e8f0;text-align:right;font-weight:600;\">' + f[1] + '<\/td><\/tr>';\n            }).join('');\n\n            \/\/ ---------- Snapshot para el env\u00edo por correo ----------\n            ultimoResultado = {\n                tipo_calculo: tipoCalculo,\n                largo: largo,\n                ancho: ancho,\n                alto_canal: altoCanal,\n                cumbrera: cumbrera,\n                num_tuneles: numTuneles,\n                delta_termico: deltaTermico,\n                tipo_ventilador: tipoVentilador,\n                tipo_calefaccion: tipoCalefaccion,\n                tipo_plastico: tipoPlastico,\n                combustible: combustible,\n                res_calefactores: document.getElementById('lbw_res_calefactores').innerText,\n                res_calefactores_modelo: document.getElementById('lbw_res_calefactores_modelo').innerText,\n                res_ventiladores: document.getElementById('lbw_res_ventiladores').innerText,\n                res_ventiladores_modelo: document.getElementById('lbw_res_ventiladores_modelo').innerText\n            };\n        }\n\n        if (btn) {\n            btn.addEventListener('click', function(e) {\n                e.preventDefault();\n                calcular();\n                captura.style.display = 'block';\n                captura.scrollIntoView({ behavior: 'smooth', block: 'nearest' });\n            });\n        }\n\n        selTipoCalculo.addEventListener('change', function() {\n            actualizarVisibilidad();\n            if (ultimoResultado) {\n                calcular();\n            }\n        });\n\n        if (btnEnviar) {\n            btnEnviar.addEventListener('click', function(e) {\n                e.preventDefault();\n\n                var nombre = document.getElementById('lbw_nombre').value.trim();\n                var email = document.getElementById('lbw_email').value.trim();\n                var website = document.getElementById('lbw_website').value.trim();\n                var emailRegex = \/^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$\/;\n\n                envioMsg.style.color = '#c0392b';\n\n                if (website !== '') {\n                    \/\/ Campo trampa lleno: probablemente un bot, no hacemos nada visible.\n                    return;\n                }\n                if (!nombre) {\n                    envioMsg.innerText = 'Por favor ingresa tu nombre completo.';\n                    return;\n                }\n                if (!emailRegex.test(email)) {\n                    envioMsg.innerText = 'Por favor ingresa un correo electr\u00f3nico v\u00e1lido.';\n                    return;\n                }\n                if (!ultimoResultado) {\n                    envioMsg.innerText = 'Primero realiza el c\u00e1lculo.';\n                    return;\n                }\n\n                btnEnviar.disabled = true;\n                var textoOriginal = btnEnviar.innerText;\n                btnEnviar.innerText = 'Enviando...';\n                envioMsg.style.color = '#4a5568';\n                envioMsg.innerText = '';\n\n                var datos = new FormData();\n                datos.append('action', 'lbw_enviar_calculo');\n                datos.append('nonce', lbwCalcAjax.nonce);\n                datos.append('nombre', nombre);\n                datos.append('email', email);\n                for (var campo in ultimoResultado) {\n                    if (Object.prototype.hasOwnProperty.call(ultimoResultado, campo)) {\n                        datos.append(campo, ultimoResultado[campo]);\n                    }\n                }\n\n                fetch(lbwCalcAjax.url, {\n                    method: 'POST',\n                    credentials: 'same-origin',\n                    body: datos\n                })\n                .then(function(r) { return r.json(); })\n                .then(function(resp) {\n                    btnEnviar.disabled = false;\n                    btnEnviar.innerText = textoOriginal;\n                    if (resp && resp.success) {\n                        envioMsg.style.color = '#1a7f37';\n                        envioMsg.innerText = '\u00a1Listo! Revisa tu correo, te hemos enviado los resultados.';\n                    } else {\n                        envioMsg.style.color = '#c0392b';\n                        envioMsg.innerText = (resp && resp.data && resp.data.message) ? resp.data.message : 'Ocurri\u00f3 un error al enviar. Intenta de nuevo.';\n                    }\n                })\n                .catch(function() {\n                    btnEnviar.disabled = false;\n                    btnEnviar.innerText = textoOriginal;\n                    envioMsg.style.color = '#c0392b';\n                    envioMsg.innerText = 'Ocurri\u00f3 un error de conexi\u00f3n. Intenta de nuevo.';\n                });\n            });\n        }\n\n        toggleDetalle.addEventListener('click', function(e) {\n            e.preventDefault();\n            var oculto = detalle.style.display === 'none';\n            detalle.style.display = oculto ? 'block' : 'none';\n            toggleDetalle.innerText = oculto ? 'Ocultar detalle de c\u00e1lculo \u25b2' : 'Ver detalle de c\u00e1lculo \u25be';\n        });\n\n        \/\/ Estado y c\u00e1lculo inicial\n        actualizarVisibilidad();\n        calcular();\n    });\n    <\/script>\n    \n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>[\/et_pb_text][\/et_pb_column][\/et_pb_row][\/et_pb_section]<!-- \/wp:post-content -->","protected":false},"excerpt":{"rendered":"    <div class=\"calc-invernadero-box\" style=\"background: #f8f9fa; border: 1px solid #e2e8f0; border-radius: 8px; padding: 24px; max-width: 640px; margin: 0 auto; font-family: system-ui, -apple-system, sans-serif;\">\n\n        <h3 style=\"margin-top: 0; color: #003366; font-size: 1.4rem; text-align: center;\">Calculadora de Calefacci\u00f3n y Ventilaci\u00f3n<\/h3>\n\n        <div style=\"background: #fff3cd; color: #856404; padding: 12px; border-radius: 6px; margin-bottom: 20px; font-size: 0.9rem; border: 1px solid #ffeeba;\">\n            <strong>Nota:<\/strong> Valida siempre el dimensionamiento final con un especialista de LB White antes de comprar equipo.\n        <\/div>\n\n        <div style=\"margin-bottom: 15px;\">\n            <label style=\"display: block; font-weight: 600; margin-bottom: 4px; color: #4a5568;\">Tipo de C\u00e1lculo:<\/label>\n            <select id=\"lbw_tipo_calculo\" style=\"width: 100%; padding: 10px 12px; border: 1px solid #cbd5e0; border-radius: 4px; background: #fff; font-size: 0.95rem; box-sizing: border-box;\">\n                <option value=\"Ventilaci\u00f3n\">Ventilaci\u00f3n<\/option>\n                <option value=\"Calefacci\u00f3n\">Calefacci\u00f3n<\/option>\n                <option value=\"Calefacci\u00f3n y Ventilaci\u00f3n\" selected>Calefacci\u00f3n y Ventilaci\u00f3n<\/option>\n            <\/select>\n        <\/div>\n\n        <div style=\"display: flex; gap: 12px; margin-bottom: 15px; flex-wrap: wrap;\">\n            <div style=\"flex: 1; min-width: 140px;\">\n                <label style=\"display: block; font-weight: 600; margin-bottom: 4px; color: #4a5568;\">Largo del t\u00fanel (m):<\/label>\n                <input type=\"number\" id=\"lbw_largo\" value=\"70\" style=\"width: 100%; padding: 10px 12px; border: 1px solid #cbd5e0; border-radius: 4px; font-size: 1rem; box-sizing: border-box;\">\n            <\/div>\n            <div style=\"flex: 1; min-width: 140px;\">\n                <label style=\"display: block; font-weight: 600; margin-bottom: 4px; color: #4a5568;\">Ancho del t\u00fanel (m):<\/label>\n                <input type=\"number\" id=\"lbw_ancho\" value=\"4\" style=\"width: 100%; padding: 10px 12px; border: 1px solid #cbd5e0; border-radius: 4px; font-size: 1rem; box-sizing: border-box;\">\n            <\/div>\n        <\/div>\n\n        <div style=\"display: flex; gap: 12px; margin-bottom: 15px; flex-wrap: wrap;\">\n            <div style=\"flex: 1; min-width: 140px;\">\n                <label style=\"display: block; font-weight: 600; margin-bottom: 4px; color: #4a5568;\">Alto a canal (m):<\/label>\n                <input type=\"number\" id=\"lbw_alto_canal\" value=\"6\" style=\"width: 100%; padding: 10px 12px; border: 1px solid #cbd5e0; border-radius: 4px; font-size: 1rem; box-sizing: border-box;\">\n            <\/div>\n            <div style=\"flex: 1; min-width: 140px;\">\n                <label style=\"display: block; font-weight: 600; margin-bottom: 4px; color: #4a5568;\">Cumbrera (m):<\/label>\n                <input type=\"number\" id=\"lbw_cumbrera\" value=\"0\" style=\"width: 100%; padding: 10px 12px; border: 1px solid #cbd5e0; border-radius: 4px; font-size: 1rem; box-sizing: border-box;\">\n            <\/div>\n        <\/div>\n\n        <div style=\"display: flex; gap: 12px; margin-bottom: 15px; flex-wrap: wrap;\">\n            <div style=\"flex: 1; min-width: 140px;\">\n                <label style=\"display: block; font-weight: 600; margin-bottom: 4px; color: #4a5568;\">N\u00famero de t\u00faneles:<\/label>\n                <input type=\"number\" id=\"lbw_num_tuneles\" value=\"100\" style=\"width: 100%; padding: 10px 12px; border: 1px solid #cbd5e0; border-radius: 4px; font-size: 1rem; box-sizing: border-box;\">\n            <\/div>\n            <div id=\"lbw_wrap_delta\" style=\"flex: 1; min-width: 140px;\">\n                <label style=\"display: block; font-weight: 600; margin-bottom: 4px; color: #4a5568;\">Delta t\u00e9rmico requerido (\u00b0C):<\/label>\n                <input type=\"number\" id=\"lbw_delta_termico\" value=\"10\" style=\"width: 100%; padding: 10px 12px; border: 1px solid #cbd5e0; border-radius: 4px; font-size: 1rem; box-sizing: border-box;\">\n            <\/div>\n        <\/div>\n\n        <div id=\"lbw_fs_ventilador\" style=\"margin-bottom: 15px;\">\n            <label style=\"display: block; font-weight: 600; margin-bottom: 4px; color: #4a5568;\">Tipo de Ventilador:<\/label>\n            <select id=\"lbw_tipo_ventilador\" style=\"width: 100%; padding: 10px 12px; border: 1px solid #cbd5e0; border-radius: 4px; background: #fff; font-size: 0.95rem; box-sizing: border-box;\">\n                <option value='Ventilador 20\"'>Ventilador 20&quot;<\/option>\n                <option value='Ventilador 28\"' selected>Ventilador 28&quot;<\/option>\n            <\/select>\n        <\/div>\n\n        <div id=\"lbw_fs_calefaccion\">\n            <div style=\"display: flex; gap: 12px; margin-bottom: 15px; flex-wrap: wrap;\">\n                <div style=\"flex: 1; min-width: 140px;\">\n                    <label style=\"display: block; font-weight: 600; margin-bottom: 4px; color: #4a5568;\">Tipo de Calefacci\u00f3n:<\/label>\n                    <select id=\"lbw_tipo_calefaccion\" style=\"width: 100%; padding: 10px 12px; border: 1px solid #cbd5e0; border-radius: 4px; background: #fff; font-size: 0.95rem; box-sizing: border-box;\">\n                        <option value=\"Calefacci\u00f3n Directa\">Calefacci\u00f3n Directa<\/option>\n                        <option value=\"Calefacci\u00f3n Indirecta\" selected>Calefacci\u00f3n Indirecta<\/option>\n                    <\/select>\n                <\/div>\n                <div style=\"flex: 1; min-width: 140px;\">\n                    <label style=\"display: block; font-weight: 600; margin-bottom: 4px; color: #4a5568;\">Tipo de Pl\u00e1stico:<\/label>\n                    <select id=\"lbw_tipo_plastico\" style=\"width: 100%; padding: 10px 12px; border: 1px solid #cbd5e0; border-radius: 4px; background: #fff; font-size: 0.95rem; box-sizing: border-box;\">\n                        <option value=\"Sencillo\" selected>Sencillo<\/option>\n                        <option value=\"Doble\">Doble<\/option>\n                    <\/select>\n                <\/div>\n            <\/div>\n\n            <div style=\"margin-bottom: 20px;\">\n                <label style=\"display: block; font-weight: 600; margin-bottom: 4px; color: #4a5568;\">Combustible:<\/label>\n                <select id=\"lbw_combustible\" style=\"width: 100%; padding: 10px 12px; border: 1px solid #cbd5e0; border-radius: 4px; background: #fff; font-size: 0.95rem; box-sizing: border-box;\">\n                    <option value=\"Gas LP Y\/O Natural\" selected>Gas LP Y\/O Natural<\/option>\n                    <option value=\"Diesel\">Diesel<\/option>\n                <\/select>\n            <\/div>\n        <\/div>\n\n        <div style=\"text-align: center; margin-bottom: 25px;\">\n            <button id=\"lbw_btn_calcular\" type=\"button\" style=\"background: #2ea3f2; color: #ffffff; border: none; padding: 12px 30px; font-size: 1.1rem; font-weight: bold; border-radius: 5px; cursor: pointer; transition: background 0.3s; width: 100%; max-width: 250px; box-shadow: 0 4px 6px rgba(0,0,0,0.1);\">\n                Calcular\n            <\/button>\n        <\/div>\n\n        <div id=\"lbw_card_calefactores\" style=\"background: #003366; color: #ffffff; padding: 20px; border-radius: 6px; text-align: center; margin-bottom: 12px;\">\n            <div style=\"font-size: 1.1rem; opacity: 0.9;\">\n                Cantidad de Calefactores: <br>\n                <strong id=\"lbw_res_calefactores\" style=\"font-size: 2.2rem; color: #fff; display: block; margin-top: 4px;\">0<\/strong>\n            <\/div>\n            <div id=\"lbw_res_calefactores_modelo\" style=\"font-size: 0.85rem; opacity: 0.85; margin-top: 8px;\">\u2014<\/div>\n        <\/div>\n\n        <div id=\"lbw_card_ventiladores\" style=\"background: #003366; color: #ffffff; padding: 20px; border-radius: 6px; text-align: center;\">\n            <div style=\"font-size: 1.1rem; opacity: 0.9;\">\n                Cantidad de Ventiladores: <br>\n                <strong id=\"lbw_res_ventiladores\" style=\"font-size: 2.2rem; color: #fff; display: block; margin-top: 4px;\">0<\/strong>\n            <\/div>\n            <div id=\"lbw_res_ventiladores_modelo\" style=\"font-size: 0.85rem; opacity: 0.85; margin-top: 8px;\">\u2014<\/div>\n        <\/div>\n\n        <div style=\"text-align: center; margin-top: 15px;\">\n            <a href=\"#\" id=\"lbw_toggle_detalle\" style=\"color: #003366; font-size: 0.85rem; font-weight: 600; text-decoration: underline;\">Ver detalle de c\u00e1lculo \u25be<\/a>\n        <\/div>\n        <div id=\"lbw_detalle\" style=\"display:none; margin-top: 12px; background: #fff; border: 1px solid #e2e8f0; border-radius: 6px; padding: 14px; font-size: 0.85rem; color: #4a5568;\">\n            <table style=\"width:100%; border-collapse: collapse;\" id=\"lbw_detalle_tabla\"><\/table>\n        <\/div>\n\n        <div id=\"lbw_captura\" style=\"display:none; margin-top: 25px; padding-top: 20px; border-top: 1px solid #e2e8f0;\">\n            <h4 style=\"margin: 0 0 4px; color: #003366; font-size: 1.05rem;\">Recibe estos resultados por correo<\/h4>\n            <p style=\"margin: 0 0 15px; color: #718096; font-size: 0.85rem;\">Te enviaremos un resumen de tu c\u00e1lculo y un especialista de LB White podr\u00e1 contactarte para ayudarte a validarlo.<\/p>\n\n            <div style=\"margin-bottom: 12px;\">\n                <label style=\"display: block; font-weight: 600; margin-bottom: 4px; color: #4a5568;\">Nombre completo:<\/label>\n                <input type=\"text\" id=\"lbw_nombre\" placeholder=\"Tu nombre completo\" style=\"width: 100%; padding: 10px 12px; border: 1px solid #cbd5e0; border-radius: 4px; font-size: 1rem; box-sizing: border-box;\">\n            <\/div>\n\n            <div style=\"margin-bottom: 12px;\">\n                <label style=\"display: block; font-weight: 600; margin-bottom: 4px; color: #4a5568;\">Correo electr\u00f3nico:<\/label>\n                <input type=\"email\" id=\"lbw_email\" placeholder=\"tucorreo@ejemplo.com\" style=\"width: 100%; padding: 10px 12px; border: 1px solid #cbd5e0; border-radius: 4px; font-size: 1rem; box-sizing: border-box;\">\n            <\/div>\n\n            <!-- Campo trampa anti-spam: debe quedar siempre vac\u00edo -->\n            <div style=\"position: absolute; left: -9999px;\" aria-hidden=\"true\">\n                <label for=\"lbw_website\">No llenar este campo<\/label>\n                <input type=\"text\" id=\"lbw_website\" name=\"lbw_website\" tabindex=\"-1\" autocomplete=\"off\">\n            <\/div>\n\n            <div style=\"text-align: center; margin-top: 18px;\">\n                <button id=\"lbw_btn_enviar\" type=\"button\" style=\"background: #28a745; color: #ffffff; border: none; padding: 12px 30px; font-size: 1.05rem; font-weight: bold; border-radius: 5px; cursor: pointer; width: 100%; max-width: 280px; box-shadow: 0 4px 6px rgba(0,0,0,0.1);\">\n                    Enviar resultados por correo\n                <\/button>\n            <\/div>\n            <div id=\"lbw_envio_msg\" style=\"margin-top: 12px; font-size: 0.85rem; text-align: center;\"><\/div>\n        <\/div>\n\n    <\/div>\n\n    <script>\n    var lbwCalcAjax = {\n        url: 'https:\/\/lbw.mx\/wp-admin\/admin-ajax.php',\n        nonce: '5d50ba46b9'\n    };\n    document.addEventListener('DOMContentLoaded', function() {\n\n        var ultimoResultado = null;\n\n        \/\/ ---- Constantes de cat\u00e1logo (equipo LB White) ----\n        var RENOVACIONES = 3.2;        \/\/ renovaciones de aire por hora\n        var CAP_VENT_20 = 7300;        \/\/ m3\/hr\n        var CAP_VENT_28 = 14400;       \/\/ m3\/hr\n        var K_SENCILLO = 6.9;          \/\/ coeficiente de transmisi\u00f3n, pl\u00e1stico sencillo\n        var K_DOBLE = 5.8;             \/\/ coeficiente de transmisi\u00f3n, pl\u00e1stico doble\n        var KCAL_POR_BTU = 0.252164;\n        var CAP_240PT = 818400;        \/\/ BTU\/hr - calefacci\u00f3n indirecta\n        var CAP_CP400DUAL = 338000;    \/\/ BTU\/hr - directa, Gas LP y\/o Natural\n        var CAP_K210 = 210000;         \/\/ BTU\/hr - directa, Diesel\n\n        var btn = document.getElementById('lbw_btn_calcular');\n        var selTipoCalculo = document.getElementById('lbw_tipo_calculo');\n        var fsVentilador = document.getElementById('lbw_fs_ventilador');\n        var fsCalefaccion = document.getElementById('lbw_fs_calefaccion');\n        var wrapDelta = document.getElementById('lbw_wrap_delta');\n        var toggleDetalle = document.getElementById('lbw_toggle_detalle');\n        var detalle = document.getElementById('lbw_detalle');\n        var tablaDetalle = document.getElementById('lbw_detalle_tabla');\n        var cardCalefactores = document.getElementById('lbw_card_calefactores');\n        var cardVentiladores = document.getElementById('lbw_card_ventiladores');\n        var captura = document.getElementById('lbw_captura');\n        var btnEnviar = document.getElementById('lbw_btn_enviar');\n        var envioMsg = document.getElementById('lbw_envio_msg');\n\n        function num(id) {\n            var v = parseFloat(document.getElementById(id).value);\n            return isNaN(v) ? 0 : v;\n        }\n\n        function fmt(n, dec) {\n            dec = dec || 0;\n            return Number(n).toLocaleString('es-MX', { minimumFractionDigits: dec, maximumFractionDigits: dec });\n        }\n\n        function actualizarVisibilidad() {\n            var tipoCalculo = selTipoCalculo.value;\n            var esVentilacionSolo = tipoCalculo === 'Ventilaci\u00f3n';\n            var esCalefaccionSolo = tipoCalculo === 'Calefacci\u00f3n';\n\n            fsVentilador.style.display = esCalefaccionSolo ? 'none' : 'block';\n            fsCalefaccion.style.display = esVentilacionSolo ? 'none' : 'block';\n            wrapDelta.style.display = esVentilacionSolo ? 'none' : 'block';\n\n            cardCalefactores.style.opacity = esVentilacionSolo ? '0.45' : '1';\n            cardVentiladores.style.opacity = esCalefaccionSolo ? '0.45' : '1';\n        }\n\n        function calcular() {\n            var tipoCalculo = selTipoCalculo.value;\n            var esVentilacionSolo = tipoCalculo === 'Ventilaci\u00f3n';\n            var esCalefaccionSolo = tipoCalculo === 'Calefacci\u00f3n';\n\n            var largo = num('lbw_largo');\n            var ancho = num('lbw_ancho');\n            var altoCanal = num('lbw_alto_canal');\n            var cumbrera = num('lbw_cumbrera');\n            var numTuneles = num('lbw_num_tuneles');\n            var deltaTermicoIn = num('lbw_delta_termico');\n            var tipoVentilador = document.getElementById('lbw_tipo_ventilador').value;\n            var tipoCalefaccion = document.getElementById('lbw_tipo_calefaccion').value;\n            var tipoPlastico = document.getElementById('lbw_tipo_plastico').value;\n            var combustible = document.getElementById('lbw_combustible').value;\n\n            \/\/ ---------- CALCULO VENTILACION ----------\n            var anchoTunel = esCalefaccionSolo ? 0 : ancho;\n            var largoTunel = esCalefaccionSolo ? 0 : largo;\n            var alturaTunel = esCalefaccionSolo ? 0 : (altoCanal + cumbrera);\n            var areaVent = anchoTunel * largoTunel * alturaTunel;\n            var numTunelesVent = esCalefaccionSolo ? 0 : numTuneles;\n            var volumenInv = areaVent * numTunelesVent;\n\n            var vent20 = (volumenInv * RENOVACIONES) \/ CAP_VENT_20;\n            var vent28 = (volumenInv * RENOVACIONES) \/ CAP_VENT_28;\n            var cantidadVentiladores = tipoVentilador === 'Ventilador 20\"' ? vent20 : vent28;\n\n            \/\/ ---------- CALCULO CALEFACCION ----------\n            var largoH = esVentilacionSolo ? 0 : largo;\n            var anchoTunelH = esVentilacionSolo ? 0 : ancho;\n            var a = anchoTunelH \/ 2;\n            var Hc = esVentilacionSolo ? 0 : altoCanal;\n            var b = esVentilacionSolo ? 0 : (tipoCalefaccion === 'Calefacci\u00f3n Directa' ? cumbrera : 0);\n            var numTunelesH = esVentilacionSolo ? 0 : numTuneles;\n\n            var areaCanal = anchoTunelH * Hc;\n            var paredNorte = areaCanal * numTunelesH;\n            var paredSur = numTunelesH * areaCanal;\n            var lateral1 = largoH * Hc;\n            var lateral2 = largoH * Hc;\n            var totalPared = paredNorte + paredSur + lateral1 + lateral2;\n\n            var o23 = ((a * a) + (b * b)) \/ 2;\n            var perimetro = Math.sqrt(o23) * 3.1416 * 2;\n            var mitadPerimetro = perimetro \/ 2;\n            var areaTechoTunel = mitadPerimetro * largoH;\n            var totalAreaTecho = areaTechoTunel * numTunelesH;\n            var totalAreaInvernadero = totalAreaTecho + totalPared;\n\n            var deltaTermico = esVentilacionSolo ? 0 : deltaTermicoIn;\n            var k = tipoPlastico === 'Sencillo' ? K_SENCILLO : K_DOBLE;\n\n            var qKcal = totalAreaInvernadero * deltaTermico * k;\n            var qBtu = qKcal \/ KCAL_POR_BTU;\n\n            var capacidadCalefactor, modeloCalefactor;\n            if (tipoCalefaccion === 'Calefacci\u00f3n Indirecta') {\n                capacidadCalefactor = CAP_240PT; modeloCalefactor = '240PT';\n            } else if (combustible === 'Gas LP Y\/O Natural') {\n                capacidadCalefactor = CAP_CP400DUAL; modeloCalefactor = 'CP400DUAL';\n            } else {\n                capacidadCalefactor = CAP_K210; modeloCalefactor = 'K210';\n            }\n\n            var numEquiposCalefaccion = capacidadCalefactor > 0 ? qBtu \/ capacidadCalefactor : 0;\n\n            \/\/ ---------- Salidas ----------\n            document.getElementById('lbw_res_calefactores').innerText = fmt(Math.round(numEquiposCalefaccion));\n            document.getElementById('lbw_res_calefactores_modelo').innerText = esVentilacionSolo\n                ? 'No aplica (solo ventilaci\u00f3n)'\n                : 'Modelo de referencia: ' + modeloCalefactor + ' (' + fmt(capacidadCalefactor) + ' BTU\/hr c\/u)';\n\n            document.getElementById('lbw_res_ventiladores').innerText = fmt(Math.round(cantidadVentiladores));\n            document.getElementById('lbw_res_ventiladores_modelo').innerText = esCalefaccionSolo\n                ? 'No aplica (solo calefacci\u00f3n)'\n                : 'Modelo seleccionado: ' + tipoVentilador;\n\n            \/\/ ---------- Detalle ----------\n            var filas = [\n                ['\u00c1rea total invernadero', fmt(totalAreaInvernadero, 2) + ' m\u00b2'],\n                ['Total paredes', fmt(totalPared, 2) + ' m\u00b2'],\n                ['Total techo', fmt(totalAreaTecho, 2) + ' m\u00b2'],\n                ['Delta t\u00e9rmico aplicado', fmt(deltaTermico, 1) + ' \u00b0C'],\n                ['Coeficiente k (' + tipoPlastico + ')', fmt(k, 1)],\n                ['Q = \u00e1rea \u00d7 k \u00d7 \u0394T', fmt(qKcal, 2) + ' kcal\/hr'],\n                ['Q en BTU\/hr', fmt(qBtu, 2) + ' BTU\/hr'],\n                ['Capacidad calefactor (' + modeloCalefactor + ')', fmt(capacidadCalefactor) + ' BTU\/hr'],\n                ['Volumen invernadero (ventilaci\u00f3n)', fmt(volumenInv, 2) + ' m\u00b3'],\n                ['Renovaciones de aire', fmt(RENOVACIONES, 1) + ' \/hr'],\n                ['Capacidad ' + tipoVentilador, fmt(tipoVentilador === 'Ventilador 20\"' ? CAP_VENT_20 : CAP_VENT_28) + ' m\u00b3\/hr']\n            ];\n\n            tablaDetalle.innerHTML = filas.map(function(f) {\n                return '<tr><td style=\"padding:4px 2px;border-bottom:1px dashed #e2e8f0;\">' + f[0] + '<\/td><td style=\"padding:4px 2px;border-bottom:1px dashed #e2e8f0;text-align:right;font-weight:600;\">' + f[1] + '<\/td><\/tr>';\n            }).join('');\n\n            \/\/ ---------- Snapshot para el env\u00edo por correo ----------\n            ultimoResultado = {\n                tipo_calculo: tipoCalculo,\n                largo: largo,\n                ancho: ancho,\n                alto_canal: altoCanal,\n                cumbrera: cumbrera,\n                num_tuneles: numTuneles,\n                delta_termico: deltaTermico,\n                tipo_ventilador: tipoVentilador,\n                tipo_calefaccion: tipoCalefaccion,\n                tipo_plastico: tipoPlastico,\n                combustible: combustible,\n                res_calefactores: document.getElementById('lbw_res_calefactores').innerText,\n                res_calefactores_modelo: document.getElementById('lbw_res_calefactores_modelo').innerText,\n                res_ventiladores: document.getElementById('lbw_res_ventiladores').innerText,\n                res_ventiladores_modelo: document.getElementById('lbw_res_ventiladores_modelo').innerText\n            };\n        }\n\n        if (btn) {\n            btn.addEventListener('click', function(e) {\n                e.preventDefault();\n                calcular();\n                captura.style.display = 'block';\n                captura.scrollIntoView({ behavior: 'smooth', block: 'nearest' });\n            });\n        }\n\n        selTipoCalculo.addEventListener('change', function() {\n            actualizarVisibilidad();\n            if (ultimoResultado) {\n                calcular();\n            }\n        });\n\n        if (btnEnviar) {\n            btnEnviar.addEventListener('click', function(e) {\n                e.preventDefault();\n\n                var nombre = document.getElementById('lbw_nombre').value.trim();\n                var email = document.getElementById('lbw_email').value.trim();\n                var website = document.getElementById('lbw_website').value.trim();\n                var emailRegex = \/^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$\/;\n\n                envioMsg.style.color = '#c0392b';\n\n                if (website !== '') {\n                    \/\/ Campo trampa lleno: probablemente un bot, no hacemos nada visible.\n                    return;\n                }\n                if (!nombre) {\n                    envioMsg.innerText = 'Por favor ingresa tu nombre completo.';\n                    return;\n                }\n                if (!emailRegex.test(email)) {\n                    envioMsg.innerText = 'Por favor ingresa un correo electr\u00f3nico v\u00e1lido.';\n                    return;\n                }\n                if (!ultimoResultado) {\n                    envioMsg.innerText = 'Primero realiza el c\u00e1lculo.';\n                    return;\n                }\n\n                btnEnviar.disabled = true;\n                var textoOriginal = btnEnviar.innerText;\n                btnEnviar.innerText = 'Enviando...';\n                envioMsg.style.color = '#4a5568';\n                envioMsg.innerText = '';\n\n                var datos = new FormData();\n                datos.append('action', 'lbw_enviar_calculo');\n                datos.append('nonce', lbwCalcAjax.nonce);\n                datos.append('nombre', nombre);\n                datos.append('email', email);\n                for (var campo in ultimoResultado) {\n                    if (Object.prototype.hasOwnProperty.call(ultimoResultado, campo)) {\n                        datos.append(campo, ultimoResultado[campo]);\n                    }\n                }\n\n                fetch(lbwCalcAjax.url, {\n                    method: 'POST',\n                    credentials: 'same-origin',\n                    body: datos\n                })\n                .then(function(r) { return r.json(); })\n                .then(function(resp) {\n                    btnEnviar.disabled = false;\n                    btnEnviar.innerText = textoOriginal;\n                    if (resp && resp.success) {\n                        envioMsg.style.color = '#1a7f37';\n                        envioMsg.innerText = '\u00a1Listo! Revisa tu correo, te hemos enviado los resultados.';\n                    } else {\n                        envioMsg.style.color = '#c0392b';\n                        envioMsg.innerText = (resp && resp.data && resp.data.message) ? resp.data.message : 'Ocurri\u00f3 un error al enviar. Intenta de nuevo.';\n                    }\n                })\n                .catch(function() {\n                    btnEnviar.disabled = false;\n                    btnEnviar.innerText = textoOriginal;\n                    envioMsg.style.color = '#c0392b';\n                    envioMsg.innerText = 'Ocurri\u00f3 un error de conexi\u00f3n. Intenta de nuevo.';\n                });\n            });\n        }\n\n        toggleDetalle.addEventListener('click', function(e) {\n            e.preventDefault();\n            var oculto = detalle.style.display === 'none';\n            detalle.style.display = oculto ? 'block' : 'none';\n            toggleDetalle.innerText = oculto ? 'Ocultar detalle de c\u00e1lculo \u25b2' : 'Ver detalle de c\u00e1lculo \u25be';\n        });\n\n        \/\/ Estado y c\u00e1lculo inicial\n        actualizarVisibilidad();\n        calcular();\n    });\n    <\/script>\n    \n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_et_pb_use_builder":"on","_et_pb_old_content":"<!-- wp:html -->\n[calculadora_btus]\n<!-- \/wp:html -->","_et_gb_content_width":"","_joinchat":[],"footnotes":""},"dipi_cpt_category":[],"class_list":["post-273","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/lbw.mx\/index.php?rest_route=\/wp\/v2\/pages\/273","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lbw.mx\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/lbw.mx\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/lbw.mx\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lbw.mx\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=273"}],"version-history":[{"count":29,"href":"https:\/\/lbw.mx\/index.php?rest_route=\/wp\/v2\/pages\/273\/revisions"}],"predecessor-version":[{"id":470,"href":"https:\/\/lbw.mx\/index.php?rest_route=\/wp\/v2\/pages\/273\/revisions\/470"}],"wp:attachment":[{"href":"https:\/\/lbw.mx\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=273"}],"wp:term":[{"taxonomy":"dipi_cpt_category","embeddable":true,"href":"https:\/\/lbw.mx\/index.php?rest_route=%2Fwp%2Fv2%2Fdipi_cpt_category&post=273"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}