<?xml version="1.0" encoding="utf-8"?>
<xbrl
  xmlns="http://www.xbrl.org/2003/instance"
  xmlns:dei="http://xbrl.sec.gov/dei/2026"
  xmlns:ffd="http://xbrl.sec.gov/ffd/2026"
  xmlns:iso4217="http://www.xbrl.org/2003/iso4217"
  xmlns:link="http://www.xbrl.org/2003/linkbase"
  xmlns:xbrldi="http://xbrl.org/2006/xbrldi"
  xmlns:xlink="http://www.w3.org/1999/xlink"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <link:schemaRef
      xlink:href="https://xbrl.sec.gov/ffd/2026/ffd-2026.xsd"
      xlink:type="simple"/>
    <context id="rc">
        <entity>
            <identifier scheme="http://www.sec.gov/CIK">0000015615</identifier>
        </entity>
        <period>
            <startDate>2026-07-29</startDate>
            <endDate>2026-07-29</endDate>
        </period>
    </context>
    <context id="offrl_1">
        <entity>
            <identifier scheme="http://www.sec.gov/CIK">0000015615</identifier>
            <segment>
                <xbrldi:typedMember dimension="ffd:OfferingAxis">
                    <dei:lineNo>1</dei:lineNo>
                </xbrldi:typedMember>
            </segment>
        </entity>
        <period>
            <startDate>2026-07-29</startDate>
            <endDate>2026-07-29</endDate>
        </period>
    </context>
    <unit id="USD">
        <measure>iso4217:USD</measure>
    </unit>
    <unit id="pure">
        <measure>pure</measure>
    </unit>
    <unit id="Shares">
        <measure>shares</measure>
    </unit>
    <ffd:FormTp contextRef="rc" id="ixv-345">S-3</ffd:FormTp>
    <ffd:SubmissnTp contextRef="rc" id="ixv-346">424B7</ffd:SubmissnTp>
    <ffd:FeeExhibitTp contextRef="rc" id="ixv-347">EX-FILING FEES</ffd:FeeExhibitTp>
    <ffd:RegnFileNb contextRef="rc" id="ixv-348">333-285425</ffd:RegnFileNb>
    <dei:EntityCentralIndexKey contextRef="rc" id="ixv-349">0000015615</dei:EntityCentralIndexKey>
    <dei:EntityRegistrantName contextRef="rc" id="ixv-350">MASTEC INC</dei:EntityRegistrantName>
    <ffd:OfferingTableNa contextRef="rc" id="hiddenrcOfferingTableNa" xsi:nil="true"/>
    <ffd:OffsetTableNa contextRef="rc" id="hiddenrcOffsetTableNa">N/A</ffd:OffsetTableNa>
    <ffd:CombinedProspectusTableNa contextRef="rc" id="hiddenrcCombinedProspectusTableNa">N/A</ffd:CombinedProspectusTableNa>
    <ffd:FormTp contextRef="rc" id="ixv-378">S-3</ffd:FormTp>
    <dei:EntityRegistrantName contextRef="rc" id="ixv-379">MASTEC INC</dei:EntityRegistrantName>
    <ffd:PrevslyPdFlg contextRef="offrl_1" id="ixv-380">false</ffd:PrevslyPdFlg>
    <ffd:OfferingSctyTp contextRef="offrl_1" id="ixv-381">Equity</ffd:OfferingSctyTp>
    <ffd:OfferingSctyTitl contextRef="offrl_1" id="ixv-382">Common Stock</ffd:OfferingSctyTitl>
    <ffd:Rule457rFlg contextRef="offrl_1" id="ixv-383">true</ffd:Rule457rFlg>
    <ffd:AmtSctiesRegd
      contextRef="offrl_1"
      decimals="0"
      id="ixv-384"
      unitRef="Shares">1219498</ffd:AmtSctiesRegd>
    <ffd:MaxOfferingPricPerScty
      contextRef="offrl_1"
      decimals="3"
      id="ixv-385"
      unitRef="USD">315.775</ffd:MaxOfferingPricPerScty>
    <ffd:MaxAggtOfferingPric
      contextRef="offrl_1"
      decimals="2"
      id="ixv-386"
      unitRef="USD">385086980.95</ffd:MaxAggtOfferingPric>
    <ffd:FeeRate
      contextRef="offrl_1"
      decimals="7"
      id="ixv-387"
      unitRef="pure">0.0001381</ffd:FeeRate>
    <ffd:FeeAmt
      contextRef="offrl_1"
      decimals="2"
      id="ixv-388"
      unitRef="USD">53180.51</ffd:FeeAmt>
    <ffd:TtlOfferingAmt contextRef="rc" decimals="2" id="ixv-389" unitRef="USD">385086980.95</ffd:TtlOfferingAmt>
    <ffd:TtlFeeAmt contextRef="rc" decimals="2" id="ixv-390" unitRef="USD">53180.51</ffd:TtlFeeAmt>
    <ffd:TtlPrevslyPdAmt contextRef="rc" decimals="2" id="ixv-391" unitRef="USD">0.00</ffd:TtlPrevslyPdAmt>
    <ffd:TtlOffsetAmt contextRef="rc" decimals="2" id="ixv-392" unitRef="USD">0.00</ffd:TtlOffsetAmt>
    <ffd:NetFeeAmt contextRef="rc" decimals="2" id="ixv-393" unitRef="USD">53180.51</ffd:NetFeeAmt>
    <ffd:OfferingNote contextRef="offrl_1" id="ixv-394">(1) Calculated pursuant to Rules 456(b), 457(c) and 457(r) of the Securities Act of 1933, as amended, or the Securities Act, by multiplying the proposed maximum aggregate offering price of securities to be registered by 0.00013810. (2) Consists of 1,219,498 shares of common stock registered for resale by the selling shareholders named in this prospectus supplement. (3) Estimated solely for purposes of calculating the registration fee in accordance with Rules 457(c) and 457(r) of the Securities Act, and based upon the average of the high and low sales price of a share of the Registrant's common stock as reported by the New York Stock Exchange on July 28, 2026.</ffd:OfferingNote>
    <ffd:NrrtvMaxAggtOfferingPric contextRef="rc" decimals="2" id="ixv-395" unitRef="USD">385086980.95</ffd:NrrtvMaxAggtOfferingPric>
    <ffd:FnlPrspctsFlg contextRef="rc" id="ixv-396">true</ffd:FnlPrspctsFlg>
</xbrl>
