JavaScript code is not working properly on Android

I have this code below, which calculates the vehicle’s ISV and IUC.

It works perfectly on desktop and android. However, on IOS, it does not calculate the ISV, only the IUC, returning this:

Total ISV: NaN€
Total IUC: 148.22€

function calculateIsv(co2Emissions, engineSize, isHybrid, firstRegistration, fuelType) {
   if (!co2Emissions || !engineSize || !firstRegistration || !fuelType) {
        console.error("Error: Some inputs are invalid or empty.");
        document.querySelector('.resultado-isv').innerHTML = "Error: Invalid data";
        return;
    }
   co2Emissions = parseInt(co2Emissions.replace(",", ".").match(/d+/)?.[0] || 0);
    engineSize = parseInt(engineSize.replace(",", ".").match(/d+/)?.[0] || 0);

    if (isNaN(co2Emissions) || isNaN(engineSize)) {
        console.error("Error: Could not convert emissions or engine capacity to number.");
        document.querySelector('.resultado-isv').innerHTML = "Error: Invalid data";
        return;
    }
    taxaB = 0
    vehicle_type = document.getElementById("vehicle-type")
    if (vehicle_type.value == "mixed-van") {
      if (engineSize <= 1.250) {
        taxaB = ((engineSize * 5.30) - 3331.68)
      } else {
        taxaB = ((engineSize * 12.58) - 12138.47)
      }
      taxaB *= (1 - 0.85).toFixed(2);
    }
   const year = parseInt(firstRegistration.split('/').pop());
   const registrationDate = new Date(firstRegistration.split('/').reverse().join('/'));
   const age = new Date().getFullYear() - registrationDate.getFullYear();
   const reductions = [0.1, 0.2, 0.28, 0.35, 0.43, 0.52, 0.6, 0.65, 0.7, 0.75, 0.8];
   const reductionPercentage = reductions[Math.min(age, 10)];
   
   let ccRate, ccDeduction;
   if (engineSize <= 1000) {
   ccRate = 1.09;
   ccDeduction = 849.03;
   } else if (engineSize <= 1250) {
   ccRate = 1.18;
   ccDeduction = 850.69;
   } else {
   ccRate = 5.61;
   ccDeduction = 6194.88;
   }
   
   const ccTax = Math.max(0, (engineSize * ccRate - ccDeduction).toFixed(2));
   
   const co2Tables = {
   'gasoline': {
      'NEDC': [
          [99, 4.62, 427], [115, 8.09, 750.99], [145, 52.56, 5903.94],
          [175, 61.24, 7140.17], [195, 155.97, 23627.27], [Infinity, 205.65, 33390.12]
      ],
      'WLTP': [
          [110, 0.44, 43.02], [115, 1.1, 115.8], [120, 1.38, 147.79],
          [130, 5.27, 619.17], [145, 6.38, 762.73], [175, 41.54, 5819.56],
          [195, 51.38, 7247.39], [235, 193.01, 34190.52], [Infinity, 233.81, 41910.96]
      ]
   },
   'diesel': {
      'NEDC': [
          [79, 5.78, 439.04], [95, 23.45, 1848.58], [120, 79.22, 7195.63],
          [140, 175.73, 18924.92], [160, 195.43, 21720.92], [Infinity, 268.42, 33447.90]
      ],
      'WLTP': [
          [110, 1.72, 11.50], [120, 18.96, 1906.19], [140, 65.04, 7360.85],
          [150, 127.40, 16080.57], [160, 160.81, 21176.06], [170, 221.69, 29227.38],
          [190, 274.08, 36987.98], [Infinity, 282.35, 38271.32]
      ]
   }
   };
   
   const standard = document.getElementById("wltp").checked ? 'WLTP' : 'NEDC';
   const co2Table = co2Tables[fuelType][standard];
   let co2Tax = 0;
   
   for (let i = 0; i < co2Table.length; i++) {
   const [limit, rate, deduction] = co2Table[i];
   if (co2Emissions <= limit) {
      co2Tax = (co2Emissions * rate - deduction).toFixed(2);
      break;
   }
   }
   
   let totalIsv = (parseFloat(ccTax) + parseFloat(co2Tax));
   
   totalIsv = (totalIsv * (1 - reductionPercentage)).toFixed(2);
   
   plug_in_hybrid = document.getElementById("plug-in-hybrid")
   if (isHybrid) {
   totalIsv *= (1 - 0.40);
   } else if (plug_in_hybrid.checked) {
   totalIsv *= (1 - 0.75);
   }
   if (taxaB > 0) {
        taxaB = parseFloat(taxaB);
   }
   totalIsv = parseFloat(totalIsv) + taxaB;
   totalIsv = totalIsv.toFixed(2);
   document.querySelector('.resultado').style.display = "initial"
   document.querySelector('.resultado-isv').innerHTML = totalIsv
   }
   function calculateIuc(engineSize, co2Emissions, firstRegistration, fuelType) {
    engineSize = parseInt(engineSize.match(/d+/)[0]);
    co2Emissions = parseInt(co2Emissions.match(/d+/)[0]);
    year = parseInt(firstRegistration.split('/').pop());
    wltp_element = document.getElementById("wltp")
    standard = wltp_element.checked ? 'WLTP' : 'NEDC';
   
    let baseTax = 0;
    if (year >= 2007) {
        if (engineSize <= 1250) {
            baseTax = 31.77;
        } else if (engineSize <= 1750) {
            baseTax = 63.74;
        } else if (engineSize <= 2500) {
            baseTax = 127.35;
        } else {
            baseTax = 435.84;
        }
    } else {
        if (fuelType === 'gasoline') {
            if (engineSize <= 1000) {
                baseTax = year >= 1996 ? 19.90 : year >= 1990 ? 12.20 : 8.80;
            } else if (engineSize <= 1300) {
                baseTax = year >= 1996 ? 39.95 : year >= 1990 ? 22.45 : 12.55;
            } else if (engineSize <= 1750) {
                baseTax = year >= 1996 ? 62.40 : year >= 1990 ? 34.87 : 17.49;
            } else if (engineSize <= 2600) {
                baseTax = year >= 1996 ? 158.31 : year >= 1990 ? 83.49 : 36.09;
            } else if (engineSize <= 3500) {
                baseTax = year >= 1996 ? 287.49 : year >= 1990 ? 156.54 : 79.72;
            } else {
                baseTax = year >= 1996 ? 512.23 : year >= 1990 ? 263.11 : 120.90;
            }
        } else if (fuelType === 'diesel') {
            if (engineSize <= 1500) {
                baseTax = year >= 1996 ? 22.48 : year >= 1990 ? 14.18 : 10.19;
            } else if (engineSize <= 2000) {
                baseTax = year >= 1996 ? 45.13 : year >= 1990 ? 25.37 : 14.18;
            } else if (engineSize <= 3000) {
                baseTax = year >= 1996 ? 70.50 : year >= 1990 ? 39.40 : 19.76;
            } else {
                baseTax = year >= 1996 ? 178.86 : year >= 1990 ? 94.33 : 40.77;
            }
        }
    }
   
    let co2Tax = 0;
    const co2Rates = standard === 'WLTP' ? [140, 205, 260, Infinity] : [120, 180, 250, Infinity];
    const co2Taxes = standard === 'WLTP' ? [65.15, 97.63, 212.04, 363.25] : [65.15, 97.63, 212.04, 363.25];
    const co2Additional = standard === 'WLTP' ? [0, 0, 31.77, 63.74] : [0, 0, 31.77, 63.74];
   
    for (let i = 0; i < co2Rates.length; i++) {
        if (co2Emissions <= co2Rates[i]) {
            co2Tax = co2Taxes[i] + (co2Emissions > co2Rates[i - 1] ? co2Additional[i] : 0);
            break;
        }
    }
   
    let coefficient = 1;
    if (year >= 2008) coefficient = 1.05;
    if (year >= 2009) coefficient = 1.10;
    if (year >= 2010) coefficient = 1.15;
   
    let dieselAdditionalTax = 0;
    if (fuelType === 'diesel') {
        if (engineSize <= 1250) {
            dieselAdditionalTax = 5.02;
        } else if (engineSize <= 1750) {
            dieselAdditionalTax = 10.07;
        } else if (engineSize <= 2500) {
            dieselAdditionalTax = 20.12;
        } else {
            dieselAdditionalTax = 68.85;
        }
    }
    let totalIuc = ((baseTax + co2Tax) * coefficient + dieselAdditionalTax).toFixed(2);
    document.querySelector('.resultado-iuc').innerHTML = totalIuc;
    document.querySelector('.wpp-proposta').style.display = "block"
   }

All fields are being passed correctly in both functions

I have already tried several different code syntaxes, but with no success.

I also tested it on several browsers, it worked perfectly on all of them on Android and Windows. Only on IOS it doesn’t work.

I tested Safari and Google Chrome on IOS, both didn’t work.