{"id":2915,"date":"2026-06-17T01:48:01","date_gmt":"2026-06-17T01:48:01","guid":{"rendered":"https:\/\/aiper.com\/blogs\/?page_id=2915"},"modified":"2026-10-21T09:14:06","modified_gmt":"2026-10-21T09:14:06","slug":"calculadora-cercas","status":"publish","type":"page","link":"https:\/\/aiper.com\/blogs\/es\/calculadora-cercas\/","title":{"rendered":"Calculadora de materiales para cercas"},"content":{"rendered":"\n<style>#fence-calc-wrapper *, #fence-calc-wrapper *::before, #fence-calc-wrapper *::after { box-sizing: border-box; }\n#fence-calc-wrapper { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif; max-width: 760px; margin: 20px auto; padding: 0; line-height: 1.5; --fcc-teal: #1ecad3; --fcc-teal-dark: #17a8b0; --fcc-teal-light: #e8fafa; --fcc-border: #e2e8f0; --fcc-text: #2d3748; --fcc-text-light: #5a6c7d; }\n#fence-calc-wrapper .fcc-intro { max-width: 680px; margin: 0 auto 16px; padding: 0 24px; text-align: center; color: var(--fcc-text-light); font-size: 15px; line-height: 1.5; }\n#fence-calc-wrapper .fcc-card { background: #fff; border-radius: 16px; box-shadow: 0 4px 24px rgba(0,0,0,0.07); padding: 28px 24px; margin-bottom: 20px; border: 1px solid var(--fcc-border); }\n#fence-calc-wrapper .fcc-subtitle { font-size: 0.9rem; color: var(--fcc-text-light); margin: 0 0 20px 0; }\n#fence-calc-wrapper .fcc-label { display: block; font-weight: 600; font-size: 0.9rem; color: var(--fcc-text); margin-bottom: 5px; }\n#fence-calc-wrapper .fcc-input-row { display: flex; gap: 10px; align-items: stretch; margin-bottom: 18px; }\n#fence-calc-wrapper .fcc-input-field { flex: 1; padding: 12px 14px; border: 2px solid var(--fcc-border); border-radius: 6px; font-size: 1rem; color: #2c3e50; background: #f9fafb; outline: none; width: 100%; }\n#fence-calc-wrapper .fcc-input-field:focus { border-color: #9486f7; background: #fff; color: #2c3e50; }\n#fence-calc-wrapper .fcc-unit-toggle { display: flex; background: #f1f5f9; border-radius: 6px; overflow: hidden; border: 2px solid var(--fcc-border); flex-wrap: wrap; }\n#fence-calc-wrapper .fcc-unit-btn { padding: 8px 14px; font-size: 0.85rem; font-weight: 600; cursor: pointer; border: none; background: transparent; color: var(--fcc-text-light); }\n#fence-calc-wrapper .fcc-unit-btn:focus, #fence-calc-wrapper .fcc-unit-btn:active { outline: 2px solid #9486f7; outline-offset: -2px; color: var(--fcc-text-light); }\n#fence-calc-wrapper .fcc-unit-btn.fcc-active { background: linear-gradient(135deg, #1ecad3, #9486f7); color: #fff; }\n#fence-calc-wrapper .fcc-preset-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }\n#fence-calc-wrapper .fcc-preset-btn { padding: 6px 13px; font-size: 0.78rem; font-weight: 600; border-radius: 20px; border: 1.5px solid var(--fcc-border); background: #fff; color: var(--fcc-text-light); cursor: pointer; }\n#fence-calc-wrapper .fcc-preset-btn:focus, #fence-calc-wrapper .fcc-preset-btn:active { outline: 2px solid #9486f7; outline-offset: 1px; color: var(--fcc-text-light); }\n#fence-calc-wrapper .fcc-preset-btn.fcc-active { border-color: #9486f7; background: #f5f3ff; color: #2c3e50; }\n#fence-calc-wrapper .fcc-btn-row { display: flex; gap: 12px; max-width: 420px; margin: 26px auto 0; flex-wrap: wrap; }\n#fence-calc-wrapper .fcc-calculate-btn { display: block; flex: 1; min-width: 160px; padding: 14px 30px; background: linear-gradient(135deg, #1ecad3, #9486f7); color: #fff; border: none; border-radius: 999px; font-size: 16px; font-weight: 600; letter-spacing: .5px; cursor: pointer; transition: all .2s; }\n#fence-calc-wrapper .fcc-calculate-btn:hover { background: linear-gradient(135deg, #169fa6, #7b6be0); color: #fff; transform: translateY(-1px); box-shadow: 0 6px 16px rgba(148,134,247,.35); }\n#fence-calc-wrapper .fcc-calculate-btn:focus, #fence-calc-wrapper .fcc-calculate-btn:active { color: #fff; outline: none; box-shadow: 0 0 0 3px rgba(148,134,247,.45); }\n#fence-calc-wrapper .fcc-reset-btn { display: block; flex: 1; min-width: 120px; padding: 14px 20px; background: #fff; color: #5a6c7d; border: 2px solid #d1e8ea; border-radius: 999px; font-size: 16px; font-weight: 600; letter-spacing: .5px; cursor: pointer; transition: all .2s; }\n#fence-calc-wrapper .fcc-reset-btn:hover { background: #f0f7f8; border-color: #1ecad3; color: #0f8c94; }\n#fence-calc-wrapper .fcc-reset-btn:focus, #fence-calc-wrapper .fcc-reset-btn:active { background: #fff; outline: none; border-color: #9486f7; color: #0f8c94; }\n#fence-calc-wrapper .fcc-error-msg { color: #dc2626; font-size: 0.85rem; font-weight: 600; text-align: center; margin-top: 10px; display: none; }\n#fence-calc-wrapper .fcc-error-msg.fcc-visible { display: block; }\n#fence-calc-wrapper .fcc-result-area { display: none; margin-top: 25px; }\n#fence-calc-wrapper .fcc-result-area.fcc-visible { display: block; animation: fccFade 0.4s ease; }\n@keyframes fccFade { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }\n#fence-calc-wrapper .fcc-result-grid { display: flex; gap: 14px; flex-wrap: wrap; }\n#fence-calc-wrapper .fcc-result-card { flex: 1; min-width: 220px; background: linear-gradient(135deg, #f5f3ff 0%, #e8fafa 100%); border: 2px solid #9486f7; border-radius: 10px; padding: 22px 18px; text-align: center; }\n#fence-calc-wrapper .fcc-result-label { font-size: 0.82rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: #5b4ab8; margin: 0 0 8px; }\n#fence-calc-wrapper .fcc-result-amount { font-size: 2.4rem; font-weight: 800; color: #17a8b0; line-height: 1.15; }\n#fence-calc-wrapper .fcc-result-amount .fcc-unit-label { font-size: 1.1rem; }\n#fence-calc-wrapper .fcc-result-sub { margin: 6px 0 0; color: var(--fcc-text-light); font-size: 0.88rem; }\n#fence-calc-wrapper .fcc-acid-line { margin-top: 12px; padding: 8px 12px; background: #fff; border: 1px solid var(--fcc-border); border-radius: 6px; font-size: 0.82rem; color: var(--fcc-text); }\n#fence-calc-wrapper .fcc-warn { display: none; margin-top: 12px; padding: 10px 14px; background: #fff7ed; border: 1px solid #fed7aa; border-radius: 6px; color: #9a3412; font-size: 0.82rem; text-align: left; }\n#fence-calc-wrapper .fcc-warn.fcc-visible { display: block; }\n#fence-calc-wrapper .fcc-toggle-row { display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: 20px; font-size: 0.85rem; color: var(--fcc-text-light); flex-wrap: wrap; }\n#fence-calc-wrapper .fcc-algebra { margin: 14px 0 0; font-size: 0.78rem; color: #8899a6; text-align: center; }\n#fence-calc-wrapper .fcc-next { margin: 14px 0 0; font-size: 0.85rem; color: var(--fcc-text-light); text-align: center; }\n#fence-calc-wrapper .fcc-next a { color: var(--fcc-teal-dark); font-weight: 600; text-decoration: none; }\n#fence-calc-wrapper .fcc-next a:hover { text-decoration: underline; }\n#fence-calc-wrapper .fcc-info-section { display: none; margin-top: 20px; }\n#fence-calc-wrapper .fcc-info-section.fcc-visible { display: block; }\n#fence-calc-wrapper .fcc-info-card { background: #fff; border: 1px solid var(--fcc-border); border-radius: 10px; padding: 20px; font-size: 0.9rem; }\n#fence-calc-wrapper .fcc-info-title { font-weight: 700; font-size: 1rem; margin-bottom: 10px; }\n#fence-calc-wrapper ol.fcc-howto-list { margin: 0; padding: 0 0 0 20px; }\n#fence-calc-wrapper ol.fcc-howto-list li { margin-bottom: 6px; }\n@media (max-width: 600px) { #fence-calc-wrapper .fcc-btn-row { flex-direction: column; max-width: 280px; } #fence-calc-wrapper .fcc-reset-btn { padding: 12px 20px; font-size: 14px; } }\n@media (max-width: 500px) { #fence-calc-wrapper .fcc-input-row { flex-direction: column; } }\n\n#fence-calc-wrapper .fcc-hide { display: none !important; }\n#fence-calc-wrapper .fcc-field { margin-bottom: 18px; }\n#fence-calc-wrapper .fcc-two-col { display: flex; gap: 14px; }\n#fence-calc-wrapper .fcc-two-col > .fcc-field { flex: 1; min-width: 0; }\n#fence-calc-wrapper .fcc-hint { font-size: 0.78rem; color: #8899a6; margin: 4px 0 0; }\n#fence-calc-wrapper .fcc-group { border: 1px solid var(--fcc-border); border-radius: 12px; padding: 18px 16px 4px; margin: 0 0 18px; background: #fcfdfe; }\n#fence-calc-wrapper .fcc-group-title { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: #5b4ab8; margin: 0 0 14px; }\n#fence-calc-wrapper .fcc-input-field, #fence-calc-wrapper select.fcc-input-field { height: auto; margin: 0; }\n#fence-calc-wrapper .fcc-run { margin-bottom: 12px; }\n#fence-calc-wrapper .fcc-run-ctl { display: flex; gap: 10px; align-items: stretch; }\n#fence-calc-wrapper .fcc-run-del { padding: 8px 14px; font-size: 0.8rem; font-weight: 600; border-radius: 6px; border: 2px solid var(--fcc-border); background: #fff; color: var(--fcc-text-light); cursor: pointer; }\n#fence-calc-wrapper .fcc-run-del:hover { border-color: #dc2626; color: #dc2626; }\n#fence-calc-wrapper .fcc-run-del:focus, #fence-calc-wrapper .fcc-run-del:active { outline: 2px solid #9486f7; outline-offset: 1px; color: var(--fcc-text-light); background: #fff; }\n#fence-calc-wrapper .fcc-link-btn { background: none; border: none; padding: 4px 0; margin: 0 0 12px; color: #17a8b0; font-size: 0.88rem; font-weight: 700; cursor: pointer; }\n#fence-calc-wrapper .fcc-link-btn:hover { text-decoration: underline; color: #0f8c94; }\n#fence-calc-wrapper .fcc-link-btn:focus, #fence-calc-wrapper .fcc-link-btn:active { outline: 2px solid #9486f7; outline-offset: 2px; background: none; color: #17a8b0; }\n#fence-calc-wrapper .fcc-check { display: flex; align-items: center; gap: 8px; font-size: 0.88rem; color: var(--fcc-text); margin: 0 0 18px; cursor: pointer; }\n#fence-calc-wrapper .fcc-check input { width: 18px; height: 18px; accent-color: #9486f7; flex-shrink: 0; margin: 0; }\n#fence-calc-wrapper .fcc-unit-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }\n#fence-calc-wrapper .fcc-unit-row .fcc-label { margin: 0; }\n#fence-calc-wrapper details.fcc-prices { border: 1px solid var(--fcc-border); border-radius: 8px; padding: 10px 14px; margin: 0 0 18px; background: #fff; }\n#fence-calc-wrapper details.fcc-prices summary { cursor: pointer; font-weight: 600; font-size: 0.9rem; color: var(--fcc-text); }\n#fence-calc-wrapper .fcc-price-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; margin-top: 14px; }\n#fence-calc-wrapper .fcc-price-label { display: block; font-size: 0.78rem; font-weight: 600; color: var(--fcc-text-light); margin-bottom: 3px; }\n#fence-calc-wrapper .fcc-price-row .fcc-input-field { padding: 8px 10px; font-size: 0.9rem; }\n#fence-calc-wrapper .fcc-postline { margin: 16px 0 12px; font-size: 0.9rem; color: var(--fcc-text); text-align: center; font-weight: 600; }\n#fence-calc-wrapper .fcc-list { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--fcc-border); border-radius: 12px; }\n#fence-calc-wrapper .fcc-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; min-width: 520px; }\n#fence-calc-wrapper .fcc-table thead th { background: linear-gradient(135deg, #1ecad3, #9486f7); color: #fff; font-weight: 600; font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.05em; padding: 10px; text-align: left; white-space: nowrap; }\n#fence-calc-wrapper .fcc-table tbody td { padding: 10px; border-bottom: 1px solid #eef1f5; vertical-align: top; color: var(--fcc-text); }\n#fence-calc-wrapper .fcc-table tbody tr:nth-child(even) { background: #fafcfd; }\n#fence-calc-wrapper .fcc-qty { font-weight: 800; color: #0f8c94; white-space: nowrap; }\n#fence-calc-wrapper .fcc-spec { color: var(--fcc-text-light); font-size: 0.8rem; }\n#fence-calc-wrapper .fcc-price { white-space: nowrap; text-align: right; }\n#fence-calc-wrapper tr.fcc-total-row td { font-weight: 700; text-align: right; background: #f5f3ff; }\n#fence-calc-wrapper .fcc-warn span { display: block; margin-top: 6px; }\n#fence-calc-wrapper .fcc-warn span:first-child { margin-top: 0; }\n#fence-calc-wrapper .fcc-jump { margin: 14px 0 0; font-size: 0.85rem; text-align: center; color: var(--fcc-text-light); }\n#fence-calc-wrapper .fcc-jump a { color: var(--fcc-teal-dark); font-weight: 600; text-decoration: none; }\n@media (max-width: 500px) { #fence-calc-wrapper .fcc-two-col { flex-direction: column; gap: 0; } #fence-calc-wrapper .fcc-price-grid { grid-template-columns: 1fr; } #fence-calc-wrapper .fcc-run-ctl { flex-direction: row; } }\n<\/style>\n<div id=\"fence-calc-wrapper\">\n    <p class=\"fcc-intro\">Esta calculadora de cercas (vallas) calcula los postes, travesa\u00f1os, listones o paneles, el hormig\u00f3n (concreto) y el coste de una cerca de madera, PVC, metal o malla. Introduzca cada lado de su cerca, a\u00f1ada puertas y obtenga una lista de compra completa con una estimaci\u00f3n del precio.<\/p>\n    <div class=\"fcc-card\">\n        <p class=\"fcc-subtitle\">Elija el tipo de cerca e introduzca los lados. Los valores iniciales describen una cerca de madera con privacidad de 20 m de largo y 1,80 m de alto, as\u00ed que puede pulsar Calcular para ver un ejemplo.<\/p>\n\n        <div class=\"fcc-field\">\n            <label class=\"fcc-label\" for=\"fcc-type\">Tipo de cerca<\/label>\n            <select id=\"fcc-type\" class=\"fcc-input-field\"><option value=\"picket\" selected>Cerca de listones de madera (montada en obra)<\/option><option value=\"wpanel\">Cerca de paneles de madera (prefabricados)<\/option><option value=\"vinyl\">Cerca de PVC (paneles)<\/option><option value=\"alum\">Cerca met\u00e1lica (panel r\u00edgido)<\/option><option value=\"chain\">Cerca de malla simple torsi\u00f3n<\/option><\/select>\n        <\/div>\n\n        <div class=\"fcc-group\">\n            <p class=\"fcc-group-title\">Trazado de la cerca<\/p>\n            <div id=\"fcc-runs\"><\/div>\n            <button type=\"button\" id=\"fcc-add-run\" class=\"fcc-link-btn\">+ A\u00f1adir otro lado<\/button>\n            <label class=\"fcc-check\"><input type=\"checkbox\" id=\"fcc-closed\"> La cerca cierra un circuito (el \u00faltimo lado vuelve al primero)<\/label>\n            <div class=\"fcc-two-col\">\n                <div class=\"fcc-field\">\n                    <label class=\"fcc-label\" for=\"fcc-gates\">N\u00famero de puertas<\/label>\n                    <select id=\"fcc-gates\" class=\"fcc-input-field\"><option value=\"0\" selected>0<\/option><option value=\"1\">1<\/option><option value=\"2\">2<\/option><option value=\"3\">3<\/option><option value=\"4\">4<\/option><option value=\"5\">5<\/option><\/select>\n                <\/div>\n                <div class=\"fcc-field\">\n                    <label class=\"fcc-label\" for=\"fcc-gatew\">Ancho de la puerta (<span class=\"fcc-u-len\">ft<\/span>)<\/label>\n                    <input type=\"number\" id=\"fcc-gatew\" class=\"fcc-input-field\" value=\"4\" min=\"0\" step=\"any\">\n                <\/div>\n            <\/div>\n            <p class=\"fcc-hint\">Incluya los huecos de las puertas en la longitud de los lados. La calculadora los resta del tramo de cerca y a\u00f1ade los postes de la puerta.<\/p>\n            <div class=\"fcc-field\">\n                <label class=\"fcc-label\" for=\"fcc-attach\">Extremos fijados a una casa, muro o cerca existente<\/label>\n                <select id=\"fcc-attach\" class=\"fcc-input-field\"><option value=\"0\" selected>Ninguno, los dos extremos llevan poste<\/option><option value=\"1\">Un extremo<\/option><option value=\"2\">Los dos extremos<\/option><\/select>\n            <\/div>\n        <\/div>\n\n        <div class=\"fcc-group\">\n            <p class=\"fcc-group-title\">Estilo de la cerca<\/p>\n            <div class=\"fcc-field\">\n                <label class=\"fcc-label\" for=\"fcc-height\">Altura de la cerca (<span class=\"fcc-u-len\">ft<\/span>)<\/label>\n                <input type=\"number\" id=\"fcc-height\" class=\"fcc-input-field\" value=\"6\" min=\"0\" step=\"any\">\n            <\/div>\n            <div class=\"fcc-preset-row\" id=\"fcc-height-presets\"><\/div>\n            <div class=\"fcc-two-col\">\n                <div class=\"fcc-field\">\n                    <label class=\"fcc-label\" for=\"fcc-spacing\">Separaci\u00f3n entre postes o ancho del panel (<span class=\"fcc-u-len\">ft<\/span>)<\/label>\n                    <input type=\"number\" id=\"fcc-spacing\" class=\"fcc-input-field\" value=\"8\" min=\"0\" step=\"any\">\n                <\/div>\n                <div class=\"fcc-field\" data-show=\"picket,wpanel\">\n                    <label class=\"fcc-label\" for=\"fcc-postsel\">Secci\u00f3n de los postes de madera<\/label>\n                    <select id=\"fcc-postsel\" class=\"fcc-input-field\"><\/select>\n                <\/div>\n            <\/div>\n            <div class=\"fcc-two-col\" data-show=\"picket\">\n                <div class=\"fcc-field\">\n                    <label class=\"fcc-label\" for=\"fcc-rails\">Travesa\u00f1os por tramo<\/label>\n                    <select id=\"fcc-rails\" class=\"fcc-input-field\"><option value=\"2\">2 travesa\u00f1os<\/option><option value=\"3\" selected>3 travesa\u00f1os<\/option><option value=\"4\">4 travesa\u00f1os<\/option><\/select>\n                <\/div>\n                <div class=\"fcc-field\">\n                    <label class=\"fcc-label\" for=\"fcc-layout\">Disposici\u00f3n de los listones<\/label>\n                    <select id=\"fcc-layout\" class=\"fcc-input-field\"><option value=\"spaced\" selected>Listones separados o juntos<\/option><option value=\"bob\">Doble capa solapada (2,5 cm de solape)<\/option><\/select>\n                <\/div>\n            <\/div>\n            <div class=\"fcc-two-col\" data-show=\"picket\">\n                <div class=\"fcc-field\">\n                    <label class=\"fcc-label\" for=\"fcc-pw\">Ancho de los listones (<span class=\"fcc-u-in\">in<\/span>)<\/label>\n                    <input type=\"number\" id=\"fcc-pw\" class=\"fcc-input-field\" value=\"5.5\" min=\"0\" step=\"any\">\n                <\/div>\n                <div class=\"fcc-field\" id=\"fcc-gap-field\">\n                    <label class=\"fcc-label\" for=\"fcc-gap\">Separaci\u00f3n entre listones (<span class=\"fcc-u-in\">in<\/span>)<\/label>\n                    <input type=\"number\" id=\"fcc-gap\" class=\"fcc-input-field\" value=\"0.5\" min=\"0\" step=\"any\">\n                <\/div>\n            <\/div>\n        <\/div>\n\n        <div class=\"fcc-group\">\n            <p class=\"fcc-group-title\">Cimentaci\u00f3n de los postes<\/p>\n            <div class=\"fcc-two-col\">\n                <div class=\"fcc-field\">\n                    <label class=\"fcc-label\" for=\"fcc-hole\">Di\u00e1metro del agujero (<span class=\"fcc-u-in\">in<\/span>)<\/label>\n                    <input type=\"number\" id=\"fcc-hole\" class=\"fcc-input-field\" value=\"10\" min=\"0\" step=\"any\">\n                <\/div>\n                <div class=\"fcc-field\">\n                    <label class=\"fcc-label\" for=\"fcc-depth\">Profundidad del agujero (<span class=\"fcc-u-in\">in<\/span>)<\/label>\n                    <input type=\"number\" id=\"fcc-depth\" class=\"fcc-input-field\" value=\"24\" min=\"0\" step=\"any\">\n                <\/div>\n            <\/div>\n            <p class=\"fcc-hint\">La profundidad sigue la altura de la cerca (alrededor de un tercio, nunca menos de 60 cm). Introduzca la profundidad de helada de su zona si es mayor.<\/p>\n            <div class=\"fcc-two-col\">\n                <div class=\"fcc-field\">\n                    <label class=\"fcc-label\" for=\"fcc-bag\">Tama\u00f1o del saco de hormig\u00f3n<\/label>\n                    <select id=\"fcc-bag\" class=\"fcc-input-field\"><\/select>\n                <\/div>\n                <div class=\"fcc-field\">\n                    <label class=\"fcc-check\"><input type=\"checkbox\" id=\"fcc-gravel\" checked> A\u00f1adir una base de grava de 15 cm<\/label>\n                <\/div>\n            <\/div>\n        <\/div>\n\n        <div class=\"fcc-group\">\n            <p class=\"fcc-group-title\">Coste y extras<\/p>\n            <label class=\"fcc-check\"><input type=\"checkbox\" id=\"fcc-cost\" checked> Incluir una estimaci\u00f3n del coste<\/label>\n            <div id=\"fcc-cost-box\">\n                <details class=\"fcc-prices\">\n                    <summary>Editar precios (precios t\u00edpicos de tienda en euros, sustit\u00fayalos por los suyos)<\/summary>\n                    <div class=\"fcc-price-grid\" id=\"fcc-prices\"><\/div>\n                <\/details>\n                <div class=\"fcc-field\">\n                    <label class=\"fcc-label\" for=\"fcc-labor\">Mano de obra de instalaci\u00f3n, por <span class=\"fcc-u-len\">ft<\/span> (opcional)<\/label>\n                    <input type=\"number\" id=\"fcc-labor\" class=\"fcc-input-field\" placeholder=\"D\u00e9jelo vac\u00edo para solo materiales\" min=\"0\" step=\"any\">\n                <\/div>\n            <\/div>\n            <div class=\"fcc-two-col\">\n                <div class=\"fcc-field\" data-show=\"picket\">\n                    <label class=\"fcc-label\" for=\"fcc-waste\">Margen por desperdicio<\/label>\n                    <select id=\"fcc-waste\" class=\"fcc-input-field\"><option value=\"0\">Ninguno<\/option><option value=\"5\">5%<\/option><option value=\"10\" selected>10%<\/option><option value=\"15\">15 % (terreno en pendiente)<\/option><\/select>\n                <\/div>\n                <div class=\"fcc-field\">\n                    <label class=\"fcc-check\"><input type=\"checkbox\" id=\"fcc-pool\"> Esta cerca rodea una piscina<\/label>\n                <\/div>\n            <\/div>\n        <\/div>\n\n        <div class=\"fcc-btn-row\">\n            <button type=\"button\" id=\"fcc-calculate-btn\" class=\"fcc-calculate-btn\">Calcular<\/button>\n            <button type=\"button\" id=\"fcc-reset-btn\" class=\"fcc-reset-btn\">Restablecer<\/button>\n        <\/div>\n        <p id=\"fcc-error-msg\" class=\"fcc-error-msg\"><\/p>\n\n        <div id=\"fcc-result-area\" class=\"fcc-result-area\">\n            <div class=\"fcc-result-grid\" id=\"fcc-result-grid\"><\/div>\n            <p class=\"fcc-postline\" id=\"fcc-postline\"><\/p>\n            <div class=\"fcc-list\" id=\"fcc-list\"><\/div>\n            <div id=\"fcc-warn\" class=\"fcc-warn\"><\/div>\n            <p class=\"fcc-algebra\" id=\"fcc-algebra\"><\/p>\n            <div class=\"fcc-info-card\">\n                <div class=\"fcc-info-title\">Antes de excavar o comprar<\/div>\n                <ol class=\"fcc-howto-list\"><li>Consulte a las compa\u00f1\u00edas de agua, gas y electricidad o a su ayuntamiento sobre las instalaciones enterradas antes de excavar.<\/li><li>Compruebe la licencia de obra, los l\u00edmites de altura, las distancias a linderos y las normas del ayuntamiento o de la comunidad de propietarios, y confirme d\u00f3nde est\u00e1 exactamente el l\u00edmite de su parcela antes de colocar los postes.<\/li><li>Marque cada poste con un cordel y estacas, y vuelva a comprobar la separaci\u00f3n antes de excavar el primer agujero.<\/li><\/ol>\n            <\/div>\n        <\/div>\n    <\/div>\n    <p class=\"fcc-jump\">\u00bfNecesita un dato r\u00e1pido? <a href=\"#fence-reference-table\">Vaya a la tabla de materiales de cerca por longitud<\/a>.<\/p>\n<\/div>\n<script>(function() {\nvar T = {\"sideLabel\": \"Lado {n}: longitud ({u})\", \"runPh\": \"p. ej., 10\", \"remove\": \"Quitar\", \"removeAria\": \"Quitar este lado\", \"postS_imp\": \"9 \u00d7 9 cm\", \"postL_imp\": \"12 \u00d7 12 cm\", \"postS_met\": \"9 \u00d7 9 cm\", \"postL_met\": \"12 \u00d7 12 cm\", \"p_post\": \"Poste (unidad)\", \"p_rail\": \"Travesa\u00f1o (unidad)\", \"p_picket\": \"List\u00f3n (unidad)\", \"p_fasteners\": \"Tornillo (unidad)\", \"p_concrete\": \"Saco de hormig\u00f3n (unidad)\", \"p_gravel\": \"Saco de grava, 14 L (unidad)\", \"p_gate\": \"Puerta (unidad)\", \"p_panel\": \"Panel (unidad)\", \"p_lpost\": \"Poste intermedio (unidad)\", \"p_tpost\": \"Poste de esquina, extremo o puerta (unidad)\", \"p_fabric\": \"Rollo de malla, 25 m (unidad)\", \"p_tbar\": \"Tension bar (each)\", \"p_tband\": \"Tension band (each)\", \"p_bband\": \"Brace band (each)\", \"p_cap\": \"Tapa de poste (unidad)\", \"p_ties\": \"Alambre de atar, rollo (unidad)\", \"p_strut\": \"Riostra (unidad)\", \"p_wire\": \"Alambre tensor, rollo de 50 m (unidad)\", \"err_length\": \"Introduzca la longitud de al menos un lado de la cerca.\", \"err_height\": \"Introduzca la altura de la cerca.\", \"err_spacing\": \"Introduzca la separaci\u00f3n entre postes (o el ancho del panel).\", \"err_gatew\": \"Introduzca el ancho de la puerta.\", \"err_gates\": \"Los huecos de las puertas son tan largos como toda la cerca. Alargue la cerca o reduzca las puertas.\", \"err_hole\": \"El agujero debe ser m\u00e1s ancho que el poste. Aumente el di\u00e1metro del agujero.\", \"err_depth\": \"El agujero debe ser m\u00e1s profundo que la base de grava. Aumente la profundidad o desmarque la base de grava.\", \"err_picket\": \"Introduzca el ancho de los listones.\", \"estCost\": \"Coste estimado\", \"matOnly\": \"Solo materiales, a los precios que ha introducido\", \"matLabor\": \"Materiales {a} + mano de obra {b}\", \"costPerFt\": \"Coste por pie\", \"costPerM\": \"Coste por metro\", \"forLen\": \"para {n} {u} de cerca\", \"cardPosts\": \"Postes\", \"cardSections\": \"Tramos\", \"cardPanels\": \"Paneles\", \"cardBetween\": \"entre postes, sin contar las puertas\", \"pLine\": \"{n} intermedios\", \"pCorner\": \"{n} de esquina\", \"pEnd\": \"{n} de extremo\", \"pGate\": \"{n} de puerta\", \"gatesOne\": \" m\u00e1s {n} hueco de puerta\", \"gatesMany\": \" m\u00e1s {n} huecos de puerta\", \"postLine\": \"Postes: {total} en total ({parts}). {sections} tramos{gates}.\", \"thItem\": \"Art\u00edculo\", \"thQty\": \"Cant.\", \"thDetails\": \"Detalles\", \"thEach\": \"Precio unidad\", \"thCost\": \"Coste\", \"matSub\": \"Subtotal de materiales\", \"labor\": \"Mano de obra\", \"total\": \"Total\", \"postType_vinyl\": \"PVC 10 \u00d7 10 cm\", \"postType_alum\": \"metal 6 \u00d7 4 cm\", \"postType_wpanel\": \"\", \"postType_picket\": \"\", \"postType_chain\": \"\", \"railPreImp\": \"\", \"railPreMet\": \"\", \"l_post\": \"Postes\", \"s_post\": \"Postes {post}, {len} de largo ({depth} bajo tierra)\", \"l_lpost\": \"Postes intermedios\", \"s_lpost\": \"Postes redondos, {len} de largo ({depth} bajo tierra)\", \"l_tpost\": \"Postes de esquina, extremo y puerta\", \"s_tpost\": \"Postes reforzados, {len} de largo\", \"l_toprail\": \"Top rail\", \"s_toprail\": \"10.5 ft lengths\", \"l_rail\": \"Travesa\u00f1os\", \"s_rail\": \"Travesa\u00f1os de {len}, {n} por tramo\", \"l_picket\": \"Listones\", \"s_bob\": \"Doble capa solapada, {w} de ancho, 2,5 cm de solape\", \"s_picket\": \"{w} de ancho con {g} de separaci\u00f3n\", \"l_fasteners\": \"Tornillos\", \"s_fasteners\": \"2 por list\u00f3n y travesa\u00f1o\", \"l_panel\": \"Paneles\", \"s_panel\": \"{w} de ancho, {h} de alto (uno por tramo)\", \"l_fabric\": \"Malla\", \"s_fabric\": \"Rollos de 25 m, {h} de alto\", \"l_tbar\": \"Tension bars\", \"s_tbar\": \"One at each fabric end\", \"l_tband\": \"Tension bands\", \"s_tband\": \"{n} per tension bar\", \"l_bband\": \"Brace bands and rail ends\", \"s_bband\": \"One per tension bar\", \"l_strut\": \"Riostras\", \"s_strut\": \"Una por lado de poste de esquina, extremo o puerta\", \"l_wire\": \"Alambre tensor\", \"s_wire\": \"{n} l\u00edneas a lo largo de la cerca, rollos de 50 m\", \"l_cap\": \"Tapas de poste\", \"s_cap\": \"Una por poste\", \"l_ties\": \"Alambre de atar\", \"s_ties\": \"Rollos de 50 m\", \"s_ties_eu\": \"Rollos de 50 m\", \"l_concrete\": \"Hormig\u00f3n en sacos\", \"s_concrete\": \"Sacos de {bag}, {vol} de hormig\u00f3n (volumen del poste descontado)\", \"l_gravel\": \"Base de grava\", \"s_gravel\": \"15 cm bajo cada poste, {vol}\", \"l_gate\": \"Puertas\", \"s_gate\": \"{w} de ancho, con bisagras y cerrojo\", \"w_waste\": \"Los listones, travesa\u00f1os y tornillos incluyen un {n} % extra por cortes y errores. Los postes, paneles y el hormig\u00f3n se cuentan en unidades enteras.\", \"w_tall\": \"Las cercas de m\u00e1s de 2 m suelen necesitar licencia o una autorizaci\u00f3n especial. Consulte la normativa local antes de comprar.\", \"w_spacing\": \"Con m\u00e1s de 2,5 m entre postes, los travesa\u00f1os se curvan. Use entre 2 y 2,5 m en una cerca de listones de madera.\", \"w_gate\": \"Las puertas de m\u00e1s de 1,2 m de ancho cargan mucho el poste de las bisagras. Use ah\u00ed un poste de 12 \u00d7 12 cm o de acero, y col\u00f3quelo con m\u00e1s hormig\u00f3n.\", \"w_attach1\": \"El extremo fijado a una casa o muro necesita un anclaje a la pared (escuadra o list\u00f3n fijado al muro) en lugar de un poste.\", \"w_attach2\": \"Los extremos fijados a una casa o muro necesitan un anclaje a la pared (escuadra o list\u00f3n fijado al muro) en lugar de un poste.\", \"w_shallow\": \"Un agujero de menos de 60 cm puede dejar que se incline una cerca tan alta. En zonas fr\u00edas, coloque los postes por debajo de la l\u00ednea de helada.\", \"w_pool\": \"Cerca de piscina: la altura, los huecos y el cierre de la puerta los fija la normativa de su comunidad aut\u00f3noma o ayuntamiento. Como referencia, se usan huecos de menos de 10 cm y una puerta que se cierra y se bloquea sola y se abre hacia fuera de la piscina. Confirme los requisitos con su ayuntamiento.\", \"w_poolLow\": \"Su cerca mide menos de {h} m.\", \"w_poolGap\": \"La separaci\u00f3n entre sus listones es de 10 cm o m\u00e1s.\", \"algebra\": \"Cada lado se divide por la separaci\u00f3n de {sp} y se redondea hacia arriba a tramos enteros{gates} = {sections} tramos. Postes = {segments} segmentos {loop}{wall} = {posts}.\", \"alg_gates\": \" (los huecos de puerta se restan de los lados m\u00e1s largos)\", \"alg_loop\": \"(circuito cerrado, por lo que no hay poste de extremo extra)\", \"alg_wall1\": \" - {n} extremo en pared\", \"alg_wall2\": \" - {n} extremos en pared\"};\nvar LOC = {\"locale\": \"es-ES\", \"currency\": \"EUR\", \"metricOnly\": true, \"nbsp\": true, \"tallFt\": 6.561679790026246, \"maxSpacingFt\": 8.234908136482938, \"wideGateFt\": 3.9370078740157477, \"poolMinM\": null, \"poolGapCm\": 10, \"runDefM\": 20, \"hDefM\": 1.8, \"gateWM\": 1.0, \"bagDefM\": \"25\", \"presetsM\": [1.0, 1.2, 1.5, 1.8, 2.0], \"model\": {\"eu\": true, \"woodPostMet\": {\"s\": 3.54, \"l\": 4.72}, \"chainLine\": 1.5, \"chainTerm\": 1.9, \"rollFt\": 82.02099737532808, \"railStdM\": [2.5, 3.0, 4.0, 5.0], \"postStdM\": [1.5, 1.8, 2.1, 2.4, 2.7, 3.0, 3.6, 4.2], \"typeOv\": {\"picket\": {\"spacingM\": 2.5}, \"wpanel\": {\"spacingM\": 1.8}, \"vinyl\": {\"spacingM\": 1.8, \"postW\": 3.94, \"holeD\": 10}, \"alum\": {\"spacingM\": 2.5, \"postW\": 2.36, \"holeD\": 8}, \"chain\": {\"spacingM\": 2.5, \"holeD\": 8}}}};\nvar FENCE_MODEL = (function () {\n    var PI = Math.PI;\n    var EPS = 1e-9;\n\n    \/\/ grp: which option group the type uses. postSq: square posts (else round).\n    var TYPES = {\n        picket: { name: 'Wood picket fence (built on site)', grp: 'picket', spacing: 8, spacingM: 2.4, wood: true },\n        wpanel: { name: 'Wood panel fence (prefab panels)', grp: 'panel', spacing: 8, spacingM: 2.4, wood: true },\n        vinyl: { name: 'Vinyl fence (panels)', grp: 'panel', spacing: 8, spacingM: 2.4, postW: 5, holeD: 12 },\n        alum: { name: 'Aluminum \/ ornamental fence (panels)', grp: 'panel', spacing: 6, spacingM: 1.8, postW: 2, holeD: 8 },\n        chain: { name: 'Chain link fence', grp: 'chain', spacing: 10, spacingM: 3, holeD: 10 }\n    };\n    var POST_STD = {\n        picket: [6, 8, 10, 12, 14, 16], wpanel: [6, 8, 10, 12, 14, 16], vinyl: [7, 8, 9, 10, 12],\n        alum: [4, 5, 6, 7, 8, 9, 10], chain: [5, 6, 7, 8, 9, 10, 12]\n    };\n    var POST_STD_M = [1.5, 1.8, 2.1, 2.4, 2.7, 3, 3.6, 4.2, 4.8].map(function (m) { return m \/ 0.3048; });\n    var RAIL_STD = [8, 10, 12, 16];\n    var RAIL_STD_M = [2.4, 3, 3.6, 4.8].map(function (m) { return m \/ 0.3048; });\n    \/\/ concrete bag yield in cubic feet (80 lb = 0.6 ft3, about 2.135 kg per litre for the metric bags)\n    var BAGS_IMP = [{ v: '50', label: '50 lb', y: 0.375 }, { v: '60', label: '60 lb', y: 0.45 }, { v: '80', label: '80 lb', y: 0.6 }];\n    var BAGS_MET = [{ v: '20', label: '20 kg', y: 9.37 \/ 28.3168 }, { v: '25', label: '25 kg', y: 11.71 \/ 28.3168 }, { v: '40', label: '40 kg', y: 18.74 \/ 28.3168 }];\n    var WOOD_POST_IN = { s: 3.5, l: 5.5 };\n    var WOOD_POST_IN_MET = { s: 3.94, l: 5.91 };\n    var GRAVEL_IN = 6;\n    \/\/ locale overrides (EU pages): typeOv, woodPostMet, chainLine\/chainTerm (in), rollFt, postStdM, railStdM, eu\n    var L = { eu: false, woodPostMet: WOOD_POST_IN_MET, chainLine: 2.375, chainTerm: 2.875, rollFt: 50, railLen: 10.5 };\n    function setLocale(loc) {\n        for (var k in loc) { if (k !== 'typeOv') L[k] = loc[k]; }\n        if (loc.typeOv) { for (var t in loc.typeOv) { for (var f in loc.typeOv[t]) TYPES[t][f] = loc.typeOv[t][f]; } }\n        if (loc.postStdM) POST_STD_M = loc.postStdM.map(function (m) { return m \/ 0.3048; });\n        if (loc.railStdM) RAIL_STD_M = loc.railStdM.map(function (m) { return m \/ 0.3048; });\n    }\n    function woodPostIn(metric, sel) { return metric ? L.woodPostMet[sel] : WOOD_POST_IN[sel]; }\n\n    function nextStd(x, arr) {\n        for (var i = 0; i < arr.length; i++) { if (arr[i] >= x - 1e-6) return arr[i]; }\n        return arr[arr.length - 1];\n    }\n    function defDepthIn(hFt) { return Math.max(24, Math.ceil(hFt * 12 \/ 3 \/ 6 - EPS) * 6); }\n    function defRails(hFt) { return hFt <= 4 + EPS ? 2 : (hFt <= 6 + EPS ? 3 : 4); }\n    function defHoleIn(type, large) {\n        if (TYPES[type].wood) return large ? 12 : 10;\n        return TYPES[type].holeD;\n    }\n    function postBuyFt(type, hFt, depthIn, metric) {\n        return nextStd(hFt + depthIn \/ 12, metric ? POST_STD_M : POST_STD[type]);\n    }\n    function railBuyFt(spacingFt, metric) { return nextStd(spacingFt, metric ? RAIL_STD_M : RAIL_STD); }\n    function r25(x) { return Math.round(x * 4) \/ 4; }\n\n    \/\/ Typical US big-box style estimates. Editable in the calculator.\n    function defaultPrices(type, hFt, o) {\n        var p = { concrete: r25(o.bagYield * 11.5), gravel: 5.5 };\n        var pf = o.postBuyFt, s = o.spacingFt;\n        if (L.eu) return euPrices(type, hFt, o);\n        if (type === 'picket') {\n            p.post = r25(pf * (o.large ? 4.2 : 2)); p.rail = r25(o.railBuyFt * 0.75); p.picket = r25(0.6 * hFt);\n            p.fasteners = 0.04; p.gate = 75;\n        } else if (type === 'wpanel') {\n            p.post = r25(pf * (o.large ? 4.2 : 2)); p.panel = r25(15 * hFt * s \/ 8); p.gate = 110;\n        } else if (type === 'vinyl') {\n            p.post = r25(pf * 5); p.panel = r25(22 * hFt * s \/ 8); p.gate = 220;\n        } else if (type === 'alum') {\n            p.post = r25(pf * 3.4); p.panel = r25(18 * hFt * s \/ 6); p.gate = 180;\n        } else {\n            p.lpost = r25(pf * 3.2); p.tpost = r25(pf * 4.5); p.rail = 15; p.fabric = r25(28 * hFt);\n            p.tbar = 6; p.tband = 1.25; p.bband = 1.5; p.cap = 1.75; p.ties = 0.12; p.gate = r25(25 * hFt);\n        }\n        return p;\n    }\n    \/\/ Typical EU store prices in EUR (heights\/lengths converted to metres)\n    function euPrices(type, hFt, o) {\n        var hM = hFt * 0.3048, sM = o.spacingFt * 0.3048, pM = o.postBuyFt * 0.3048;\n        var p = { concrete: Math.round(o.bagYield * 9.5 * 4) \/ 4, gravel: 4 };\n        if (type === 'picket') {\n            p.post = r25(pM * (o.large ? 10.5 : 5)); p.rail = r25(o.railBuyFt * 0.3048 * 1.7); p.picket = r25(1.8 * hM);\n            p.fasteners = 0.05; p.gate = 120;\n        } else if (type === 'wpanel') {\n            p.post = r25(pM * (o.large ? 10.5 : 5)); p.panel = r25(23 * hM * sM); p.gate = 140;\n        } else if (type === 'vinyl') {\n            p.post = r25(pM * 12); p.panel = r25(43 * hM * sM); p.gate = 250;\n        } else if (type === 'alum') {\n            p.post = r25(pM * 4.5); p.panel = r25(16.5 * hM * sM); p.gate = 150;\n        } else {\n            p.lpost = r25(pM * 3); p.tpost = r25(pM * 4.2); p.strut = 6; p.fabric = r25(29 * hM);\n            p.wire = 12; p.ties = 6; p.cap = 1.25; p.gate = 110;\n        }\n        return p;\n    }\n    var PRICE_KEYS = {\n        picket: ['post', 'rail', 'picket', 'fasteners', 'concrete', 'gravel', 'gate'],\n        wpanel: ['post', 'panel', 'concrete', 'gravel', 'gate'],\n        vinyl: ['post', 'panel', 'concrete', 'gravel', 'gate'],\n        alum: ['post', 'panel', 'concrete', 'gravel', 'gate'],\n        chain: ['lpost', 'tpost', 'rail', 'fabric', 'tbar', 'tband', 'bband', 'cap', 'ties', 'concrete', 'gravel', 'gate']\n    };\n    function priceKeys(type) {\n        if (L.eu) {\n            if (type === 'chain') return ['lpost', 'tpost', 'strut', 'fabric', 'wire', 'ties', 'cap', 'concrete', 'gravel', 'gate'];\n        }\n        return PRICE_KEYS[type];\n    }\n\n    \/\/ c: all lengths in feet, all small dimensions in inches.\n    function model(c) {\n        var T = TYPES[c.type];\n        var runs = c.runs.filter(function (x) { return x > 0; });\n        if (!runs.length) return { err: 'length' };\n        if (!(c.hFt > 0)) return { err: 'height' };\n        var s = c.spacingFt;\n        if (!(s > 0)) return { err: 'spacing' };\n        var gates = c.gates || 0;\n        if (gates > 0) {\n            if (!(c.gateW > 0)) return { err: 'gatew' };\n        }\n        var totalLen = 0;\n        runs.forEach(function (r) { totalLen += r; });\n        var G = gates * (c.gateW || 0);\n        if (G >= totalLen - EPS) return { err: 'gates' };\n        var netLen = totalLen - G;\n\n        \/\/ place each gate in the longest remaining side, then round every side up to whole sections\n        var rem = runs.slice();\n        for (var gi = 0; gi < gates; gi++) {\n            var mi = 0;\n            for (var ri = 1; ri < rem.length; ri++) { if (rem[ri] > rem[mi]) mi = ri; }\n            rem[mi] = Math.max(0, rem[mi] - c.gateW);\n        }\n        var sumN = 0;\n        rem.forEach(function (r) { sumN += Math.ceil(r \/ s - EPS); });\n        var sections = Math.max(1, sumN);\n        var closed = runs.length >= 3 ? !!c.closed : false;\n        var segments = sections + gates;\n        var corners = closed ? runs.length : runs.length - 1;\n        var attach = closed ? 0 : Math.min(c.attach || 0, 2);\n        var totalPosts = closed ? segments : segments + 1 - attach;\n        var endP = Math.min(closed ? 0 : 2 - attach, totalPosts);\n        var cornP = Math.min(corners, totalPosts - endP);\n        var gateP = Math.min(gates * 2, totalPosts - endP - cornP);\n        var lineP = totalPosts - endP - cornP - gateP;\n\n        var dIn = c.holeDIn, depthIn = c.depthIn;\n        var gIn = c.gravel ? GRAVEL_IN : 0;\n        var wMax = T.grp === 'chain' ? L.chainTerm : (c.postWIn || 0);\n        if (!(dIn > wMax)) return { err: 'hole' };\n        var cH = depthIn - gIn;\n        if (!(cH > 0)) return { err: 'depth' };\n        var holeArea = PI \/ 4 * dIn * dIn;\n        function perPost(w, sq) { return (holeArea - (sq ? w * w : PI \/ 4 * w * w)) * cH; }\n        var conc;\n        if (T.grp === 'chain') conc = lineP * perPost(L.chainLine, false) + (totalPosts - lineP) * perPost(L.chainTerm, false);\n        else conc = totalPosts * perPost(c.postWIn, true);\n        var concFt3 = conc \/ 1728;\n        var bags = Math.ceil(concFt3 \/ c.bagYield - EPS);\n        var gravelFt3 = c.gravel ? totalPosts * holeArea * gIn \/ 1728 : 0;\n        var gravelBags = c.gravel ? Math.ceil(gravelFt3 \/ 0.5 - EPS) : 0;\n        var postFt = c.hFt + depthIn \/ 12;\n        var buyFt = postBuyFt(c.type, c.hFt, depthIn, c.metric);\n\n        var items = [];\n        function add(key, qty, extra) {\n            var it = { key: key, qty: qty };\n            for (var k in extra) it[k] = extra[k];\n            items.push(it);\n        }\n        var waste = 1 + (c.wastePct || 0) \/ 100;\n        var info = { buyFt: buyFt, postFt: postFt };\n        if (T.grp === 'picket') {\n            var rails = Math.ceil(c.rails * sections * waste - EPS);\n            var peff = c.bob ? Math.max(1, c.pwIn - 1) : c.pwIn + c.gapIn;\n            if (!(c.pwIn > 0) || !(peff > 0)) return { err: 'picket' };\n            var picketsBase = Math.ceil(netLen * 12 \/ peff - EPS);\n            var pickets = Math.ceil(picketsBase * waste - EPS);\n            info.railBuyFt = railBuyFt(s, c.metric);\n            info.peff = peff;\n            add('post', totalPosts, {});\n            add('rail', rails, {});\n            add('picket', pickets, {});\n            add('fasteners', pickets * c.rails * 2, {});\n        } else if (T.grp === 'panel') {\n            add('post', totalPosts, {});\n            add('panel', sections, {});\n        } else if (L.eu) {\n            var struts = endP + 2 * cornP + gateP;\n            var lines = c.hFt * 0.3048 > 1.0 + EPS ? 3 : 2;\n            add('lpost', lineP, {});\n            add('tpost', totalPosts - lineP, {});\n            add('strut', struts, {});\n            add('fabric', Math.max(1, Math.ceil(netLen \/ L.rollFt - EPS)), {});\n            add('wire', Math.max(1, Math.ceil(lines * netLen * 0.3048 \/ 50 - EPS)), { lines: lines });\n            add('ties', Math.max(1, Math.ceil(netLen * 0.3048 \/ 50 - EPS)), {});\n            add('cap', totalPosts, {});\n        } else {\n            var tbars = endP + 2 * cornP + gateP;\n            var tbandEach = Math.max(2, Math.ceil(c.hFt - EPS) - 1);\n            var terminals = totalPosts - lineP;\n            add('lpost', lineP, {});\n            add('tpost', terminals, {});\n            add('rail', Math.ceil(netLen \/ 10.5 - EPS), {});\n            add('fabric', Math.max(1, Math.ceil(netLen \/ L.rollFt - EPS)), {});\n            add('tbar', tbars, {});\n            add('tband', tbars * tbandEach, {});\n            add('bband', tbars, {});\n            add('cap', totalPosts, {});\n            add('ties', Math.ceil(netLen \/ 2 - EPS) + lineP * Math.ceil(c.hFt - EPS), {});\n        }\n        add('concrete', bags, { ft3: concFt3 });\n        if (c.gravel) add('gravel', gravelBags, { ft3: gravelFt3 });\n        if (gates > 0) add('gate', gates, {});\n\n        var pr = c.prices || {};\n        var materials = 0;\n        items.forEach(function (it) {\n            it.price = Number(pr[it.key]) || 0;\n            it.cost = it.price * it.qty;\n            materials += it.cost;\n        });\n        var labor = (Number(c.laborPerFt) || 0) * totalLen;\n        var total = materials + labor;\n        return {\n            err: null, items: items, info: info,\n            totalLen: totalLen, netLen: netLen, sumN: sumN, sections: sections, segments: segments, closed: closed,\n            posts: { total: totalPosts, line: lineP, corner: cornP, end: endP, gate: gateP },\n            concFt3: concFt3, bags: bags, perPostBags: (conc \/ totalPosts \/ 1728) \/ c.bagYield,\n            materials: materials, labor: labor, total: total, perFt: total \/ totalLen\n        };\n    }\n\n    return {\n        TYPES: TYPES, PRICE_KEYS: PRICE_KEYS, priceKeys: priceKeys, setLocale: setLocale, woodPostIn: woodPostIn,\n        BAGS_IMP: BAGS_IMP, BAGS_MET: BAGS_MET, GRAVEL_IN: GRAVEL_IN,\n        defDepthIn: defDepthIn, defRails: defRails, defHoleIn: defHoleIn, postBuyFt: postBuyFt, railBuyFt: railBuyFt,\n        defaultPrices: defaultPrices, model: model, nextStd: nextStd\n    };\n})();\n\n    \/\/ T (texts) and LOC (locale settings) are defined above this code by the page builder\n    var get = function (id) { return document.getElementById(id); };\n    var M = FENCE_MODEL;\n    if (LOC.model) M.setLocale(LOC.model);\n    var FT = 0.3048, CM = 2.54;\n    var S = { metric: !!LOC.metricOnly, type: 'picket', touched: {}, pTouched: {}, pVals: {} };\n    var NB = LOC.nbsp ? '\u00a0' : ' ';\n    var PRESETS_FT = LOC.presetsM ? LOC.presetsM.map(function (m) { return m \/ FT; }) : [4, 5, 6, 8];\n\n    var t = function (key, vars) {\n        var s = T[key];\n        if (s === undefined) return key;\n        if (vars) { for (var k in vars) { s = s.split('{' + k + '}').join(vars[k]); } }\n        return s;\n    };\n    var rnd = function (n, d) { var p = Math.pow(10, d); return Math.round(n * p) \/ p; };\n    var nf = function (n, max) { return Number(n).toLocaleString(LOC.locale, { maximumFractionDigits: max === undefined ? 2 : max }); };\n    var num = function (n) { return Number(n).toLocaleString(LOC.locale); };\n    var curFmt = function (d) { return new Intl.NumberFormat(LOC.locale, { style: 'currency', currency: LOC.currency, minimumFractionDigits: d, maximumFractionDigits: d }); };\n    var money = function (n) { return curFmt(2).format(n); };\n    var money0 = function (n) { return curFmt(0).format(Math.round(n)); };\n    var val = function (id) { var v = parseFloat(get(id).value); return isNaN(v) ? NaN : v; };\n\n    \/\/ unit helpers: lengths are ft (US) or m, small dimensions are in (US) or cm\n    var toFt = function (v) { return S.metric ? v \/ FT : v; };\n    var toIn = function (v) { return S.metric ? v \/ CM : v; };\n    var roundCm5 = function (inch) { return Math.round(inch * CM \/ 5) * 5; };\n    var fLen = function (ft) { return S.metric ? nf(rnd(ft * FT, 2)) + NB + 'm' : rnd(ft, 1) + ' ft'; };\n    var fIn = function (inch) { return S.metric ? Math.round(inch * CM) + NB + 'cm' : rnd(inch, 1) + ' in'; };\n\n    var curType = function () { return M.TYPES[S.type]; };\n    var isLarge = function () { return get('fcc-postsel').value === 'l'; };\n    var postWIn = function () {\n        var T0 = curType();\n        if (T0.wood) return M.woodPostIn(S.metric, get('fcc-postsel').value);\n        return T0.postW || 0;\n    };\n    var bagList = function () { return S.metric ? M.BAGS_MET : M.BAGS_IMP; };\n    var bagYield = function () {\n        var v = get('fcc-bag').value, l = bagList();\n        for (var i = 0; i < l.length; i++) { if (l[i].v === v) return l[i].y; }\n        return l[l.length - 1].y;\n    };\n    var bagLabel = function () {\n        var v = get('fcc-bag').value, l = bagList();\n        for (var i = 0; i < l.length; i++) { if (l[i].v === v) return l[i].label; }\n        return '';\n    };\n\n    \/\/ ---------------------------------------------------------------- sides (runs)\n    var runsEl = get('fcc-runs');\n    var runRows = function () { return Array.prototype.slice.call(runsEl.querySelectorAll('.fcc-run')); };\n    var renumberRuns = function () {\n        var rows = runRows();\n        rows.forEach(function (row, i) {\n            var inp = row.querySelector('.fcc-run-in'), lab = row.querySelector('.fcc-run-label');\n            inp.id = 'fcc-run-' + (i + 1);\n            lab.htmlFor = inp.id;\n            lab.textContent = t('sideLabel', { n: i + 1, u: S.metric ? 'm' : 'ft' });\n            row.querySelector('.fcc-run-del').classList.toggle('fcc-hide', rows.length < 2);\n        });\n        var closed = get('fcc-closed');\n        closed.disabled = rows.length < 3;\n        if (rows.length < 3) closed.checked = false;\n        get('fcc-add-run').classList.toggle('fcc-hide', rows.length >= 12);\n    };\n    var addRun = function (v) {\n        var row = document.createElement('div');\n        row.className = 'fcc-run';\n        row.innerHTML = '<label class=\"fcc-run-label\"><\/label>' +\n            '<div class=\"fcc-run-ctl\"><input type=\"number\" class=\"fcc-input-field fcc-run-in\" min=\"0\" step=\"any\" placeholder=\"' + t('runPh') + '\">' +\n            '<button type=\"button\" class=\"fcc-run-del\" aria-label=\"' + t('removeAria') + '\">' + t('remove') + '<\/button><\/div>';\n        if (v !== undefined) { if (v !== null) row.querySelector('.fcc-run-in').value = v; }\n        runsEl.appendChild(row);\n        renumberRuns();\n        return row;\n    };\n    runsEl.addEventListener('click', function (e) {\n        if (!e.target.classList.contains('fcc-run-del')) return;\n        runsEl.removeChild(e.target.closest('.fcc-run'));\n        renumberRuns();\n    });\n    get('fcc-add-run').onclick = function () { addRun('').querySelector('.fcc-run-in').focus(); };\n\n    \/\/ ---------------------------------------------------------------- defaults \/ visibility\n    var heightFt = function () { var h = val('fcc-height'); return isNaN(h) ? NaN : toFt(h); };\n    var setSelectOptions = function (sel, list, keep, dflt) {\n        var cur = sel.value;\n        sel.innerHTML = '';\n        list.forEach(function (o) {\n            var op = document.createElement('option');\n            op.value = o.v; op.textContent = o.label;\n            sel.appendChild(op);\n        });\n        var has = keep ? list.some(function (o) { return o.v === cur; }) : false;\n        sel.value = has ? cur : (dflt || list[list.length - 1].v);\n    };\n    var presetLabel = function (ft) { return S.metric ? nf(rnd(ft * FT, 1), 1) + NB + 'm' : ft + ' ft'; };\n    var buildPresets = function () {\n        var box = get('fcc-height-presets');\n        box.innerHTML = '';\n        PRESETS_FT.forEach(function (ft) {\n            var b = document.createElement('button');\n            b.type = 'button'; b.className = 'fcc-preset-btn'; b.dataset.ft = String(ft);\n            box.appendChild(b);\n        });\n    };\n    var syncUnitLabels = function () {\n        Array.prototype.forEach.call(document.querySelectorAll('#fence-calc-wrapper .fcc-u-len'), function (el) { el.textContent = S.metric ? 'm' : 'ft'; });\n        Array.prototype.forEach.call(document.querySelectorAll('#fence-calc-wrapper .fcc-u-in'), function (el) { el.textContent = S.metric ? 'cm' : 'in'; });\n        Array.prototype.forEach.call(get('fcc-height-presets').children, function (b) { b.textContent = presetLabel(parseFloat(b.dataset.ft)); });\n        setSelectOptions(get('fcc-postsel'), S.metric ?\n            [{ v: 's', label: T.postS_met }, { v: 'l', label: T.postL_met }] :\n            [{ v: 's', label: T.postS_imp }, { v: 'l', label: T.postL_imp }], true);\n        setSelectOptions(get('fcc-bag'), bagList(), true, S.metric ? (LOC.bagDefM || '25') : '80');\n        if (!LOC.metricOnly) {\n            get('fcc-unit-toggle').children[0].classList.toggle('fcc-active', !S.metric);\n            get('fcc-unit-toggle').children[1].classList.toggle('fcc-active', S.metric);\n        }\n        renumberRuns();\n    };\n    var syncPresets = function () {\n        var h = heightFt();\n        Array.prototype.forEach.call(get('fcc-height-presets').children, function (b) {\n            b.classList.toggle('fcc-active', Math.abs(parseFloat(b.dataset.ft) - h) < 0.15);\n        });\n    };\n    var showGroups = function () {\n        Array.prototype.forEach.call(document.querySelectorAll('#fence-calc-wrapper [data-show]'), function (el) {\n            el.classList.toggle('fcc-hide', el.dataset.show.split(',').indexOf(S.type) < 0);\n        });\n    };\n    \/\/ values that follow the fence height \/ type until the user edits them\n    var applyAuto = function () {\n        var hFt = heightFt();\n        if (isNaN(hFt) || hFt <= 0) return;\n        if (!S.touched['fcc-depth']) { var dIn = M.defDepthIn(hFt); get('fcc-depth').value = S.metric ? roundCm5(dIn) : dIn; }\n        if (!S.touched['fcc-rails']) get('fcc-rails').value = String(M.defRails(hFt));\n        if (!S.touched['fcc-hole']) { var hIn = M.defHoleIn(S.type, isLarge()); get('fcc-hole').value = S.metric ? roundCm5(hIn) : hIn; }\n    };\n    var setTypeDefaults = function () {\n        var T0 = curType();\n        get('fcc-spacing').value = S.metric ? T0.spacingM : T0.spacing;\n        S.touched['fcc-spacing'] = false; S.touched['fcc-hole'] = false;\n        S.pTouched = {}; S.pVals = {};\n        showGroups();\n        applyAuto();\n        renderPrices();\n    };\n\n    \/\/ ---------------------------------------------------------------- prices\n    var renderPrices = function () {\n        var hFt = heightFt(), sp = toFt(val('fcc-spacing')), dIn = toIn(val('fcc-depth'));\n        if (isNaN(hFt) || hFt <= 0 || isNaN(sp) || sp <= 0 || isNaN(dIn) || dIn <= 0) return;\n        var def = M.defaultPrices(S.type, hFt, {\n            postBuyFt: M.postBuyFt(S.type, hFt, dIn, S.metric), large: isLarge(), spacingFt: sp,\n            railBuyFt: M.railBuyFt(sp, S.metric), bagYield: bagYield()\n        });\n        var box = get('fcc-prices');\n        box.innerHTML = '';\n        M.priceKeys(S.type).forEach(function (k) {\n            var v = S.pTouched[k] ? S.pVals[k] : def[k];\n            var row = document.createElement('div');\n            row.className = 'fcc-price-row';\n            row.innerHTML = '<label class=\"fcc-price-label\" for=\"fcc-p-' + k + '\">' + t('p_' + k) + '<\/label>' +\n                '<input type=\"number\" class=\"fcc-input-field fcc-price-in\" id=\"fcc-p-' + k + '\" data-key=\"' + k + '\" min=\"0\" step=\"0.01\">';\n            box.appendChild(row);\n            row.querySelector('input').value = v;\n        });\n    };\n    get('fcc-prices').addEventListener('input', function (e) {\n        var k = e.target.dataset.key;\n        if (!k) return;\n        S.pTouched[k] = true;\n        S.pVals[k] = e.target.value;\n    });\n    var readPrices = function () {\n        var o = {};\n        Array.prototype.forEach.call(get('fcc-prices').querySelectorAll('.fcc-price-in'), function (el) { o[el.dataset.key] = parseFloat(el.value) || 0; });\n        return o;\n    };\n\n    \/\/ ---------------------------------------------------------------- events\n    ['fcc-depth', 'fcc-rails', 'fcc-hole', 'fcc-spacing'].forEach(function (id) {\n        get(id).addEventListener('input', function () { S.touched[id] = true; if (id !== 'fcc-rails') renderPrices(); });\n    });\n    get('fcc-rails').addEventListener('change', function () { S.touched['fcc-rails'] = true; });\n    get('fcc-height').addEventListener('input', function () { applyAuto(); syncPresets(); renderPrices(); });\n    get('fcc-height-presets').addEventListener('click', function (e) {\n        if (!e.target.dataset.ft) return;\n        var ft = parseFloat(e.target.dataset.ft);\n        get('fcc-height').value = S.metric ? rnd(ft * FT, 1) : ft;\n        applyAuto(); syncPresets(); renderPrices();\n    });\n    get('fcc-postsel').addEventListener('change', function () { applyAuto(); renderPrices(); });\n    get('fcc-bag').addEventListener('change', renderPrices);\n    get('fcc-type').addEventListener('change', function () { S.type = get('fcc-type').value; setTypeDefaults(); hideResults(); });\n    get('fcc-layout').addEventListener('change', function () { get('fcc-gap-field').classList.toggle('fcc-hide', get('fcc-layout').value === 'bob'); });\n    get('fcc-cost').addEventListener('change', function () { get('fcc-cost-box').classList.toggle('fcc-hide', !get('fcc-cost').checked); });\n\n    if (!LOC.metricOnly) get('fcc-unit-toggle').onclick = function (e) {\n        var m = e.target.dataset.unit;\n        if (!m) return;\n        var toMetric = m === 'metric';\n        if (toMetric === S.metric) return;\n        var lenFn = toMetric ? function (v) { return rnd(v * FT, 2); } : function (v) { return rnd(v \/ FT, 1); };\n        var inFn = toMetric ? function (v) { return rnd(v * CM, 1); } : function (v) { return rnd(v \/ CM, 2); };\n        var conv = function (id, fn) { var el = get(id), v = parseFloat(el.value); if (!isNaN(v)) el.value = fn(v); };\n        \/\/ fields that still hold the starting value switch to the starting value of the other system\n        var pairs = { 'fcc-gatew': [4, 1.2], 'fcc-pw': [5.5, 14], 'fcc-gap': [0.5, 1] };\n        Object.keys(pairs).forEach(function (id) {\n            var el = get(id), v = parseFloat(el.value), p = pairs[id];\n            if (isNaN(v)) return;\n            if (Math.abs(v - p[S.metric ? 1 : 0]) < 1e-6) el.value = p[toMetric ? 1 : 0];\n            else el.value = (id === 'fcc-gatew' ? lenFn : inFn)(v);\n        });\n        var h = heightFt();\n        var hp = null;\n        PRESETS_FT.forEach(function (ft) { if (Math.abs(ft - h) < 0.15) hp = ft; });\n        if (hp !== null) get('fcc-height').value = toMetric ? rnd(hp * FT, 1) : hp;\n        else conv('fcc-height', lenFn);\n        Array.prototype.forEach.call(document.querySelectorAll('#fcc-runs .fcc-run-in'), function (el) { var v = parseFloat(el.value); if (!isNaN(v)) el.value = lenFn(v); });\n        var spTouched = S.touched['fcc-spacing'];\n        if (spTouched) conv('fcc-spacing', lenFn);\n        ['fcc-hole', 'fcc-depth'].forEach(function (id) { if (S.touched[id]) conv(id, inFn); });\n        S.metric = toMetric;\n        if (!spTouched) get('fcc-spacing').value = toMetric ? curType().spacingM : curType().spacing;\n        syncUnitLabels();\n        applyAuto();\n        syncPresets(); renderPrices(); hideResults();\n    };\n\n    \/\/ ---------------------------------------------------------------- results\n    var hideResults = function () { get('fcc-result-area').classList.remove('fcc-visible'); };\n    var showError = function (msg) {\n        var err = get('fcc-error-msg');\n        err.textContent = msg;\n        err.classList.add('fcc-visible');\n        hideResults();\n    };\n    var card = function (label, amount, sub) {\n        return '<div class=\"fcc-result-card\"><p class=\"fcc-result-label\">' + label + '<\/p><div class=\"fcc-result-amount\">' + amount + '<\/div><p class=\"fcc-result-sub\">' + sub + '<\/p><\/div>';\n    };\n\n    var readCfg = function () {\n        var runs = Array.prototype.map.call(document.querySelectorAll('#fcc-runs .fcc-run-in'), function (el) { var v = parseFloat(el.value); return isNaN(v) ? 0 : toFt(v); });\n        var labor = parseFloat(get('fcc-labor').value) || 0;\n        return {\n            type: S.type, runs: runs, closed: get('fcc-closed').checked,\n            gates: parseInt(get('fcc-gates').value, 10) || 0, gateW: toFt(val('fcc-gatew')),\n            attach: parseInt(get('fcc-attach').value, 10) || 0,\n            hFt: heightFt(), spacingFt: toFt(val('fcc-spacing')),\n            postWIn: postWIn(), holeDIn: toIn(val('fcc-hole')), depthIn: toIn(val('fcc-depth')),\n            gravel: get('fcc-gravel').checked, bagYield: bagYield(),\n            rails: parseInt(get('fcc-rails').value, 10) || 2,\n            pwIn: toIn(val('fcc-pw')), gapIn: toIn(isNaN(val('fcc-gap')) ? 0 : val('fcc-gap')), bob: get('fcc-layout').value === 'bob',\n            wastePct: parseFloat(get('fcc-waste').value) || 0, metric: S.metric,\n            laborPerFt: get('fcc-cost').checked ? (S.metric ? labor * FT : labor) : 0,\n            prices: get('fcc-cost').checked ? readPrices() : {}\n        };\n    };\n\n    var postLabel = function () {\n        var T0 = curType();\n        if (T0.wood) return S.metric ? (isLarge() ? T.postL_met : T.postS_met) : (isLarge() ? '6x6' : '4x4');\n        return t('postType_' + S.type);\n    };\n    var itemRow = function (it, r, c) {\n        var spec = '', label = '';\n        var buy = r.info.buyFt;\n        var vol = function (ft3) { return S.metric ? nf(rnd(ft3 * 28.3168, 0), 0) + NB + 'L' : rnd(ft3, 1) + ' cu ft'; };\n        if (it.key === 'post') {\n            label = t('l_post');\n            spec = t('s_post', { post: postLabel(), len: fLen(buy), depth: fIn(c.depthIn) });\n        } else if (it.key === 'lpost') { label = t('l_lpost'); spec = t('s_lpost', { len: fLen(buy), depth: fIn(c.depthIn) });\n        } else if (it.key === 'tpost') { label = t('l_tpost'); spec = t('s_tpost', { len: fLen(buy) });\n        } else if (it.key === 'rail') {\n            label = S.type === 'chain' ? t('l_toprail') : t('l_rail');\n            spec = S.type === 'chain' ? t('s_toprail') : t('s_rail', { pre: S.metric ? T.railPreMet : T.railPreImp, len: fLen(r.info.railBuyFt), n: c.rails });\n        } else if (it.key === 'picket') {\n            label = t('l_picket');\n            spec = c.bob ? t('s_bob', { w: fIn(c.pwIn) }) : t('s_picket', { w: fIn(c.pwIn), g: fIn(c.gapIn) });\n        } else if (it.key === 'fasteners') { label = t('l_fasteners'); spec = t('s_fasteners');\n        } else if (it.key === 'panel') { label = t('l_panel'); spec = t('s_panel', { w: fLen(c.spacingFt), h: fLen(c.hFt) });\n        } else if (it.key === 'fabric') { label = t('l_fabric'); spec = t('s_fabric', { h: fLen(c.hFt) });\n        } else if (it.key === 'tbar') { label = t('l_tbar'); spec = t('s_tbar');\n        } else if (it.key === 'tband') { label = t('l_tband'); spec = t('s_tband', { n: Math.max(2, Math.ceil(c.hFt - 0.001) - 1) });\n        } else if (it.key === 'bband') { label = t('l_bband'); spec = t('s_bband');\n        } else if (it.key === 'strut') { label = t('l_strut'); spec = t('s_strut');\n        } else if (it.key === 'wire') { label = t('l_wire'); spec = t('s_wire', { n: it.lines });\n        } else if (it.key === 'cap') { label = t('l_cap'); spec = t('s_cap');\n        } else if (it.key === 'ties') { label = t('l_ties'); var euChain = LOC.model ? LOC.model.eu : false; spec = S.type === 'chain' ? (euChain ? t('s_ties_eu') : t('s_ties')) : t('s_ties');\n        } else if (it.key === 'concrete') { label = t('l_concrete'); spec = t('s_concrete', { bag: bagLabel(), vol: vol(it.ft3) });\n        } else if (it.key === 'gravel') { label = t('l_gravel'); spec = t('s_gravel', { vol: vol(it.ft3) });\n        } else if (it.key === 'gate') { label = t('l_gate'); spec = t('s_gate', { w: fLen(c.gateW) }); }\n        return { label: label, spec: spec };\n    };\n\n    var calc = function () {\n        var err = get('fcc-error-msg');\n        err.classList.remove('fcc-visible');\n        err.textContent = '';\n        var c = readCfg();\n        var r = M.model(c);\n        if (r.err) { showError(t('err_' + r.err)); return; }\n        var cost = get('fcc-cost').checked;\n\n        \/\/ cost \/ summary cards\n        var grid = get('fcc-result-grid');\n        var unitLen = S.metric ? 'm' : 'ft';\n        var totalDisp = S.metric ? rnd(r.totalLen * FT, 1) : rnd(r.totalLen, 1);\n        var forLen = t('forLen', { n: nf(totalDisp, 1), u: unitLen });\n        if (cost) {\n            var perDisp = S.metric ? r.perFt \/ FT : r.perFt;\n            var subCost = c.laborPerFt > 0 ? t('matLabor', { a: money0(r.materials), b: money0(r.labor) }) : t('matOnly');\n            grid.innerHTML = card(t('estCost'), '<span>' + money0(r.total) + '<\/span>', subCost) +\n                card(S.metric ? t('costPerM') : t('costPerFt'), '<span>' + money(perDisp) + '<\/span>', forLen);\n        } else {\n            grid.innerHTML = card(t('cardPosts'), '<span>' + num(r.posts.total) + '<\/span>', forLen) +\n                card(S.type === 'picket' || S.type === 'chain' ? t('cardSections') : t('cardPanels'), '<span>' + num(r.sections) + '<\/span>', t('cardBetween'));\n        }\n\n        \/\/ post breakdown\n        var pb = [];\n        if (r.posts.line) pb.push(t('pLine', { n: r.posts.line }));\n        if (r.posts.corner) pb.push(t('pCorner', { n: r.posts.corner }));\n        if (r.posts.end) pb.push(t('pEnd', { n: r.posts.end }));\n        if (r.posts.gate) pb.push(t('pGate', { n: r.posts.gate }));\n        var gtxt = c.gates ? t(c.gates > 1 ? 'gatesMany' : 'gatesOne', { n: c.gates }) : '';\n        get('fcc-postline').textContent = t('postLine', { total: num(r.posts.total), parts: pb.join(', '), sections: num(r.sections), gates: gtxt });\n\n        \/\/ shopping list\n        var head = '<tr><th>' + t('thItem') + '<\/th><th>' + t('thQty') + '<\/th><th>' + t('thDetails') + '<\/th>' + (cost ? '<th>' + t('thEach') + '<\/th><th>' + t('thCost') + '<\/th>' : '') + '<\/tr>';\n        var body = r.items.map(function (it) {\n            var d = itemRow(it, r, c);\n            return '<tr><td><strong>' + d.label + '<\/strong><\/td><td class=\"fcc-qty\">' + num(it.qty) + '<\/td><td class=\"fcc-spec\">' + d.spec + '<\/td>' +\n                (cost ? '<td class=\"fcc-price\">' + money(it.price) + '<\/td><td class=\"fcc-price\">' + money(it.cost) + '<\/td>' : '') + '<\/tr>';\n        }).join('');\n        var foot = '';\n        if (cost) {\n            var span = 4;\n            foot = '<tr class=\"fcc-total-row\"><td colspan=\"' + span + '\">' + t('matSub') + '<\/td><td class=\"fcc-price\">' + money(r.materials) + '<\/td><\/tr>';\n            if (r.labor > 0) foot += '<tr class=\"fcc-total-row\"><td colspan=\"' + span + '\">' + t('labor') + '<\/td><td class=\"fcc-price\">' + money(r.labor) + '<\/td><\/tr>' +\n                '<tr class=\"fcc-total-row\"><td colspan=\"' + span + '\">' + t('total') + '<\/td><td class=\"fcc-price\">' + money(r.total) + '<\/td><\/tr>';\n        }\n        get('fcc-list').innerHTML = '<table class=\"fcc-table\"><thead>' + head + '<\/thead><tbody>' + body + foot + '<\/tbody><\/table>';\n\n        \/\/ notes and warnings\n        var w = [];\n        var hM = c.hFt * FT;\n        if (S.type === 'picket') { if (c.wastePct > 0) w.push(t('w_waste', { n: c.wastePct })); }\n        if (c.hFt > LOC.tallFt + 0.01) w.push(t('w_tall'));\n        if (S.type === 'picket') { if (c.spacingFt > LOC.maxSpacingFt + 0.01) w.push(t('w_spacing')); }\n        if (c.gates > 0) { if (c.gateW > LOC.wideGateFt + 0.01) w.push(t('w_gate')); }\n        if (c.attach > 0) w.push(t(c.attach > 1 ? 'w_attach2' : 'w_attach1'));\n        var shallow = c.depthIn < 23.5;\n        if (shallow) shallow = c.hFt >= 4;\n        if (shallow) w.push(t('w_shallow'));\n        if (get('fcc-pool').checked) {\n            var pool = t('w_pool');\n            var low = LOC.poolMinM ? hM < LOC.poolMinM - 0.005 : false;\n            if (low) pool = t('w_poolLow', { h: nf(LOC.poolMinM, 2) }) + ' ' + pool;\n            var wideGap = S.type === 'picket' ? !c.bob : false;\n            if (wideGap) wideGap = c.gapIn * CM >= LOC.poolGapCm - 0.05;\n            if (wideGap) pool = t('w_poolGap') + ' ' + pool;\n            w.push(pool);\n        }\n        var wb = get('fcc-warn');\n        wb.innerHTML = w.map(function (m) { return '<span>' + m + '<\/span>'; }).join('');\n        wb.classList.toggle('fcc-visible', w.length > 0);\n\n        get('fcc-algebra').textContent = t('algebra', {\n            sp: fLen(c.spacingFt), gates: c.gates ? t('alg_gates') : '', sections: r.sections, segments: r.segments,\n            loop: r.closed ? t('alg_loop') : '+ 1', wall: c.attach ? t(c.attach > 1 ? 'alg_wall2' : 'alg_wall1', { n: c.attach }) : '', posts: r.posts.total\n        });\n\n        get('fcc-result-area').classList.add('fcc-visible');\n        get('fcc-result-area').scrollIntoView({ behavior: 'smooth', block: 'nearest' });\n    };\n\n    \/\/ ---------------------------------------------------------------- reset\n    var resetAll = function () {\n        S.metric = !!LOC.metricOnly; S.type = 'picket'; S.touched = {}; S.pTouched = {}; S.pVals = {};\n        get('fcc-type').value = 'picket';\n        runsEl.innerHTML = '';\n        addRun(S.metric ? (LOC.runDefM || 30) : 100);\n        get('fcc-closed').checked = false;\n        get('fcc-gates').value = '0';\n        get('fcc-gatew').value = S.metric ? (LOC.gateWM || 1.2) : '4';\n        get('fcc-attach').value = '0';\n        get('fcc-height').value = S.metric ? (LOC.hDefM || 1.8) : '6';\n        get('fcc-layout').value = 'spaced';\n        get('fcc-pw').value = S.metric ? '14' : '5.5';\n        get('fcc-gap').value = S.metric ? '1' : '0.5';\n        get('fcc-gap-field').classList.remove('fcc-hide');\n        get('fcc-gravel').checked = true;\n        get('fcc-waste').value = '10';\n        get('fcc-pool').checked = false;\n        get('fcc-cost').checked = true;\n        get('fcc-cost-box').classList.remove('fcc-hide');\n        get('fcc-labor').value = '';\n        get('fcc-postsel').innerHTML = '';\n        get('fcc-bag').innerHTML = '';\n        syncUnitLabels();\n        get('fcc-postsel').value = 's';\n        setTypeDefaults();\n        syncPresets();\n        var err = get('fcc-error-msg');\n        err.classList.remove('fcc-visible');\n        err.textContent = '';\n        get('fcc-warn').classList.remove('fcc-visible');\n        hideResults();\n    };\n\n    get('fcc-calculate-btn').onclick = calc;\n    get('fcc-reset-btn').onclick = function () { resetAll(); var f = get('fcc-run-1'); if (f) f.focus(); };\n    buildPresets();\n    resetAll();\n\n})();<\/script>\n\n\n\n<style>\n  #fence-reference-table { max-width: 860px; margin: 2.5rem auto; font-family: 'Inter', system-ui, sans-serif; color: #2c3e50; scroll-margin-top: 80px; }\n  #fence-reference-table h2 { font-size: 1.5rem; font-weight: 700; color: #17a8b0; margin: 0 0 8px; }\n  #fence-reference-table h3 { font-size: 1.1rem; font-weight: 700; color: #5b4ab8; margin: 28px 0 6px; }\n  #fence-reference-table .fct-subtitle { font-size: 0.9rem; color: #5a6c7d; margin: 0 0 16px; line-height: 1.5; }\n  #fence-reference-table .fct-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid #e0e5eb; border-radius: 14px; box-shadow: 0 4px 16px rgba(0,0,0,0.04); }\n  #fence-reference-table .fct-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; min-width: 520px; }\n  #fence-reference-table .fct-table thead th { background: linear-gradient(135deg, #1ecad3, #9486f7); color: #fff; font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; padding: 12px 10px; text-align: center; white-space: nowrap; }\n  #fence-reference-table .fct-table thead th:first-child { border-radius: 13px 0 0 0; text-align: left; }\n  #fence-reference-table .fct-table thead th:last-child { border-radius: 0 13px 0 0; }\n  #fence-reference-table .fct-table tbody td { padding: 10px; border-bottom: 1px solid #eef1f5; vertical-align: middle; text-align: center; }\n  #fence-reference-table .fct-table tbody tr:nth-child(even) { background: #fafcfd; }\n  #fence-reference-table .fct-table tbody tr:hover { background: #e8fafb; }\n  #fence-reference-table .fct-vol { font-weight: 600; color: #2c3e50; white-space: nowrap; text-align: left; }\n  #fence-reference-table .fct-num { font-weight: 700; color: #0f8c94; white-space: nowrap; }\n  #fence-reference-table .fct-acid { font-weight: 600; color: #5b4ab8; white-space: nowrap; }\n  #fence-reference-table .fct-note { margin-top: 12px; font-size: 0.8rem; color: #8899a6; line-height: 1.5; }\n  @media (max-width: 500px) {\n    #fence-reference-table { padding: 0 6px; }\n    #fence-reference-table .fct-table { font-size: 0.78rem; min-width: 460px; }\n    #fence-reference-table .fct-table thead th { padding: 8px 6px; font-size: 0.65rem; }\n    #fence-reference-table .fct-table tbody td { padding: 7px 6px; }\n  }\n<\/style>\n<div id=\"fence-reference-table\">\n  <h2>Tabla de materiales de cerca: postes, listones y hormig\u00f3n seg\u00fan la longitud<\/h2>\n  <p class=\"fct-subtitle\">Busque la longitud de su cerca y vea las cantidades. Todas las tablas siguen las mismas reglas que la calculadora de arriba, para una cerca recta con un poste en cada extremo, sin puertas y sin margen por desperdicio. Para esquinas, puertas o medidas propias, use la calculadora.<\/p>\n\n  <h3>Cu\u00e1ntos postes, travesa\u00f1os y listones para una cerca, seg\u00fan la longitud (cerca de madera de 1,80 m con privacidad)<\/h3>\n  <div class=\"fct-table-wrap\">\n    <table class=\"fct-table\">\n      <thead><tr><th>Longitud<\/th><th>Tramos<\/th><th>Postes<\/th><th>Travesa\u00f1os (2,5 m)<\/th><th>Listones (14 cm)<\/th><th>Hormig\u00f3n (sacos de 25 kg)<\/th><\/tr><\/thead>\n      <tbody>\n        <tr><td class=\"fct-vol\">5\u00a0m<\/td><td class=\"fct-num\">2<\/td><td class=\"fct-num\">3<\/td><td class=\"fct-num\">6<\/td><td class=\"fct-num\">34<\/td><td class=\"fct-acid\">5<\/td><\/tr><tr><td class=\"fct-vol\">10\u00a0m<\/td><td class=\"fct-num\">4<\/td><td class=\"fct-num\">5<\/td><td class=\"fct-num\">12<\/td><td class=\"fct-num\">67<\/td><td class=\"fct-acid\">8<\/td><\/tr><tr><td class=\"fct-vol\">15\u00a0m<\/td><td class=\"fct-num\">6<\/td><td class=\"fct-num\">7<\/td><td class=\"fct-num\">18<\/td><td class=\"fct-num\">100<\/td><td class=\"fct-acid\">11<\/td><\/tr><tr><td class=\"fct-vol\">20\u00a0m<\/td><td class=\"fct-num\">8<\/td><td class=\"fct-num\">9<\/td><td class=\"fct-num\">24<\/td><td class=\"fct-num\">134<\/td><td class=\"fct-acid\">15<\/td><\/tr><tr><td class=\"fct-vol\">25\u00a0m<\/td><td class=\"fct-num\">10<\/td><td class=\"fct-num\">11<\/td><td class=\"fct-num\">30<\/td><td class=\"fct-num\">167<\/td><td class=\"fct-acid\">18<\/td><\/tr><tr><td class=\"fct-vol\">30\u00a0m<\/td><td class=\"fct-num\">12<\/td><td class=\"fct-num\">13<\/td><td class=\"fct-num\">36<\/td><td class=\"fct-num\">200<\/td><td class=\"fct-acid\">21<\/td><\/tr><tr><td class=\"fct-vol\">40\u00a0m<\/td><td class=\"fct-num\">16<\/td><td class=\"fct-num\">17<\/td><td class=\"fct-num\">48<\/td><td class=\"fct-num\">267<\/td><td class=\"fct-acid\">27<\/td><\/tr><tr><td class=\"fct-vol\">50\u00a0m<\/td><td class=\"fct-num\">20<\/td><td class=\"fct-num\">21<\/td><td class=\"fct-num\">60<\/td><td class=\"fct-num\">334<\/td><td class=\"fct-acid\">33<\/td><\/tr><tr><td class=\"fct-vol\">75\u00a0m<\/td><td class=\"fct-num\">30<\/td><td class=\"fct-num\">31<\/td><td class=\"fct-num\">90<\/td><td class=\"fct-num\">500<\/td><td class=\"fct-acid\">49<\/td><\/tr><tr><td class=\"fct-vol\">100\u00a0m<\/td><td class=\"fct-num\">40<\/td><td class=\"fct-num\">41<\/td><td class=\"fct-num\">120<\/td><td class=\"fct-num\">667<\/td><td class=\"fct-acid\">65<\/td><\/tr>\n      <\/tbody>\n    <\/table>\n  <\/div>\n  <p class=\"fct-note\">Calculado con 2,5 m entre postes, 3 travesa\u00f1os por tramo, postes de 9 \u00d7 9 cm, listones de 14 cm con 1 cm de separaci\u00f3n y un agujero de 25 cm de di\u00e1metro y 60 cm de profundidad con 15 cm de base de grava. A\u00f1ada alrededor de un 10 % a listones y travesa\u00f1os por los cortes.<\/p>\n\n  <h3>Cu\u00e1ntos postes necesita una longitud de cerca, seg\u00fan la separaci\u00f3n<\/h3>\n  <div class=\"fct-table-wrap\">\n    <table class=\"fct-table\">\n      <thead><tr><th>Longitud<\/th><th>Separaci\u00f3n 1,8 m<\/th><th>Separaci\u00f3n 2,0 m<\/th><th>Separaci\u00f3n 2,4 m<\/th><th>Separaci\u00f3n 2,5 m<\/th><th>Separaci\u00f3n 3,0 m<\/th><\/tr><\/thead>\n      <tbody>\n        <tr><td class=\"fct-vol\">5\u00a0m<\/td><td class=\"fct-num\">4<\/td><td class=\"fct-num\">4<\/td><td class=\"fct-num\">4<\/td><td class=\"fct-num\">3<\/td><td class=\"fct-num\">3<\/td><\/tr><tr><td class=\"fct-vol\">10\u00a0m<\/td><td class=\"fct-num\">7<\/td><td class=\"fct-num\">6<\/td><td class=\"fct-num\">6<\/td><td class=\"fct-num\">5<\/td><td class=\"fct-num\">5<\/td><\/tr><tr><td class=\"fct-vol\">15\u00a0m<\/td><td class=\"fct-num\">10<\/td><td class=\"fct-num\">9<\/td><td class=\"fct-num\">8<\/td><td class=\"fct-num\">7<\/td><td class=\"fct-num\">6<\/td><\/tr><tr><td class=\"fct-vol\">20\u00a0m<\/td><td class=\"fct-num\">13<\/td><td class=\"fct-num\">11<\/td><td class=\"fct-num\">10<\/td><td class=\"fct-num\">9<\/td><td class=\"fct-num\">8<\/td><\/tr><tr><td class=\"fct-vol\">25\u00a0m<\/td><td class=\"fct-num\">15<\/td><td class=\"fct-num\">14<\/td><td class=\"fct-num\">12<\/td><td class=\"fct-num\">11<\/td><td class=\"fct-num\">10<\/td><\/tr><tr><td class=\"fct-vol\">30\u00a0m<\/td><td class=\"fct-num\">18<\/td><td class=\"fct-num\">16<\/td><td class=\"fct-num\">14<\/td><td class=\"fct-num\">13<\/td><td class=\"fct-num\">11<\/td><\/tr><tr><td class=\"fct-vol\">40\u00a0m<\/td><td class=\"fct-num\">24<\/td><td class=\"fct-num\">21<\/td><td class=\"fct-num\">18<\/td><td class=\"fct-num\">17<\/td><td class=\"fct-num\">15<\/td><\/tr><tr><td class=\"fct-vol\">50\u00a0m<\/td><td class=\"fct-num\">29<\/td><td class=\"fct-num\">26<\/td><td class=\"fct-num\">22<\/td><td class=\"fct-num\">21<\/td><td class=\"fct-num\">18<\/td><\/tr><tr><td class=\"fct-vol\">75\u00a0m<\/td><td class=\"fct-num\">43<\/td><td class=\"fct-num\">39<\/td><td class=\"fct-num\">33<\/td><td class=\"fct-num\">31<\/td><td class=\"fct-num\">26<\/td><\/tr><tr><td class=\"fct-vol\">100\u00a0m<\/td><td class=\"fct-num\">57<\/td><td class=\"fct-num\">51<\/td><td class=\"fct-num\">43<\/td><td class=\"fct-num\">41<\/td><td class=\"fct-num\">35<\/td><\/tr><tr><td class=\"fct-vol\">150\u00a0m<\/td><td class=\"fct-num\">85<\/td><td class=\"fct-num\">76<\/td><td class=\"fct-num\">64<\/td><td class=\"fct-num\">61<\/td><td class=\"fct-num\">51<\/td><\/tr><tr><td class=\"fct-vol\">200\u00a0m<\/td><td class=\"fct-num\">113<\/td><td class=\"fct-num\">101<\/td><td class=\"fct-num\">85<\/td><td class=\"fct-num\">81<\/td><td class=\"fct-num\">68<\/td><\/tr>\n      <\/tbody>\n    <\/table>\n  <\/div>\n  <p class=\"fct-note\">Postes = longitud de la cerca dividida por la separaci\u00f3n, redondeada hacia arriba, m\u00e1s uno. Las cercas de listones de madera suelen llevar 2 a 2,5 m entre postes, los paneles de madera y PVC suelen medir 1,8 m de ancho, los paneles r\u00edgidos 2,5 m, y los postes intermedios de una malla se colocan m\u00e1s o menos cada 2,5 m.<\/p>\n\n  <h3>Cu\u00e1nto hormig\u00f3n por poste: sacos seg\u00fan el tama\u00f1o del agujero<\/h3>\n  <div class=\"fct-table-wrap\">\n    <table class=\"fct-table\">\n      <thead><tr><th>Poste<\/th><th>Agujero (di\u00e1metro \u00d7 profundidad)<\/th><th>Hormig\u00f3n (litros)<\/th><th>Sacos de 20 kg<\/th><th>Sacos de 25 kg<\/th><th>Sacos de 40 kg<\/th><\/tr><\/thead>\n      <tbody>\n        <tr><td class=\"fct-vol\">9 \u00d7 9 cm<\/td><td class=\"fct-num\">20 \u00d7 60\u00a0cm<\/td><td class=\"fct-num\">10<\/td><td class=\"fct-acid\">1,1<\/td><td class=\"fct-acid\">0,9<\/td><td class=\"fct-acid\">0,6<\/td><\/tr><tr><td class=\"fct-vol\">9 \u00d7 9 cm<\/td><td class=\"fct-num\">25 \u00d7 60\u00a0cm<\/td><td class=\"fct-num\">18<\/td><td class=\"fct-acid\">2,0<\/td><td class=\"fct-acid\">1,6<\/td><td class=\"fct-acid\">1,0<\/td><\/tr><tr><td class=\"fct-vol\">9 \u00d7 9 cm<\/td><td class=\"fct-num\">25 \u00d7 80\u00a0cm<\/td><td class=\"fct-num\">27<\/td><td class=\"fct-acid\">2,8<\/td><td class=\"fct-acid\">2,3<\/td><td class=\"fct-acid\">1,4<\/td><\/tr><tr><td class=\"fct-vol\">9 \u00d7 9 cm<\/td><td class=\"fct-num\">30 \u00d7 80\u00a0cm<\/td><td class=\"fct-num\">41<\/td><td class=\"fct-acid\">4,3<\/td><td class=\"fct-acid\">3,5<\/td><td class=\"fct-acid\">2,2<\/td><\/tr><tr><td class=\"fct-vol\">12 \u00d7 12 cm<\/td><td class=\"fct-num\">30 \u00d7 80\u00a0cm<\/td><td class=\"fct-num\">36<\/td><td class=\"fct-acid\">3,9<\/td><td class=\"fct-acid\">3,1<\/td><td class=\"fct-acid\">1,9<\/td><\/tr><tr><td class=\"fct-vol\">12 \u00d7 12 cm<\/td><td class=\"fct-num\">30 \u00d7 100\u00a0cm<\/td><td class=\"fct-num\">48<\/td><td class=\"fct-acid\">5,1<\/td><td class=\"fct-acid\">4,1<\/td><td class=\"fct-acid\">2,5<\/td><\/tr><tr><td class=\"fct-vol\">12 \u00d7 12 cm<\/td><td class=\"fct-num\">35 \u00d7 100\u00a0cm<\/td><td class=\"fct-num\">69<\/td><td class=\"fct-acid\">7,4<\/td><td class=\"fct-acid\">5,9<\/td><td class=\"fct-acid\">3,7<\/td><\/tr>\n      <\/tbody>\n    <\/table>\n  <\/div>\n  <p class=\"fct-note\">Sacos por poste para un agujero, descontando el volumen del poste y con 15 cm de grava debajo. Un saco de 25 kg rinde unos 12 litros de hormig\u00f3n (concreto). Redondee hacia arriba el total para toda la cerca. Sin base de grava, un poste de 9 \u00d7 9 cm en un agujero de 25 \u00d7 60 cm necesita unos 2,1 sacos de 25 kg.<\/p>\n\n  <h3>Qu\u00e9 profundidad y qu\u00e9 longitud deben tener los postes, seg\u00fan la altura de la cerca<\/h3>\n  <div class=\"fct-table-wrap\">\n    <table class=\"fct-table\">\n      <thead><tr><th>Altura de la cerca<\/th><th>Profundidad del agujero<\/th><th>Longitud de poste necesaria<\/th><th>Poste est\u00e1ndar a comprar<\/th><th>Travesa\u00f1os por tramo<\/th><\/tr><\/thead>\n      <tbody>\n        <tr><td class=\"fct-vol\">1,0\u00a0m<\/td><td class=\"fct-num\">60\u00a0cm<\/td><td class=\"fct-num\">1,60\u00a0m<\/td><td class=\"fct-num\">1,8\u00a0m<\/td><td class=\"fct-acid\">2<\/td><\/tr><tr><td class=\"fct-vol\">1,2\u00a0m<\/td><td class=\"fct-num\">60\u00a0cm<\/td><td class=\"fct-num\">1,80\u00a0m<\/td><td class=\"fct-num\">1,8\u00a0m<\/td><td class=\"fct-acid\">2<\/td><\/tr><tr><td class=\"fct-vol\">1,5\u00a0m<\/td><td class=\"fct-num\">60\u00a0cm<\/td><td class=\"fct-num\">2,10\u00a0m<\/td><td class=\"fct-num\">2,1\u00a0m<\/td><td class=\"fct-acid\">3<\/td><\/tr><tr><td class=\"fct-vol\">1,8\u00a0m<\/td><td class=\"fct-num\">60\u00a0cm<\/td><td class=\"fct-num\">2,40\u00a0m<\/td><td class=\"fct-num\">2,4\u00a0m<\/td><td class=\"fct-acid\">3<\/td><\/tr><tr><td class=\"fct-vol\">2,0\u00a0m<\/td><td class=\"fct-num\">75\u00a0cm<\/td><td class=\"fct-num\">2,75\u00a0m<\/td><td class=\"fct-num\">3,0\u00a0m<\/td><td class=\"fct-acid\">4<\/td><\/tr>\n      <\/tbody>\n    <\/table>\n  <\/div>\n  <p class=\"fct-note\">La profundidad es un tercio de la altura de la cerca, nunca menos de 60 cm. La longitud del poste es la altura de la cerca m\u00e1s la profundidad del agujero. En zonas fr\u00edas, ponga la profundidad por debajo de la l\u00ednea de helada.<\/p>\n\n  <h3>Coste de una cerca seg\u00fan la longitud y el tipo (solo materiales, 1,80 m de alto)<\/h3>\n  <div class=\"fct-table-wrap\">\n    <table class=\"fct-table\">\n      <thead><tr><th>Longitud<\/th><th>Listones de madera<\/th><th>Paneles de madera<\/th><th>PVC<\/th><th>Panel r\u00edgido<\/th><th>Malla<\/th><\/tr><\/thead>\n      <tbody>\n        <tr><td class=\"fct-vol\">10\u00a0m<\/td><td class=\"fct-num\">393\u00a0\u20ac<\/td><td class=\"fct-num\">591\u00a0\u20ac<\/td><td class=\"fct-num\">1.097\u00a0\u20ac<\/td><td class=\"fct-num\">383\u00a0\u20ac<\/td><td class=\"fct-num\">162\u00a0\u20ac<\/td><\/tr><tr><td class=\"fct-vol\">20\u00a0m<\/td><td class=\"fct-num\">766\u00a0\u20ac<\/td><td class=\"fct-num\">1.162\u00a0\u20ac<\/td><td class=\"fct-num\">2.153\u00a0\u20ac<\/td><td class=\"fct-num\">747\u00a0\u20ac<\/td><td class=\"fct-num\">236\u00a0\u20ac<\/td><\/tr><tr><td class=\"fct-vol\">30\u00a0m<\/td><td class=\"fct-num\">1.131\u00a0\u20ac<\/td><td class=\"fct-num\">1.639\u00a0\u20ac<\/td><td class=\"fct-num\">3.033\u00a0\u20ac<\/td><td class=\"fct-num\">1.107\u00a0\u20ac<\/td><td class=\"fct-num\">343\u00a0\u20ac<\/td><\/tr><tr><td class=\"fct-vol\">50\u00a0m<\/td><td class=\"fct-num\">1.873\u00a0\u20ac<\/td><td class=\"fct-num\">2.682\u00a0\u20ac<\/td><td class=\"fct-num\">4.973\u00a0\u20ac<\/td><td class=\"fct-num\">1.835\u00a0\u20ac<\/td><td class=\"fct-num\">475\u00a0\u20ac<\/td><\/tr><tr><td class=\"fct-vol\">75\u00a0m<\/td><td class=\"fct-num\">2.794\u00a0\u20ac<\/td><td class=\"fct-num\">4.009\u00a0\u20ac<\/td><td class=\"fct-num\">7.437\u00a0\u20ac<\/td><td class=\"fct-num\">2.737\u00a0\u20ac<\/td><td class=\"fct-num\">698\u00a0\u20ac<\/td><\/tr><tr><td class=\"fct-vol\">100\u00a0m<\/td><td class=\"fct-num\">3.718\u00a0\u20ac<\/td><td class=\"fct-num\">5.340\u00a0\u20ac<\/td><td class=\"fct-num\">9.905\u00a0\u20ac<\/td><td class=\"fct-num\">3.643\u00a0\u20ac<\/td><td class=\"fct-num\">907\u00a0\u20ac<\/td><\/tr>\n      <\/tbody>\n    <\/table>\n  <\/div>\n  <p class=\"fct-note\">Solo materiales, para una cerca recta sin puertas, con los precios por defecto de la calculadora (precios t\u00edpicos de tienda en euros, que var\u00edan seg\u00fan la regi\u00f3n y la \u00e9poca). No incluye la mano de obra. Introduzca sus propios precios en la calculadora para una estimaci\u00f3n local.<\/p>\n<\/div>\n\n\n\n<h2 class=\"wp-block-heading\">C\u00f3mo cuenta los materiales esta calculadora de cercas<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Tramos.<\/strong> Cada lado de la cerca se divide por la separaci\u00f3n entre postes y se redondea hacia arriba a tramos enteros. Un lado de 10 m con 2,5 m de separaci\u00f3n da exactamente 4 tramos, y uno de 10,5 m da 5. Los huecos de las puertas se restan primero de los lados m\u00e1s largos.<\/li><li><strong>Postes.<\/strong> Una cerca que no cierra un circuito necesita un poste m\u00e1s que tramos. Un circuito cerrado necesita exactamente un poste por tramo. Cada puerta a\u00f1ade dos postes de puerta, y un extremo fijado a un muro no necesita poste.<\/li><li><strong>Longitud y profundidad de los postes.<\/strong> La profundidad del agujero es alrededor de un tercio de la altura, nunca menos de 60 cm. La longitud del poste es la altura m\u00e1s esa profundidad, redondeada a la siguiente longitud est\u00e1ndar.<\/li><li><strong>Listones y travesa\u00f1os.<\/strong> Los listones son la longitud de la cerca menos las puertas, dividida por el ancho del list\u00f3n m\u00e1s la separaci\u00f3n, redondeada hacia arriba. Los travesa\u00f1os son los travesa\u00f1os por tramo por el n\u00famero de tramos.<\/li><li><strong>Hormig\u00f3n.<\/strong> Cada agujero es un cilindro al que se le resta el volumen del poste. Una base de grava ocupa los 15 cm del fondo y el hormig\u00f3n llena el resto. Los sacos se redondean hacia arriba para toda la cerca.<\/li><li><strong>Coste.<\/strong> Cada cantidad se multiplica por el precio del editor de precios, y se suma la mano de obra por metro si la introduce.<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Preguntas frecuentes sobre la calculadora de cercas<\/h2>\n\n\n\n<div class=\"schema-faq wp-block-yoast-faq-block\"><div class=\"schema-faq-section\" id=\"faq-question-1790200000000\"><strong class=\"schema-faq-question\">\u00bfC\u00f3mo cambian las esquinas y la forma de la cerca el n\u00famero de postes?<\/strong> <p class=\"schema-faq-answer\">La forma importa porque cada lado se redondea por separado a tramos enteros. Una cerca recta de 24 m con 2,5 m entre postes necesita 11 postes, pero esos mismos 24 m como un cuadrado cerrado de 6 m por 6 m necesitan 12. Introduzca cada lado por separado en la calculadora y marque el circuito cerrado si la cerca vuelve al punto de partida.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1790200017311\"><strong class=\"schema-faq-question\">\u00bfHay que poner hormig\u00f3n en todos los postes de la cerca?<\/strong> <p class=\"schema-faq-answer\">Los postes de esquina, de extremo y de puerta deben ir siempre con hormig\u00f3n, porque soportan la tensi\u00f3n de la cerca o el peso de la puerta. Los postes intermedios pueden ir en grava bien compactada si el suelo es firme y drena bien. El hormig\u00f3n es m\u00e1s seguro en suelo arenoso o blando, en cercas altas y opacas que reciben mucho viento, y en postes de cercas de PVC o de malla. La calculadora cuenta todos los postes con hormig\u00f3n, as\u00ed que da la cantidad m\u00e1s alta.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1790200034622\"><strong class=\"schema-faq-question\">\u00bfQu\u00e9 profundidad deben tener los postes en zonas fr\u00edas?<\/strong> <p class=\"schema-faq-answer\">Col\u00f3quelos por debajo de la l\u00ednea de helada de su zona. El suelo que se congela y agarra un poste poco profundo lo levanta un poco cada invierno. Introduzca la profundidad de helada de su zona en el campo de profundidad del agujero y mantenga los 15 cm de grava para que el agua se aleje del pie del poste. Su ayuntamiento puede indicarle esa profundidad.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1790200051933\"><strong class=\"schema-faq-question\">\u00bfCu\u00e1nto cuesta una cerca por metro?<\/strong> <p class=\"schema-faq-answer\">La calculadora muestra los materiales a los precios del editor de precios: introduzca lo que cobra su tienda por los postes, los listones o paneles y el hormig\u00f3n, y a\u00f1ada una tarifa de instalaci\u00f3n por metro si tiene un presupuesto. El presupuesto de un profesional puede incluir tambi\u00e9n permisos, retirada de una cerca vieja, transporte de residuos y el trabajo extra en terrenos inclinados o pedregosos, algo que esta estimaci\u00f3n no cubre.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1790200069244\"><strong class=\"schema-faq-question\">\u00bfC\u00f3mo calculo la separaci\u00f3n entre los listones de una cerca?<\/strong> <p class=\"schema-faq-answer\">Para separaciones uniformes, divida el espacio libre entre dos postes menos el ancho de todos los listones por el n\u00famero de listones m\u00e1s uno. Ejemplo: 240 cm de espacio libre y 20 listones de 9 cm da (240 \u2212 180) \u00f7 21, es decir, unos 2,9 cm de separaci\u00f3n. En una cerca con privacidad deje de 0,5 a 1 cm, porque la madera se contrae al secarse. Elija doble capa solapada en la calculadora si los listones deben cubrir las juntas: cuenta 2,5 cm de solape.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1790200086555\"><strong class=\"schema-faq-question\">\u00bfC\u00f3mo se hace una cerca en un terreno en pendiente?<\/strong> <p class=\"schema-faq-answer\">Mida cada lado a lo largo del suelo con una cinta m\u00e9trica, no en horizontal. Despu\u00e9s hay dos m\u00e9todos. Siguiendo la pendiente, los tramos acompa\u00f1an el terreno, y en escalones cada tramo queda horizontal y se forma una cu\u00f1a bajo el lado alto. En una pendiente fuerte, elija un 15 % de margen y compre postes una longitud m\u00e1s largos para el extremo bajo, porque all\u00ed crece el hueco con el suelo.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1790200103866\"><strong class=\"schema-faq-question\">\u00bfQu\u00e9 diferencia hay entre postes intermedios, de esquina, de extremo y de puerta?<\/strong> <p class=\"schema-faq-answer\">Los postes intermedios sostienen la cerca entre otros postes. Los de esquina y extremo soportan la tensi\u00f3n de la cerca de un lado, por eso necesitan la cimentaci\u00f3n m\u00e1s profunda, y en la malla son postes m\u00e1s fuertes con riostras. Los postes de puerta soportan el peso y el giro de la puerta. Para una puerta de m\u00e1s de 1,2 m de ancho, use un poste de 12 \u00d7 12 cm o de acero y col\u00f3quelo con m\u00e1s hormig\u00f3n para que no ceda.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1790200121177\"><strong class=\"schema-faq-question\">\u00bfQu\u00e9 requisitos tiene una cerca de piscina?<\/strong> <p class=\"schema-faq-answer\">En Espa\u00f1a los requisitos de altura, huecos y cierre de la puerta los fija la normativa de cada comunidad aut\u00f3noma y ayuntamiento, as\u00ed que var\u00edan. Como referencia de seguridad infantil, se suelen usar huecos de menos de 10 cm, que no haya apoyos para trepar y una puerta que se cierre y se bloquee sola y se abra hacia fuera de la piscina. Consulte a su ayuntamiento antes de construir. Marque la casilla de piscina para recibir un aviso con el resultado.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1790200138488\"><strong class=\"schema-faq-question\">\u00bfNecesito licencia, o consultar las instalaciones enterradas, antes de hacer una cerca?<\/strong> <p class=\"schema-faq-answer\">Antes de excavar, consulte a las compa\u00f1\u00edas de agua, gas y electricidad o a su ayuntamiento para no da\u00f1ar ninguna instalaci\u00f3n enterrada. Seg\u00fan el municipio, una cerca puede necesitar licencia u obra menor, y el planeamiento urban\u00edstico suele fijar la altura y el tipo de cerramiento. Puede a\u00f1adirse el reglamento de la comunidad de propietarios. Confirme el lindero exacto de su parcela antes de colocar los postes.<\/p> <\/div><\/div>\n\n\n<!-- aiper-tool-links -->\n<div class=\"aiper-tool-links\">\n  <div class=\"aiper-tl-section\">\n    <div class=\"aiper-tl-heading\">M\u00e1s herramientas<\/div>\n    <div class=\"aiper-tl-tags\">\n      <a href=\"https:\/\/aiper.com\/blogs\/es\/calculadora-de-adoquines\/\" class=\"aiper-tl-tag\">Calculadora de Adoquines<\/a>\n<a href=\"https:\/\/aiper.com\/blogs\/es\/calculadora-de-terrazas\/\" class=\"aiper-tl-tag\">Calculadora de Terrazas<\/a>\n<a href=\"https:\/\/aiper.com\/blogs\/es\/calculadora-muro-de-contencion\/\" class=\"aiper-tl-tag\">Calculadora De Muro De Contenci\u00f3n<\/a>\n    <\/div>\n  <\/div>\n  <div class=\"aiper-tl-section\">\n    <div class=\"aiper-tl-heading\">Art\u00edculos relacionados<\/div>\n    <div class=\"aiper-tl-tags\">\n      <a href=\"https:\/\/aiper.com\/blogs\/es\/bajar-alcalinidad-piscina\/\" class=\"aiper-tl-tag\">C\u00f3mo bajar la alcalinidad de la piscina<\/a>\n<a href=\"https:\/\/aiper.com\/blogs\/es\/ahuyentar-gansos-canadienses-cesped\/\" class=\"aiper-tl-tag\">C\u00f3mo ahuyentar los gansos canadienses del c\u00e9sped<\/a>\n<a href=\"https:\/\/aiper.com\/blogs\/es\/como-eliminar-setas-del-cesped\/\" class=\"aiper-tl-tag\">C\u00f3mo eliminar las setas del c\u00e9sped<\/a>\n<a href=\"https:\/\/aiper.com\/blogs\/es\/escarificar-cesped-detectar-eliminar-fieltro\/\" class=\"aiper-tl-tag\">Escarificar el c\u00e9sped: c\u00f3mo detectar y eliminar el fieltro<\/a>\n    <\/div>\n  <\/div>\n<\/div>\n\n<style>\n.aiper-tool-links{margin:2.5rem 0 1.5rem;padding:1.5rem 1.75rem;background:linear-gradient(135deg,rgba(148,134,247,.04),rgba(30,202,211,.04));border-radius:12px;border:1px solid rgba(148,134,247,.10)}\n.aiper-tl-section{margin-bottom:1.25rem}\n.aiper-tl-section:last-child{margin-bottom:0}\n.aiper-tl-heading{font-size:.75rem;font-weight:600;letter-spacing:.09em;text-transform:uppercase;color:#8899aa;margin:0 0 .65rem}\n.aiper-tl-tags{display:flex;flex-wrap:wrap;gap:.5rem}\n.aiper-tl-tag{display:inline-block;padding:.4rem .95rem;font-size:.82rem;font-weight:500;line-height:1.35;color:#9486f7;background:rgba(148,134,247,.055);border:1px solid rgba(30,202,211,.25);border-radius:22px;text-decoration:none;transition:all .18s}\n.aiper-tl-tag:hover{background:#1ecad3;color:#fff;border-color:#1ecad3;box-shadow:0 2px 10px rgba(30,202,211,.22)}\n<\/style>\n\n\n<p class=\"has-text-align-center aiper-last-updated has-small-font-size wp-block-paragraph\"><time datetime=\"2026-09-30\">\u00daltima actualizaci\u00f3n: 30 de septiembre de 2026<\/time><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Esta calculadora de cercas (vallas) calcula los postes, travesa\u00f1os, listones o paneles, el hormig\u00f3n (concreto) y el coste de una cerca de madera, PVC, metal o malla. Introduzca cada lado de su cerca, a\u00f1ada puertas y obtenga una lista de compra completa con una estimaci\u00f3n del precio. Elija el tipo de cerca e introduzca los&#8230;<\/p>\n","protected":false},"author":3,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","footnotes":""},"class_list":["post-2915","page","type-page","status-publish","hentry"],"lang":"es","translations":{"es":2915,"en":2908,"de":2910,"fr":2913},"_links":{"self":[{"href":"https:\/\/aiper.com\/blogs\/wp-json\/wp\/v2\/pages\/2915","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/aiper.com\/blogs\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/aiper.com\/blogs\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/aiper.com\/blogs\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/aiper.com\/blogs\/wp-json\/wp\/v2\/comments?post=2915"}],"version-history":[{"count":6,"href":"https:\/\/aiper.com\/blogs\/wp-json\/wp\/v2\/pages\/2915\/revisions"}],"predecessor-version":[{"id":11866,"href":"https:\/\/aiper.com\/blogs\/wp-json\/wp\/v2\/pages\/2915\/revisions\/11866"}],"wp:attachment":[{"href":"https:\/\/aiper.com\/blogs\/wp-json\/wp\/v2\/media?parent=2915"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}