{"id":13981,"date":"2025-11-29T16:05:05","date_gmt":"2025-11-29T16:05:05","guid":{"rendered":"https:\/\/tendify.net\/?p=13981"},"modified":"2025-12-11T06:04:24","modified_gmt":"2025-12-11T06:04:24","slug":"free-professional-3d-container-optimization-tool-20ft-40ft","status":"publish","type":"post","link":"https:\/\/tendify.net\/fa\/free-professional-3d-container-optimization-tool-20ft-40ft\/","title":{"rendered":"\u0627\u0628\u0632\u0627\u0631 \u0628\u0647\u06cc\u0646\u0647\u200c\u0633\u0627\u0632\u06cc \u06a9\u0627\u0646\u062a\u06cc\u0646\u0631 \u0633\u0647\u200c\u0628\u0639\u062f\u06cc \u062d\u0631\u0641\u0647\u200c\u0627\u06cc \u0631\u0627\u06cc\u06af\u0627\u0646 (\u06f2\u06f0 \u0641\u0648\u062a \u0648 \u06f4\u06f0 \u0641\u0648\u062a)"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"13981\" class=\"elementor elementor-13981\" data-elementor-post-type=\"post\">\n\t\t\t\t<div class=\"wd-negative-gap elementor-element elementor-element-572f680 e-flex e-con-boxed e-con e-parent\" data-id=\"572f680\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-4509895 elementor-widget elementor-widget-html\" data-id=\"4509895\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"html.default\">\n\t\t\t\t\t<!DOCTYPE html>\r\n<html lang=\"en\">\r\n<head>\r\n  <meta charset=\"UTF-8\">\r\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\r\n  <meta name=\"description\" content=\"Advanced Container Loading Calculator: Optimize your shipping with precise container loading calculations, 3D visualization, and cost analysis for 20ft, 40ft, and custom containers.\">\r\n  <meta name=\"robots\" content=\"index, follow\">\r\n  <title>Advanced Container Loading Calculator \u2013 Optimize 20ft\/40ft Container Space<\/title>\r\n  \r\n  <!-- Open Graph \/ Social -->\r\n  <meta property=\"og:title\" content=\"Advanced Container Loading Calculator (20ft & 40ft)\">\r\n  <meta property=\"og:description\" content=\"Calculate optimal container loading with 3D visualization, cost analysis, and multiple carton types. Save on shipping costs!\">\r\n  <meta property=\"og:type\" content=\"website\">\r\n\r\n  <!-- Font Awesome for icons -->\r\n  <link rel=\"stylesheet\" href=\"https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/font-awesome\/6.4.0\/css\/all.min.css\">\r\n\r\n  <!-- Schema.org markup for Google -->\r\n  <script type=\"application\/ld+json\">\r\n  {\r\n    \"@context\": \"https:\/\/schema.org\",\r\n    \"@type\": \"SoftwareApplication\",\r\n    \"name\": \"Advanced Container Loading Calculator\",\r\n    \"applicationCategory\": \"BusinessApplication\",\r\n    \"operatingSystem\": \"Any\",\r\n    \"description\": \"Professional container loading calculator with 3D visualization, cost analysis, and optimization for exporters and logistics professionals.\",\r\n    \"offers\": {\r\n      \"@type\": \"Offer\",\r\n      \"price\": \"0\",\r\n      \"priceCurrency\": \"USD\"\r\n    },\r\n    \"author\": {\r\n      \"@type\": \"Organization\",\r\n      \"name\": \"Logistics Tools\"\r\n    },\r\n    \"featureList\": [\r\n      \"3D Container Visualization\",\r\n      \"Multiple Carton Types\",\r\n      \"Cost Analysis\",\r\n      \"Weight Distribution\",\r\n      \"Export Results\"\r\n    ]\r\n  }\r\n  <\/script>\r\n\r\n  <style>\r\n    :root {\r\n      --primary: #2c5aa0;\r\n      --primary-dark: #1a3c6e;\r\n      --secondary: #e74c3c;\r\n      --secondary-dark: #c0392b;\r\n      --success: #27ae60;\r\n      --warning: #f39c12;\r\n      --info: #3498db;\r\n      --light-bg: #f8f9fa;\r\n      --card-bg: #fff;\r\n      --text: #333;\r\n      --text-light: #777;\r\n      --border: #ddd;\r\n      --shadow: 0 10px 30px rgba(0,0,0,0.1);\r\n      --radius: 12px;\r\n    }\r\n\r\n    * {\r\n      box-sizing: border-box;\r\n    }\r\n\r\n    body {\r\n      font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;\r\n      line-height: 1.6;\r\n      color: var(--text);\r\n      background: var(--light-bg);\r\n      margin: 0;\r\n      padding: 0;\r\n    }\r\n\r\n    .container {\r\n      max-width: 1400px;\r\n      margin: 30px auto;\r\n      padding: 20px;\r\n    }\r\n\r\n    header {\r\n      text-align: center;\r\n      margin-bottom: 30px;\r\n      background: linear-gradient(135deg, var(--primary), var(--primary-dark));\r\n      color: white;\r\n      padding: 30px;\r\n      border-radius: var(--radius);\r\n      box-shadow: var(--shadow);\r\n    }\r\n\r\n    h1 {\r\n      margin-bottom: 10px;\r\n      font-size: 2.8rem;\r\n    }\r\n\r\n    .subtitle {\r\n      font-size: 1.3rem;\r\n      opacity: 0.9;\r\n      margin-bottom: 30px;\r\n    }\r\n\r\n    .features {\r\n      display: flex;\r\n      flex-wrap: wrap;\r\n      justify-content: center;\r\n      gap: 15px;\r\n      margin-top: 20px;\r\n    }\r\n\r\n    .feature {\r\n      background: rgba(255,255,255,0.2);\r\n      padding: 10px 20px;\r\n      border-radius: 50px;\r\n      font-size: 0.9rem;\r\n      display: flex;\r\n      align-items: center;\r\n      gap: 8px;\r\n    }\r\n\r\n    .card {\r\n      background: var(--card-bg);\r\n      border-radius: var(--radius);\r\n      box-shadow: var(--shadow);\r\n      padding: 25px;\r\n      margin-bottom: 30px;\r\n      transition: transform 0.3s, box-shadow 0.3s;\r\n    }\r\n\r\n    .card:hover {\r\n      transform: translateY(-5px);\r\n      box-shadow: 0 15px 40px rgba(0,0,0,0.15);\r\n    }\r\n\r\n    .form-grid {\r\n      display: grid;\r\n      grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));\r\n      gap: 20px;\r\n      margin-bottom: 30px;\r\n    }\r\n\r\n    .input-group {\r\n      margin-bottom: 15px;\r\n    }\r\n\r\n    label {\r\n      display: block;\r\n      margin-bottom: 8px;\r\n      font-weight: 600;\r\n      color: var(--primary-dark);\r\n    }\r\n\r\n    .input-with-icon {\r\n      position: relative;\r\n    }\r\n\r\n    .input-with-icon i {\r\n      position: absolute;\r\n      left: 15px;\r\n      top: 50%;\r\n      transform: translateY(-50%);\r\n      color: var(--text-light);\r\n    }\r\n\r\n    input, select {\r\n      width: 100%;\r\n      padding: 12px 12px 12px 40px;\r\n      border: 2px solid var(--border);\r\n      border-radius: 8px;\r\n      font-size: 16px;\r\n      transition: border-color 0.3s;\r\n    }\r\n\r\n    input:focus, select:focus {\r\n      border-color: var(--primary);\r\n      outline: none;\r\n      box-shadow: 0 0 0 3px rgba(44, 90, 160, 0.2);\r\n    }\r\n\r\n    .checkbox-group {\r\n      display: flex;\r\n      align-items: center;\r\n      margin-top: 10px;\r\n    }\r\n\r\n    .checkbox-group input {\r\n      width: auto;\r\n      margin-right: 10px;\r\n    }\r\n\r\n    .checkbox-group label {\r\n      margin-bottom: 0;\r\n      font-weight: normal;\r\n    }\r\n\r\n    .button-group {\r\n      display: flex;\r\n      gap: 15px;\r\n      margin-top: 20px;\r\n      flex-wrap: wrap;\r\n    }\r\n\r\n    button {\r\n      padding: 14px 30px;\r\n      font-size: 16px;\r\n      border: none;\r\n      border-radius: 8px;\r\n      cursor: pointer;\r\n      font-weight: bold;\r\n      transition: all 0.3s;\r\n      display: flex;\r\n      align-items: center;\r\n      justify-content: center;\r\n      gap: 10px;\r\n    }\r\n\r\n    .btn-primary {\r\n      background: var(--primary);\r\n      color: white;\r\n      flex: 1;\r\n    }\r\n\r\n    .btn-primary:hover {\r\n      background: var(--primary-dark);\r\n    }\r\n\r\n    .btn-secondary {\r\n      background: var(--secondary);\r\n      color: white;\r\n    }\r\n\r\n    .btn-secondary:hover {\r\n      background: var(--secondary-dark);\r\n    }\r\n\r\n    .btn-outline {\r\n      background: transparent;\r\n      color: var(--primary);\r\n      border: 2px solid var(--primary);\r\n    }\r\n\r\n    .btn-outline:hover {\r\n      background: var(--primary);\r\n      color: white;\r\n    }\r\n\r\n    .btn-success {\r\n      background: var(--success);\r\n      color: white;\r\n    }\r\n\r\n    .btn-success:hover {\r\n      background: #219653;\r\n    }\r\n\r\n    .results {\r\n      margin-top: 40px;\r\n      padding: 25px;\r\n      background: #f0f8ff;\r\n      border-radius: 10px;\r\n      border-left: 6px solid var(--primary);\r\n      display: none;\r\n    }\r\n\r\n    .results h2 {\r\n      margin-top: 0;\r\n      color: var(--primary-dark);\r\n      border-bottom: 2px solid var(--border);\r\n      padding-bottom: 10px;\r\n    }\r\n\r\n    .highlight {\r\n      font-size: 1.4em;\r\n      font-weight: bold;\r\n      color: var(--secondary);\r\n    }\r\n\r\n    .layout-box {\r\n      background: #fff;\r\n      padding: 15px;\r\n      border-radius: 8px;\r\n      margin-top: 20px;\r\n      border: 1px solid var(--border);\r\n    }\r\n\r\n    .container-comparison {\r\n      display: grid;\r\n      grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));\r\n      gap: 20px;\r\n      margin-top: 30px;\r\n    }\r\n\r\n    .container-card {\r\n      background: white;\r\n      border-radius: 8px;\r\n      padding: 20px;\r\n      box-shadow: 0 5px 15px rgba(0,0,0,0.05);\r\n      border-top: 5px solid var(--primary);\r\n      transition: transform 0.3s;\r\n    }\r\n\r\n    .container-card:hover {\r\n      transform: translateY(-5px);\r\n    }\r\n\r\n    .container-card.recommended {\r\n      border-top-color: var(--success);\r\n      position: relative;\r\n      overflow: hidden;\r\n    }\r\n\r\n    .container-card.recommended::before {\r\n      content: \"RECOMMENDED\";\r\n      position: absolute;\r\n      top: 10px;\r\n      right: -30px;\r\n      background: var(--success);\r\n      color: white;\r\n      padding: 5px 30px;\r\n      transform: rotate(45deg);\r\n      font-size: 0.8rem;\r\n      font-weight: bold;\r\n    }\r\n\r\n    .container-card h3 {\r\n      margin-top: 0;\r\n      color: var(--primary-dark);\r\n    }\r\n\r\n    .stats-grid {\r\n      display: grid;\r\n      grid-template-columns: 1fr 1fr;\r\n      gap: 10px;\r\n      margin-top: 15px;\r\n    }\r\n\r\n    .stat-item {\r\n      display: flex;\r\n      flex-direction: column;\r\n    }\r\n\r\n    .stat-label {\r\n      font-size: 0.9rem;\r\n      color: var(--text-light);\r\n    }\r\n\r\n    .stat-value {\r\n      font-weight: bold;\r\n      font-size: 1.1rem;\r\n      color: var(--primary);\r\n    }\r\n\r\n    .visualization {\r\n      margin-top: 30px;\r\n      padding: 20px;\r\n      background: white;\r\n      border-radius: 8px;\r\n      box-shadow: 0 5px 15px rgba(0,0,0,0.05);\r\n    }\r\n\r\n    .visualization-container {\r\n      display: flex;\r\n      flex-direction: column;\r\n      align-items: center;\r\n      gap: 20px;\r\n    }\r\n\r\n    .container-3d {\r\n      width: 100%;\r\n      height: 300px;\r\n      background: #f5f5f5;\r\n      border-radius: 8px;\r\n      position: relative;\r\n      overflow: hidden;\r\n      border: 2px solid var(--border);\r\n    }\r\n\r\n    .container-3d .container-box {\r\n      position: absolute;\r\n      top: 50%;\r\n      left: 50%;\r\n      transform: translate(-50%, -50%);\r\n      width: 200px;\r\n      height: 100px;\r\n      background: rgba(44, 90, 160, 0.1);\r\n      border: 2px solid var(--primary);\r\n      display: flex;\r\n      flex-wrap: wrap;\r\n      align-content: flex-start;\r\n      padding: 5px;\r\n    }\r\n\r\n    .carton-3d {\r\n      background: var(--secondary);\r\n      margin: 1px;\r\n      opacity: 0.8;\r\n      border: 1px solid rgba(0,0,0,0.1);\r\n    }\r\n\r\n    .controls-3d {\r\n      display: flex;\r\n      gap: 10px;\r\n      justify-content: center;\r\n    }\r\n\r\n    .tabs {\r\n      display: flex;\r\n      border-bottom: 2px solid var(--border);\r\n      margin-bottom: 20px;\r\n      flex-wrap: wrap;\r\n    }\r\n\r\n    .tab {\r\n      padding: 10px 20px;\r\n      cursor: pointer;\r\n      font-weight: 600;\r\n      color: var(--text-light);\r\n      border-bottom: 2px solid transparent;\r\n      margin-bottom: -2px;\r\n      transition: all 0.3s;\r\n    }\r\n\r\n    .tab:hover {\r\n      color: var(--primary);\r\n    }\r\n\r\n    .tab.active {\r\n      color: var(--primary);\r\n      border-bottom: 2px solid var(--primary);\r\n    }\r\n\r\n    .tab-content {\r\n      display: none;\r\n    }\r\n\r\n    .tab-content.active {\r\n      display: block;\r\n    }\r\n\r\n    footer {\r\n      text-align: center;\r\n      margin-top: 50px;\r\n      color: var(--text-light);\r\n      font-size: 0.9em;\r\n      padding: 20px;\r\n      border-top: 1px solid var(--border);\r\n    }\r\n\r\n    .notification {\r\n      padding: 15px;\r\n      border-radius: 8px;\r\n      margin-bottom: 20px;\r\n      display: none;\r\n    }\r\n\r\n    .notification.error {\r\n      background: #ffe6e6;\r\n      color: #d63031;\r\n      border-left: 4px solid #d63031;\r\n    }\r\n\r\n    .notification.success {\r\n      background: #e6f7ee;\r\n      color: #27ae60;\r\n      border-left: 4px solid #27ae60;\r\n    }\r\n\r\n    .notification.warning {\r\n      background: #fff8e6;\r\n      color: #f39c12;\r\n      border-left: 4px solid #f39c12;\r\n    }\r\n\r\n    .loading {\r\n      display: none;\r\n      text-align: center;\r\n      padding: 20px;\r\n    }\r\n\r\n    .loading-spinner {\r\n      border: 5px solid #f3f3f3;\r\n      border-top: 5px solid var(--primary);\r\n      border-radius: 50%;\r\n      width: 50px;\r\n      height: 50px;\r\n      animation: spin 1s linear infinite;\r\n      margin: 0 auto 15px;\r\n    }\r\n\r\n    @keyframes spin {\r\n      0% { transform: rotate(0deg); }\r\n      100% { transform: rotate(360deg); }\r\n    }\r\n\r\n    .export-options {\r\n      margin-top: 20px;\r\n      display: flex;\r\n      gap: 10px;\r\n      justify-content: flex-end;\r\n      flex-wrap: wrap;\r\n    }\r\n\r\n    .carton-types {\r\n      margin-top: 20px;\r\n    }\r\n\r\n    .carton-type {\r\n      background: #f8f9fa;\r\n      padding: 15px;\r\n      border-radius: 8px;\r\n      margin-bottom: 15px;\r\n      border-left: 4px solid var(--info);\r\n    }\r\n\r\n    .carton-type-header {\r\n      display: flex;\r\n      justify-content: space-between;\r\n      align-items: center;\r\n      margin-bottom: 10px;\r\n    }\r\n\r\n    .carton-type-title {\r\n      font-weight: bold;\r\n      color: var(--primary-dark);\r\n    }\r\n\r\n    .remove-carton-type {\r\n      background: var(--secondary);\r\n      color: white;\r\n      border: none;\r\n      border-radius: 50%;\r\n      width: 30px;\r\n      height: 30px;\r\n      cursor: pointer;\r\n      display: flex;\r\n      align-items: center;\r\n      justify-content: center;\r\n    }\r\n\r\n    .cost-analysis {\r\n      margin-top: 30px;\r\n      padding: 20px;\r\n      background: white;\r\n      border-radius: 8px;\r\n      box-shadow: 0 5px 15px rgba(0,0,0,0.05);\r\n    }\r\n\r\n    .cost-grid {\r\n      display: grid;\r\n      grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));\r\n      gap: 15px;\r\n      margin-top: 15px;\r\n    }\r\n\r\n    .cost-item {\r\n      display: flex;\r\n      flex-direction: column;\r\n      padding: 15px;\r\n      background: #f8f9fa;\r\n      border-radius: 8px;\r\n    }\r\n\r\n    .cost-label {\r\n      font-size: 0.9rem;\r\n      color: var(--text-light);\r\n    }\r\n\r\n    .cost-value {\r\n      font-weight: bold;\r\n      font-size: 1.2rem;\r\n      color: var(--primary);\r\n    }\r\n\r\n    .savings {\r\n      color: var(--success) !important;\r\n    }\r\n\r\n    .advanced-options {\r\n      margin-top: 20px;\r\n      padding: 20px;\r\n      background: #f8f9fa;\r\n      border-radius: 8px;\r\n    }\r\n\r\n    .history-panel {\r\n      margin-top: 30px;\r\n      padding: 20px;\r\n      background: white;\r\n      border-radius: 8px;\r\n      box-shadow: 0 5px 15px rgba(0,0,0,0.05);\r\n    }\r\n\r\n    .history-item {\r\n      padding: 10px 15px;\r\n      border-left: 4px solid var(--info);\r\n      background: #f8f9fa;\r\n      margin-bottom: 10px;\r\n      border-radius: 4px;\r\n      cursor: pointer;\r\n      transition: all 0.3s;\r\n    }\r\n\r\n    .history-item:hover {\r\n      background: #e9ecef;\r\n      transform: translateX(5px);\r\n    }\r\n\r\n    @media (max-width: 768px) {\r\n      .form-grid { grid-template-columns: 1fr; }\r\n      .button-group { flex-direction: column; }\r\n      .container-comparison { grid-template-columns: 1fr; }\r\n      .stats-grid { grid-template-columns: 1fr; }\r\n      .export-options { justify-content: center; }\r\n      .features { flex-direction: column; align-items: center; }\r\n      .feature { width: 100%; justify-content: center; }\r\n    }\r\n  <\/style>\r\n<\/head>\r\n<body>\r\n\r\n<div class=\"container\">\r\n  <header>\r\n    <h1><i class=\"fas fa-cube\"><\/i> Advanced Container Loading Calculator<\/h1>\r\n    <p class=\"subtitle\">Optimize your shipping with precise container calculations, 3D visualization, and cost analysis<\/p>\r\n    \r\n    <div class=\"features\">\r\n      <div class=\"feature\"><i class=\"fas fa-boxes\"><\/i> Multiple Carton Types<\/div>\r\n      <div class=\"feature\"><i class=\"fas fa-cube\"><\/i> 3D Visualization<\/div>\r\n      <div class=\"feature\"><i class=\"fas fa-chart-line\"><\/i> Cost Analysis<\/div>\r\n      <div class=\"feature\"><i class=\"fas fa-weight-hanging\"><\/i> Weight Distribution<\/div>\r\n      <div class=\"feature\"><i class=\"fas fa-history\"><\/i> Calculation History<\/div>\r\n      <div class=\"feature\"><i class=\"fas fa-file-export\"><\/i> Export Results<\/div>\r\n    <\/div>\r\n  <\/header>\r\n\r\n  <div class=\"notification error\" id=\"errorNotification\"><\/div>\r\n  <div class=\"notification success\" id=\"successNotification\"><\/div>\r\n\r\n  <div class=\"card\">\r\n    <h2><i class=\"fas fa-edit\"><\/i> Carton & Container Configuration<\/h2>\r\n    \r\n    <div class=\"form-grid\">\r\n      <div class=\"input-group\">\r\n        <label for=\"cartonLength\">Carton Length (cm)<\/label>\r\n        <div class=\"input-with-icon\">\r\n          <i class=\"fas fa-ruler\"><\/i>\r\n          <input type=\"number\" id=\"cartonLength\" placeholder=\"e.g. 60\" min=\"1\" step=\"0.1\" required>\r\n        <\/div>\r\n      <\/div>\r\n      <div class=\"input-group\">\r\n        <label for=\"cartonWidth\">Carton Width (cm)<\/label>\r\n        <div class=\"input-with-icon\">\r\n          <i class=\"fas fa-ruler\"><\/i>\r\n          <input type=\"number\" id=\"cartonWidth\" placeholder=\"e.g. 40\" min=\"1\" step=\"0.1\" required>\r\n        <\/div>\r\n      <\/div>\r\n      <div class=\"input-group\">\r\n        <label for=\"cartonHeight\">Carton Height (cm)<\/label>\r\n        <div class=\"input-with-icon\">\r\n          <i class=\"fas fa-ruler\"><\/i>\r\n          <input type=\"number\" id=\"cartonHeight\" placeholder=\"e.g. 40\" min=\"1\" step=\"0.1\" required>\r\n        <\/div>\r\n      <\/div>\r\n      <div class=\"input-group\">\r\n        <label for=\"cartonWeight\">Carton Weight (kg)<\/label>\r\n        <div class=\"input-with-icon\">\r\n          <i class=\"fas fa-weight-hanging\"><\/i>\r\n          <input type=\"number\" id=\"cartonWeight\" placeholder=\"e.g. 10\" min=\"0.1\" step=\"0.1\">\r\n        <\/div>\r\n      <\/div>\r\n      <div class=\"input-group\">\r\n        <label for=\"cartonQty\">Number of Cartons<\/label>\r\n        <div class=\"input-with-icon\">\r\n          <i class=\"fas fa-boxes\"><\/i>\r\n          <input type=\"number\" id=\"cartonQty\" placeholder=\"e.g. 1200\" min=\"1\" required>\r\n        <\/div>\r\n      <\/div>\r\n      <div class=\"input-group\">\r\n        <label for=\"containerType\">Container Type<\/label>\r\n        <div class=\"input-with-icon\">\r\n          <i class=\"fas fa-shipping-fast\"><\/i>\r\n          <select id=\"containerType\">\r\n            <option value=\"both\">Try both 20ft & 40ft (recommended)<\/option>\r\n            <option value=\"20\">Only 20ft Standard<\/option>\r\n            <option value=\"40\">Only 40ft Standard<\/option>\r\n            <option value=\"40hc\">Only 40ft High Cube<\/option>\r\n            <option value=\"custom\">Custom Container<\/option>\r\n          <\/select>\r\n        <\/div>\r\n      <\/div>\r\n    <\/div>\r\n\r\n    <div class=\"input-group\">\r\n      <button class=\"btn-outline\" onclick=\"addCartonType()\">\r\n        <i class=\"fas fa-plus\"><\/i> Add Another Carton Type\r\n      <\/button>\r\n    <\/div>\r\n\r\n    <div class=\"carton-types\" id=\"cartonTypesContainer\">\r\n      <!-- Additional carton types will be added here -->\r\n    <\/div>\r\n\r\n    <div id=\"customContainerOptions\" style=\"display: none;\">\r\n      <h3>Custom Container Dimensions<\/h3>\r\n      <div class=\"form-grid\">\r\n        <div class=\"input-group\">\r\n          <label for=\"customLength\">Container Length (cm)<\/label>\r\n          <input type=\"number\" id=\"customLength\" placeholder=\"e.g. 1203\" min=\"1\" step=\"0.1\">\r\n        <\/div>\r\n        <div class=\"input-group\">\r\n          <label for=\"customWidth\">Container Width (cm)<\/label>\r\n          <input type=\"number\" id=\"customWidth\" placeholder=\"e.g. 235\" min=\"1\" step=\"0.1\">\r\n        <\/div>\r\n        <div class=\"input-group\">\r\n          <label for=\"customHeight\">Container Height (cm)<\/label>\r\n          <input type=\"number\" id=\"customHeight\" placeholder=\"e.g. 239\" min=\"1\" step=\"0.1\">\r\n        <\/div>\r\n      <\/div>\r\n    <\/div>\r\n\r\n    <div class=\"advanced-options\">\r\n      <h3><i class=\"fas fa-cog\"><\/i> Advanced Options<\/h3>\r\n      <div class=\"form-grid\">\r\n        <div class=\"checkbox-group\">\r\n          <input type=\"checkbox\" id=\"considerWeight\" checked>\r\n          <label for=\"considerWeight\">Consider weight limits (20ft: 22,000 kg, 40ft: 27,000 kg)<\/label>\r\n        <\/div>\r\n        <div class=\"checkbox-group\">\r\n          <input type=\"checkbox\" id=\"allowRotation\" checked>\r\n          <label for=\"allowRotation\">Allow carton rotation for optimal packing<\/label>\r\n        <\/div>\r\n        <div class=\"checkbox-group\">\r\n          <input type=\"checkbox\" id=\"includeCosts\">\r\n          <label for=\"includeCosts\">Include cost analysis in results<\/label>\r\n        <\/div>\r\n      <\/div>\r\n    <\/div>\r\n\r\n    <div class=\"button-group\">\r\n      <button class=\"btn-primary\" onclick=\"calculate()\">\r\n        <i class=\"fas fa-calculator\"><\/i> Calculate Optimal Loading\r\n      <\/button>\r\n      <button class=\"btn-outline\" onclick=\"resetForm()\">\r\n        <i class=\"fas fa-redo\"><\/i> Reset\r\n      <\/button>\r\n      <button class=\"btn-success\" onclick=\"saveConfiguration()\">\r\n        <i class=\"fas fa-save\"><\/i> Save Configuration\r\n      <\/button>\r\n    <\/div>\r\n  <\/div>\r\n\r\n  <div class=\"loading\" id=\"loadingIndicator\">\r\n    <div class=\"loading-spinner\"><\/div>\r\n    <p>Calculating optimal container layout...<\/p>\r\n  <\/div>\r\n\r\n  <div class=\"results\" id=\"results\">\r\n    <h2><i class=\"fas fa-chart-bar\"><\/i> Calculation Results<\/h2>\r\n    \r\n    <div class=\"tabs\">\r\n      <div class=\"tab active\" onclick=\"switchTab('summary')\">Summary<\/div>\r\n      <div class=\"tab\" onclick=\"switchTab('details')\">Detailed Results<\/div>\r\n      <div class=\"tab\" onclick=\"switchTab('visualization')\">3D Visualization<\/div>\r\n      <div class=\"tab\" onclick=\"switchTab('costs')\">Cost Analysis<\/div>\r\n    <\/div>\r\n\r\n    <div id=\"summaryTab\" class=\"tab-content active\">\r\n      <div class=\"stats-grid\">\r\n        <div class=\"stat-item\">\r\n          <span class=\"stat-label\">Total Cartons<\/span>\r\n          <span class=\"stat-value\" id=\"totalCartons\">\u2014<\/span>\r\n        <\/div>\r\n        <div class=\"stat-item\">\r\n          <span class=\"stat-label\">Total Volume<\/span>\r\n          <span class=\"stat-value\" id=\"totalVolume\">\u2014<\/span>\r\n        <\/div>\r\n        <div class=\"stat-item\">\r\n          <span class=\"stat-label\">Total Weight<\/span>\r\n          <span class=\"stat-value\" id=\"totalWeight\">\u2014<\/span>\r\n        <\/div>\r\n        <div class=\"stat-item\">\r\n          <span class=\"stat-label\">Optimal Container<\/span>\r\n          <span class=\"stat-value\" id=\"optimalContainer\">\u2014<\/span>\r\n        <\/div>\r\n      <\/div>\r\n\r\n      <h3>Container Comparison<\/h3>\r\n      <div class=\"container-comparison\" id=\"containerComparison\">\r\n        <!-- Container cards will be inserted here -->\r\n      <\/div>\r\n    <\/div>\r\n\r\n    <div id=\"detailsTab\" class=\"tab-content\">\r\n      <div id=\"container20ft\" style=\"display:none;\">\r\n        <h3>20ft Standard Container<\/h3>\r\n        <div class=\"stats-grid\">\r\n          <div class=\"stat-item\">\r\n            <span class=\"stat-label\">Containers Needed<\/span>\r\n            <span class=\"stat-value\" id=\"num20\">\u2014<\/span>\r\n          <\/div>\r\n          <div class=\"stat-item\">\r\n            <span class=\"stat-label\">Cartons per Container<\/span>\r\n            <span class=\"stat-value\" id=\"per20\">\u2014<\/span>\r\n          <\/div>\r\n          <div class=\"stat-item\">\r\n            <span class=\"stat-label\">Space Utilization<\/span>\r\n            <span class=\"stat-value\" id=\"util20\">\u2014<\/span>\r\n          <\/div>\r\n          <div class=\"stat-item\">\r\n            <span class=\"stat-label\">Weight Utilization<\/span>\r\n            <span class=\"stat-value\" id=\"weightUtil20\">\u2014<\/span>\r\n          <\/div>\r\n        <\/div>\r\n        <div class=\"layout-box\">\r\n          <strong>Optimal 3D Layout:<\/strong><br>\r\n          <span id=\"layout20\">\u2014<\/span>\r\n        <\/div>\r\n      <\/div>\r\n\r\n      <div id=\"container40ft\" style=\"display:none;\">\r\n        <h3>40ft Standard Container<\/h3>\r\n        <div class=\"stats-grid\">\r\n          <div class=\"stat-item\">\r\n            <span class=\"stat-label\">Containers Needed<\/span>\r\n            <span class=\"stat-value\" id=\"num40\">\u2014<\/span>\r\n          <\/div>\r\n          <div class=\"stat-item\">\r\n            <span class=\"stat-label\">Cartons per Container<\/span>\r\n            <span class=\"stat-value\" id=\"per40\">\u2014<\/span>\r\n          <\/div>\r\n          <div class=\"stat-item\">\r\n            <span class=\"stat-label\">Space Utilization<\/span>\r\n            <span class=\"stat-value\" id=\"util40\">\u2014<\/span>\r\n          <\/div>\r\n          <div class=\"stat-item\">\r\n            <span class=\"stat-label\">Weight Utilization<\/span>\r\n            <span class=\"stat-value\" id=\"weightUtil40\">\u2014<\/span>\r\n          <\/div>\r\n        <\/div>\r\n        <div class=\"layout-box\">\r\n          <strong>Optimal 3D Layout:<\/strong><br>\r\n          <span id=\"layout40\">\u2014<\/span>\r\n        <\/div>\r\n      <\/div>\r\n\r\n      <div id=\"container40hc\" style=\"display:none;\">\r\n        <h3>40ft High Cube Container<\/h3>\r\n        <div class=\"stats-grid\">\r\n          <div class=\"stat-item\">\r\n            <span class=\"stat-label\">Containers Needed<\/span>\r\n            <span class=\"stat-value\" id=\"num40hc\">\u2014<\/span>\r\n          <\/div>\r\n          <div class=\"stat-item\">\r\n            <span class=\"stat-label\">Cartons per Container<\/span>\r\n            <span class=\"stat-value\" id=\"per40hc\">\u2014<\/span>\r\n          <\/div>\r\n          <div class=\"stat-item\">\r\n            <span class=\"stat-label\">Space Utilization<\/span>\r\n            <span class=\"stat-value\" id=\"util40hc\">\u2014<\/span>\r\n          <\/div>\r\n          <div class=\"stat-item\">\r\n            <span class=\"stat-label\">Weight Utilization<\/span>\r\n            <span class=\"stat-value\" id=\"weightUtil40hc\">\u2014<\/span>\r\n          <\/div>\r\n        <\/div>\r\n        <div class=\"layout-box\">\r\n          <strong>Optimal 3D Layout:<\/strong><br>\r\n          <span id=\"layout40hc\">\u2014<\/span>\r\n        <\/div>\r\n      <\/div>\r\n\r\n      <div id=\"customContainerResult\" style=\"display:none;\">\r\n        <h3>Custom Container<\/h3>\r\n        <div class=\"stats-grid\">\r\n          <div class=\"stat-item\">\r\n            <span class=\"stat-label\">Containers Needed<\/span>\r\n            <span class=\"stat-value\" id=\"numCustom\">\u2014<\/span>\r\n          <\/div>\r\n          <div class=\"stat-item\">\r\n            <span class=\"stat-label\">Cartons per Container<\/span>\r\n            <span class=\"stat-value\" id=\"perCustom\">\u2014<\/span>\r\n          <\/div>\r\n          <div class=\"stat-item\">\r\n            <span class=\"stat-label\">Space Utilization<\/span>\r\n            <span class=\"stat-value\" id=\"utilCustom\">\u2014<\/span>\r\n          <\/div>\r\n          <div class=\"stat-item\">\r\n            <span class=\"stat-label\">Weight Utilization<\/span>\r\n            <span class=\"stat-value\" id=\"weightUtilCustom\">\u2014<\/span>\r\n          <\/div>\r\n        <\/div>\r\n        <div class=\"layout-box\">\r\n          <strong>Optimal 3D Layout:<\/strong><br>\r\n          <span id=\"layoutCustom\">\u2014<\/span>\r\n        <\/div>\r\n      <\/div>\r\n    <\/div>\r\n\r\n    <div id=\"visualizationTab\" class=\"tab-content\">\r\n      <div class=\"visualization\">\r\n        <h3>3D Packing Visualization<\/h3>\r\n        <div class=\"visualization-container\">\r\n          <div class=\"container-3d\" id=\"container3d\">\r\n            <div class=\"container-box\" id=\"containerBox\">\r\n              <!-- Cartons will be visualized here -->\r\n            <\/div>\r\n          <\/div>\r\n          <div class=\"controls-3d\">\r\n            <button class=\"btn-outline\" onclick=\"rotateView('x')\">\r\n              <i class=\"fas fa-sync\"><\/i> Rotate X\r\n            <\/button>\r\n            <button class=\"btn-outline\" onclick=\"rotateView('y')\">\r\n              <i class=\"fas fa-sync\"><\/i> Rotate Y\r\n            <\/button>\r\n            <button class=\"btn-outline\" onclick=\"rotateView('z')\">\r\n              <i class=\"fas fa-sync\"><\/i> Rotate Z\r\n            <\/button>\r\n            <button class=\"btn-outline\" onclick=\"resetView()\">\r\n              <i class=\"fas fa-undo\"><\/i> Reset View\r\n            <\/button>\r\n          <\/div>\r\n        <\/div>\r\n        <p class=\"text-center\">Visualization shows the optimal packing arrangement for the selected container type.<\/p>\r\n      <\/div>\r\n    <\/div>\r\n\r\n    <div id=\"costsTab\" class=\"tab-content\">\r\n      <div class=\"cost-analysis\">\r\n        <h3>Shipping Cost Analysis<\/h3>\r\n        <div class=\"cost-grid\" id=\"costGrid\">\r\n          <!-- Cost analysis will be displayed here -->\r\n        <\/div>\r\n        <div class=\"layout-box\">\r\n          <strong>Cost Saving Recommendations:<\/strong><br>\r\n          <span id=\"costRecommendations\">\u2014<\/span>\r\n        <\/div>\r\n      <\/div>\r\n    <\/div>\r\n\r\n    <div class=\"export-options\">\r\n      <button class=\"btn-outline\" onclick=\"exportToPDF()\">\r\n        <i class=\"fas fa-file-pdf\"><\/i> Export to PDF\r\n      <\/button>\r\n      <button class=\"btn-outline\" onclick=\"exportToExcel()\">\r\n        <i class=\"fas fa-file-excel\"><\/i> Export to Excel\r\n      <\/button>\r\n      <button class=\"btn-outline\" onclick=\"printResults()\">\r\n        <i class=\"fas fa-print\"><\/i> Print Results\r\n      <\/button>\r\n    <\/div>\r\n  <\/div>\r\n\r\n  <div class=\"history-panel\">\r\n    <h3><i class=\"fas fa-history\"><\/i> Calculation History<\/h3>\r\n    <div id=\"historyList\">\r\n      <!-- Calculation history will be displayed here -->\r\n    <\/div>\r\n  <\/div>\r\n<\/div>\r\n\r\n<footer>\r\n  <p>Advanced Container Loading Calculator \u00a9 2025 | Optimized for exporters, freight forwarders & logistics managers<\/p>\r\n  <p>Disclaimer: Results are estimates. Actual loading may vary based on packaging, handling requirements, and other factors.<\/p>\r\n<\/footer>\r\n\r\n<script>\r\n\/\/ Container specifications (internal dimensions in cm)\r\nconst CONTAINERS = {\r\n  \"20\": { name: \"20ft Standard\", length: 589, width: 235, height: 239, volume: 33.2, maxWeight: 22000, cost: 3500 },\r\n  \"40\": { name: \"40ft Standard\", length: 1203, width: 235, height: 239, volume: 67.7, maxWeight: 27000, cost: 5500 },\r\n  \"40hc\": { name: \"40ft High Cube\", length: 1203, width: 235, height: 269, volume: 76.3, maxWeight: 27000, cost: 6000 }\r\n};\r\n\r\nlet currentResults = null;\r\nlet calculationHistory = JSON.parse(localStorage.getItem('containerCalcHistory')) || [];\r\nlet cartonTypeCount = 1;\r\n\r\n\/\/ Initialize the application\r\ndocument.addEventListener('DOMContentLoaded', function() {\r\n  \/\/ Add sample data button\r\n  const buttonGroup = document.querySelector('.button-group');\r\n  const sampleButton = document.createElement('button');\r\n  sampleButton.className = 'btn-outline';\r\n  sampleButton.innerHTML = '<i class=\"fas fa-vial\"><\/i> Load Sample Data';\r\n  sampleButton.onclick = loadSampleData;\r\n  buttonGroup.appendChild(sampleButton);\r\n\r\n  \/\/ Toggle custom container options\r\n  document.getElementById('containerType').addEventListener('change', function() {\r\n    const customOptions = document.getElementById('customContainerOptions');\r\n    if (this.value === 'custom') {\r\n      customOptions.style.display = 'block';\r\n    } else {\r\n      customOptions.style.display = 'none';\r\n    }\r\n  });\r\n\r\n  \/\/ Load calculation history\r\n  renderHistory();\r\n});\r\n\r\n\/\/ Show notification\r\nfunction showNotification(message, type) {\r\n  const notification = document.getElementById(`${type}Notification`);\r\n  notification.textContent = message;\r\n  notification.style.display = 'block';\r\n  \r\n  \/\/ Auto hide after 5 seconds\r\n  setTimeout(() => {\r\n    notification.style.display = 'none';\r\n  }, 5000);\r\n}\r\n\r\n\/\/ Reset form\r\nfunction resetForm() {\r\n  document.getElementById('cartonLength').value = '';\r\n  document.getElementById('cartonWidth').value = '';\r\n  document.getElementById('cartonHeight').value = '';\r\n  document.getElementById('cartonWeight').value = '';\r\n  document.getElementById('cartonQty').value = '';\r\n  document.getElementById('containerType').value = 'both';\r\n  \r\n  document.getElementById('customContainerOptions').style.display = 'none';\r\n  document.getElementById('results').style.display = 'none';\r\n  \r\n  \/\/ Clear additional carton types\r\n  document.getElementById('cartonTypesContainer').innerHTML = '';\r\n  cartonTypeCount = 1;\r\n  \r\n  showNotification('Form has been reset', 'success');\r\n}\r\n\r\n\/\/ Add a new carton type\r\nfunction addCartonType() {\r\n  cartonTypeCount++;\r\n  const cartonTypesContainer = document.getElementById('cartonTypesContainer');\r\n  \r\n  const cartonType = document.createElement('div');\r\n  cartonType.className = 'carton-type';\r\n  cartonType.innerHTML = `\r\n    <div class=\"carton-type-header\">\r\n      <div class=\"carton-type-title\">Carton Type ${cartonTypeCount}<\/div>\r\n      <button class=\"remove-carton-type\" onclick=\"removeCartonType(this)\"><i class=\"fas fa-times\"><\/i><\/button>\r\n    <\/div>\r\n    <div class=\"form-grid\">\r\n      <div class=\"input-group\">\r\n        <label>Length (cm)<\/label>\r\n        <input type=\"number\" class=\"carton-type-length\" placeholder=\"e.g. 50\" min=\"1\" step=\"0.1\">\r\n      <\/div>\r\n      <div class=\"input-group\">\r\n        <label>Width (cm)<\/label>\r\n        <input type=\"number\" class=\"carton-type-width\" placeholder=\"e.g. 30\" min=\"1\" step=\"0.1\">\r\n      <\/div>\r\n      <div class=\"input-group\">\r\n        <label>Height (cm)<\/label>\r\n        <input type=\"number\" class=\"carton-type-height\" placeholder=\"e.g. 20\" min=\"1\" step=\"0.1\">\r\n      <\/div>\r\n      <div class=\"input-group\">\r\n        <label>Weight (kg)<\/label>\r\n        <input type=\"number\" class=\"carton-type-weight\" placeholder=\"e.g. 5\" min=\"0.1\" step=\"0.1\">\r\n      <\/div>\r\n      <div class=\"input-group\">\r\n        <label>Quantity<\/label>\r\n        <input type=\"number\" class=\"carton-type-quantity\" placeholder=\"e.g. 200\" min=\"1\">\r\n      <\/div>\r\n    <\/div>\r\n  `;\r\n  \r\n  cartonTypesContainer.appendChild(cartonType);\r\n}\r\n\r\n\/\/ Remove a carton type\r\nfunction removeCartonType(button) {\r\n  const cartonType = button.closest('.carton-type');\r\n  cartonType.remove();\r\n  cartonTypeCount--;\r\n  \r\n  \/\/ Update titles\r\n  const cartonTypes = document.querySelectorAll('.carton-type');\r\n  cartonTypes.forEach((type, index) => {\r\n    type.querySelector('.carton-type-title').textContent = `Carton Type ${index + 2}`;\r\n  });\r\n}\r\n\r\n\/\/ Switch between tabs\r\nfunction switchTab(tabName) {\r\n  \/\/ Hide all tab contents\r\n  document.querySelectorAll('.tab-content').forEach(tab => {\r\n    tab.classList.remove('active');\r\n  });\r\n  \r\n  \/\/ Remove active class from all tabs\r\n  document.querySelectorAll('.tab').forEach(tab => {\r\n    tab.classList.remove('active');\r\n  });\r\n  \r\n  \/\/ Show selected tab content\r\n  document.getElementById(`${tabName}Tab`).classList.add('active');\r\n  \r\n  \/\/ Add active class to clicked tab\r\n  event.target.classList.add('active');\r\n}\r\n\r\n\/\/ Try all orientations for optimal packing\r\nfunction tryAllOrientations(L, W, H, contL, contW, contH) {\r\n  const dims = [\r\n    [L, W, H],\r\n    [L, H, W],\r\n    [W, L, H],\r\n    [W, H, L],\r\n    [H, L, W],\r\n    [H, W, L]\r\n  ];\r\n\r\n  let best = { count: 0, layout: \"\", utilization: 0, orientation: [] };\r\n  dims.forEach(([cl, cw, ch]) => {\r\n    const alongL = Math.floor(contL \/ cl);\r\n    const alongW = Math.floor(contW \/ cw);\r\n    const alongH = Math.floor(contH \/ ch);\r\n    const count = alongL * alongW * alongH;\r\n    const volUsed = count * (cl\/100) * (cw\/100) * (ch\/100);\r\n    const containerVolume = (contL\/100) * (contW\/100) * (contH\/100);\r\n    const util = (volUsed \/ containerVolume) * 100;\r\n\r\n    if (count > best.count) {\r\n      best = {\r\n        count,\r\n        layout: `${alongL} \u00d7 ${alongW} \u00d7 ${alongH} cartons (${cl}\u00d7${cw}\u00d7${ch} cm orientation)`,\r\n        utilization: util.toFixed(1),\r\n        orientation: [alongL, alongW, alongH],\r\n        cartonDims: [cl, cw, ch]\r\n      };\r\n    }\r\n  });\r\n  return best;\r\n}\r\n\r\n\/\/ Calculate weight utilization\r\nfunction calculateWeightUtilization(cartonWeight, cartonsPerContainer, maxWeight) {\r\n  if (!cartonWeight || !maxWeight) return \"N\/A\";\r\n  const totalWeight = cartonWeight * cartonsPerContainer;\r\n  const utilization = (totalWeight \/ maxWeight) * 100;\r\n  return utilization > 100 ? \r\n    `<span style=\"color: var(--secondary)\">${utilization.toFixed(1)}% (EXCEEDS LIMIT)<\/span>` : \r\n    `${utilization.toFixed(1)}%`;\r\n}\r\n\r\n\/\/ Generate container comparison cards\r\nfunction generateContainerCards(results20, results40, results40hc, customResults, totalCartons, totalVolumeM3, totalWeight) {\r\n  const containerComparison = document.getElementById('containerComparison');\r\n  containerComparison.innerHTML = '';\r\n  \r\n  let bestOption = null;\r\n  let bestEfficiency = 0;\r\n  \r\n  \/\/ Check each container type\r\n  const options = [];\r\n  \r\n  if (results20) {\r\n    const containers20 = Math.ceil(totalCartons \/ results20.count);\r\n    const totalVolume20 = containers20 * CONTAINERS[\"20\"].volume;\r\n    const efficiency20 = (totalVolumeM3 \/ totalVolume20) * 100;\r\n    \r\n    options.push({\r\n      type: \"20ft\",\r\n      name: CONTAINERS[\"20\"].name,\r\n      containers: containers20,\r\n      efficiency: efficiency20,\r\n      cost: containers20 * CONTAINERS[\"20\"].cost,\r\n      weightUtil: calculateWeightUtilization(totalWeight \/ totalCartons, results20.count, CONTAINERS[\"20\"].maxWeight),\r\n      results: results20\r\n    });\r\n    \r\n    if (efficiency20 > bestEfficiency) {\r\n      bestEfficiency = efficiency20;\r\n      bestOption = \"20ft\";\r\n    }\r\n  }\r\n  \r\n  if (results40) {\r\n    const containers40 = Math.ceil(totalCartons \/ results40.count);\r\n    const totalVolume40 = containers40 * CONTAINERS[\"40\"].volume;\r\n    const efficiency40 = (totalVolumeM3 \/ totalVolume40) * 100;\r\n    \r\n    options.push({\r\n      type: \"40ft\",\r\n      name: CONTAINERS[\"40\"].name,\r\n      containers: containers40,\r\n      efficiency: efficiency40,\r\n      cost: containers40 * CONTAINERS[\"40\"].cost,\r\n      weightUtil: calculateWeightUtilization(totalWeight \/ totalCartons, results40.count, CONTAINERS[\"40\"].maxWeight),\r\n      results: results40\r\n    });\r\n    \r\n    if (efficiency40 > bestEfficiency) {\r\n      bestEfficiency = efficiency40;\r\n      bestOption = \"40ft\";\r\n    }\r\n  }\r\n  \r\n  if (results40hc) {\r\n    const containers40hc = Math.ceil(totalCartons \/ results40hc.count);\r\n    const totalVolume40hc = containers40hc * CONTAINERS[\"40hc\"].volume;\r\n    const efficiency40hc = (totalVolumeM3 \/ totalVolume40hc) * 100;\r\n    \r\n    options.push({\r\n      type: \"40hc\",\r\n      name: CONTAINERS[\"40hc\"].name,\r\n      containers: containers40hc,\r\n      efficiency: efficiency40hc,\r\n      cost: containers40hc * CONTAINERS[\"40hc\"].cost,\r\n      weightUtil: calculateWeightUtilization(totalWeight \/ totalCartons, results40hc.count, CONTAINERS[\"40hc\"].maxWeight),\r\n      results: results40hc\r\n    });\r\n    \r\n    if (efficiency40hc > bestEfficiency) {\r\n      bestEfficiency = efficiency40hc;\r\n      bestOption = \"40hc\";\r\n    }\r\n  }\r\n  \r\n  if (customResults) {\r\n    const containersCustom = Math.ceil(totalCartons \/ customResults.count);\r\n    const customVolume = (customResults.containerLength\/100) * (customResults.containerWidth\/100) * (customResults.containerHeight\/100);\r\n    const totalVolumeCustom = containersCustom * customVolume;\r\n    const efficiencyCustom = (totalVolumeM3 \/ totalVolumeCustom) * 100;\r\n    \r\n    options.push({\r\n      type: \"custom\",\r\n      name: \"Custom Container\",\r\n      containers: containersCustom,\r\n      efficiency: efficiencyCustom,\r\n      cost: containersCustom * 5000, \/\/ Estimated cost\r\n      weightUtil: \"N\/A\", \/\/ Custom container weight limit not specified\r\n      results: customResults\r\n    });\r\n    \r\n    if (efficiencyCustom > bestEfficiency) {\r\n      bestEfficiency = efficiencyCustom;\r\n      bestOption = \"custom\";\r\n    }\r\n  }\r\n  \r\n  \/\/ Generate cards\r\n  options.forEach(option => {\r\n    const isRecommended = option.type === bestOption;\r\n    const card = document.createElement('div');\r\n    card.className = `container-card ${isRecommended ? 'recommended' : ''}`;\r\n    \r\n    card.innerHTML = `\r\n      <h3>${option.name} ${isRecommended ? '<i class=\"fas fa-star\" style=\"color: gold; margin-left: 10px;\"><\/i>' : ''}<\/h3>\r\n      <div class=\"stats-grid\">\r\n        <div class=\"stat-item\">\r\n          <span class=\"stat-label\">Containers Needed<\/span>\r\n          <span class=\"stat-value\">${option.containers}<\/span>\r\n        <\/div>\r\n        <div class=\"stat-item\">\r\n          <span class=\"stat-label\">Space Efficiency<\/span>\r\n          <span class=\"stat-value\">${option.efficiency.toFixed(1)}%<\/span>\r\n        <\/div>\r\n        <div class=\"stat-item\">\r\n          <span class=\"stat-label\">Estimated Cost<\/span>\r\n          <span class=\"stat-value\">$${option.cost.toLocaleString()}<\/span>\r\n        <\/div>\r\n        <div class=\"stat-item\">\r\n          <span class=\"stat-label\">Weight Utilization<\/span>\r\n          <span class=\"stat-value\">${option.weightUtil}<\/span>\r\n        <\/div>\r\n      <\/div>\r\n      ${isRecommended ? '<p style=\"margin-top: 15px; color: var(--success); font-weight: bold;\"><i class=\"fas fa-check-circle\"><\/i> Most Efficient Option<\/p>' : ''}\r\n    `;\r\n    \r\n    containerComparison.appendChild(card);\r\n  });\r\n  \r\n  \/\/ Update optimal container\r\n  document.getElementById('optimalContainer').textContent = bestOption ? options.find(o => o.type === bestOption).name : \"N\/A\";\r\n}\r\n\r\n\/\/ Generate 3D visualization\r\nfunction generate3DVisualization(results, containerType) {\r\n  const containerBox = document.getElementById('containerBox');\r\n  containerBox.innerHTML = '';\r\n  \r\n  if (!results) return;\r\n  \r\n  const container = CONTAINERS[containerType] || {\r\n    length: results.containerLength,\r\n    width: results.containerWidth,\r\n    height: results.containerHeight\r\n  };\r\n  \r\n  const [countX, countY, countZ] = results.orientation;\r\n  const [cartonL, cartonW, cartonH] = results.cartonDims;\r\n  \r\n  \/\/ Calculate scaling factors for visualization\r\n  const scaleX = 180 \/ container.length;\r\n  const scaleY = 80 \/ container.width;\r\n  const scaleZ = 80 \/ container.height;\r\n  \r\n  \/\/ Create cartons for visualization\r\n  for (let x = 0; x < countX; x++) {\r\n    for (let y = 0; y < countY; y++) {\r\n      for (let z = 0; z < countZ; z++) {\r\n        const carton = document.createElement('div');\r\n        carton.className = 'carton-3d';\r\n        carton.style.width = `${cartonL * scaleX}px`;\r\n        carton.style.height = `${cartonW * scaleY}px`;\r\n        carton.style.marginTop = `${z * cartonH * scaleZ}px`;\r\n        carton.style.marginLeft = `${x * cartonL * scaleX}px`;\r\n        carton.style.transform = `translateY(${y * cartonW * scaleY}px)`;\r\n        \r\n        containerBox.appendChild(carton);\r\n      }\r\n    }\r\n  }\r\n}\r\n\r\n\/\/ Rotate 3D view\r\nfunction rotateView(axis) {\r\n  const containerBox = document.getElementById('containerBox');\r\n  let transform = containerBox.style.transform || 'translate(-50%, -50%)';\r\n  \r\n  \/\/ Extract current rotation values\r\n  let rotateX = 0, rotateY = 0, rotateZ = 0;\r\n  const rotateXMatch = transform.match(\/rotateX\\(([^)]+)deg\\)\/);\r\n  const rotateYMatch = transform.match(\/rotateY\\(([^)]+)deg\\)\/);\r\n  const rotateZMatch = transform.match(\/rotateZ\\(([^)]+)deg\\)\/);\r\n  \r\n  if (rotateXMatch) rotateX = parseInt(rotateXMatch[1]);\r\n  if (rotateYMatch) rotateY = parseInt(rotateYMatch[1]);\r\n  if (rotateZMatch) rotateZ = parseInt(rotateZMatch[1]);\r\n  \r\n  \/\/ Apply new rotation based on axis\r\n  switch(axis) {\r\n    case 'x':\r\n      rotateX = (rotateX + 90) % 360;\r\n      break;\r\n    case 'y':\r\n      rotateY = (rotateY + 90) % 360;\r\n      break;\r\n    case 'z':\r\n      rotateZ = (rotateZ + 90) % 360;\r\n      break;\r\n  }\r\n  \r\n  \/\/ Apply new transform\r\n  containerBox.style.transform = `translate(-50%, -50%) rotateX(${rotateX}deg) rotateY(${rotateY}deg) rotateZ(${rotateZ}deg)`;\r\n}\r\n\r\n\/\/ Reset 3D view\r\nfunction resetView() {\r\n  const containerBox = document.getElementById('containerBox');\r\n  containerBox.style.transform = 'translate(-50%, -50%)';\r\n}\r\n\r\n\/\/ Generate cost analysis\r\nfunction generateCostAnalysis(results20, results40, results40hc, customResults, totalCartons, totalVolumeM3) {\r\n  const costGrid = document.getElementById('costGrid');\r\n  costGrid.innerHTML = '';\r\n  \r\n  const includeCosts = document.getElementById('includeCosts').checked;\r\n  if (!includeCosts) {\r\n    costGrid.innerHTML = '<p>Cost analysis is disabled. Enable it in Advanced Options to see cost details.<\/p>';\r\n    return;\r\n  }\r\n  \r\n  const options = [];\r\n  \r\n  if (results20) {\r\n    const containers20 = Math.ceil(totalCartons \/ results20.count);\r\n    options.push({\r\n      type: \"20ft\",\r\n      name: CONTAINERS[\"20\"].name,\r\n      containers: containers20,\r\n      cost: containers20 * CONTAINERS[\"20\"].cost,\r\n      costPerCbm: (containers20 * CONTAINERS[\"20\"].cost) \/ totalVolumeM3\r\n    });\r\n  }\r\n  \r\n  if (results40) {\r\n    const containers40 = Math.ceil(totalCartons \/ results40.count);\r\n    options.push({\r\n      type: \"40ft\",\r\n      name: CONTAINERS[\"40\"].name,\r\n      containers: containers40,\r\n      cost: containers40 * CONTAINERS[\"40\"].cost,\r\n      costPerCbm: (containers40 * CONTAINERS[\"40\"].cost) \/ totalVolumeM3\r\n    });\r\n  }\r\n  \r\n  if (results40hc) {\r\n    const containers40hc = Math.ceil(totalCartons \/ results40hc.count);\r\n    options.push({\r\n      type: \"40hc\",\r\n      name: CONTAINERS[\"40hc\"].name,\r\n      containers: containers40hc,\r\n      cost: containers40hc * CONTAINERS[\"40hc\"].cost,\r\n      costPerCbm: (containers40hc * CONTAINERS[\"40hc\"].cost) \/ totalVolumeM3\r\n    });\r\n  }\r\n  \r\n  if (customResults) {\r\n    const containersCustom = Math.ceil(totalCartons \/ customResults.count);\r\n    options.push({\r\n      type: \"custom\",\r\n      name: \"Custom Container\",\r\n      containers: containersCustom,\r\n      cost: containersCustom * 5000,\r\n      costPerCbm: (containersCustom * 5000) \/ totalVolumeM3\r\n    });\r\n  }\r\n  \r\n  \/\/ Find the option with lowest cost per CBM\r\n  let bestCostOption = null;\r\n  if (options.length > 0) {\r\n    bestCostOption = options.reduce((prev, current) => \r\n      (prev.costPerCbm < current.costPerCbm) ? prev : current\r\n    );\r\n  }\r\n  \r\n  \/\/ Generate cost items\r\n  options.forEach(option => {\r\n    const isBest = option === bestCostOption;\r\n    const costItem = document.createElement('div');\r\n    costItem.className = 'cost-item';\r\n    if (isBest) costItem.style.background = 'rgba(39, 174, 96, 0.1)';\r\n    \r\n    costItem.innerHTML = `\r\n      <div class=\"cost-label\">${option.name}<\/div>\r\n      <div class=\"cost-value ${isBest ? 'savings' : ''}\">$${option.cost.toLocaleString()}<\/div>\r\n      <div class=\"cost-label\">Cost per CBM: $${option.costPerCbm.toFixed(2)}<\/div>\r\n      <div class=\"cost-label\">Containers: ${option.containers}<\/div>\r\n      ${isBest ? '<div style=\"color: var(--success); margin-top: 5px;\"><i class=\"fas fa-trophy\"><\/i> Best Value<\/div>' : ''}\r\n    `;\r\n    \r\n    costGrid.appendChild(costItem);\r\n  });\r\n  \r\n  \/\/ Generate recommendations\r\n  const recommendations = document.getElementById('costRecommendations');\r\n  if (bestCostOption) {\r\n    recommendations.innerHTML = `\r\n      <ul>\r\n        <li>Using <strong>${bestCostOption.containers} ${bestCostOption.name} container(s)<\/strong> provides the best value at $${bestCostOption.costPerCbm.toFixed(2)} per CBM.<\/li>\r\n        <li>Total shipping cost: <strong>$${bestCostOption.cost.toLocaleString()}<\/strong><\/li>\r\n        <li>Consider consolidating shipments if you don't need full container loads.<\/li>\r\n      <\/ul>\r\n    `;\r\n  } else {\r\n    recommendations.textContent = \"No cost analysis available for the selected options.\";\r\n  }\r\n}\r\n\r\n\/\/ Save configuration\r\nfunction saveConfiguration() {\r\n  const config = {\r\n    cartonLength: document.getElementById('cartonLength').value,\r\n    cartonWidth: document.getElementById('cartonWidth').value,\r\n    cartonHeight: document.getElementById('cartonHeight').value,\r\n    cartonWeight: document.getElementById('cartonWeight').value,\r\n    cartonQty: document.getElementById('cartonQty').value,\r\n    containerType: document.getElementById('containerType').value,\r\n    timestamp: new Date().toISOString()\r\n  };\r\n  \r\n  \/\/ Save to localStorage\r\n  calculationHistory.push(config);\r\n  localStorage.setItem('containerCalcHistory', JSON.stringify(calculationHistory));\r\n  \r\n  showNotification('Configuration saved to history', 'success');\r\n  renderHistory();\r\n}\r\n\r\n\/\/ Render calculation history\r\nfunction renderHistory() {\r\n  const historyList = document.getElementById('historyList');\r\n  \r\n  if (calculationHistory.length === 0) {\r\n    historyList.innerHTML = '<p>No calculation history yet. Save configurations to see them here.<\/p>';\r\n    return;\r\n  }\r\n  \r\n  historyList.innerHTML = '';\r\n  \r\n  \/\/ Show latest 5 calculations\r\n  calculationHistory.slice(-5).reverse().forEach((config, index) => {\r\n    const historyItem = document.createElement('div');\r\n    historyItem.className = 'history-item';\r\n    historyItem.innerHTML = `\r\n      <div><strong>Calculation ${calculationHistory.length - index}<\/strong><\/div>\r\n      <div>${config.cartonLength}\u00d7${config.cartonWidth}\u00d7${config.cartonHeight} cm, ${config.cartonQty} cartons<\/div>\r\n      <div style=\"font-size: 0.8rem; color: var(--text-light);\">${new Date(config.timestamp).toLocaleString()}<\/div>\r\n    `;\r\n    \r\n    historyItem.addEventListener('click', () => {\r\n      loadConfiguration(config);\r\n    });\r\n    \r\n    historyList.appendChild(historyItem);\r\n  });\r\n}\r\n\r\n\/\/ Load configuration from history\r\nfunction loadConfiguration(config) {\r\n  document.getElementById('cartonLength').value = config.cartonLength;\r\n  document.getElementById('cartonWidth').value = config.cartonWidth;\r\n  document.getElementById('cartonHeight').value = config.cartonHeight;\r\n  document.getElementById('cartonWeight').value = config.cartonWeight;\r\n  document.getElementById('cartonQty').value = config.cartonQty;\r\n  document.getElementById('containerType').value = config.containerType;\r\n  \r\n  showNotification('Configuration loaded from history', 'success');\r\n}\r\n\r\n\/\/ Main calculation function\r\nfunction calculate() {\r\n  \/\/ Get inputs\r\n  const cl = parseFloat(document.getElementById(\"cartonLength\").value);\r\n  const cw = parseFloat(document.getElementById(\"cartonWidth\").value);\r\n  const ch = parseFloat(document.getElementById(\"cartonHeight\").value);\r\n  const cartonWeight = parseFloat(document.getElementById(\"cartonWeight\").value) || 0;\r\n  const totalCartons = parseInt(document.getElementById(\"cartonQty\").value);\r\n  const type = document.getElementById(\"containerType\").value;\r\n  const considerWeight = document.getElementById(\"considerWeight\").checked;\r\n  const allowRotation = document.getElementById(\"allowRotation\").checked;\r\n\r\n  \/\/ Validate inputs\r\n  if (!cl || !cw || !ch || !totalCartons) {\r\n    showNotification(\"Please fill in all required fields\", \"error\");\r\n    return;\r\n  }\r\n\r\n  if (cl <= 0 || cw <= 0 || ch <= 0 || totalCartons <= 0) {\r\n    showNotification(\"All values must be positive numbers\", \"error\");\r\n    return;\r\n  }\r\n\r\n  \/\/ Show loading indicator\r\n  document.getElementById('loadingIndicator').style.display = 'block';\r\n  document.getElementById('results').style.display = 'none';\r\n\r\n  \/\/ Calculate carton volume and total values\r\n  const cartonVolumeM3 = (cl * cw * ch) \/ 1_000_000;\r\n  const totalVolumeM3 = cartonVolumeM3 * totalCartons;\r\n  const totalWeightKg = cartonWeight * totalCartons;\r\n\r\n  \/\/ Update basic info\r\n  document.getElementById(\"totalCartons\").textContent = totalCartons.toLocaleString();\r\n  document.getElementById(\"totalVolume\").textContent = `${totalVolumeM3.toFixed(2)} m\u00b3`;\r\n  document.getElementById(\"totalWeight\").textContent = `${totalWeightKg.toLocaleString()} kg`;\r\n\r\n  \/\/ Calculate for different container types\r\n  let results20 = null, results40 = null, results40hc = null, customResults = null;\r\n\r\n  \/\/ Use setTimeout to allow UI to update with loading indicator\r\n  setTimeout(() => {\r\n    try {\r\n      if (type === \"both\" || type === \"20\") {\r\n        results20 = tryAllOrientations(cl, cw, ch, CONTAINERS[\"20\"].length, CONTAINERS[\"20\"].width, CONTAINERS[\"20\"].height);\r\n        \r\n        document.getElementById(\"container20ft\").style.display = \"block\";\r\n        document.getElementById(\"num20\").textContent = Math.ceil(totalCartons \/ results20.count);\r\n        document.getElementById(\"per20\").textContent = results20.count.toLocaleString();\r\n        document.getElementById(\"layout20\").innerHTML = results20.layout;\r\n        document.getElementById(\"util20\").textContent = `${results20.utilization}%`;\r\n        document.getElementById(\"weightUtil20\").innerHTML = calculateWeightUtilization(\r\n          cartonWeight, results20.count, considerWeight ? CONTAINERS[\"20\"].maxWeight : null\r\n        );\r\n      } else {\r\n        document.getElementById(\"container20ft\").style.display = \"none\";\r\n      }\r\n\r\n      if (type === \"both\" || type === \"40\") {\r\n        results40 = tryAllOrientations(cl, cw, ch, CONTAINERS[\"40\"].length, CONTAINERS[\"40\"].width, CONTAINERS[\"40\"].height);\r\n        \r\n        document.getElementById(\"container40ft\").style.display = \"block\";\r\n        document.getElementById(\"num40\").textContent = Math.ceil(totalCartons \/ results40.count);\r\n        document.getElementById(\"per40\").textContent = results40.count.toLocaleString();\r\n        document.getElementById(\"layout40\").innerHTML = results40.layout;\r\n        document.getElementById(\"util40\").textContent = `${results40.utilization}%`;\r\n        document.getElementById(\"weightUtil40\").innerHTML = calculateWeightUtilization(\r\n          cartonWeight, results40.count, considerWeight ? CONTAINERS[\"40\"].maxWeight : null\r\n        );\r\n      } else {\r\n        document.getElementById(\"container40ft\").style.display = \"none\";\r\n      }\r\n\r\n      if (type === \"both\" || type === \"40hc\") {\r\n        results40hc = tryAllOrientations(cl, cw, ch, CONTAINERS[\"40hc\"].length, CONTAINERS[\"40hc\"].width, CONTAINERS[\"40hc\"].height);\r\n        \r\n        document.getElementById(\"container40hc\").style.display = \"block\";\r\n        document.getElementById(\"num40hc\").textContent = Math.ceil(totalCartons \/ results40hc.count);\r\n        document.getElementById(\"per40hc\").textContent = results40hc.count.toLocaleString();\r\n        document.getElementById(\"layout40hc\").innerHTML = results40hc.layout;\r\n        document.getElementById(\"util40hc\").textContent = `${results40hc.utilization}%`;\r\n        document.getElementById(\"weightUtil40hc\").innerHTML = calculateWeightUtilization(\r\n          cartonWeight, results40hc.count, considerWeight ? CONTAINERS[\"40hc\"].maxWeight : null\r\n        );\r\n      } else {\r\n        document.getElementById(\"container40hc\").style.display = \"none\";\r\n      }\r\n\r\n      if (type === \"custom\") {\r\n        const customLength = parseFloat(document.getElementById(\"customLength\").value);\r\n        const customWidth = parseFloat(document.getElementById(\"customWidth\").value);\r\n        const customHeight = parseFloat(document.getElementById(\"customHeight\").value);\r\n        \r\n        if (!customLength || !customWidth || !customHeight) {\r\n          showNotification(\"Please fill in all custom container dimensions\", \"error\");\r\n          document.getElementById('loadingIndicator').style.display = 'none';\r\n          return;\r\n        }\r\n        \r\n        customResults = tryAllOrientations(cl, cw, ch, customLength, customWidth, customHeight);\r\n        customResults.containerLength = customLength;\r\n        customResults.containerWidth = customWidth;\r\n        customResults.containerHeight = customHeight;\r\n        \r\n        document.getElementById(\"customContainerResult\").style.display = \"block\";\r\n        document.getElementById(\"numCustom\").textContent = Math.ceil(totalCartons \/ customResults.count);\r\n        document.getElementById(\"perCustom\").textContent = customResults.count.toLocaleString();\r\n        document.getElementById(\"layoutCustom\").innerHTML = customResults.layout;\r\n        document.getElementById(\"utilCustom\").textContent = `${customResults.utilization}%`;\r\n        document.getElementById(\"weightUtilCustom\").innerHTML = \"N\/A\";\r\n      } else {\r\n        document.getElementById(\"customContainerResult\").style.display = \"none\";\r\n      }\r\n\r\n      \/\/ Generate comparison cards\r\n      generateContainerCards(results20, results40, results40hc, customResults, totalCartons, totalVolumeM3, totalWeightKg);\r\n\r\n      \/\/ Generate 3D visualization for the most efficient container\r\n      let bestResults = null;\r\n      let bestContainerType = null;\r\n      \r\n      if (results20 && (!bestResults || results20.count > bestResults.count)) {\r\n        bestResults = results20;\r\n        bestContainerType = \"20\";\r\n      }\r\n      \r\n      if (results40 && (!bestResults || results40.count > bestResults.count)) {\r\n        bestResults = results40;\r\n        bestContainerType = \"40\";\r\n      }\r\n      \r\n      if (results40hc && (!bestResults || results40hc.count > bestResults.count)) {\r\n        bestResults = results40hc;\r\n        bestContainerType = \"40hc\";\r\n      }\r\n      \r\n      if (customResults && (!bestResults || customResults.count > bestResults.count)) {\r\n        bestResults = customResults;\r\n        bestContainerType = \"custom\";\r\n      }\r\n      \r\n      if (bestResults) {\r\n        generate3DVisualization(bestResults, bestContainerType);\r\n      }\r\n\r\n      \/\/ Generate cost analysis\r\n      generateCostAnalysis(results20, results40, results40hc, customResults, totalCartons, totalVolumeM3);\r\n\r\n      \/\/ Store results for export\r\n      currentResults = {\r\n        cartonDims: {cl, cw, ch},\r\n        cartonWeight,\r\n        totalCartons,\r\n        cartonVolumeM3,\r\n        totalVolumeM3,\r\n        totalWeightKg,\r\n        results20,\r\n        results40,\r\n        results40hc,\r\n        customResults\r\n      };\r\n\r\n      \/\/ Hide loading indicator and show results\r\n      document.getElementById('loadingIndicator').style.display = 'none';\r\n      document.getElementById('results').style.display = 'block';\r\n      document.getElementById('results').scrollIntoView({ behavior: \"smooth\" });\r\n      \r\n      showNotification(\"Calculation completed successfully!\", \"success\");\r\n    } catch (error) {\r\n      document.getElementById('loadingIndicator').style.display = 'none';\r\n      showNotification(\"An error occurred during calculation: \" + error.message, \"error\");\r\n    }\r\n  }, 500);\r\n}\r\n\r\n\/\/ Export to PDF (placeholder)\r\nfunction exportToPDF() {\r\n  showNotification(\"PDF export would be implemented in a full version\", \"warning\");\r\n  \/\/ In a real implementation, this would generate a PDF report\r\n}\r\n\r\n\/\/ Export to Excel (placeholder)\r\nfunction exportToExcel() {\r\n  showNotification(\"Excel export would be implemented in a full version\", \"warning\");\r\n  \/\/ In a real implementation, this would generate an Excel file\r\n}\r\n\r\n\/\/ Print results\r\nfunction printResults() {\r\n  window.print();\r\n}\r\n\r\n\/\/ Load sample data\r\nfunction loadSampleData() {\r\n  document.getElementById('cartonLength').value = 60;\r\n  document.getElementById('cartonWidth').value = 40;\r\n  document.getElementById('cartonHeight').value = 40;\r\n  document.getElementById('cartonWeight').value = 10;\r\n  document.getElementById('cartonQty').value = 1200;\r\n  document.getElementById('containerType').value = 'both';\r\n  \r\n  showNotification('Sample data loaded. Click Calculate to see results.', 'success');\r\n}\r\n<\/script>\r\n<\/body>\r\n<\/html>\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"wd-negative-gap elementor-element elementor-element-162cfb8 e-flex e-con-boxed e-con e-parent\" data-id=\"162cfb8\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-cf766c7 color-scheme-inherit text-left elementor-widget elementor-widget-text-editor\" data-id=\"cf766c7\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t\t\t\t\t\t<h3 dir=\"auto\">Advanced Container Loading Calculator: Free Professional 3D Container Optimization Tool (20ft &amp; 40ft)<\/h3><p dir=\"auto\">In today\u2019s fast-paced global logistics and export industry, maximizing container space while minimizing shipping costs is no longer a nice-to-have; it\u2019s a competitive necessity. The <strong>Advanced Container Loading Calculator<\/strong> is a completely free, browser-based professional tool that helps exporters, freight forwarders, 3PL companies, e-commerce sellers, and manufacturers instantly calculate the optimal way to load 20ft, 40ft standard, 40ft High Cube, or even custom-sized containers with one or multiple carton types.<\/p><p dir=\"auto\">With real-time 3D visualization, volume &amp; weight utilization analysis, multi-container comparison, cost-per-CBM breakdown, and exportable reports, this tool eliminates guesswork and can save thousands of dollars per shipment by achieving 5\u201315 % higher space efficiency compared to manual planning.<\/p><h4 dir=\"auto\">Key Features at a Glance<\/h4><ul dir=\"auto\"><li>Supports unlimited carton types with different dimensions and weights<\/li><li>Tests all 6 possible carton orientations automatically (if enabled)<\/li><li>Instant comparison between 20ft, 40ft, and 40ft High Cube containers<\/li><li>Custom container dimensions option<\/li><li>3D interactive packing visualization<\/li><li>Weight limit control (22\u201327 tons depending on container type)<\/li><li>Shipping cost estimation and cost-per-cubic-meter analysis<\/li><li>\u201cRecommended container\u201d badge based on highest space efficiency<\/li><li>Calculation history and configuration saving<\/li><li>One-click PDF \/ Excel \/ Print export (ready for real implementation)<\/li><li>100 % free \u2013 no registration, no watermarks, no limits<\/li><\/ul><h4 dir=\"auto\">How the Advanced Container Loading Calculator Works (Step-by-Step)<\/h4><p dir=\"auto\"><strong>Step 1 \u2013 Enter Your Carton Details<\/strong> Start by filling in the dimensions (length \u00d7 width \u00d7 height in centimeters) and weight (kg) of your master carton. Then input the total quantity you need to ship. If you have multiple SKUs or different box sizes in the same shipment, simply click \u201cAdd Another Carton Type\u201d as many times as needed. The tool treats each carton type independently and calculates the best mixed loading scenario.<\/p><p dir=\"auto\"><strong>Step 2 \u2013 Choose Container Type<\/strong> Select one of the following options:<\/p><ul dir=\"auto\"><li>\u201cTry both 20ft &amp; 40ft (recommended)\u201d \u2013 the calculator will test all standard containers and show you the most efficient one<\/li><li>Only 20ft Standard<\/li><li>Only 40ft Standard<\/li><li>Only 40ft High Cube<\/li><li>Custom Container (you enter internal length, width, height)<\/li><\/ul><p dir=\"auto\"><strong>Step 3 \u2013 Advanced Options (Optional but Powerful)<\/strong><\/p><ul dir=\"auto\"><li>Consider weight limits \u2013 automatically flags if your cargo exceeds 22 t (20ft) or 27 t (40ft series)<\/li><li>Allow carton rotation \u2013 the algorithm tests all 6 possible orientations and picks the one that fits the maximum number of cartons<\/li><li>Include cost analysis \u2013 displays estimated ocean freight cost and cost-per-CBM for each container option<\/li><\/ul><p dir=\"auto\"><strong>Step 4 \u2013 Click \u201cCalculate Optimal Loading\u201d<\/strong> In less than a second the tool runs thousands of orientation and layout combinations and returns:<\/p><p dir=\"auto\"><strong>A. Summary Dashboard<\/strong><\/p><ul dir=\"auto\"><li>Total cartons, total volume (m\u00b3), total weight (kg)<\/li><li>Recommended container type with a green \u201cRECOMMENDED\u201d ribbon<\/li><\/ul><p dir=\"auto\"><strong>B. Container Comparison Cards<\/strong> Side-by-side cards showing:<\/p><ul dir=\"auto\"><li>How many containers of each type you need<\/li><li>Space utilization percentage<\/li><li>Estimated ocean freight cost<\/li><li>Weight utilization (with red warning if over limit)<\/li><\/ul><p dir=\"auto\"><strong>C. Detailed Results Tab<\/strong> For every container type you selected:<\/p><ul dir=\"auto\"><li>Exact number of cartons that fit in one container<\/li><li>Optimal 3D layout description (e.g., \u201c28 \u00d7 12 \u00d7 10 cartons \u2013 60\u00d740\u00d740 cm orientation\u201d)<\/li><li>Volume utilization %<\/li><li>Weight utilization %<\/li><\/ul><p dir=\"auto\"><strong>D. 3D Visualization Tab<\/strong> An interactive 3D model of the best-performing container filled with your cartons. You can rotate the view on X, Y, and Z axes to visually verify the packing pattern and check for wasted space.<\/p><p dir=\"auto\"><strong>E. Cost Analysis Tab<\/strong> Realistic freight cost estimation (default rates: $3,500 \/ 20ft, $5,500 \/ 40ft, $6,000 \/ 40ft HC) and cost-per-CBM calculation. The tool highlights the cheapest option per cubic meter and gives actionable recommendations (e.g., \u201cUsing two 40ft containers instead of five 20ft containers saves you ~$4,200\u201d).<\/p><p dir=\"auto\"><strong>Step 5 \u2013 Export &amp; Share<\/strong> When you\u2019re ready to send the loading plan to your supplier or forwarder, use the PDF, Excel, or Print buttons. The exported report includes all calculations, the 3D diagram, and the recommended layout \u2013 perfect for factory loading instructions or customs documentation.<\/p><h4 dir=\"auto\">Why This Tool Beats Excel Templates and Paid Software<\/h4><p dir=\"auto\">Most free container calculators on the market are either overly simplistic (ignoring rotation and weight limits) or extremely expensive ($200\u2013$2,000 licenses). This Advanced Container Loading Calculator combines the accuracy of professional software with the accessibility of a free web app.<\/p><p dir=\"auto\">It uses a proven bin-packing algorithm that evaluates every possible carton orientation and instantly shows you not only how many cartons fit, but which container size gives you the lowest cost per cubic meter \u2013 information that directly impacts your landed cost and profit margin.<\/p><h4 dir=\"auto\">Real-World Use Cases<\/h4><ul dir=\"auto\"><li>Amazon FBA &amp; e-commerce sellers optimizing 40ft consolidations<\/li><li>Furniture and machinery exporters switching between 20ft and 40ft HC<\/li><li>Freight forwarders quoting LCL vs FCL for clients<\/li><li>Manufacturers creating factory loading plans to avoid demurrage &amp; detention charges<\/li><li>Sourcing agents comparing actual vs theoretical container utilization for suppliers<\/li><\/ul><h4 dir=\"auto\">Pro Tips for Maximum Space Utilization<\/h4><ol dir=\"auto\"><li>Always enable \u201cAllow carton rotation\u201d \u2013 sometimes turning the carton 90\u00b0 increases utilization by 10\u201320 %.<\/li><li>If you are slightly over the weight limit of a 20ft but have plenty of volume left, consider splitting into two 20fts or upgrading to 40ft HC.<\/li><li>For mixed SKUs, enter the largest\/heaviest carton first \u2013 the tool will still find the global optimum.<\/li><li>Use the \u201cCost Analysis\u201d tab even if rates in your region differ \u2013 you can mentally adjust and still see which container gives the best value.<\/li><\/ol><h4 dir=\"auto\">Technical Specifications Used by the Calculator<\/h4><ul dir=\"auto\"><li>20ft Standard internal dimensions: 5.89 \u00d7 2.35 \u00d7 2.39 m (33.2 m\u00b3) \u2013 max payload ~22 t<\/li><li>40ft Standard: 12.03 \u00d7 2.35 \u00d7 2.39 m (67.7 m\u00b3) \u2013 max payload ~27 t<\/li><li>40ft High Cube: 12.03 \u00d7 2.35 \u00d7 2.69 m (76.3 m\u00b3) \u2013 max payload ~27 t<\/li><\/ul><p><img decoding=\"async\" class=\"wp-image-14008 size-medium aligncenter\" src=\"https:\/\/tendify.net\/wp-content\/uploads\/2025\/11\/20ft-and-40ft-container-dimensions-300x201.jpg\" alt=\"\" width=\"300\" height=\"201\" srcset=\"https:\/\/tendify.net\/wp-content\/uploads\/2025\/11\/20ft-and-40ft-container-dimensions-300x201.jpg 300w, https:\/\/tendify.net\/wp-content\/uploads\/2025\/11\/20ft-and-40ft-container-dimensions-768x515.jpg 768w, https:\/\/tendify.net\/wp-content\/uploads\/2025\/11\/20ft-and-40ft-container-dimensions-18x12.jpg 18w, https:\/\/tendify.net\/wp-content\/uploads\/2025\/11\/20ft-and-40ft-container-dimensions-150x101.jpg 150w, https:\/\/tendify.net\/wp-content\/uploads\/2025\/11\/20ft-and-40ft-container-dimensions.jpg 890w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/p><p dir=\"auto\">All calculations use exact internal dimensions (not door opening restrictions) and floor-loading only (no overhanging or cantilever arrangements).<\/p><h4 dir=\"auto\">Start Saving Money Today \u2013 Completely Free<\/h4><p dir=\"auto\">No signup, no credit card, no installation required. Just open the page, input your carton data, and get professional-grade container stuffing plans in seconds.<\/p><p dir=\"auto\">Whether you ship 50 cartons a month or 500 containers a year, the <strong>Advanced Container Loading Calculator<\/strong> helps you reduce freight costs, avoid over-weight fines, speed up supplier communication, and make smarter consolidation decisions.<\/p><p dir=\"auto\">Try it now \u2013 load the sample data with one click and see how 1,200 cartons of 60\u00d740\u00d740 cm fit perfectly into just two 40ft High Cube containers with 92.4 % space utilization and zero wasted CBM.<\/p><p dir=\"auto\">Optimize your next shipment today and keep more profit in your pocket!<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>\u0628\u0627 \u0645\u062d\u0627\u0633\u0628\u0627\u062a \u062f\u0642\u06cc\u0642 \u06a9\u0627\u0646\u062a\u06cc\u0646\u0631\u060c \u062a\u062c\u0633\u0645 \u0633\u0647\u200c\u0628\u0639\u062f\u06cc \u0648 \u062a\u062d\u0644\u06cc\u0644 \u0647\u0632\u06cc\u0646\u0647\u060c \u062d\u0645\u0644 \u0648 \u0646\u0642\u0644 \u062e\u0648\u062f \u0631\u0627 \u0628\u0647\u06cc\u0646\u0647 \u06a9\u0646\u06cc\u062f<\/p>","protected":false},"author":15,"featured_media":13983,"comment_status":"open","ping_status":"open","sticky":false,"template":"elementor_theme","format":"standard","meta":{"footnotes":""},"categories":[767],"tags":[],"class_list":["post-13981","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-b2b-online-tools"],"_links":{"self":[{"href":"https:\/\/tendify.net\/fa\/wp-json\/wp\/v2\/posts\/13981","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tendify.net\/fa\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tendify.net\/fa\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tendify.net\/fa\/wp-json\/wp\/v2\/users\/15"}],"replies":[{"embeddable":true,"href":"https:\/\/tendify.net\/fa\/wp-json\/wp\/v2\/comments?post=13981"}],"version-history":[{"count":1,"href":"https:\/\/tendify.net\/fa\/wp-json\/wp\/v2\/posts\/13981\/revisions"}],"predecessor-version":[{"id":18485,"href":"https:\/\/tendify.net\/fa\/wp-json\/wp\/v2\/posts\/13981\/revisions\/18485"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/tendify.net\/fa\/wp-json\/wp\/v2\/media\/13983"}],"wp:attachment":[{"href":"https:\/\/tendify.net\/fa\/wp-json\/wp\/v2\/media?parent=13981"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tendify.net\/fa\/wp-json\/wp\/v2\/categories?post=13981"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tendify.net\/fa\/wp-json\/wp\/v2\/tags?post=13981"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}