app/template/default/Product/detail.twig line 1751

Open in your IDE?
  1. {#
  2. This file is part of EC-CUBE
  3. Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved.
  4. http://www.ec-cube.co.jp/
  5. For the full copyright and license information, please view the LICENSE
  6. file that was distributed with this source code.
  7. #}
  8. {% extends 'default_frame.twig' %}
  9. {% set body_class = 'product_page' %}
  10. {% block stylesheet %}
  11.     <style>
  12.         .slick-slider {
  13.             margin-bottom: 10px;
  14.             margin-top: -20px;
  15.         }
  16.         .slick-dots {
  17.             position: absolute;
  18.             bottom: -45px;
  19.             display: block;
  20.             width: 100%;
  21.             padding: 0;
  22.             list-style: none;
  23.             text-align: center;
  24.         }
  25.         .slick-dots li {
  26.             position: relative;
  27.             display: inline-block;
  28.             width: 20px;
  29.             height: 20px;
  30.             margin: 0 5px;
  31.             padding: 0;
  32.             cursor: pointer;
  33.         }
  34.         .slick-dots li button {
  35.             font-size: 0;
  36.             line-height: 0;
  37.             display: block;
  38.             width: 20px;
  39.             height: 20px;
  40.             padding: 5px;
  41.             cursor: pointer;
  42.             color: transparent;
  43.             border: 0;
  44.             outline: none;
  45.             background: transparent;
  46.         }
  47.         .slick-dots li button:hover,
  48.         .slick-dots li button:focus {
  49.             outline: none;
  50.         }
  51.         .slick-dots li button:hover:before,
  52.         .slick-dots li button:focus:before {
  53.             opacity: 1;
  54.         }
  55.         .slick-dots li button:before {
  56.             content: " ";
  57.             line-height: 20px;
  58.             position: absolute;
  59.             top: 0;
  60.             left: 0;
  61.             width: 12px;
  62.             height: 12px;
  63.             text-align: center;
  64.             opacity: .25;
  65.             background-color: black;
  66.             border-radius: 50%;
  67.         }
  68.         .slick-dots li.slick-active button:before {
  69.             opacity: .75;
  70.             background-color: black;
  71.         }
  72.         .slick-dots li button.thumbnail img {
  73.             width: 0;
  74.             height: 0;
  75.         }
  76.     </style>
  77.     <link rel="stylesheet" href="/html/user_data/js/style.css">
  78.     <link rel="stylesheet" href="/html/plugins/icheck-bootstrap/icheck-bootstrap.min.css">
  79.     <style>
  80.         /* ============================================
  81.            商品詳細グリッド: 画像50% / 内容50%(均等)
  82.         ============================================ */
  83.         @media (min-width: 768px) {
  84.             body.product_page .ec-grid2 {
  85.                 display: flex;
  86.                 align-items: flex-start;
  87.             }
  88.             body.product_page .ec-grid2 .ec-grid2__cell {
  89.                 width: 50%;
  90.                 flex: 0 0 50%;
  91.                 min-width: 0;
  92.             }
  93.             body.product_page .ec-grid2 .ec-grid2__cell2 {
  94.                 width: 50%;
  95.                 flex: 0 0 50%;
  96.                 min-width: 0;
  97.             }
  98.         }
  99.         /* ============================================
  100.            商品説明欄内のHTMLが画面幅を突き抜けないように
  101.         ============================================ */
  102.         body.product_page .ec-productRole__description {
  103.             min-width: 0;
  104.             overflow-wrap: break-word;
  105.             word-break: break-word;
  106.         }
  107.         body.product_page .ec-productRole__description img,
  108.         body.product_page .ec-productRole__description table,
  109.         body.product_page .ec-productRole__description iframe,
  110.         body.product_page .ec-productRole__description video {
  111.             max-width: 100% !important;
  112.             height: auto;
  113.         }
  114.         body.product_page .ec-productRole__description table {
  115.             display: block;
  116.             overflow-x: auto;
  117.             -webkit-overflow-scrolling: touch;
  118.         }
  119.         /* ============================================
  120.            スマホ用 見積金額 下部固定バー
  121.         ============================================ */
  122.         #sp-mitsumori-bar {
  123.             display: none;
  124.         }
  125.         
  126.         /* ============================================
  127.            商品タイプ選択 共通スタイル
  128.         ============================================ */
  129.         /* セクションラベル */
  130.         .rp-section-label {
  131.             font-size: 14px;
  132.             font-weight: bold;
  133.             color: #333;
  134.             margin-bottom: 10px;
  135.         }
  136.         .rp-section-label span {
  137.             font-weight: normal;
  138.             color: #c00;
  139.         }
  140.         /* ---- 1. 画像付きカード ---- */
  141.         .rp-card-group {
  142.             display: flex;
  143.             flex-wrap: wrap;
  144.             gap: 8px;
  145.             margin-bottom: 4px;
  146.         }
  147.         .rp-card {
  148.             position: relative;
  149.             cursor: pointer;
  150.             width: 110px;
  151.             border: 2px solid #ddd;
  152.             border-radius: 10px;
  153.             overflow: hidden;
  154.             transition: border-color 0.2s, box-shadow 0.2s;
  155.             background: #fff;
  156.         }
  157.         .rp-card:hover {
  158.             border-color: #999;
  159.             box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  160.         }
  161.         .rp-card.is-selected {
  162.             border-color: #1a6fcf;
  163.             box-shadow: 0 2px 10px rgba(26,111,207,0.25);
  164.         }
  165.         .rp-card input[type="radio"] { display: none; }
  166.         .rp-card__image {
  167.             width: 100%;
  168.             aspect-ratio: 1 / 1;
  169.             object-fit: cover;
  170.             display: block;
  171.             background: #f5f5f5;
  172.         }
  173.         .rp-card__placeholder {
  174.             width: 100%;
  175.             aspect-ratio: 1 / 1;
  176.             background: #f0f0f0;
  177.             display: flex;
  178.             align-items: center;
  179.             justify-content: center;
  180.             color: #bbb;
  181.             font-size: 24px;
  182.         }
  183.         .rp-card__name {
  184.             display: block;
  185.             padding: 5px 5px;
  186.             font-size: 11px;
  187.             color: #333;
  188.             text-align: center;
  189.             line-height: 1.4;
  190.             word-break: break-all;
  191.         }
  192.         .rp-card.is-selected .rp-card__name { color: #1a6fcf; font-weight: bold; }
  193.         .rp-card.is-selected::after {
  194.             content: "✓";
  195.             position: absolute;
  196.             top: 3px; right: 6px;
  197.             color: #1a6fcf;
  198.             font-size: 13px;
  199.             font-weight: bold;
  200.         }
  201.         /* ---- 2. ボタン式ラジオ(画像なし・8個以内)---- */
  202.         .rp-btn-group {
  203.             display: flex;
  204.             flex-wrap: wrap;
  205.             gap: 8px;
  206.             margin-bottom: 4px;
  207.             max-width: 100%;
  208.             min-width: 0;
  209.         }
  210.         .rp-btn {
  211.             cursor: pointer;
  212.             padding: 8px 14px;
  213.             border: 2px solid #ddd;
  214.             border-radius: 10px;
  215.             font-size: 13px;
  216.             color: #333;
  217.             background: #fff;
  218.             transition: border-color 0.2s, background 0.2s;
  219.             white-space: nowrap;
  220.             max-width: 100%;
  221.             overflow: hidden;
  222.             text-overflow: ellipsis;
  223.         }
  224.         .rp-btn:hover { border-color: #999; }
  225.         .rp-btn.is-selected {
  226.             border-color: #1a6fcf;
  227.             color: #1a6fcf;
  228.             font-weight: bold;
  229.             background: #f0f6ff;
  230.         }
  231.         .rp-btn input[type="radio"] { display: none; }
  232.         /* ---- ボタン群が3行以上になる場合は1行横スクロール ---- */
  233.         .rp-btn-group.is-scroll,
  234.         .opt-btn-group.is-scroll {
  235.             flex-wrap: nowrap;
  236.             overflow-x: auto;
  237.             overflow-y: hidden;
  238.             -webkit-overflow-scrolling: touch;
  239.             scrollbar-width: thin;
  240.             padding-bottom: 6px;
  241.         }
  242.         .rp-btn-group.is-scroll::-webkit-scrollbar,
  243.         .opt-btn-group.is-scroll::-webkit-scrollbar {
  244.             height: 6px;
  245.         }
  246.         .rp-btn-group.is-scroll::-webkit-scrollbar-thumb,
  247.         .opt-btn-group.is-scroll::-webkit-scrollbar-thumb {
  248.             background: #c0c0c0;
  249.             border-radius: 3px;
  250.         }
  251.         .rp-btn-group.is-scroll > .rp-btn,
  252.         .opt-btn-group.is-scroll > .opt-btn {
  253.             flex: 0 0 auto;
  254.         }
  255.         /* ---- 3. プルダウン(画像なし・9個以上)---- */
  256.         .rp-select-wrap {
  257.             margin-bottom: 4px;
  258.         }
  259.         .rp-select {
  260.             width: 100%;
  261.             max-width: 420px;
  262.             padding: 8px 12px;
  263.             border: 2px solid #ddd;
  264.             border-radius: 10px;
  265.             font-size: 13px;
  266.             color: #333;
  267.             background: #fff;
  268.             appearance: none;
  269.             background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23666' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  270.             background-repeat: no-repeat;
  271.             background-position: right 12px center;
  272.             cursor: pointer;
  273.         }
  274.         .rp-select:focus {
  275.             outline: none;
  276.             border-color: #1a6fcf;
  277.         }
  278.         /* ---- オプション選択ボタン(枠線ラジオ)---- */
  279.         .opt-btn-group {
  280.             display: flex;
  281.             flex-wrap: wrap;
  282.             gap: 8px;
  283.             padding: 6px 0;
  284.             max-width: 100%;
  285.             min-width: 0;
  286.         }
  287.         .opt-btn {
  288.             cursor: pointer;
  289.             padding: 7px 14px;
  290.             border: 2px solid #ddd;
  291.             border-radius: 10px;
  292.             font-size: 13px;
  293.             color: #333;
  294.             background: #fff;
  295.             transition: border-color 0.2s, background 0.2s;
  296.             white-space: nowrap;
  297.             max-width: 100%;
  298.             overflow: hidden;
  299.             text-overflow: ellipsis;
  300.         }
  301.         .opt-btn:hover { border-color: #999; }
  302.         .opt-btn.is-selected {
  303.             border-color: #1a6fcf;
  304.             color: #1a6fcf;
  305.             font-weight: bold;
  306.             background: #f0f6ff;
  307.         }
  308.         .opt-btn input[type="radio"] { display: none; }
  309.         /* ============================================
  310.            施工エリア案内
  311.         ============================================ */
  312.         .ec-areaNotice {
  313.             margin: 16px 0;
  314.             padding: 16px 20px;
  315.             background: #f8f9fa;
  316.             border-left: 4px solid #1a6fcf;
  317.             border-radius: 0 8px 8px 0;
  318.         }
  319.         .ec-areaNotice__inner {
  320.             display: flex;
  321.             align-items: flex-start;
  322.             gap: 12px;
  323.         }
  324.         .ec-areaNotice__icon {
  325.             font-size: 22px;
  326.             line-height: 1;
  327.             flex-shrink: 0;
  328.             margin-top: 2px;
  329.         }
  330.         .ec-areaNotice__body {
  331.             flex: 1;
  332.         }
  333.         .ec-areaNotice__title {
  334.             font-size: 13px;
  335.             font-weight: bold;
  336.             color: #1a6fcf;
  337.             margin: 0 0 6px;
  338.         }
  339.         .ec-areaNotice__text {
  340.             font-size: 13px;
  341.             color: #444;
  342.             line-height: 1.7;
  343.             margin: 0;
  344.         }
  345.         .ec-areaNotice__text strong {
  346.             color: #222;
  347.         }
  348.         .ec-areaNotice__link {
  349.             display: inline-block;
  350.             margin-top: 8px;
  351.             font-size: 12px;
  352.             color: #1a6fcf;
  353.             text-decoration: underline;
  354.         }
  355.         .ec-areaNotice__link:hover {
  356.             color: #0d4fa0;
  357.         }
  358.         /* ============================================
  359.            SNSシェア + ブランド名 タイトル行
  360.         ============================================ */
  361.         .ec-productRole__titleRow {
  362.             display: flex;
  363.             align-items: center;
  364.             justify-content: space-between;
  365.             gap: 8px;
  366.             margin-bottom: 4px;
  367.         }
  368.         .ec-productRole__titleRow .ec-headingTitle {
  369.             margin: 0;
  370.             flex: 1;
  371.             font-size: 18px;
  372.         }
  373.         .ec-share-inline {
  374.             display: flex;
  375.             align-items: center;
  376.             gap: 8px;
  377.             flex-shrink: 0;
  378.         }
  379.         @media (max-width: 767px) {
  380.             /* maker_area の float を解除して独立表示 */
  381.             #maker_area {
  382.                 float: none !important;
  383.                 width: auto !important;
  384.                 height: auto !important;
  385.                 display: block;
  386.                 margin-bottom: 4px;
  387.             }
  388.             /* タイトル行: 商品名が全幅を占有しSNSは右寄せ下段 */
  389.             .ec-productRole__titleRow {
  390.                 flex-wrap: wrap;
  391.                 clear: both;
  392.             }
  393.             .ec-productRole__titleRow .ec-headingTitle {
  394.                 flex: 1 1 100%;
  395.                 font-size: 16px;
  396.             }
  397.             .ec-share-inline {
  398.                 flex: 0 0 auto;
  399.                 margin-left: auto;
  400.             }
  401.         }
  402.         .ec-share-inline a {
  403.             display: flex;
  404.             align-items: center;
  405.             justify-content: center;
  406.             width: 32px;
  407.             height: 32px;
  408.             border-radius: 50%;
  409.             font-size: 15px;
  410.             color: #fff;
  411.             text-decoration: none;
  412.             transition: opacity 0.2s;
  413.         }
  414.         .ec-share-inline a:hover { opacity: 0.8; }
  415.         .ec-share-inline .share-twitter  { background: #000; }
  416.         .ec-share-inline .share-facebook { background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); }
  417.         .ec-share-inline .share-line     { background: #06c755; }
  418.         /* description_detail下のシェアブロックはPC/スマホ共通で非表示(タイトル行に移動) */
  419.         .ec-productRole__share { display: none; }
  420.         /* ============================================
  421.            PC用: 現在のお見積り額カード強調
  422.         ============================================ */
  423.         @media (min-width: 768px) {
  424.             .mitsumori-card-pc {
  425.                 border: 2px solid #1a6fcf !important;
  426.                 border-radius: 10px !important;
  427.                 box-shadow: 0 4px 16px rgba(26,111,207,0.18) !important;
  428.                 margin-top: 20px;
  429.                 overflow: hidden;
  430.                 background: linear-gradient(135deg, #1a6fcf, #0d4fa0) !important;
  431.             }
  432.             .mitsumori-card-pc .card-header {
  433.                 background: linear-gradient(135deg, #1a6fcf, #0d4fa0) !important;
  434.                 color: #fff !important;
  435.                 padding: 14px 16px !important;
  436.                 border-bottom: none !important;
  437.             }
  438.             .mitsumori-card-pc .card-title {
  439.                 color: #fff !important;
  440.                 font-size: 15px !important;
  441.                 font-weight: bold !important;
  442.                 margin: 0 !important;
  443.             }
  444.             .mitsumori-card-pc #mitsumori_message {
  445.                 font-size: 22px !important;
  446.                 font-weight: bold !important;
  447.                 color: #fff !important;
  448.             }
  449.             .mitsumori-card-pc .btn-tool {
  450.                 color: #fff !important;
  451.             }
  452.             /* 合計行を大きく強調 */
  453.             .mitsumori-card-pc .nav-item:first-child .nav-link {
  454.                 font-size: 16px !important;
  455.                 font-weight: bold !important;
  456.                 color: #c00 !important;
  457.                 background: #fff8f8 !important;
  458.                 padding: 12px 16px !important;
  459.             }
  460.             .mitsumori-card-pc .nav-item:first-child #mitsumori_goukei {
  461.                 font-size: 20px !important;
  462.                 font-weight: bold !important;
  463.                 color: #c00 !important;
  464.             }
  465.             /* card-body(明細リスト)を白背景に */
  466.             .mitsumori-card-pc .card-body {
  467.                 background: #fff !important;
  468.             }
  469.             .mitsumori-card-pc .card-footer {
  470.                 background: #f8faff !important;
  471.                 border-top: 1px solid #dce8fb !important;
  472.                 padding: 12px 16px !important;
  473.             }
  474.         }
  475.         @media (max-width: 767px) {
  476.             /* スマホでは現在のお見積り額カードの強調スタイルをすべてリセット */
  477.             .mitsumori-card-pc {
  478.                 border: none !important;
  479.                 border-radius: 0 !important;
  480.                 box-shadow: none !important;
  481.                 margin-top: 0 !important;
  482.                 overflow: visible !important;
  483.                 background: none !important;
  484.             }
  485.             .mitsumori-card-pc .card-header {
  486.                 background: none !important;
  487.                 color: inherit !important;
  488.                 padding: inherit !important;
  489.                 border-bottom: inherit !important;
  490.             }
  491.             .mitsumori-card-pc .card-title { color: inherit !important; }
  492.             .mitsumori-card-pc #mitsumori_message { font-size: inherit !important; color: inherit !important; }
  493.             .mitsumori-card-pc .btn-tool { color: inherit !important; }
  494.             /* 折りたたみトグルボタン */
  495.             .btn-mitsumori-toggle {
  496.                 background: none !important;
  497.                 border: 1px solid #aaa !important;
  498.                 border-radius: 4px !important;
  499.                 padding: 2px 8px !important;
  500.                 font-size: 12px !important;
  501.                 color: #333 !important;
  502.                 line-height: 1.4 !important;
  503.             }
  504.             .btn-mitsumori-toggle .toggle-icon {
  505.                 display: inline-block;
  506.                 transition: transform 0.2s;
  507.             }
  508.             /* 展開状態: ▼→▲ */
  509.             .card:not(.collapsed-card) .btn-mitsumori-toggle .toggle-icon::before {
  510.                 content: "▲ 閉じる";
  511.             }
  512.             .card:not(.collapsed-card) .btn-mitsumori-toggle .toggle-icon {
  513.                 display: none;
  514.             }
  515.             .card:not(.collapsed-card) .btn-mitsumori-toggle::after {
  516.                 content: "▲ 閉じる";
  517.                 font-size: 12px;
  518.             }
  519.             .mitsumori-card-pc .nav-item:first-child .nav-link {
  520.                 font-size: inherit !important;
  521.                 color: inherit !important;
  522.                 background: none !important;
  523.                 padding: inherit !important;
  524.             }
  525.             .mitsumori-card-pc .nav-item:first-child #mitsumori_goukei {
  526.                 font-size: inherit !important;
  527.                 color: inherit !important;
  528.             }
  529.             .mitsumori-card-pc .card-footer {
  530.                 background: none !important;
  531.                 border-top: inherit !important;
  532.                 padding: inherit !important;
  533.             }
  534.             /* 横スクロール禁止 */
  535.             body, html {
  536.                 overflow-x: hidden;
  537.                 max-width: 100vw;
  538.             }
  539.             /* ボタンの折り返しを許可(nowrapが原因で横スクロール発生するため) */
  540.             .opt-btn,
  541.             .rp-btn {
  542.                 white-space: normal;
  543.                 word-break: break-all;
  544.             }
  545.             /* エリア案内: スマホでコンパクト */
  546.             .ec-areaNotice {
  547.                 margin: 8px 0;
  548.                 padding: 8px 10px;
  549.                 border-left-width: 3px;
  550.                 cursor: pointer;
  551.             }
  552.             .ec-areaNotice__inner {
  553.                 flex-direction: row;
  554.                 gap: 8px;
  555.                 align-items: flex-start;
  556.             }
  557.             .ec-areaNotice__icon { font-size: 15px; }
  558.             /* タイトル行: 展開トグル */
  559.             .ec-areaNotice__title {
  560.                 font-size: 11px;
  561.                 margin-bottom: 3px;
  562.                 display: flex;
  563.                 justify-content: space-between;
  564.                 align-items: center;
  565.             }
  566.             .ec-areaNotice__title::after {
  567.                 content: "▼";
  568.                 font-size: 9px;
  569.                 color: #888;
  570.                 margin-left: 6px;
  571.                 transition: transform 0.2s;
  572.             }
  573.             .ec-areaNotice.is-open .ec-areaNotice__title::after {
  574.                 transform: rotate(180deg);
  575.             }
  576.             /* 折りたたみ対象: 閉じた状態では非表示 */
  577.             .ec-areaNotice__detail {
  578.                 display: none;
  579.             }
  580.             .ec-areaNotice.is-open .ec-areaNotice__detail {
  581.                 display: block;
  582.             }
  583.             .ec-areaNotice__text { font-size: 11px; line-height: 1.5; }
  584.             .ec-areaNotice__text br { display: none; }
  585.             .ec-areaNotice__link { font-size: 11px; margin-top: 3px; }
  586.             .rp-card { width: calc(33.333% - 6px); min-width: 80px; }
  587.             
  588.             #sp-mitsumori-bar {
  589.                 display: flex;
  590.                 position: fixed;
  591.                 bottom: 0;
  592.                 left: 0;
  593.                 right: 0;
  594.                 z-index: 1000;
  595.                 background: #fff;
  596.                 border-top: 2px solid #e0e0e0;
  597.                 box-shadow: 0 -2px 8px rgba(0,0,0,0.12);
  598.                 align-items: center;
  599.                 padding: 8px 12px;
  600.                 gap: 10px;
  601.             }
  602.             #sp-mitsumori-bar .sp-bar__label {
  603.                 font-size: 11px;
  604.                 color: #666;
  605.                 white-space: nowrap;
  606.             }
  607.             #sp-mitsumori-bar .sp-bar__price {
  608.                 font-size: 18px;
  609.                 font-weight: bold;
  610.                 color: #c00;
  611.                 flex: 1;
  612.             }
  613.             #sp-mitsumori-bar .sp-bar__btn {
  614.                 font-size: 12px;
  615.                 padding: 8px 12px;
  616.                 background: #333;
  617.                 color: #fff;
  618.                 border: none;
  619.                 border-radius: 6px;
  620.                 white-space: nowrap;
  621.                 cursor: pointer;
  622.                 position: relative;
  623.                 display: inline-flex;
  624.                 align-items: center;
  625.                 gap: 6px;
  626.             }
  627.             #sp-mitsumori-bar .sp-bar__btn i {
  628.                 font-size: 14px;
  629.             }
  630.             #sp-mitsumori-bar .sp-bar__cart-badge {
  631.                 position: absolute;
  632.                 top: -6px;
  633.                 right: -6px;
  634.                 background: #c00;
  635.                 color: #fff;
  636.                 border-radius: 50%;
  637.                 min-width: 16px;
  638.                 height: 16px;
  639.                 font-size: 10px;
  640.                 line-height: 16px;
  641.                 padding: 0 4px;
  642.                 font-weight: bold;
  643.             }
  644.             #sp-mitsumori-bar .sp-bar__home-btn {
  645.                 display: inline-flex;
  646.                 align-items: center;
  647.                 justify-content: center;
  648.                 width: 36px;
  649.                 height: 36px;
  650.                 border: 1px solid #ccc;
  651.                 border-radius: 6px;
  652.                 background: #fff;
  653.                 color: #333;
  654.                 text-decoration: none;
  655.                 cursor: pointer;
  656.             }
  657.             #sp-mitsumori-bar .sp-bar__home-btn i {
  658.                 font-size: 16px;
  659.             }
  660.             #sp-mitsumori-bar .sp-bar__home-btn:hover {
  661.                 background: #f0f0f0;
  662.             }
  663.             /* 下部バーの高さ分ページ下部にpaddingを追加 */
  664.             body {
  665.                 padding-bottom: 64px;
  666.             }
  667.         }
  668.         /* ============================================
  669.            カート追加モーダル: 縦並び中央配置
  670.         ============================================ */
  671.         .add-cart-modal__wrap {
  672.             text-align: center;
  673.         }
  674.         .add-cart-modal__header {
  675.             font-size: 16px;
  676.             margin: 20px 0 24px;
  677.             text-align: center;
  678.         }
  679.         .add-cart-modal__actions {
  680.             display: flex;
  681.             flex-direction: column;
  682.             align-items: center;
  683.             gap: 16px;
  684.             padding: 0 20px 20px;
  685.         }
  686.         .add-cart-modal__primary {
  687.             display: inline-block;
  688.             width: 80%;
  689.             max-width: 320px;
  690.             padding: 14px 20px;
  691.             font-size: 15px;
  692.             font-weight: bold;
  693.             text-align: center;
  694.             background: #d9534f;
  695.             color: #fff !important;
  696.             border-radius: 6px;
  697.             text-decoration: none;
  698.             cursor: pointer;
  699.         }
  700.         .add-cart-modal__primary:hover {
  701.             background: #c9302c;
  702.             color: #fff !important;
  703.             text-decoration: none;
  704.         }
  705.         .add-cart-modal__secondary {
  706.             display: inline-block;
  707.             padding: 6px 14px;
  708.             font-size: 12px;
  709.             color: #666;
  710.             border: 1px solid #ccc;
  711.             border-radius: 4px;
  712.             background: #fff;
  713.             cursor: pointer;
  714.         }
  715.         .add-cart-modal__secondary:hover {
  716.             background: #f0f0f0;
  717.             color: #333;
  718.         }
  719.         @media (max-width: 767px) {
  720.             .add-cart-modal__actions {
  721.                 gap: 20px;
  722.             }
  723.         }
  724.     </style>
  725. {% endblock %}
  726. {% block javascript %}
  727.     <script>
  728.         eccube.classCategories = {{ class_categories_as_json(Product)|raw }};
  729.         // 規格2に選択肢を割り当てる。
  730.         function fnSetClassCategories(form, classcat_id2_selected) {
  731.             var $form = $(form);
  732.             var product_id = $form.find('input[name=product_id]').val();
  733.             var $sele1 = $form.find('select[name=classcategory_id1]');
  734.             var $sele2 = $form.find('select[name=classcategory_id2]');
  735.             eccube.setClassCategories($form, product_id, $sele1, $sele2, classcat_id2_selected);
  736.         }
  737.         {% if form.classcategory_id2 is defined %}
  738.         fnSetClassCategories(
  739.             $('#form1'), {{ form.classcategory_id2.vars.value|json_encode|raw }}
  740.         );
  741.         {% elseif form.classcategory_id1 is defined %}
  742.         eccube.checkStock($('#form1'), {{ Product.id }}, {{ form.classcategory_id1.vars.value|json_encode|raw }}, null);
  743.         {% endif %}
  744.     </script>
  745.     <script>
  746.         $(function() {
  747.             // bfcache無効化
  748.             $(window).bind('pageshow', function(event) {
  749.                 if (event.originalEvent.persisted) {
  750.                     location.reload(true);
  751.                 }
  752.             });
  753.             // Core Web Vital の Cumulative Layout Shift(CLS)対策のため
  754.             // img タグに width, height が付与されている.
  755.             // 630px 未満の画面サイズでは縦横比が壊れるための対策
  756.             // see https://github.com/EC-CUBE/ec-cube/pull/5023
  757.             $('.ec-grid2__cell').hide();
  758.             var removeSize = function () {
  759.                 $('.slide-item').height('');
  760.                 $('.slide-item img')
  761.                     .removeAttr('width')
  762.                     .removeAttr('height')
  763.                     .removeAttr('style');
  764.             };
  765.             var slickInitial = function(slick) {
  766.                 $('.ec-grid2__cell').fadeIn(1500);
  767.                 var baseHeight = $(slick.target).height();
  768.                 var baseWidth = $(slick.target).width();
  769.                 var rate = baseWidth / baseHeight;
  770.                 if(baseHeight * rate < 400){
  771.                     $('.slide-item').height(baseHeight * rate); // 余白を削除する
  772.                 }else{
  773.                     $('.slide-item').height(400); // 余白を削除する
  774.                 }
  775.                 // transform を使用することでCLSの影響を受けないようにする
  776.                 $('.slide-item img')
  777.                     .css(
  778.                         {
  779.                             'transform-origin': 'top left',
  780.                             'transform': 'scaleY(' + rate + ')',
  781.                             'transition': 'transform .1s'
  782.                         }
  783.                     );
  784.                 // 正しいサイズに近くなったら属性を解除する
  785.                 setTimeout(removeSize, 500);
  786.             };
  787.             $('.item_visual').on('init', slickInitial);
  788.             // リサイズ時は CLS の影響を受けないため属性を解除する
  789.             $(window).resize(removeSize);
  790.             $('.item_visual').slick({
  791.                 dots: false,
  792.                 arrows: true,
  793.                 responsive: [{
  794.                     breakpoint: 768,
  795.                     settings: {
  796.                         dots: true,
  797.                         arrows: false
  798.                     }
  799.                 }]
  800.             });
  801.             $('.slideThumb').on('click', function() {
  802.                 var index = $(this).attr('data-index');
  803.                 $('.item_visual').slick('slickGoTo', index, false);
  804.             })
  805.         });
  806.     </script>
  807.     <script>
  808.         $(function() {
  809.             $('.add-cart').on('click', function(event) {
  810.                 {% if form.classcategory_id1 is defined %}
  811.                 // 規格1フォームの必須チェック
  812.                 if ($('#classcategory_id1').val() == '__unselected' || $('#classcategory_id1').val() == '') {
  813.                     $('#classcategory_id1')[0].setCustomValidity('{{ '項目が選択されていません'|trans }}');
  814.                     return true;
  815.                 } else {
  816.                     $('#classcategory_id1')[0].setCustomValidity('');
  817.                 }
  818.                 {% endif %}
  819.                 {% if form.classcategory_id2 is defined %}
  820.                 // 規格2フォームの必須チェック
  821.                 if ($('#classcategory_id2').val() == '__unselected' || $('#classcategory_id2').val() == '') {
  822.                     $('#classcategory_id2')[0].setCustomValidity('{{ '項目が選択されていません'|trans }}');
  823.                     return true;
  824.                 } else {
  825.                     $('#classcategory_id2')[0].setCustomValidity('');
  826.                 }
  827.                 {% endif %}
  828.                 // タイプ2: カート送信直前に set_count を quantity に同期
  829.                 if($('#set_count').length){
  830.                     var _sc = parseInt($('#set_count').val()) || 1;
  831.                     $('#quantity').val(_sc);
  832.                     $('input[name="quantity"]').val(_sc);
  833.                 }
  834.                 // 個数フォームのチェック
  835.                 if ($('#quantity').val() < 1) {
  836.                     $('#quantity')[0].setCustomValidity('{{ '1以上で入力してください。'|trans }}');
  837.                     return true;
  838.                 } else {
  839.                     $('#quantity')[0].setCustomValidity('');
  840.                 }
  841.                 event.preventDefault();
  842.                 $form = $('#form1');
  843.                 $.ajax({
  844.                     url: $form.attr('action'),
  845.                     type: $form.attr('method'),
  846.                     data: $form.serialize(),
  847.                     dataType: 'json',
  848.                     beforeSend: function(xhr, settings) {
  849.                         // Buttonを無効にする
  850.                         $('.add-cart').prop('disabled', true);
  851.                     }
  852.                 }).done(function(data) {
  853.                     // レスポンス内のメッセージをalertで表示
  854.                     $.each(data.messages, function() {
  855.                         $('#ec-modal-header').text(this);
  856.                     });
  857.                     $('.ec-modal').show()
  858.                     // カートブロックを更新する
  859.                     $.ajax({
  860.                         url: "{{ url('block_cart') }}",
  861.                         type: 'GET',
  862.                         dataType: 'html'
  863.                     }).done(function(html) {
  864.                         $('.ec-headerRole__cart').html(html);
  865.                     });
  866.                 }).fail(function(data) {
  867.                     alert('{{ '施工検討リストへの追加に失敗しました。'|trans }}');
  868.                 }).always(function(data) {
  869.                     // Buttonを有効にする
  870.                     $('.add-cart').prop('disabled', false);
  871.                 });
  872.             });
  873.         });
  874.         $('.ec-modal-wrap').on('click', function(e) {
  875.             // モーダル内の処理は外側にバブリングさせない
  876.             e.stopPropagation();
  877.         });
  878.         $('.ec-modal-overlay, .ec-modal, .ec-modal-close, .ec-inlineBtn--cancel').on('click', function() {
  879.             $('.ec-modal').hide()
  880.         });
  881.         var pw = "{% if mitsumori_json %}{{ mitsumori_json.pw }}{% endif %}";
  882.         var pd = "{% if mitsumori_json %}{{ mitsumori_json.pd }}{% endif %}";
  883.         var ph = "{% if mitsumori_json %}{{ mitsumori_json.ph }}{% endif %}";
  884.         var pm = "{% if mitsumori_json %}{{ mitsumori_json.pm }}{% endif %}";
  885.         var pc = "{% if mitsumori_json %}{{ mitsumori_json.pc }}{% endif %}";
  886.         var op0 = "{% if mitsumori_json %}{{ mitsumori_json.op[0] }}{% endif %}";
  887.         var op1 = "{% if mitsumori_json %}{{ mitsumori_json.op[1] }}{% endif %}";
  888.         var op2 = "{% if mitsumori_json %}{{ mitsumori_json.op[2] }}{% endif %}";
  889.         var op3 = "{% if mitsumori_json %}{{ mitsumori_json.op[3] }}{% endif %}";
  890.         var op4 = "{% if mitsumori_json %}{{ mitsumori_json.op[4] }}{% endif %}";
  891.         var op5 = "{% if mitsumori_json %}{{ mitsumori_json.op[5] }}{% endif %}";
  892.         var op6 = "{% if mitsumori_json %}{{ mitsumori_json.op[6] }}{% endif %}";
  893.         var op7 = "{% if mitsumori_json %}{{ mitsumori_json.op[7] }}{% endif %}";
  894.         var op8 = "{% if mitsumori_json %}{{ mitsumori_json.op[8] }}{% endif %}";
  895.         var op9 = "{% if mitsumori_json %}{{ mitsumori_json.op[9] }}{% endif %}";
  896.         var op10 = "{% if mitsumori_json %}{{ mitsumori_json.op[10] }}{% endif %}";
  897.         const formatter = new Intl.NumberFormat('ja-JP');
  898.         function mitsumori_simulation(type , value_id){
  899.             var pp = {{ pp|raw }};
  900.             if(type == "pw"){
  901.                 pw = $('#'+value_id).val();
  902.             }
  903.             if(type == "pd"){
  904.                 pd = $('#'+value_id).val();
  905.             }
  906.             if(type == "ph"){
  907.                 ph = $('#'+value_id).val();
  908.             }
  909.             if(type == "pm"){
  910.                 pm = $('#'+value_id).val();
  911.             }
  912.             if(type == "pc"){
  913.                 pc = $('#'+value_id).val();
  914.             }
  915.             if(type == "op0"){ op0 = $('#'+value_id).val(); }
  916.             if(type == "op1"){ op1 = $('#'+value_id).val(); }
  917.             if(type == "op2"){ op2 = $('#'+value_id).val(); }
  918.             if(type == "op3"){ op3 = $('#'+value_id).val(); }
  919.             if(type == "op4"){ op4 = $('#'+value_id).val(); }
  920.             if(type == "op5"){ op5 = $('#'+value_id).val(); }
  921.             if(type == "op6"){ op6 = $('#'+value_id).val(); }
  922.             if(type == "op7"){ op7 = $('#'+value_id).val(); }
  923.             if(type == "op8"){ op8 = $('#'+value_id).val(); }
  924.             if(type == "op9"){ op9 = $('#'+value_id).val(); }
  925.             if(type == "op10"){ op10 = $('#'+value_id).val(); }
  926.             // op系: ボタンの is-selected を選択中のものに付け替え + radio チェック
  927.             if(/^op\d+$/.test(type)) {
  928.                 var $clicked = $('#' + value_id);
  929.                 $clicked.prop('checked', true);
  930.                 var groupName = $clicked.attr('name');
  931.                 $('input[name="' + groupName + '"]').closest('.opt-btn').removeClass('is-selected');
  932.                 $clicked.closest('.opt-btn').addClass('is-selected');
  933.                 // ラベルの選択値テキスト更新
  934.                 var $group = $clicked.closest('.form-group');
  935.                 var $label = $group.find('.rp-section-label');
  936.                 if ($label.length) {
  937.                     var labelText = $label.text().split(':')[0].trim();
  938.                     $label.html(labelText + ': <span>' + $clicked.val() + '</span>');
  939.                 }
  940.             }
  941.             if(pm == ""){
  942.                 $('#mitsumori_message').text("素材を選択してください");
  943.             }
  944.             if(ph == ""){
  945.                 $('#mitsumori_message').text("高さを選択してください");
  946.             }
  947.             if(pd == ""){
  948.                 $('#mitsumori_message').text("奥行きを選択してください");
  949.             }
  950.             if(pw == ""){
  951.                 $('#mitsumori_message').text("幅を選択してください");
  952.             }
  953.             if(pc == ""){
  954.                 $('#mitsumori_message').text("カラーを選択してください");
  955.                 $('#mitsumori_btn').hide();
  956.                 $('#mitsumori_goukei').text("---円");
  957.                 $('#mitsumori_off').text("---円");
  958.                 $('#mitsumori_price').text("---円");
  959.                 $('#maker_price').text("---円");
  960.                 $('#mitsumori_ct').text("---円");
  961.                 $('#mitsumori_option').text("---円");
  962.             }
  963.             if(pw != "" && pd != "" && ph != "" && pm != "" && pc != ""){
  964.                 $('#mitsumori_btn').show();
  965.                 var pp_matched = false;
  966.                 pp.forEach((el) => {
  967.                   if((pw == el.w || pw == "指定なし") && (pd == el.d || pd == "指定なし") && (ph == el.h || ph == "指定なし") && (pm == el.m || pm == "指定なし") && (pc == el.c || pc == "指定なし")){
  968.                     pp_matched = true;
  969.                     if(op0 == "商品購入のみ" || op1 == "商品購入のみ" || op2 == "商品購入のみ" || op3 == "商品購入のみ" || op4 == "商品購入のみ"
  970.                         || op5 == "商品購入のみ" || op6 == "商品購入のみ" || op7 == "商品購入のみ" || op8 == "商品購入のみ" || op9 == "商品購入のみ"){
  971.                           $('#mitsumori_message').text(formatter.format(parseInt(el.price)) + "円");
  972.                           $('#mitsumori_goukei').text(formatter.format(parseInt(el.price)) + "円");
  973.                           $('#mitsumori_off').text(formatter.format(parseInt(el.price) - parseInt(el.maker_price)) + "円");
  974.                           $('#mitsumori_price').text(formatter.format(parseInt(el.price)) + "円");
  975.                           $('#maker_price').text(formatter.format(parseInt(el.maker_price)) + "円");
  976.                           $('#mitsumori_ct').text("0円");
  977.                           $('#mitsumori_option').text("0円");
  978.                           $('#mitsumori_kei').text(formatter.format(parseInt(el.price)) + "円");
  979.                           $('#mitsumori_price_01').text(formatter.format(parseInt(el.price)) + "円");
  980.                           $('#mitsumori_price_02').text(formatter.format(parseInt(el.price)) + "円");
  981.                           $('#mitsumori_ct_01').text("0円");
  982.                           $('#mitsumori_ct_02').text("0円");
  983.                           $('#mitsumori_goukei_02').text(formatter.format(parseInt(el.price)) + "円");
  984.                         mitsumori_goukei = (parseInt(el.price));
  985.                         shoukei = mitsumori_goukei / 1.1;
  986.                         tax = parseInt(mitsumori_goukei - shoukei);
  987.                           $('#mitsumori_shoukei').text(formatter.format(parseInt(shoukei)) + "円");
  988.                           $('#mitsumori_tax').text(formatter.format(parseInt(tax)) + "円");
  989.                     }else{
  990.                           $('#mitsumori_message').text(formatter.format(parseInt(el.price) + parseInt(el.ct)) + "円");
  991.                           $('#mitsumori_goukei').text(formatter.format(parseInt(el.price) + parseInt(el.ct)) + "円");
  992.                           $('#mitsumori_off').text(formatter.format(parseInt(el.price) - parseInt(el.maker_price)) + "円");
  993.                           $('#mitsumori_price').text(formatter.format(parseInt(el.price)) + "円");
  994.                           $('#maker_price').text(formatter.format(parseInt(el.maker_price)) + "円");
  995.                           $('#mitsumori_ct').text(formatter.format(parseInt(el.ct)) + "円");
  996.                           $('#mitsumori_option').text("0円");
  997.                           $('#mitsumori_kei').text(formatter.format(parseInt(el.price) + parseInt(el.ct)) + "円");
  998.                           $('#mitsumori_price_01').text(formatter.format(parseInt(el.price)) + "円");
  999.                           $('#mitsumori_price_02').text(formatter.format(parseInt(el.price)) + "円");
  1000.                           $('#mitsumori_ct_01').text(formatter.format(parseInt(el.ct)) + "円");
  1001.                           $('#mitsumori_ct_02').text(formatter.format(parseInt(el.ct)) + "円");
  1002.                           $('#mitsumori_goukei_02').text(formatter.format(parseInt(el.price) + parseInt(el.ct)) + "円");
  1003.                         mitsumori_goukei = (parseInt(el.price) + parseInt(el.ct));
  1004.                         shoukei = mitsumori_goukei / 1.1;
  1005.                         tax = parseInt(mitsumori_goukei - shoukei);
  1006.                           $('#mitsumori_shoukei').text(formatter.format(parseInt(shoukei)) + "円");
  1007.                           $('#mitsumori_tax').text(formatter.format(parseInt(tax)) + "円");
  1008.                     }
  1009.                   }
  1010.                 });
  1011.                 if (!pp_matched) {
  1012.                     $('#mitsumori_message').text("この組み合わせは対応しておりません");
  1013.                     $('#mitsumori_btn').hide();
  1014.                     $('#mitsumori_goukei').text("---円");
  1015.                     $('#mitsumori_off').text("---円");
  1016.                     $('#mitsumori_price').text("---円");
  1017.                     $('#maker_price').text("---円");
  1018.                     $('#mitsumori_ct').text("---円");
  1019.                     $('#mitsumori_option').text("---円");
  1020.                     $('#mitsumori_kei').text("---円");
  1021.                     $('#mitsumori_shoukei').text("---円");
  1022.                     $('#mitsumori_tax').text("---円");
  1023.                 }    
  1024.                 // タイプ5: ステップ・フェンス・面積の現在値を取得
  1025.                 if($('input[name=deck_step]:checked').length){ deck_step = $('input[name=deck_step]:checked').val(); }
  1026.                 if($('input[name=deck_fence]:checked').length){ deck_fence = $('input[name=deck_fence]:checked').val(); }
  1027.                 // タイプ2: 窓サイズ・窓タイプ・ガラスタイプ・セット数
  1028.                 var mado_w_val     = $('#mado_w').val()     || '';
  1029.                 var mado_h_val     = $('#mado_h').val()     || '';
  1030.                 var mado_type_val  = $('input[name=mado_type]:checked').val()  || '';
  1031.                 var glass_type_val = $('input[name=glass_type]:checked').val() || '';
  1032.                 var set_count_val  = parseInt($('#set_count').val()) || 1;
  1033.                 // タイプ3: 台数
  1034.                 var daisu_val = parseInt($('#daisu').val()) || 1;
  1035.                 // タイプ4・6: 枚数
  1036.                 var maisu_val = parseInt($('#maisu').val()) || 1;
  1037.                 // タイプ5: 面積
  1038.                 var area_val = $('#area').val() || '';
  1039.                 // sale_type
  1040.                 var sale_type_id = {{ ProductClass.SaleType.id }};
  1041.                 var mitsumori_json = { "mitsumori_goukei": $('#mitsumori_goukei').text(),
  1042.                                         "mitsumori_goukei_02": $('#mitsumori_goukei_02').text(),
  1043.                                         "mitsumori_price": $('#mitsumori_price').text(),
  1044.                                         "maker_price": $('#maker_price').text(),
  1045.                                         "mitsumori_off": $('#mitsumori_off').text(),
  1046.                                         "mitsumori_ct": $('#mitsumori_ct').text(),
  1047.                                         "mitsumori_option": $('#mitsumori_option').text(),
  1048.                                         "product_id": {{ Product.id }},
  1049.                                         "sale_type": sale_type_id,
  1050.                                         "pw": pw,
  1051.                                         "pd": pd,
  1052.                                         "ph": ph,
  1053.                                         "pm": pm,
  1054.                                         "pc": pc,
  1055.                                         "op": [op0,op1,op2,op3,op4,op5,op6,op7,op8,op9,op10],
  1056.                                         "mado_w":     mado_w_val,
  1057.                                         "mado_h":     mado_h_val,
  1058.                                         "mado_type":  mado_type_val,
  1059.                                         "glass_type": glass_type_val,
  1060.                                         "set_count":  set_count_val,
  1061.                                         "daisu":      daisu_val,
  1062.                                         "maisu":      maisu_val,
  1063.                                         "area":       area_val,
  1064.                                         "deck_step":  deck_step,
  1065.                                         "deck_fence": deck_fence };
  1066.                 $('#mitsumori_json').val(JSON.stringify(mitsumori_json));
  1067.                 
  1068.             }
  1069.             
  1070.         }
  1071.         {% if color and color|length == 1 %}
  1072.             pc = "指定なし";
  1073.             {% for cc in color %}{% if cc and cc['name'] %} pc = "{{ cc['name'] }}"; {% endif %}{% endfor %}
  1074.         {% endif %}
  1075.         {% if p_w and (p_w|length == 1 or p_w|join == "") %}
  1076.             pw = "指定なし";
  1077.             {% for pw in p_w %}{% if pw %} pw = "{{ pw }}"; {% endif %}{% endfor %}
  1078.         {% endif %}
  1079.         {% if p_d and (p_d|length == 1 or p_d|join == "") %}
  1080.             pd = "指定なし";
  1081.             {% for pd in p_d %}{% if pd %} pd = "{{ pd }}"; {% endif %}{% endfor %}
  1082.         {% endif %}
  1083.         {% if p_h and (p_h|length == 1 or p_h|join == "") %}
  1084.             ph = "指定なし";
  1085.             {% for ph in p_h %}{% if ph %} ph = "{{ ph }}"; {% endif %}{% endfor %}
  1086.         {% endif %}
  1087.         {% if p_m and (p_m|length == 1 or p_m|join == "") %}
  1088.             pm = "指定なし";
  1089.             {% for pm in p_m %}{% if pm %} pm = "{{ pm }}"; {% endif %}{% endfor %}
  1090.         {% endif %}
  1091.         // ページ読み込み時: タイプ別に quantity の初期値をセット
  1092.         (function initQuantityByType(){
  1093.             var saleType = {{ ProductClass.SaleType.id }};
  1094.             if(saleType == 2 && $('#set_count').length){
  1095.                 var _v = parseInt($('#set_count').val()) || 1;
  1096.                 $('#quantity').val(_v);
  1097.                 $('input[name="quantity"]').val(_v);
  1098.             } else if(saleType == 3 && $('#daisu').length){
  1099.                 $('#quantity').val(parseInt($('#daisu').val()) || 1);
  1100.             } else if((saleType == 4 || saleType == 6) && $('#maisu').length){
  1101.                 $('#quantity').val(parseInt($('#maisu').val()) || 1);
  1102.             } else if(saleType == 9 && $('#quantity_only').length){
  1103.                 $('#quantity').val(parseInt($('#quantity_only').val()) || 1);
  1104.             }
  1105.         })();
  1106.         // type → ラベルのプレフィックス文字列
  1107.         var optLabelMap = {pc:'カラー', pw:'幅', pd:'奥行き', ph:'高さ', pm:'素材'};
  1108.         // type → input[name]
  1109.         var optNameMap  = {pc:'color', pw:'pw', pd:'pd', ph:'ph', pm:'pm'};
  1110.         // opt-btn用: 値を直接受け取るラッパー
  1111.         function mitsumori_simulation_val(type, value) {
  1112.             if (type === 'pc') pc = value;
  1113.             if (type === 'pw') pw = value;
  1114.             if (type === 'pd') pd = value;
  1115.             if (type === 'ph') ph = value;
  1116.             if (type === 'pm') pm = value;
  1117.             // is-selected クラスを同グループ内で付け替え
  1118.             var inputName = optNameMap[type];
  1119.             if (inputName) {
  1120.                 var $btns = $('input[name="' + inputName + '"]').closest('.opt-btn');
  1121.                 $btns.removeClass('is-selected');
  1122.                 $btns.filter(function(){
  1123.                     return $(this).find('input').val() === value;
  1124.                 }).addClass('is-selected');
  1125.             }
  1126.             // ラベル行の選択値テキストを更新(例: 「カラー: ブラック」)
  1127.             var labelPrefix = optLabelMap[type];
  1128.             if (labelPrefix) {
  1129.                 // 対象のrp-section-labelを特定(input[name]を含む親を遡る)
  1130.                 var $group = $('input[name="' + inputName + '"]').first().closest('.form-group');
  1131.                 var $label = $group.find('.rp-section-label');
  1132.                 $label.html(labelPrefix + ': <span>' + value + '</span>');
  1133.             }
  1134.             // simulation本体を呼ぶ(value_idは空でOK、グローバル変数を使う)
  1135.             mitsumori_simulation('', '');
  1136.         }
  1137.         mitsumori_simulation("","");
  1138.         // ボタン群: 親幅を超える、または3行以上になる場合は is-scroll で1行横スクロール化
  1139.         function applyBtnGroupScroll() {
  1140.             $('.rp-btn-group, .opt-btn-group').each(function() {
  1141.                 var $group = $(this);
  1142.                 $group.removeClass('is-scroll');
  1143.                 var $items = $group.children();
  1144.                 if ($items.length === 0) return;
  1145.                 var parentWidth = $group.parent().width() || $group.width();
  1146.                 var totalWidth = 0;
  1147.                 var gap = parseInt($group.css('gap'), 10) || 8;
  1148.                 $items.each(function() {
  1149.                     totalWidth += this.offsetWidth + gap;
  1150.                 });
  1151.                 // 単一ボタンが親幅を超える、もしくは合計幅が親幅を超える → 横スクロール化
  1152.                 var anyTooWide = false;
  1153.                 $items.each(function() {
  1154.                     if (this.offsetWidth > parentWidth) { anyTooWide = true; return false; }
  1155.                 });
  1156.                 // 折り返し時の行数も計測
  1157.                 var tops = {};
  1158.                 $items.each(function() { tops[this.offsetTop] = true; });
  1159.                 var rowCount = Object.keys(tops).length;
  1160.                 if (anyTooWide || totalWidth > parentWidth * 2 || rowCount >= 3) {
  1161.                     $group.addClass('is-scroll');
  1162.                 }
  1163.             });
  1164.         }
  1165.         applyBtnGroupScroll();
  1166.         $(window).on('resize', function() {
  1167.             clearTimeout(window._btnScrollTimer);
  1168.             window._btnScrollTimer = setTimeout(applyBtnGroupScroll, 150);
  1169.         });
  1170.         // onload: 見積金額が確定している場合は「工事費込み価格」表示を一致させる
  1171.         (function syncPrice02Display() {
  1172.             var goukeiEl = document.getElementById('mitsumori_goukei');
  1173.             var displayEl = document.getElementById('price02-display');
  1174.             if (!goukeiEl || !displayEl) return;
  1175.             var goukeiText = goukeiEl.textContent.trim();
  1176.             // ---円(未確定)の場合は書き換えない
  1177.             if (goukeiText && goukeiText !== '---円') {
  1178.                 displayEl.textContent = goukeiText;
  1179.             }
  1180.             // 以降の変更にも追従: mitsumori_goukei を監視
  1181.             new MutationObserver(function() {
  1182.                 var text = goukeiEl.textContent.trim();
  1183.                 if (text && text !== '---円') {
  1184.                     displayEl.textContent = text;
  1185.                 }
  1186.             }).observe(goukeiEl, { childList: true, subtree: true, characterData: true });
  1187.         })();
  1188.         function contact_form(product_id){
  1189.             $('#form1').attr('action', '{{ url('contact', {product:Product.id}) }}');
  1190.             $('#form1').submit();
  1191.         }
  1192.         // maisu / madoset は下部の新しい関数定義を使用
  1193.         function heibei(bei){
  1194.             $('#heibei').val(parseInt($('#heibei').val()) + bei);
  1195.             if(parseInt($('#heibei').val()) < 1){ $('#heibei').val(1); }
  1196.             if(parseInt($('#heibei').val()) > 100){ $('#heibei').val(100); }
  1197.             $('#quantity').val($('#heibei').val());
  1198.             mitsumori_simulation('heibei','heibei');
  1199.         }
  1200.         function daisu(dai){
  1201.             $('#daisu').val(parseInt($('#daisu').val()) + dai);
  1202.             if(parseInt($('#daisu').val()) < 1){ $('#daisu').val(1); }
  1203.             if(parseInt($('#daisu').val()) > 10){ $('#daisu').val(10); }
  1204.             $('#quantity').val($('#daisu').val());
  1205.             mitsumori_simulation('daisu','daisu');
  1206.         }
  1207.         function maisu(mai){
  1208.             $('#maisu').val(parseInt($('#maisu').val()) + mai);
  1209.             if(parseInt($('#maisu').val()) < 1){ $('#maisu').val(1); }
  1210.             if(parseInt($('#maisu').val()) > 100){ $('#maisu').val(100); }
  1211.             $('#quantity').val($('#maisu').val());
  1212.             mitsumori_simulation('maisu','maisu');
  1213.         }
  1214.         // タイプ2: セット数プルダウン連動
  1215.         function madosetSelect(val){
  1216.             var v = parseInt(val);
  1217.             if(v < 1) v = 1;
  1218.             if(v > 20) v = 20;
  1219.             // id="quantity" と name="quantity" 両方を確実に書き換え
  1220.             $('#quantity').val(v);
  1221.             $('input[name="quantity"]').val(v);
  1222.             mitsumori_simulation('set','set_count');
  1223.         }
  1224.         // タイプ2: ±ボタン版(後方互換)
  1225.         function madoset(mai){
  1226.             var current = parseInt($('#set_count').val()) || 1;
  1227.             var next = current + mai;
  1228.             if(next < 1) next = 1;
  1229.             if(next > 20) next = 20;
  1230.             $('#set_count').val(next);
  1231.             madosetSelect(next);
  1232.         }
  1233.         // タイプ5: ステップ・フェンス選択値を mitsumori_json に保存するためのグローバル変数
  1234.         var deck_step = "{% if mitsumori_json %}{{ mitsumori_json.deck_step|default('不要') }}{% else %}不要{% endif %}";
  1235.         var deck_fence = "{% if mitsumori_json %}{{ mitsumori_json.deck_fence|default('不要') }}{% else %}不要{% endif %}";
  1236.         // PDF出力: モーダルの mitsumori_json をフォームに同期してから送信
  1237.         function syncPdfJson(){
  1238.             var jsonVal = $('#mitsumori_json').val();
  1239.             $('#pdf_mitsumori_json').val(jsonVal);
  1240.         }
  1241.         // タイプ9: 商品のみ購入
  1242.         function quantityOnly(val){
  1243.             var current = parseInt($('#quantity_only').val()) || 1;
  1244.             var next = current + val;
  1245.             if(next < 1) next = 1;
  1246.             $('#quantity_only').val(next);
  1247.             $('#quantity').val(next);
  1248.         }
  1249.         // ===== スマホ用下部固定バーへの金額同期 =====
  1250.         // mitsumori_message と mitsumori_goukei を監視して下部バーを更新
  1251.         (function() {
  1252.             var msgTarget   = document.getElementById('mitsumori_message');
  1253.             var goukeiTarget = document.getElementById('mitsumori_goukei');
  1254.             var spPrice     = document.getElementById('sp-mitsumori-price');
  1255.             var spBtn       = document.querySelector('#sp-mitsumori-bar .sp-bar__btn');
  1256.             if (!spPrice || !spBtn) return;
  1257.             function syncBar() {
  1258.                 var msg    = msgTarget ? msgTarget.textContent : '';
  1259.                 var goukei = goukeiTarget ? goukeiTarget.textContent : '---円';
  1260.                 // メッセージが「〇〇を選択してください」の場合はメッセージを表示しボタンを非表示
  1261.                 if (msg.indexOf('選択してください') !== -1) {
  1262.                     spPrice.textContent = msg;
  1263.                     spPrice.style.fontSize = '13px';
  1264.                     spPrice.style.color    = '#888';
  1265.                     spBtn.style.display    = 'none';
  1266.                 } else {
  1267.                     // 価格確定時はボタンを表示
  1268.                     spPrice.textContent = goukei;
  1269.                     spPrice.style.fontSize = '18px';
  1270.                     spPrice.style.color    = '#c00';
  1271.                     spBtn.style.display    = 'block';
  1272.                 }
  1273.             }
  1274.             // 初期値を同期
  1275.             syncBar();
  1276.             // mitsumori_message の変化を監視
  1277.             if (msgTarget) {
  1278.                 new MutationObserver(syncBar).observe(
  1279.                     msgTarget, { childList: true, subtree: true, characterData: true }
  1280.                 );
  1281.             }
  1282.             // mitsumori_goukei の変化も監視
  1283.             if (goukeiTarget) {
  1284.                 new MutationObserver(syncBar).observe(
  1285.                     goukeiTarget, { childList: true, subtree: true, characterData: true }
  1286.                 );
  1287.             }
  1288.         })();
  1289.         // ===== 現在のお見積り額: 折りたたみトグルボタンのテキスト切り替え =====
  1290.         (function() {
  1291.             var card = document.querySelector('.mitsumori-card-pc');
  1292.             var btn  = document.querySelector('.btn-mitsumori-toggle .toggle-icon');
  1293.             if (!card || !btn) return;
  1294.             // MutationObserverでcollapsed-cardクラスの変化を監視
  1295.             new MutationObserver(function() {
  1296.                 if (card.classList.contains('collapsed-card')) {
  1297.                     btn.textContent = '▼ 詳細';
  1298.                 } else {
  1299.                     btn.textContent = '▲ 閉じる';
  1300.                 }
  1301.             }).observe(card, { attributes: true, attributeFilter: ['class'] });
  1302.         })();
  1303.         // ===== エリア案内: スマホのみタップで展開 =====
  1304.         (function() {
  1305.             var notice = document.querySelector('.ec-areaNotice');
  1306.             if (!notice) return;
  1307.             notice.addEventListener('click', function(e) {
  1308.                 if (window.innerWidth > 767) return;
  1309.                 // リンククリック時は展開/折りたたみせずリンク遷移
  1310.                 if (e.target.tagName === 'A') return;
  1311.                 notice.classList.toggle('is-open');
  1312.             });
  1313.         })();
  1314.     </script>
  1315.     <script type="application/ld+json">
  1316.     {
  1317.         "@context": "https://schema.org/",
  1318.         "@type": "Product",
  1319.         "name": "{{ Product.name }}",
  1320.         "image": [
  1321.             {% for img in Product.ProductImage %}
  1322.                 "{{ app.request.schemeAndHttpHost }}{{ asset(img, 'save_image') }}"{% if not loop.last %},{% endif %}
  1323.             {% else %}
  1324.                 "{{ app.request.schemeAndHttpHost }}{{ asset(''|no_image_product, 'save_image') }}"
  1325.             {% endfor %}
  1326.         ],
  1327.         "description": "{{ Product.description_list | default(Product.description_detail) | replace({'\n': '', '\r': ''}) | slice(0,300) }}",
  1328.         {% if Product.code_min %}
  1329.         "sku": "{{ Product.code_min }}",
  1330.         {% endif %}
  1331.         "offers": {
  1332.             "@type": "Offer",
  1333.             "url": "{{ url('product_detail', {'id': Product.id}) }}",
  1334.             "priceCurrency": "{{ eccube_config.currency }}",
  1335.             "price": {{ Product.getPrice02IncTaxMin ? Product.getPrice02IncTaxMin : 0}},
  1336.             "availability": "{{ Product.stock_find ? "InStock" : "OutOfStock" }}"
  1337.         }
  1338.     }
  1339.     </script>
  1340. {% endblock %}
  1341. {% block main %}
  1342.     <div class="ec-productRole" style="margin-top:20px;">
  1343.         <div class="ec-grid2">
  1344.             <div class="ec-grid2__cell">
  1345.                 <div class="ec-sliderItemRole">
  1346.                     {# 商品名 + ブランド名 + SNSシェア #}
  1347.                     <div class="ec-productRole__title">
  1348.                         <div class="ec-productRole__titleRow">
  1349.                             <h2 class="ec-headingTitle">{{ Product.name }}</h2>
  1350.                             <div class="ec-share-inline">
  1351.                                 <a href="https://twitter.com/share?url={{ app.request.uri|url_encode }}&text={{ Product.name|url_encode }}"
  1352.                                    class="share-twitter" target="_blank" rel="noreferrer noopener" title="Xでシェア">
  1353.                                     <svg viewBox="0 0 24 24" style="width:15px;height:15px;fill:#fff;"><path d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-4.714-6.231-5.401 6.231H2.74l7.73-8.835L1.254 2.25H8.08l4.254 5.622L18.244 2.25zm-1.161 17.52h1.833L7.084 4.126H5.117z"/></svg>
  1354.                                 </a>
  1355.                                 <a href="https://www.instagram.com/" class="share-facebook" target="_blank" rel="noreferrer noopener" title="Instagram">
  1356.                                     <svg viewBox="0 0 24 24" style="width:15px;height:15px;fill:#fff;"><path d="M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zM12 0C8.741 0 8.333.014 7.053.072 2.695.272.273 2.69.073 7.052.014 8.333 0 8.741 0 12c0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98C8.333 23.986 8.741 24 12 24c3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98C15.668.014 15.259 0 12 0zm0 5.838a6.162 6.162 0 100 12.324 6.162 6.162 0 000-12.324zM12 16a4 4 0 110-8 4 4 0 010 8zm6.406-11.845a1.44 1.44 0 100 2.881 1.44 1.44 0 000-2.881z"/></svg>
  1357.                                 </a>
  1358.                                 <a href="https://social-plugins.line.me/lineit/share?url={{ app.request.uri|url_encode }}"
  1359.                                    class="share-line" target="_blank" rel="noreferrer noopener" title="LINEでシェア">
  1360.                                     <i class="fab fa-line"></i>
  1361.                                 </a>
  1362.                             </div>
  1363.                         </div>
  1364.                     </div>
  1365.                     {% if BaseInfo.option_favorite_product %}
  1366.                      <div style="position:relative;top: 20px;left: 10px;z-index:100;">
  1367.                         {% if is_favorite == false %}
  1368.                         <form action="{{ url('product_add_favorite', {id:Product.id}) }}" method="post">
  1369.                            <button type="submit" id="favorite" class="favorite">&#9825;</button>
  1370.                         </form>
  1371.                         {% else %}
  1372.                         <form action="{{ url('product_add_favorite', {id:Product.id}) }}" method="post">
  1373.                            <button type="submit" id="favorite" class="favorite" style="color:red;">&#9829;</button>
  1374.                         </form>
  1375.                         {% endif %}
  1376.                      </div>
  1377.                     {% endif %}
  1378.                     <div class="item_visual">
  1379.                         {% for ProductImage in Product.ProductImage %}
  1380.                             <div class="slide-item"><img src="{{ asset(ProductImage, 'save_image') }}" alt="{{ loop.first ? Product.name : '' }}" width="550" height="550" style="max-height: 400px;"{% if loop.index > 1 %} loading="lazy"{% endif %}></div>
  1381.                         {% else %}
  1382.                             <div class="slide-item"><img src="{{ asset(''|no_image_product, 'save_image') }}" alt="{{ loop.first ? Product.name : '' }}" width="550" height="550" style="max-height: 400px;"></div>
  1383.                         {% endfor %}
  1384.                     </div>
  1385.                     <div class="item_nav">
  1386.                         {% for ProductImage in Product.ProductImage %}
  1387.                             <div class="slideThumb" data-index="{{ loop.index0 }}"><img src="{{ asset(ProductImage, 'save_image') }}" alt="" width="80" height="80" loading="lazy"></div>
  1388.                         {% endfor %}
  1389.                     </div>
  1390.                 </div>
  1391.                     {# ===== 施工エリア案内(見積シミュレーションの下)===== #}
  1392.                     <div class="ec-areaNotice" style="margin-top:16px;margin-right:10px;">
  1393.                         <div class="ec-areaNotice__inner">
  1394.                             <div class="ec-areaNotice__icon">📍</div>
  1395.                             <div class="ec-areaNotice__body">
  1396.                                 <p class="ec-areaNotice__title">施工対応エリアについて</p>
  1397.                                 <div class="ec-areaNotice__detail">
  1398.                                     <p class="ec-areaNotice__text">
  1399.                                         当店の施工サービスは、<strong>山梨県全域</strong>および<br>
  1400.                                         <strong>諏訪エリア(諏訪市・岡谷市・茅野市・諏訪郡)</strong>を対象としております。<br>
  1401.                                         上記エリア外のお客様には、商品のみのご購入が可能でございます。<br>
  1402.                                         ご不明な点がございましたら、お気軽にお問い合わせください。
  1403.                                     </p>
  1404.                                     <a class="ec-areaNotice__link" href="{{ url('contact') }}">エリア外のお客様・ご相談はこちら →</a>
  1405.                                 </div>
  1406.                             </div>
  1407.                         </div>
  1408.                     </div>
  1409.             </div>
  1410.             <div class="ec-grid2__cell2">
  1411.                 <div class="ec-productRole__profile" >
  1412.                     {# 関連カテゴリ #}
  1413.                     {% if Product.ProductCategories is not empty %}
  1414.                         <div class="ec-productRole__category" style="padding:10px 0;">
  1415.                             {% for ProductCategory in Product.ProductCategories %}
  1416.                                 <ul>
  1417.                                     <li>
  1418.                                         {% for Category in ProductCategory.Category.path %}
  1419.                                             <a href="{{ url('product_list') }}?category_id={{ Category.id }}">{{ Category.name }}</a> {%- if loop.last == false %}
  1420.                                             <span>></span>{% endif -%}
  1421.                                         {% endfor %}
  1422.                                     </li>
  1423.                                 </ul>
  1424.                             {% endfor %}
  1425.                         </div>
  1426.                     {% endif %}
  1427.                     {# 販売価格 #}
  1428.                     <div class="ec-productRole__price">
  1429.                         <span style="color:black;font-size:15px;">工事費込み価格</span>
  1430.                         {% if Product.hasProductClass -%}
  1431.                             {% if Product.getPrice02IncTaxMin == Product.getPrice02IncTaxMax %}
  1432.                                 <div class="ec-price">
  1433.                                     <span id="price02-display" class="ec-price__price price02-default">{{ Product.getPrice02IncTaxMin|price }}</span>
  1434.                                     <span class="ec-price__tax">({{ '税込'|trans }})~</span>
  1435.                                 </div>
  1436.                             {% else %}
  1437.                                 <div class="ec-price">
  1438.                                     <span id="price02-display" class="ec-price__price price02-default">{{ Product.getPrice02IncTaxMin|price }} ~ {{ Product.getPrice02IncTaxMax|price }}</span>
  1439.                                     <span class="ec-price__tax">({{ '税込'|trans }})</span>
  1440.                                 </div>
  1441.                             {% endif %}
  1442.                         {% else %}
  1443.                             <div class="ec-price">
  1444.                                 <span id="price02-display" class="ec-price__price">{{ Product.getPrice02IncTaxMin|price }}</span>
  1445.                                     <span class="ec-price__tax">({{ '税込'|trans }})~</span>
  1446.                             </div>
  1447.                         {% endif %}
  1448.                     </div>
  1449.                     {# タグ #}
  1450.                     <ul class="ec-productRole__tags">
  1451.                         {% for Tag in Product.Tags %}
  1452.                             <li class="ec-productRole__tag tag_{{ Tag.id }}">{{ Tag }}</li>
  1453.                         {% endfor %}
  1454.                     </ul>
  1455.                     {# 商品コード #}
  1456.                     {% if Product.code_min is not empty %}
  1457.                         <div class="ec-productRole__code">
  1458.                             {{ '商品コード'|trans }}: <span class="product-code-default">{{ Product.code_min }}{% if Product.code_min != Product.code_max %} ~ {{ Product.code_max }}{% endif %}</span>
  1459.                         </div>
  1460.                     {% endif %}
  1461.                     <div class="ec-productRole__description">
  1462.                         <div class="ec-rectHeading">
  1463.                             <h4>製品情報</h4>
  1464.                         </div>
  1465.                         {{ Product.sales_infomation|raw|nl2br }}
  1466.                     </div>
  1467.                     <div class="card card-danger" style="clear:both;margin:1px;">
  1468.                       <div class="card-header">
  1469.                         <h3 class="card-title">見積シミュレーション</h3>
  1470.                       </div>
  1471.                       <div class="card-body p-2">
  1472.                         {% set related_image = getProduct_field(Product.id,"related_image") %}
  1473.                         {# related_image は配列: ["1段目画像あり","2段目画像あり","3段目画像あり"] のうち該当するものが格納 #}
  1474.                         {% set img1 = related_image and ("1段目画像あり" in related_image) %}
  1475.                         {% set img2 = related_image and ("2段目画像あり" in related_image) %}
  1476.                         {% set img3 = related_image and ("3段目画像あり" in related_image) %}
  1477.                         {% set img4 = related_image and ("4段目画像あり" in related_image) %}
  1478.                         {% set type1 = getProduct_field(Product.id,"related_name1") %}
  1479.                         {% set type2 = getProduct_field(Product.id,"related_name2") %}
  1480.                         {% set type3 = getProduct_field(Product.id,"related_name3") %}
  1481.                         {% set type4 = getProduct_field(Product.id,"related_name4") %}
  1482.                         {% set hasRelated = (type1 and related_product1 and related_product1|length)
  1483.                                          or (type2 and related_product2 and related_product2|length)
  1484.                                          or (type3 and related_product3 and related_product3|length)
  1485.                                          or (type4 and related_product4 and related_product4|length) %}
  1486.                         {% if hasRelated %}
  1487.                             <div class="row" style="border-bottom:1px solid rgba(0,0,0,.125)"><label class="col-12 col-form-label">この商品のタイプを選択してください。</label></div>
  1488.                         {% endif %}
  1489.                         {# ===== 1段目 ===== #}
  1490.                         {% if type1 and related_product1 and related_product1|length %}
  1491.                         <div class="form-group mt-3 pb-3" style="border-bottom:1px solid rgba(0,0,0,.125)">
  1492.                           <div class="rp-section-label">{{ type1 }}{% if img1 and base_select1 %}: <span>{{ base_select1 }}</span>{% endif %}</div>
  1493.                           {% if img1 %}
  1494.                             {# --- 画像付きカード --- #}
  1495.                             <div class="rp-card-group">
  1496.                               {% for rp_id, rp_name in related_product1 %}
  1497.                                 <label class="rp-card{% if base_select1 == rp_name %} is-selected{% endif %}"
  1498.                                        onclick="location.href='/products/detail/{{ rp_id }}';">
  1499.                                   <input type="radio" name="rp1" value="{{ rp_name }}"
  1500.                                          {% if base_select1 == rp_name %}checked{% endif %}>
  1501.                                   <img class="rp-card__image"
  1502.                                        src="{{ asset('p' ~ rp_id ~ '_cp_1.jpg', 'save_image') }}"
  1503.                                        alt="{{ rp_name }}"
  1504.                                        onerror="this.style.display='none';this.nextElementSibling.style.display='flex';">
  1505.                                   <div class="rp-card__placeholder" style="display:none;">📦</div>
  1506.                                   <span class="rp-card__name">{{ rp_name }}</span>
  1507.                                 </label>
  1508.                               {% endfor %}
  1509.                             </div>
  1510.                           {% else %}
  1511.                             {# --- ボタン式ラジオ --- #}
  1512.                             <div class="rp-btn-group">
  1513.                               {% for rp_id, rp_name in related_product1 %}
  1514.                                 <label class="rp-btn{% if base_select1 == rp_name %} is-selected{% endif %}"
  1515.                                        onclick="location.href='/products/detail/{{ rp_id }}';">
  1516.                                   <input type="radio" name="rp1" value="{{ rp_name }}"
  1517.                                          {% if base_select1 == rp_name %}checked{% endif %}>
  1518.                                   {{ rp_name }}
  1519.                                 </label>
  1520.                               {% endfor %}
  1521.                             </div>
  1522.                           {% endif %}
  1523.                         </div>
  1524.                         {% endif %}
  1525.                         {# ===== 2段目 ===== #}
  1526.                         {% if type2 and related_product2 and related_product2|length %}
  1527.                         <div class="form-group mt-3 pb-3" style="border-bottom:1px solid rgba(0,0,0,.125)">
  1528.                           <div class="rp-section-label">{{ type2 }}{% if img2 and base_select2 %}: <span>{{ base_select2 }}</span>{% endif %}</div>
  1529.                           {% if img2 %}
  1530.                             <div class="rp-card-group">
  1531.                               {% for rp_id, rp_name in related_product2 %}
  1532.                                 <label class="rp-card{% if base_select2 == rp_name %} is-selected{% endif %}"
  1533.                                        onclick="location.href='/products/detail/{{ rp_id }}';">
  1534.                                   <input type="radio" name="rp2" value="{{ rp_name }}"
  1535.                                          {% if base_select2 == rp_name %}checked{% endif %}>
  1536.                                   <img class="rp-card__image"
  1537.                                        src="{{ asset('p' ~ rp_id ~ '_cp_1.jpg', 'save_image') }}"
  1538.                                        alt="{{ rp_name }}"
  1539.                                        onerror="this.style.display='none';this.nextElementSibling.style.display='flex';">
  1540.                                   <div class="rp-card__placeholder" style="display:none;">📦</div>
  1541.                                   <span class="rp-card__name">{{ rp_name }}</span>
  1542.                                 </label>
  1543.                               {% endfor %}
  1544.                             </div>
  1545.                           {% else %}
  1546.                             <div class="rp-btn-group">
  1547.                               {% for rp_id, rp_name in related_product2 %}
  1548.                                 <label class="rp-btn{% if base_select2 == rp_name %} is-selected{% endif %}"
  1549.                                        onclick="location.href='/products/detail/{{ rp_id }}';">
  1550.                                   <input type="radio" name="rp2" value="{{ rp_name }}"
  1551.                                          {% if base_select2 == rp_name %}checked{% endif %}>
  1552.                                   {{ rp_name }}
  1553.                                 </label>
  1554.                               {% endfor %}
  1555.                             </div>
  1556.                           {% endif %}
  1557.                         </div>
  1558.                         {% endif %}
  1559.                         {# ===== 3段目 ===== #}
  1560.                         {% if type3 and related_product3 and related_product3|length %}
  1561.                         <div class="form-group mt-3 pb-3" style="border-bottom:1px solid rgba(0,0,0,.125)">
  1562.                           <div class="rp-section-label">{{ type3 }}{% if img3 and base_select3 %}: <span>{{ base_select3 }}</span>{% endif %}</div>
  1563.                           {% if img3 %}
  1564.                             <div class="rp-card-group">
  1565.                               {% for rp_id, rp_name in related_product3 %}
  1566.                                 <label class="rp-card{% if base_select3 == rp_name %} is-selected{% endif %}"
  1567.                                        onclick="location.href='/products/detail/{{ rp_id }}';">
  1568.                                   <input type="radio" name="rp3" value="{{ rp_name }}"
  1569.                                          {% if base_select3 == rp_name %}checked{% endif %}>
  1570.                                   <img class="rp-card__image"
  1571.                                        src="{{ asset('p' ~ rp_id ~ '_cp_1.jpg', 'save_image') }}"
  1572.                                        alt="{{ rp_name }}"
  1573.                                        onerror="this.style.display='none';this.nextElementSibling.style.display='flex';">
  1574.                                   <div class="rp-card__placeholder" style="display:none;">📦</div>
  1575.                                   <span class="rp-card__name">{{ rp_name }}</span>
  1576.                                 </label>
  1577.                               {% endfor %}
  1578.                             </div>
  1579.                           {% else %}
  1580.                             <div class="rp-btn-group">
  1581.                               {% for rp_id, rp_name in related_product3 %}
  1582.                                 <label class="rp-btn{% if base_select3 == rp_name %} is-selected{% endif %}"
  1583.                                        onclick="location.href='/products/detail/{{ rp_id }}';">
  1584.                                   <input type="radio" name="rp3" value="{{ rp_name }}"
  1585.                                          {% if base_select3 == rp_name %}checked{% endif %}>
  1586.                                   {{ rp_name }}
  1587.                                 </label>
  1588.                               {% endfor %}
  1589.                             </div>
  1590.                           {% endif %}
  1591.                         </div>
  1592.                         {% endif %}
  1593.                         {# ===== 4段目 ===== #}
  1594.                         {% if type4 and related_product4 and related_product4|length %}
  1595.                         <div class="form-group mt-3 pb-3" style="border-bottom:1px solid rgba(0,0,0,.125)">
  1596.                           <div class="rp-section-label">{{ type4 }}{% if img4 and base_select4 %}: <span>{{ base_select4 }}</span>{% endif %}</div>
  1597.                           {% if img4 %}
  1598.                             {# --- 画像付きカード --- #}
  1599.                             <div class="rp-card-group">
  1600.                               {% for rp_id, rp_name in related_product4 %}
  1601.                                 <label class="rp-card{% if base_select4 == rp_name %} is-selected{% endif %}"
  1602.                                        onclick="location.href='/products/detail/{{ rp_id }}';">
  1603.                                   <input type="radio" name="rp4" value="{{ rp_name }}"
  1604.                                          {% if base_select4 == rp_name %}checked{% endif %}>
  1605.                                   <img class="rp-card__image"
  1606.                                        src="{{ asset('p' ~ rp_id ~ '_cp_1.jpg', 'save_image') }}"
  1607.                                        alt="{{ rp_name }}" loading="lazy">
  1608.                                   <span class="rp-card__label">{{ rp_name }}</span>
  1609.                                 </label>
  1610.                               {% endfor %}
  1611.                             </div>
  1612.                           {% else %}
  1613.                             {# --- ボタン式ラジオ --- #}
  1614.                             <div class="rp-btn-group">
  1615.                               {% for rp_id, rp_name in related_product4 %}
  1616.                                 <label class="rp-btn{% if base_select4 == rp_name %} is-selected{% endif %}"
  1617.                                        onclick="location.href='/products/detail/{{ rp_id }}';">
  1618.                                   <input type="radio" name="rp4" value="{{ rp_name }}"
  1619.                                          {% if base_select4 == rp_name %}checked{% endif %}>
  1620.                                   {{ rp_name }}
  1621.                                 </label>
  1622.                               {% endfor %}
  1623.                             </div>
  1624.                           {% endif %}
  1625.                         </div>
  1626.                         {% endif %}
  1627.                         <div class="row" style="border-bottom:1px solid rgba(0,0,0,.125)"><label class="col-12 col-form-label">この商品のオプションを選択してください。</label></div>
  1628.                         {% if color and color|length and ProductClass.SaleType.id != 3 %}
  1629.                         <div class="form-group mt-3 pb-2" style="border-bottom:1px solid rgba(0,0,0,.125)">
  1630.                           <div class="rp-section-label">カラー{% if mitsumori_json and mitsumori_json.pc %}: <span>{{ mitsumori_json.pc }}</span>{% endif %}</div>
  1631.                           <div class="opt-btn-group">
  1632.                             {% set idx = 0 %}
  1633.                             {% for cc in color %}{% if cc and cc['name'] %}{% set idx = idx + 1 %}
  1634.                               <label class="opt-btn{% if (mitsumori_json and mitsumori_json.pc == cc['name']) or color|length == 1 %} is-selected{% endif %}"
  1635.                                      onclick="mitsumori_simulation_val('pc', '{{ cc['name']|e('js') }}');">
  1636.                                 <input type="radio" name="color" id="cc_{{ idx }}" value="{{ cc['name'] }}"
  1637.                                        {% if (mitsumori_json and mitsumori_json.pc == cc['name']) or color|length == 1 %}checked{% endif %}>
  1638.                                 {{ cc['name'] }}
  1639.                               </label>
  1640.                             {% endif %}{% endfor %}
  1641.                           </div>
  1642.                         </div>
  1643.                         {% endif %}
  1644.                         {% if p_w and p_w|length and p_w|join != "" %}
  1645.                         <div class="form-group mt-3 pb-2" style="border-bottom:1px solid rgba(0,0,0,.125)">
  1646.                           <div class="rp-section-label">幅{% if mitsumori_json and mitsumori_json.pw %}: <span>{{ mitsumori_json.pw }}</span>{% endif %}</div>
  1647.                           <div class="opt-btn-group">
  1648.                             {% set idx = 0 %}
  1649.                             {% for pw in p_w %}{% if pw %}{% set idx = idx + 1 %}
  1650.                               <label class="opt-btn{% if (mitsumori_json and mitsumori_json.pw == pw) or p_w|length == 1 %} is-selected{% endif %}"
  1651.                                      onclick="mitsumori_simulation_val('pw', '{{ pw|e('js') }}');">
  1652.                                 <input type="radio" name="pw" id="pw_{{ idx }}" value="{{ pw }}"
  1653.                                        {% if (mitsumori_json and mitsumori_json.pw == pw) or p_w|length == 1 %}checked{% endif %}>
  1654.                                 {{ pw }}
  1655.                               </label>
  1656.                             {% endif %}{% endfor %}
  1657.                           </div>
  1658.                         </div>
  1659.                         {% endif %}
  1660.                         {% if p_d and p_d|length and p_d|join != "" %}
  1661.                         <div class="form-group mt-3 pb-2" style="border-bottom:1px solid rgba(0,0,0,.125)">
  1662.                           <div class="rp-section-label">奥行き{% if mitsumori_json and mitsumori_json.pd %}: <span>{{ mitsumori_json.pd }}</span>{% endif %}</div>
  1663.                           <div class="opt-btn-group">
  1664.                             {% set idx = 0 %}
  1665.                             {% for pd in p_d %}{% if pd %}{% set idx = idx + 1 %}
  1666.                               <label class="opt-btn{% if (mitsumori_json and mitsumori_json.pd == pd) or p_d|length == 1 %} is-selected{% endif %}"
  1667.                                      onclick="mitsumori_simulation_val('pd', '{{ pd|e('js') }}');">
  1668.                                 <input type="radio" name="pd" id="pd_{{ idx }}" value="{{ pd }}"
  1669.                                        {% if (mitsumori_json and mitsumori_json.pd == pd) or p_d|length == 1 %}checked{% endif %}>
  1670.                                 {{ pd }}
  1671.                               </label>
  1672.                             {% endif %}{% endfor %}
  1673.                           </div>
  1674.                         </div>
  1675.                         {% endif %}
  1676.                         {% if p_h and p_h|length and p_h|join != "" %}
  1677.                         <div class="form-group mt-3 pb-2" style="border-bottom:1px solid rgba(0,0,0,.125)">
  1678.                           <div class="rp-section-label">高さ{% if mitsumori_json and mitsumori_json.ph %}: <span>{{ mitsumori_json.ph }}</span>{% endif %}</div>
  1679.                           <div class="opt-btn-group">
  1680.                             {% set idx = 0 %}
  1681.                             {% for ph in p_h %}{% if ph %}{% set idx = idx + 1 %}
  1682.                               <label class="opt-btn{% if (mitsumori_json and mitsumori_json.ph == ph) or p_h|length == 1 %} is-selected{% endif %}"
  1683.                                      onclick="mitsumori_simulation_val('ph', '{{ ph|e('js') }}');">
  1684.                                 <input type="radio" name="ph" id="ph_{{ idx }}" value="{{ ph }}"
  1685.                                        {% if (mitsumori_json and mitsumori_json.ph == ph) or p_h|length == 1 %}checked{% endif %}>
  1686.                                 {{ ph }}
  1687.                               </label>
  1688.                             {% endif %}{% endfor %}
  1689.                           </div>
  1690.                         </div>
  1691.                         {% endif %}
  1692.                         {% if p_m and p_m|length and p_m|join != "" %}
  1693.                         <div class="form-group mt-3 pb-2" style="border-bottom:1px solid rgba(0,0,0,.125)">
  1694.                           <div class="rp-section-label">素材{% if mitsumori_json and mitsumori_json.pm %}: <span>{{ mitsumori_json.pm }}</span>{% endif %}</div>
  1695.                           <div class="opt-btn-group">
  1696.                             {% set idx = 0 %}
  1697.                             {% for pm in p_m %}{% if pm %}{% set idx = idx + 1 %}
  1698.                               <label class="opt-btn{% if (mitsumori_json and mitsumori_json.pm == pm) or p_m|length == 1 %} is-selected{% endif %}"
  1699.                                      onclick="mitsumori_simulation_val('pm', '{{ pm|e('js') }}');">
  1700.                                 <input type="radio" name="pm" id="pm_{{ idx }}" value="{{ pm }}"
  1701.                                        {% if (mitsumori_json and mitsumori_json.pm == pm) or p_m|length == 1 %}checked{% endif %}>
  1702.                                 {{ pm }}
  1703.                               </label>
  1704.                             {% endif %}{% endfor %}
  1705.                           </div>
  1706.                         </div>
  1707.                         {% endif %}
  1708.                         <!-- 1: 施工見積(通常) → 幅/奥行/高さ/素材/カラーは上部の共通ブロックで表示済み -->
  1709.                         {% if ProductClass.SaleType.id == 1 %}
  1710.                         {% endif %}
  1711.                         <!-- 2: 施工見積(補助金・窓) -->
  1712.                         {% if ProductClass.SaleType.id == 2 %}
  1713.                             {# 窓サイズ(自由入力) #}
  1714.                             <div class="form-group row mt-2" style="border-bottom:1px solid rgba(0,0,0,.125)">
  1715.                               <label class="col-4 col-form-label">窓サイズ</label>
  1716.                               <div class="col-4">
  1717.                                 <div class="input-group">
  1718.                                   <span class="input-group-text">窓幅</span>
  1719.                                   <input type="number" name="mado_w" id="mado_w" class="form-control" value="{{ mitsumori_json.mado_w|default('') }}" placeholder="例: 90" min="1" onchange="mitsumori_simulation('mado_w','mado_w');">
  1720.                                   <span class="input-group-text">cm</span>
  1721.                                 </div>
  1722.                               </div>
  1723.                               <div class="col-4">
  1724.                                 <div class="input-group">
  1725.                                   <span class="input-group-text">窓高さ</span>
  1726.                                   <input type="number" name="mado_h" id="mado_h" class="form-control" value="{{ mitsumori_json.mado_h|default('') }}" placeholder="例: 110" min="1" onchange="mitsumori_simulation('mado_h','mado_h');">
  1727.                                   <span class="input-group-text">cm</span>
  1728.                                 </div>
  1729.                               </div>
  1730.                             </div>
  1731.                             {# 窓タイプ(p_d データから選択肢を生成) #}
  1732.                             {% if p_d and p_d|length and p_d|join != "" %}
  1733.                             <div class="form-group row mt-2" style="border-bottom:1px solid rgba(0,0,0,.125)">
  1734.                               <label class="col-4 col-form-label">窓タイプ</label>
  1735.                               <div class="col-8">
  1736.                                 <div class="form-group clearfix">
  1737.                                 {% set idx = 0 %}
  1738.                                 {% for pd_val in p_d %}
  1739.                                   {% if pd_val %}
  1740.                                   {% set idx = idx + 1 %}
  1741.                                   <div class="icheck-danger d-inline">
  1742.                                     <input type="radio" name="mado_type" id="mado_type_{{ idx }}" value="{{ pd_val }}"
  1743.                                       {% if (mitsumori_json and mitsumori_json.pd == pd_val) or (p_d|length == 1) %}checked{% endif %}
  1744.                                       onclick="mitsumori_simulation('pd','mado_type_{{ idx }}');">
  1745.                                     <label for="mado_type_{{ idx }}">{{ pd_val }}</label>
  1746.                                   </div>
  1747.                                   {% endif %}
  1748.                                 {% endfor %}
  1749.                                 </div>
  1750.                               </div>
  1751.                             </div>
  1752.                             {% endif %}
  1753.                             {# ガラスタイプ(p_m データから選択肢を生成) #}
  1754.                             {% if p_m and p_m|length and p_m|join != "" %}
  1755.                             <div class="form-group row mt-2" style="border-bottom:1px solid rgba(0,0,0,.125)">
  1756.                               <label class="col-4 col-form-label">ガラスタイプ</label>
  1757.                               <div class="col-8">
  1758.                                 <div class="form-group clearfix">
  1759.                                 {% set idx = 0 %}
  1760.                                 {% for pm_val in p_m %}
  1761.                                   {% if pm_val %}
  1762.                                   {% set idx = idx + 1 %}
  1763.                                   <div class="icheck-danger d-inline">
  1764.                                     <input type="radio" name="glass_type" id="glass_type_{{ idx }}" value="{{ pm_val }}"
  1765.                                       {% if (mitsumori_json and mitsumori_json.pm == pm_val) or (p_m|length == 1) %}checked{% endif %}
  1766.                                       onclick="mitsumori_simulation('pm','glass_type_{{ idx }}');">
  1767.                                     <label for="glass_type_{{ idx }}">{{ pm_val }}</label>
  1768.                                   </div>
  1769.                                   {% endif %}
  1770.                                 {% endfor %}
  1771.                                 </div>
  1772.                               </div>
  1773.                             </div>
  1774.                             {% endif %}
  1775.                             {# セット数(プルダウン) → quantity に連動 #}
  1776.                             <div class="form-group row mt-2" style="border-bottom:1px solid rgba(0,0,0,.125)">
  1777.                               <label class="col-4 col-form-label">セット数</label>
  1778.                               <div class="col-8">
  1779.                                 <select name="set_count" id="set_count" class="form-control" onchange="madosetSelect(this.value);">
  1780.                                   {% for i in 1..20 %}
  1781.                                     <option value="{{ i }}" {% if mitsumori_json and mitsumori_json.set_count == i %}selected{% endif %}>{{ i }} セット</option>
  1782.                                   {% endfor %}
  1783.                                 </select>
  1784.                               </div>
  1785.                             </div>
  1786.                         {% endif %}
  1787.                         <!-- 3: 施工見積(物置・ゴミステーション) -->
  1788.                         {% if ProductClass.SaleType.id == 3 %}
  1789.                             {# 幅・奥行き・高さ(p_w/p_d/p_h からラジオボタン生成) #}
  1790.                             {% if p_w and p_w|length and p_w|join != "" %}
  1791.                             <div class="form-group row mt-2" style="border-bottom:1px solid rgba(0,0,0,.125)">
  1792.                               <label class="col-4 col-form-label">幅</label>
  1793.                               <div class="col-8">
  1794.                                 <div class="form-group clearfix">
  1795.                                 {% set idx = 0 %}
  1796.                                 {% for pw_val in p_w %}{% if pw_val %}{% set idx = idx + 1 %}
  1797.                                   <div class="icheck-danger d-inline">
  1798.                                     <input type="radio" name="pw" id="pw3_{{ idx }}" value="{{ pw_val }}"
  1799.                                       {% if (mitsumori_json and mitsumori_json.pw == pw_val) or p_w|length == 1 %}checked{% endif %}
  1800.                                       onclick="mitsumori_simulation('pw','pw3_{{ idx }}');">
  1801.                                     <label for="pw3_{{ idx }}">{{ pw_val }}</label>
  1802.                                   </div>
  1803.                                 {% endif %}{% endfor %}
  1804.                                 </div>
  1805.                               </div>
  1806.                             </div>
  1807.                             {% endif %}
  1808.                             {% if p_d and p_d|length and p_d|join != "" %}
  1809.                             <div class="form-group row mt-2" style="border-bottom:1px solid rgba(0,0,0,.125)">
  1810.                               <label class="col-4 col-form-label">奥行き</label>
  1811.                               <div class="col-8">
  1812.                                 <div class="form-group clearfix">
  1813.                                 {% set idx = 0 %}
  1814.                                 {% for pd_val in p_d %}{% if pd_val %}{% set idx = idx + 1 %}
  1815.                                   <div class="icheck-danger d-inline">
  1816.                                     <input type="radio" name="pd" id="pd3_{{ idx }}" value="{{ pd_val }}"
  1817.                                       {% if (mitsumori_json and mitsumori_json.pd == pd_val) or p_d|length == 1 %}checked{% endif %}
  1818.                                       onclick="mitsumori_simulation('pd','pd3_{{ idx }}');">
  1819.                                     <label for="pd3_{{ idx }}">{{ pd_val }}</label>
  1820.                                   </div>
  1821.                                 {% endif %}{% endfor %}
  1822.                                 </div>
  1823.                               </div>
  1824.                             </div>
  1825.                             {% endif %}
  1826.                             {% if p_h and p_h|length and p_h|join != "" %}
  1827.                             <div class="form-group row mt-2" style="border-bottom:1px solid rgba(0,0,0,.125)">
  1828.                               <label class="col-4 col-form-label">高さ</label>
  1829.                               <div class="col-8">
  1830.                                 <div class="form-group clearfix">
  1831.                                 {% set idx = 0 %}
  1832.                                 {% for ph_val in p_h %}{% if ph_val %}{% set idx = idx + 1 %}
  1833.                                   <div class="icheck-danger d-inline">
  1834.                                     <input type="radio" name="ph" id="ph3_{{ idx }}" value="{{ ph_val }}"
  1835.                                       {% if (mitsumori_json and mitsumori_json.ph == ph_val) or p_h|length == 1 %}checked{% endif %}
  1836.                                       onclick="mitsumori_simulation('ph','ph3_{{ idx }}');">
  1837.                                     <label for="ph3_{{ idx }}">{{ ph_val }}</label>
  1838.                                   </div>
  1839.                                 {% endif %}{% endfor %}
  1840.                                 </div>
  1841.                               </div>
  1842.                             </div>
  1843.                             {% endif %}
  1844.                             {# 棚タイプ(p_m データから選択肢を生成) #}
  1845.                             {% if p_m and p_m|length and p_m|join != "" %}
  1846.                             <div class="form-group row mt-2" style="border-bottom:1px solid rgba(0,0,0,.125)">
  1847.                               <label class="col-4 col-form-label">棚タイプ<br><small class="text-muted">(間仕切り仕様)</small></label>
  1848.                               <div class="col-8">
  1849.                                 <div class="form-group clearfix">
  1850.                                 {% set idx = 0 %}
  1851.                                 {% for pm_val in p_m %}{% if pm_val %}{% set idx = idx + 1 %}
  1852.                                   <div class="icheck-danger d-inline">
  1853.                                     <input type="radio" name="pm" id="pm3_{{ idx }}" value="{{ pm_val }}"
  1854.                                       {% if (mitsumori_json and mitsumori_json.pm == pm_val) or p_m|length == 1 %}checked{% endif %}
  1855.                                       onclick="mitsumori_simulation('pm','pm3_{{ idx }}');">
  1856.                                     <label for="pm3_{{ idx }}">{{ pm_val }}</label>
  1857.                                   </div>
  1858.                                 {% endif %}{% endfor %}
  1859.                                 </div>
  1860.                               </div>
  1861.                             </div>
  1862.                             {% endif %}
  1863.                             {# カラー(共通の color データ使用) #}
  1864.                             {% if color and color|length %}
  1865.                             <div class="form-group row mt-2" style="border-bottom:1px solid rgba(0,0,0,.125)">
  1866.                               <label class="col-4 col-form-label">カラー</label>
  1867.                               <div class="col-8">
  1868.                                 <div class="form-group clearfix">
  1869.                                 {% set idx = 0 %}
  1870.                                 {% for cc in color %}{% if cc and cc['name'] %}{% set idx = idx + 1 %}
  1871.                                   <div class="icheck-danger d-inline">
  1872.                                     <input type="radio" name="color3" id="cc3_{{ idx }}" value="{{ cc['name'] }}"
  1873.                                       {% if (mitsumori_json and mitsumori_json.pc == cc['name']) or color|length == 1 %}checked{% endif %}
  1874.                                       onclick="mitsumori_simulation('pc','cc3_{{ idx }}');">
  1875.                                     <label for="cc3_{{ idx }}">{{ cc['name'] }}</label>
  1876.                                   </div>
  1877.                                 {% endif %}{% endfor %}
  1878.                                 </div>
  1879.                               </div>
  1880.                             </div>
  1881.                             {% endif %}
  1882.                             {# 台数 #}
  1883.                             <div class="form-group row mt-2" style="border-bottom:1px solid rgba(0,0,0,.125)">
  1884.                               <label class="col-4 col-form-label">台数</label>
  1885.                               <div class="col-4">
  1886.                                 <div class="input-group mb-3">
  1887.                                   <input type="number" name="daisu" id="daisu" class="form-control" value="{{ mitsumori_json.daisu|default('1') }}" min="1" max="10" onchange="mitsumori_simulation('daisu','daisu');">
  1888.                                   <span class="input-group-text">台</span>
  1889.                                 </div>
  1890.                               </div>
  1891.                               <div class="col-4">
  1892.                                 <button type="button" class="btn btn-info" onclick="daisu(+1);">+</button>
  1893.                                 <button type="button" class="btn btn-danger" onclick="daisu(-1);">ー</button>
  1894.                               </div>
  1895.                             </div>
  1896.                         {% endif %}
  1897.                         <!-- 4: 施工見積(フェンス・組み立て式) -->
  1898.                         {% if ProductClass.SaleType.id == 4 %}
  1899.                             {# 枚数 #}
  1900.                             <div class="form-group row mt-2" style="border-bottom:1px solid rgba(0,0,0,.125)">
  1901.                               <label class="col-4 col-form-label">枚数</label>
  1902.                               <div class="col-4 mb-3">
  1903.                                 <div class="input-group">
  1904.                                   <input type="number" name="maisu" id="maisu" class="form-control" value="{{ mitsumori_json.maisu|default('3') }}" min="3" max="20" onchange="mitsumori_simulation('maisu','maisu');">
  1905.                                   <span class="input-group-text">枚</span>
  1906.                                 </div>
  1907.                               </div>
  1908.                               <div class="col-4">
  1909.                                 <button type="button" class="btn btn-info" onclick="maisu(+1);">+</button>
  1910.                                 <button type="button" class="btn btn-danger" onclick="maisu(-1);">ー</button>
  1911.                               </div>
  1912.                             </div>
  1913.                         {% endif %}
  1914.                         <!-- 5: 施工見積(ウッドデッキ・タイルデッキ) -->
  1915.                         {% if ProductClass.SaleType.id == 5 %}
  1916.                             {# 施工面積(㎡ 直接入力) #}
  1917.                             <div class="form-group row mt-2" style="border-bottom:1px solid rgba(0,0,0,.125)">
  1918.                               <label class="col-4 col-form-label">施工面積</label>
  1919.                               <div class="col-8">
  1920.                                 <div class="input-group">
  1921.                                   <input type="number" name="area" id="area"
  1922.                                     class="form-control"
  1923.                                     value="{{ mitsumori_json.area|default('') }}"
  1924.                                     placeholder="例: 7.5"
  1925.                                     min="0.1" step="0.1"
  1926.                                     onchange="mitsumori_simulation('area','area');">
  1927.                                   <span class="input-group-text">㎡</span>
  1928.                                 </div>
  1929.                                 <small class="text-muted">幅(cm) × 奥行き(cm) ÷ 10000 = ㎡</small>
  1930.                               </div>
  1931.                             </div>
  1932.                             {# ステップの有無 #}
  1933.                             <div class="form-group row mt-2" style="border-bottom:1px solid rgba(0,0,0,.125)">
  1934.                               <label class="col-4 col-form-label">ステップ</label>
  1935.                               <div class="col-8">
  1936.                                 <div class="form-group clearfix">
  1937.                                   <div class="icheck-danger d-inline">
  1938.                                     <input type="radio" name="deck_step" id="deck_step_yes" value="必要"
  1939.                                       {% if mitsumori_json and mitsumori_json.deck_step == '必要' %}checked{% endif %}
  1940.                                       onclick="mitsumori_simulation('op0','deck_step_yes');">
  1941.                                     <label for="deck_step_yes">必要</label>
  1942.                                   </div>
  1943.                                   <div class="icheck-danger d-inline">
  1944.                                     <input type="radio" name="deck_step" id="deck_step_no" value="不要"
  1945.                                       {% if not mitsumori_json or mitsumori_json.deck_step == '不要' or not mitsumori_json.deck_step %}checked{% endif %}
  1946.                                       onclick="mitsumori_simulation('op0','deck_step_no');">
  1947.                                     <label for="deck_step_no">不要</label>
  1948.                                   </div>
  1949.                                 </div>
  1950.                               </div>
  1951.                             </div>
  1952.                             {# ウッドデッキフェンスの有無 #}
  1953.                             <div class="form-group row mt-2" style="border-bottom:1px solid rgba(0,0,0,.125)">
  1954.                               <label class="col-4 col-form-label">デッキフェンス</label>
  1955.                               <div class="col-8">
  1956.                                 <div class="form-group clearfix">
  1957.                                   <div class="icheck-danger d-inline">
  1958.                                     <input type="radio" name="deck_fence" id="deck_fence_yes" value="必要"
  1959.                                       {% if mitsumori_json and mitsumori_json.deck_fence == '必要' %}checked{% endif %}
  1960.                                       onclick="mitsumori_simulation('op1','deck_fence_yes');">
  1961.                                     <label for="deck_fence_yes">必要</label>
  1962.                                   </div>
  1963.                                   <div class="icheck-danger d-inline">
  1964.                                     <input type="radio" name="deck_fence" id="deck_fence_no" value="不要"
  1965.                                       {% if not mitsumori_json or mitsumori_json.deck_fence == '不要' or not mitsumori_json.deck_fence %}checked{% endif %}
  1966.                                       onclick="mitsumori_simulation('op1','deck_fence_no');">
  1967.                                     <label for="deck_fence_no">不要</label>
  1968.                                   </div>
  1969.                                 </div>
  1970.                               </div>
  1971.                             </div>
  1972.                         {% endif %}
  1973.                         <!-- 6: 施工見積(芝生・枚数・数量買い) -->
  1974.                         {% if ProductClass.SaleType.id == 6 %}
  1975.                             {# 規格(p_m データ → 素材から抽出) #}
  1976.                             {% if p_m and p_m|length and p_m|join != "" %}
  1977.                             <div class="form-group row mt-2" style="border-bottom:1px solid rgba(0,0,0,.125)">
  1978.                               <label class="col-4 col-form-label">規格</label>
  1979.                               <div class="col-8">
  1980.                                 <div class="form-group clearfix">
  1981.                                 {% set idx = 0 %}
  1982.                                 {% for pm_val in p_m %}{% if pm_val %}{% set idx = idx + 1 %}
  1983.                                   <div class="icheck-danger d-inline">
  1984.                                     <input type="radio" name="pm" id="pm6_{{ idx }}" value="{{ pm_val }}"
  1985.                                       {% if (mitsumori_json and mitsumori_json.pm == pm_val) or p_m|length == 1 %}checked{% endif %}
  1986.                                       onclick="mitsumori_simulation('pm','pm6_{{ idx }}');">
  1987.                                     <label for="pm6_{{ idx }}">{{ pm_val }}</label>
  1988.                                   </div>
  1989.                                 {% endif %}{% endfor %}
  1990.                                 </div>
  1991.                               </div>
  1992.                             </div>
  1993.                             {% endif %}
  1994.                             {# 芝の長さ(p_w データ → 幅から抽出) #}
  1995.                             {% if p_w and p_w|length and p_w|join != "" %}
  1996.                             <div class="form-group row mt-2" style="border-bottom:1px solid rgba(0,0,0,.125)">
  1997.                               <label class="col-4 col-form-label">芝の長さ</label>
  1998.                               <div class="col-8">
  1999.                                 <div class="form-group clearfix">
  2000.                                 {% set idx = 0 %}
  2001.                                 {% for pw_val in p_w %}{% if pw_val %}{% set idx = idx + 1 %}
  2002.                                   <div class="icheck-danger d-inline">
  2003.                                     <input type="radio" name="pw" id="pw6_{{ idx }}" value="{{ pw_val }}"
  2004.                                       {% if (mitsumori_json and mitsumori_json.pw == pw_val) or p_w|length == 1 %}checked{% endif %}
  2005.                                       onclick="mitsumori_simulation('pw','pw6_{{ idx }}');">
  2006.                                     <label for="pw6_{{ idx }}">{{ pw_val }}</label>
  2007.                                   </div>
  2008.                                 {% endif %}{% endfor %}
  2009.                                 </div>
  2010.                               </div>
  2011.                             </div>
  2012.                             {% endif %}
  2013.                             {# 施工面積(㎡ 自由入力) #}
  2014.                             <div class="form-group row mt-2" style="border-bottom:1px solid rgba(0,0,0,.125)">
  2015.                               <label class="col-4 col-form-label">施工面積</label>
  2016.                               <div class="col-8">
  2017.                                 <div class="input-group">
  2018.                                   <input type="number" name="area" id="area"
  2019.                                     class="form-control"
  2020.                                     value="{{ mitsumori_json.area|default('') }}"
  2021.                                     placeholder="例: 10.5"
  2022.                                     min="0.1" step="0.1"
  2023.                                     onchange="mitsumori_simulation('area','area');">
  2024.                                   <span class="input-group-text">平米</span>
  2025.                                 </div>
  2026.                               </div>
  2027.                             </div>
  2028.                         {% endif %}
  2029.                         <!-- 9: 商品のみ購入 -->
  2030.                         {% if ProductClass.SaleType.id == 9 %}
  2031.                             <div class="form-group row mt-2" style="border-bottom:1px solid rgba(0,0,0,.125)">
  2032.                               <label class="col-4 col-form-label">数量</label>
  2033.                               <div class="col-4">
  2034.                                 <div class="input-group mb-3">
  2035.                                   <input type="number" name="quantity_only" id="quantity_only" class="form-control" value="1" min="1" onchange="$('#quantity').val(this.value);">
  2036.                                   <span class="input-group-text">個</span>
  2037.                                 </div>
  2038.                               </div>
  2039.                               <div class="col-4">
  2040.                                 <button type="button" class="btn btn-info" onclick="quantityOnly(+1);">+</button>
  2041.                                 <button type="button" class="btn btn-danger" onclick="quantityOnly(-1);">ー</button>
  2042.                               </div>
  2043.                             </div>
  2044.                         {% endif %}
  2045.                         <div class="row" style="border-bottom:1px solid rgba(0,0,0,.125)"><label class="col-12 col-form-label">取り付け工事のご希望に関してお答えください。</label></div>
  2046.                         {% for i in 0..10 %}
  2047.                             {% if op and op|length >= i+1 %}
  2048.                             {% if op[i]['name'] %}
  2049.                             <div class="form-group mt-3 pb-3" style="border-bottom:1px solid rgba(0,0,0,.125)">
  2050.                               <div class="rp-section-label">{{ op[i]['name'] }}{% if mitsumori_json and mitsumori_json.op[i] %}: <span>{{ mitsumori_json.op[i] }}</span>{% endif %}</div>
  2051.                               {% if op[i]['comment'] %}<div class="opt-comment" style="font-size:12px;color:#666;margin:4px 0 6px;">{{ op[i]['comment'] }}</div>{% endif %}
  2052.                               <div class="opt-btn-group">
  2053.                                 <label class="opt-btn{% if mitsumori_json and mitsumori_json.op[i] == op[i]['on'] %} is-selected{% endif %}"
  2054.                                        onclick="mitsumori_simulation('op{{ i }}','op{{ i }}_1');">
  2055.                                   <input type="radio" name="op{{ i }}" id="op{{ i }}_1" value="{{ op[i]['on'] }}" {% if mitsumori_json and mitsumori_json.op[i] == op[i]['on'] %}checked{% endif %}>
  2056.                                   {{ op[i]['on'] }}
  2057.                                 </label>
  2058.                                 <label class="opt-btn{% if mitsumori_json and mitsumori_json.op[i] == op[i]['off'] %} is-selected{% endif %}"
  2059.                                        onclick="mitsumori_simulation('op{{ i }}','op{{ i }}_2');">
  2060.                                   <input type="radio" name="op{{ i }}" id="op{{ i }}_2" value="{{ op[i]['off'] }}" {% if mitsumori_json and mitsumori_json.op[i] == op[i]['off'] %}checked{% endif %}>
  2061.                                   {{ op[i]['off'] }}
  2062.                                 </label>
  2063.                               </div>
  2064.                             </div>
  2065.                             {% endif %}
  2066.                             {% endif %}
  2067.                         {% endfor %}
  2068.                       </div>
  2069.                       <!-- /.card-body -->
  2070.                     </div>
  2071.                     <form action="{{ url('product_add_cart', {id:Product.id}) }}" method="post" id="form1" name="form1">
  2072.                         {% if Product.stock_find %}
  2073.                             <div class="ec-productRole__actions">
  2074.                                 {% if form.classcategory_id1 is defined %}
  2075.                                     <div class="ec-select">
  2076.                                         {{ form_row(form.classcategory_id1) }}
  2077.                                         {{ form_errors(form.classcategory_id1) }}
  2078.                                     </div>
  2079.                                     {% if form.classcategory_id2 is defined %}
  2080.                                         <div class="ec-select">
  2081.                                             {{ form_row(form.classcategory_id2) }}
  2082.                                             {{ form_errors(form.classcategory_id2) }}
  2083.                                         </div>
  2084.                                     {% endif %}
  2085.                                 {% endif %}
  2086.                                 <div class="ec-numberInput">
  2087.                                     {{ form_widget(form.quantity, { type: 'hidden' }) }}
  2088.                                     {{ form_errors(form.quantity) }}
  2089.                                 </div>
  2090.                             </div>
  2091.                         {% else %}
  2092.                             <div class="ec-productRole__btn">
  2093.                                 <button type="button" class="ec-blockBtn--action" disabled="disabled">
  2094.                                     {{ 'ただいま品切れ中です。'|trans }}
  2095.                                 </button>
  2096.                             </div>
  2097.                         {% endif %}
  2098.                         <div class="ec-productRole__btn mt-3">
  2099.                            <button type="submit" id="cart_btn" class="ec-blockBtn--action add-cart">施工検討リストに入れる</button>
  2100.                         </div>
  2101.                         {{ form_rest(form) }}
  2102.                     </form>
  2103.                     <div class="ec-modal add-cart-modal">
  2104.                         <div class="ec-modal-overlay">
  2105.                             <div class="ec-modal-wrap add-cart-modal__wrap">
  2106.                                 <span class="ec-modal-close"><span class="ec-icon"><img src="{{ asset('assets/icon/cross-dark.svg') }}" alt=""/></span></span>
  2107.                                 <div id="ec-modal-header" class="text-center add-cart-modal__header">{{ '施工検討リストに追加しました。'|trans }}</div>
  2108.                                 <div class="ec-modal-box add-cart-modal__box">
  2109.                                     <div class="ec-role add-cart-modal__actions">
  2110.                                         <a href="{{ url('cart') }}" class="ec-inlineBtn--action add-cart-modal__primary">{{ '施工検討リストへ進む'|trans }}</a>
  2111.                                         <span class="ec-inlineBtn--cancel add-cart-modal__secondary">{{ '商品検索を続ける'|trans }}</span>
  2112.                                     </div>
  2113.                                 </div>
  2114.                             </div>
  2115.                         </div>
  2116.                     </div>
  2117.                     <div class="ec-productRole__description">{{ Product.description_detail|raw|nl2br }}
  2118.                     </div>
  2119.                     {# SNSシェア #}
  2120.                     <div class="ec-productRole__share">
  2121.                         <ul class="ec-share">
  2122.                             <li class="ec-share__item">
  2123.                                 <a href="https://twitter.com/share?url={{ app.request.uri|url_encode }}&text={{ Product.name|url_encode }}" class="ec-share__link ec-share__link--twitter" target="_blank" rel="noreferrer noopener">
  2124.                                     <i class="fab fa-twitter"></i>
  2125.                                 </a>
  2126.                             </li>
  2127.                             <li class="ec-share__item">
  2128.                                 <a href="https://www.facebook.com/sharer/sharer.php?u={{ app.request.uri|url_encode }}" class="ec-share__link ec-share__link--facebook" target="_blank" rel="noreferrer noopener">
  2129.                                     <i class="fab fa-facebook-f"></i>
  2130.                                 </a>
  2131.                             </li>
  2132.                             <li class="ec-share__item">
  2133.                                 <a href="https://social-plugins.line.me/lineit/share?url={{ app.request.uri|url_encode }}" class="ec-share__link ec-share__link--line" target="_blank" rel="noreferrer noopener">
  2134.                                     <i class="fab fa-line"></i>
  2135.                                 </a>
  2136.                             </li>
  2137.                         </ul>
  2138.                     </div>
  2139.                 </div>
  2140.                 {# ===== スマホ用 見積金額 下部固定バー ===== #}
  2141.                 <div id="sp-mitsumori-bar">
  2142.                     <div>
  2143.                         <div class="sp-bar__label">合計(工事費・税込)</div>
  2144.                         <div class="sp-bar__price" id="sp-mitsumori-price">---円</div>
  2145.                     </div>
  2146.                     <button type="button" class="sp-bar__btn"
  2147.                             onclick="document.getElementById('cart_btn2') && document.getElementById('cart_btn2').click();">
  2148.                         <i class="fas fa-shopping-cart"></i>
  2149.                         <span class="sp-bar__btn-label">検討リストへ</span>
  2150.                         {% set spTotalQty = get_carts_total_quantity() %}
  2151.                         {% if spTotalQty > 0 %}
  2152.                             <span class="sp-bar__cart-badge">{{ spTotalQty|number_format }}</span>
  2153.                         {% endif %}
  2154.                     </button>
  2155.                     <a href="{{ url('homepage') }}" class="sp-bar__home-btn" title="トップページへ">
  2156.                         <i class="fas fa-home"></i>
  2157.                     </a>
  2158.                 </div>
  2159.                 <div class="card col-12 collapsed-card sticky-top float-right mitsumori-card-pc">
  2160.                     <div class="card-header">
  2161.                       <h3 class="card-title">現在のお見積り額</h3>
  2162.                       <div class="card-tools">
  2163.                         <span class="float-left" id="mitsumori_message">395000円</span>
  2164.                         <button type="button" class="btn btn-tool btn-mitsumori-toggle" data-card-widget="collapse" title="詳細を表示">
  2165.                           <span class="toggle-icon">▼ 詳細</span>
  2166.                         </button>
  2167.                       </div>
  2168.                     </div>
  2169.                     <div class="card-body p-0">
  2170.                       <ul class="nav nav-pills flex-column">
  2171.                         <li class="nav-item active">
  2172.                           <a class="nav-link">
  2173.                             <i class="far fa-file-alt"></i> 合計(工事費・税込)
  2174.                             <span class="float-right" id="mitsumori_goukei">395,000円</span>
  2175.                           </a>
  2176.                         </li>
  2177.                         <li class="nav-item active">
  2178.                           <a class="nav-link">
  2179.                             <i class="far fa-file-alt"></i> 商品価格
  2180.                             <span class="float-right" id="mitsumori_price">307,008円</span>
  2181.                           </a>
  2182.                         </li>
  2183.                         <li class="nav-item">
  2184.                           <a class="nav-link">
  2185.                             &nbsp;&nbsp;<i class="far fa-file-alt"></i> カタログ価格
  2186.                             <span class="float-right" id="maker_price">479,700円</span>
  2187.                           </a>
  2188.                         </li>
  2189.                         <li class="nav-item">
  2190.                           <a class="nav-link">
  2191.                             &nbsp;&nbsp;<i class="far fa-file-alt"></i> お値引き
  2192.                             <span class="float-right" id="mitsumori_off">-172,692円</span>
  2193.                           </a>
  2194.                         </li>
  2195.                         <li class="nav-item">
  2196.                           <a class="nav-link">
  2197.                             <i class="far fa-file-alt"></i> 基本工事費
  2198.                             <span class="float-right" id="mitsumori_ct">53,250円</span>
  2199.                           </a>
  2200.                         </li>
  2201.                         <li class="nav-item">
  2202.                           <a class="nav-link">
  2203.                             <i class="far fa-file-alt"></i> 施工オプション
  2204.                             <span class="float-right"id="mitsumori_option">6,297円</span>
  2205.                           </a>
  2206.                         </li>
  2207.                       </ul>
  2208.                     </div>
  2209.                     <div class="card-footer">
  2210.                         <button type="button" id="mitsumori_btn" class="btn btn-info" data-toggle="modal" data-target="#modal-mitsumori">
  2211.                           見積書表示
  2212.                         </button>
  2213.                         <button type="submit" id="cart_btn2" class="btn btn-info add-cart">施工検討リストに入れる</button>
  2214.                     </div>
  2215.                 </div>
  2216.             </div>
  2217.         </div>
  2218.     </div>
  2219.   <div class="modal" id="modal-mitsumori">
  2220.     <div class="modal-dialog modal-mitsumori" style="max-width:1000px">
  2221.       <div class="modal-content">
  2222.         <div class="modal-header">
  2223.           <h4 class="modal-title">お見積書</h4>
  2224.           <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  2225.             <span aria-hidden="true">&times;</span>
  2226.           </button>
  2227.         </div>
  2228.         <div class="modal-body">
  2229.             <div class="invoice p-3 mb-5" style="max-width:1000px; margin:auto;">
  2230.               <!-- title row -->
  2231.               <div class="row">
  2232.                 <div class="col-12">
  2233.                   <h2>概算お見積書 
  2234.                     <small class="float-right" style="font-size:14px;">発行日: 2025/03/14</small>
  2235.                   </h2>
  2236.                 </div>
  2237.                 <!-- /.col -->
  2238.               </div>
  2239.               <!-- info row -->
  2240.               <div class="row invoice-info">
  2241.                 <div class="col-sm-8 invoice-col">
  2242.                   <h3>お客様</h3>
  2243.                   <span>下記の通り、お見積もり申し上げます。</span>
  2244.                   <br />
  2245.                   <br / >
  2246.                   <br />
  2247.                   <h2>お見積金額: <span id="mitsumori_kei">399,080円</span></h2>
  2248.                   <span>
  2249.                     <br/>
  2250.                     <br/>
  2251.                     <br/>
  2252.                     <br/>
  2253.                   </span>
  2254.                 </div>
  2255.                 <div class="col-sm-4 invoice-col">
  2256.                   <p>
  2257.                     <img alt="" src="/html/user_data/js/images/logo.png" style="width: 260px; max-width: 100%; max-height: 10mm;">
  2258.                   </p>
  2259.                   <p>有限会社プラス</p>
  2260.                   <p>〒400-0334</p>
  2261.                   <p>山梨県南アルプス市藤田1450番地2</p>
  2262.                   <p>TEL: 055-284-6480</p>
  2263.                   <img alt="" src="/html/user_data/js/images/seal.svg" style="z-index: 2; position: absolute; width: 21mm; left: 58mm; top: 36mm;">
  2264.                 </div>
  2265.                 <!-- /.col -->
  2266.                 <!-- /.col -->
  2267.               </div>
  2268.               <!-- /.row -->
  2269.               <!-- Table row -->
  2270.               <div class="row">
  2271.                 <div class="col-12 table-responsive">
  2272.                   <table class="table table-striped">
  2273.                     <thead>
  2274.                       <tr>
  2275.                         <th>項目</th>
  2276.                         <th>数量</th>
  2277.                         <th>単位</th>
  2278.                         <th>単価</th>
  2279.                         <th>小計</th>
  2280.                       </tr>
  2281.                     </thead>
  2282.                     <tbody>
  2283.                       <tr>
  2284.                         <td>プレーンルーフ 600タイプ 1台用 単体セット</td>
  2285.                         <td>1</td>
  2286.                         <td>式</td>
  2287.                         <td id="mitsumori_price_01">352,800</td>
  2288.                         <td id="mitsumori_price_02">352,800</td>
  2289.                       </tr>
  2290.                       <tr>
  2291.                         <td>基本工事費</td>
  2292.                         <td>1</td>
  2293.                         <td>式</td>
  2294.                         <td id="mitsumori_ct_01">10,000</td>
  2295.                         <td id="mitsumori_ct_02">10,000</td>
  2296.                       </tr>
  2297.                       <tr>
  2298.                         <td>残土・ガラ処理</td>
  2299.                         <td>1</td>
  2300.                         <td>式</td>
  2301.                         <td>0円</td>
  2302.                         <td></td>
  2303.                       </tr>
  2304.                       <tr>
  2305.                         <td> </td>
  2306.                         <td></td>
  2307.                         <td></td>
  2308.                         <td></td>
  2309.                         <td></td>
  2310.                       </tr>
  2311.                     </tbody>
  2312.                   </table>
  2313.                 </div>
  2314.                 <!-- /.col -->
  2315.               </div>
  2316.               <!-- /.row -->
  2317.               <div class="row">
  2318.                 <!-- accepted payments column -->
  2319.                 <div class="col-6">
  2320.                   <p class="lead">お支払い方法</p>
  2321.                   <p class="text-muted well well-sm shadow-none" style="margin-top: 10px;">銀行振込、クレジットカード決済、PAYPAY決済
  2322.                     <br>銀行振込:山梨中央銀行 白根支店 普通口座 391402
  2323.                     <br>※商品代金と工事代金の総額が金100万円(税込)を超える場合、着手金として代金の半額をご契約後お支払いいただきます。 
  2324.                   </p>
  2325.                 </div>
  2326.                 <!-- /.col -->
  2327.                 <div class="col-6">
  2328.                   <div class="table-responsive">
  2329.                     <table class="table">
  2330.                       <tbody>
  2331.                         <tr>
  2332.                           <th style="width:50%">小計:</th>
  2333.                           <td id="mitsumori_shoukei">362,800</td>
  2334.                         </tr>
  2335.                         <tr>
  2336.                           <th>消費税 (10%)</th>
  2337.                           <td id="mitsumori_tax">36,280</td>
  2338.                         </tr>
  2339.                         <tr>
  2340.                           <th>合計:</th>
  2341.                           <td id="mitsumori_goukei_02">399,080</td>
  2342.                         </tr>
  2343.                       </tbody>
  2344.                     </table>
  2345.                   </div>
  2346.                 </div>
  2347.                 <!-- /.col -->
  2348.               </div>
  2349.               <!-- /.row -->
  2350.             </div>
  2351.         </div>
  2352.         <div class="modal-footer justify-content-between">
  2353.                   {# PDF出力: mitsumori_json を POST して PDF ダウンロード #}
  2354.                   <form method="post" action="{{ url('mitsumori_pdf') }}" target="_blank" id="pdf_download_form">
  2355.                     <input type="hidden" name="_token" value="{{ csrf_token('mitsumori_pdf') }}">
  2356.                     <input type="hidden" name="mitsumori_json" id="pdf_mitsumori_json">
  2357.                     <button type="submit" class="btn btn-primary float-right" style="margin-right: 5px;" onclick="syncPdfJson();">
  2358.                       <i class="fas fa-download"></i>PDF出力
  2359.                     </button>
  2360.                   </form>
  2361.                   <button type="submit" id="cart_btn3" class="btn btn-info add-cart">施工検討リストに入れる</button>
  2362.         </div>
  2363.       </div>
  2364.       <!-- /.modal-content -->
  2365.     </div>
  2366.     <!-- /.modal-dialog -->
  2367.   </div>
  2368.   <!-- /.modal -->
  2369. {% endblock %}