@charset "UTF-8";

/* ========================================================================== */
/* SUB_PAGE_HEADER (下層ヘッダー背景) */
/* ========================================================================== */
/*.sub_page_header { background-image: url("../images/products/sub_header_bg_extinguisher.jpg"); }*/


/* ========================================================================== */
/* CATEGORY TABS (上部タブメニュー) */
/* ========================================================================== */
.product_tabs {
   display: flex;
   justify-content: center;
   gap: 1px;
   width: calc(100% - 60px);
   max-width: 990px;
   margin: 43px auto 0;
   background-color: #F5F6F6;

   position: sticky;      /* 画面上部に張り付かせる設定 */
   top: 100px;            /* 固定ヘッダーの高さ（100px）のすぐ下に配置 */
   z-index: 900;          /* ヘッダー（1000）より下、コンテンツより上に浮かす */
   /*box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);*/ /* 【お好みで】固定時に少し影をつけて立体感を出す */
}

.product_tabs li {
   flex: 1;
   text-align: center;
}

.product_tabs li a {
   display: flex;
   align-items: center;
   justify-content: center;
   height: 60px;
   background-color: #E0E3E3;
   font-size: 18px;
   font-weight: 500;
   color: #2B2B2B;
   transition: all 0.5s ease;
}

/* アクティブなタブ（現在は全埋込型）のオレンジ背景 */
.product_tabs li.active a {
   background-color: #FA5B22;
   color: #FFF;
   opacity: 1;
}

.product_tabs li:not(.active) a:hover {
   background-color: #FA5B22;
   color: #FFF;
   opacity: 1;
}



/* ========================================================================== */
/* MAIN_CONTAINER */
/* ========================================================================== */
main .main_container.onTabs { margin-top: 0; }



/* ========================================================================== */
/* PRODUCT GRID (4カラム製品リスト & 完璧に交差する縦横の破線) */
/* ========================================================================== */
.product_list_wrapper {
   width: 100%;
   max-width: 1500px;
   margin: 0 auto;
   padding: 0 80px;
   box-sizing: border-box;
}

.product_grid {
   display: grid;
   grid-template-columns: repeat(4, 1fr); 
   width: 100%;
   
   /* 【修正】上下の隙間を 120px、左右の隙間を 64px に設定 */
   gap: 120px 64px; 

   /* カードの外側への点線のはみ出しを綺麗にカット */
   overflow: hidden;
   position: relative;
}

.product_item {
   position: relative;
   display: flex;
   flex-direction: column;
   width: 100%;
   box-sizing: border-box;
}

.product_item a {
   display: block;
   margin-bottom: 15px;
}


/* -------------------------------------------------------------
   【新・格子状の交差設計】上下120px / 左右64px の中央で完璧に交差
------------------------------------------------------------- */

/* ① 横の点線：上下の隙間 120px のど真ん中（下に 60px 進んだ位置） */
.product_item::after {
   content: "";
   position: absolute;
   
   /* 左右の隙間の半分（32px）まで線を左に引き伸ばす */
   left: -32px; 
   
   /* 【修正】カードの底（ボタンの真下）から 60px 下に離した位置に固定 */
   bottom: -60px; 
   
   /* 左右の隙間（32px + 32px = 64px）をカバーする幅に拡張 */
   width: calc(100% + 64px); 
   height: 1px;
   border-bottom: 1px solid #E5E6E6;
}

/* ② 縦の点線：左右の隙間 64px のど真ん中（右に 32px 進んだ位置） */
.product_item::before {
   content: "";
   position: absolute;
   
   /* 【修正】上側の隙間の半分（60px）まで線を上に引き伸ばす */
   top: -60px; 
   
   /* 左右の隙間の半分（32px）の位置に固定 */
   right: -32px; 
   width: 1px;
   
   /* 【修正】上下の隙間（60px + 60px = 120px）をカバーする高さに拡張 */
   height: calc(100% + 120px); 
   border-right: 1px solid #E5E6E6;
   z-index: 1;
}

/* 縦線を消すのは「絶対に右端にくる4の倍数番目（4n）」のカードだけに限定 */
.product_grid > .product_item:nth-child(4n)::before {
   display: none !important;
}





/* ========================================================================== */
/* COMPONENTS (カード内各パーツ) */
/* ========================================================================== */

/* 新商品バッジ */
.product_item .badge_new {
   position: absolute;
   top: 2px;
   right: 0;
   padding: 2px 8px 3px;
   background-color: #ED1C24;
   color: #FFF;
   font-size: 14px;
   font-weight: 500;
   line-height: 1;
   z-index: 10;
}

/* 画像エリア（外枠） */
.product_item .img_box {
   display: flex;
   align-items: center;
   justify-content: center;
   width: 100%;
   max-width: 100%;
   margin: 0 auto 20px; 
   aspect-ratio: 3 / 2; 
   background-color: #FFF;
   overflow: hidden;
}

/* 中の画像 */
.product_item .img_box img {
   width: 100%;
   height: 100%;
   max-width: 100%;
   max-height: 100%;
   object-fit: contain;
}

/* テキスト情報エリア */
.product_item .info_box {
   /*margin-bottom: 15px;*/
   /*font-family: "Noto Sans JP", sans-serif;*/
}

.product_item .prod_model {
   color: #2B2B2B;
   font-family: 'Roboto', 'Noto Sans JP', sans-serif;
   font-size: 17px;
   font-weight: 500;
   margin-bottom: 2px;
}

.product_item .prod_price {
   font-size: clamp(14px, 0.48vw + 9.06px, 16px);
   color: #2B2B2B;
   text-align: left;

   display: block;        /* 通常のテキストの流れ（ブロック）にします */
   /*padding-left: 2.5em;*/     /* ① 塊全体を「定価：」の文字幅分（4文字分）、あらかじめ右にずらします */
   /*text-indent: -2.5em;*/     /* ② 1行目の先頭だけを左に4文字分引き戻します。これで1行目は元通り並びます */
}

.product_item .prod_price span:nth-child(1) {
   display: inline;
}

.product_item .prod_price span:nth-child(2) {
   display: inline;
   white-space: nowrap;   /* ￥と金額が途中で絶対に折れないようにする */
}

.product_item .prod_price span:nth-child(3) {
   display: inline;
   /*display: inline-block;*/ /* ここがポイントです */
   white-space: nowrap;   /* 税込価格自体も途中で折れないようにする */
   /*text-indent: 0;*/        /* 親の「-4em」の引き戻し効果を、2行目（この要素）ではリセットします */
}

.product_item .prod_desc {
   font-size: clamp(14px, 0.48vw + 9.06px, 16px);
   color: #2B2B2B;
}

/* CADダウンロードボタンのコンテナ */
.product_item .dl_buttons {
   display: flex;
   flex-wrap: wrap; /* 100px以下になったら折り返すように設定 */
   gap: 8px;
   margin-top: auto; /* ボタン群を常に最下部に揃える */
}

/* ボタン共通設定 */
.product_item .dl_buttons a {
   flex: 1 1 100px; /* ベースの最小幅を100pxに指定 */
   display: flex;
   align-items: center;
   justify-content: center;
   height: 32px;
   margin-bottom: 0;
   border: 1px solid #CCC;
   box-sizing: border-box;
   /*font-family: 'Roboto', 'Noto Sans JP', sans-serif;*/
   font-size: 15px;
   font-weight: 700;
   transition: all 0.25s ease;

   padding-left: 19px; 
   position: relative;
}

.product_item .dl_buttons a::before {
   content: "";
   position: absolute;
   /* 文字のすぐ左側にぴったり配置されるように計算（50%位置から文字幅分戻す） */
   left: calc(50% - 3.0em); 
   top: 50%;
   transform: translateY(-50%);
   width: 15px;  /* アイコンの横幅 */
   height: 18px; /* アイコンの縦幅 */
   
   /* 【超重要】SVGをマスクとして設定 */
   mask-repeat: no-repeat;
   mask-position: center;
   mask-size: contain;
   
   /* マスクの色がフワッと変わるようにアニメーションを設定 */
   transition: background-color 0.25s ease;
}

/* DXFボタン */
.product_item .dl_buttons .btn_dxf {
   background-color: #FFF;
   color: #232D3B;
   border-color: #232D3B;
}

.product_item .dl_buttons .btn_dxf:hover {
   background-color: #232D3B;
   color: #FFF;
   opacity: 1;
}

.product_item .dl_buttons .btn_dxf::before {
   mask-image: url("../images/icon_file.svg");
   background-color: #232D3B;
}

.product_item .dl_buttons .btn_dxf:hover::before { background-color: #FFF; }

/* PDFボタン */
.product_item .dl_buttons .btn_pdf {
   background-color: #FFF;
   color: #E1212E;
   border-color: #E1212E;
}

.product_item .dl_buttons .btn_pdf:hover {
   background-color: #E1212E;
   color: #FFF;
   opacity: 1;
}

.product_item .dl_buttons .btn_pdf::before {
   mask-image: url("../images/icon_file.svg");
   background-color: #E1212E;
}

.product_item .dl_buttons .btn_pdf:hover::before {
   background-color: #FFF;
}


/* ========================================================================== */
/* TAB & INFINITE SCROLL CONTROL (表示・非表示とアニメーション制御) */
/* ========================================================================== */
/* 初期状態はすべてのコンテンツ（親の.tab_content）を非表示にする */
.product_list_wrapper .tab_content {
   display: none; 
}

/* activeクラスがついているコンテンツだけを表示する */
.product_list_wrapper .tab_content.active {
   display: block; /* 無限スクロールのグリッド維持のためblockまたは初期値のままスクリプトで制御 */
}

/* スクリプトによって非表示にされた21枚目以降のカード */
.product_item.is-hidden {
   display: none !important;
}

/* 読み込まれたときにフワッと上に浮き上がらせるフェードイン効果 */
.product_item.fade-in {
   /* アニメーション時間を 0.4s から 0.8s に変更してゆっくり動かします */
   animation: fadeInUp 0.8s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes fadeInUp {
   from {
      opacity: 0;
      transform: translateY(25px); /* 浮き上がる距離を 25px に広げて効果を強調 */
   }
   to {
      opacity: 1;
      transform: translateY(0);
   }
}



/* ========================================================================== */
/* SEARCH FORM STYLE (商品検索フォーム ＆ はみ出し対策完全版) */
/* ========================================================================== */
.search_form_wrapper {
   background-color: #F5F6F6;
   padding: 40px;
   margin-bottom: 60px;
   border-radius: 6px;
   width: 100%;
   box-sizing: border-box; /* 内側のパディングを含めて計算 */
}

/* PCサイズ（3カラム並列） */
.search_field_grid {
   display: grid;
   grid-template-columns: repeat(3, 1fr);
   gap: 24px;
   margin-bottom: 30px;
   width: 100%;
}

.field_item {
   display: flex;
   flex-direction: column;
   width: 100%;
   box-sizing: border-box;
}

.field_item label {
   font-size: 15px;
   font-weight: 700;
   margin-bottom: 8px;
   color: #2B2B2B;
}

/* 入力欄本体のサイズ固定を解除し、親に対して100%にする */
.field_item input[type="text"],
.field_item input[type="number"],
.field_item select {
   height: 48px;
   padding: 0 12px;
   border: 1px solid #CCC;
   background-color: #FFF;
   font-size: 15px;
   color: #2B2B2B;
   box-sizing: border-box;
   border-radius: 4px;
   width: 100% !important; /* 横幅を強制的に100%に */
   max-width: 100% !important;
   text-overflow: ellipsis; /* 長い選択肢が溢れた場合は「...」にする */
}

/* 価格入力欄（下限〜上限）の横並び設定 */
.price_input_flex {
   display: flex;
   align-items: center;
   gap: 8px; /* 要素間の隙間をタイトに調整 */
   width: 100%;
   box-sizing: border-box;
}

/* 「〜」のスタイル */
.price_input_flex .range_tilde {
   white-space: nowrap;
   flex-shrink: 0; /* 画面が狭くなっても「〜」が潰れないようにする */
}

/* 入力欄と「円」をグループ化するラッパー */
.price_unit_wrap {
   display: flex;
   align-items: center;
   gap: 6px; /* 入力欄と「円」の間の隙間 */
   flex: 1;
   min-width: 0; /* はみ出し防止（flex子要素の縮小限界を解除） */
}

/* グループ内のinputタグの横幅を設定 */
.price_unit_wrap input {
   flex: 1;
   min-width: 0; /* はみ出し防止 */
}

/* 「円」のテキストスタイル */
.price_unit_wrap .unit_text {
   font-size: 15px;
   font-weight: 500;
   color: #2B2B2B;
   white-space: nowrap; /* 「円」が改行されるのを絶対に防ぐ */
   flex-shrink: 0;
}

.search_submit_btn {
   text-align: center;
}

.search_submit_btn button {
   display: inline-flex;
   align-items: center;
   justify-content: center;
   width: 100%;
   max-width: 280px; /* PCでは最大280px、スマホでは自動縮小 */
   height: 54px;
   background-color: #FA5B22;
   color: #FFF;
   font-size: 16px;
   font-weight: 700;
   border-radius: 6px;
   transition: background-color 0.3s ease;
   border: none;
   cursor: pointer;
}

.search_submit_btn button:hover {
   background-color: #232D3B;
}

.search_result_heading {
   margin-bottom: 30px;
   padding-bottom: 10px;
   border-bottom: 2px solid #232D3B;
}

.search_result_heading h3 {
   font-size: 20px;
   font-weight: 700;
}



/* ========================================================================== */
/* RESPONSIVE DESIGN (レスポンシブ対応) */
/* ========================================================================== */
/* タブレットサイズ（1024px以下）: 3カラムに変更 */
@media screen and (max-width: 1024px) {
   .product_tabs {
      width: calc(100% - 40px); /* 左右の余白を少し詰める */
      margin-top: 40px;
   }
   .product_list_wrapper {
      padding: 0 20px;
   }
   .product_grid {
      grid-template-columns: repeat(3, 1fr); /* 3カラムに変形 */
      gap: 80px 40px; 
      background-image: none;
   }
   .product_item {
      padding-bottom: 0; 
   }
   
   /* ① 横の点線：上下の隙間 80px のど真ん中（下に 40px 進んだ位置） */
   .product_item::after {
      left: -20px; 
      bottom: -40px; 
      width: calc(100% + 40px); 
   }

   /* ② 縦の点線：左右の隙間 40px のど真ん中（右に 20px 進んだ位置） */
   .product_item::before {
      display: block !important; 
      top: -40px; 
      right: -20px; 
      width: 1px;
      height: calc(100% + 80px); 
      border-right: 1px solid #E5E6E6;
      z-index: 1;
   }
   
   /* 【修正】縦線を消す条件の最適化（3カラム版） */
   .product_grid > .product_item:nth-child(4n)::before {
      display: block !important; /* PC用の消去設定をリセット */
   }
   
   /* 縦線を消すのは「3の倍数（＝物理的に右端にいるカード）」の時だけに限定します。
      これにより、1つ（1列目）や2つ（2列目）で終わった最後のカードの右側には、
      必ず縦線が残るようになります。 */
   .product_grid > .product_item:nth-child(3n)::before {
      display: none !important; 
   }

   .product_item .prod_price {
      font-size: clamp(14px, 0.78vw + 8px, 16px);
   }
   .product_item .prod_desc {
      font-size: clamp(14px, 0.78vw + 8px, 16px);
   }

   /* 【検索フォーム】タブレット設定 */
   .search_form_wrapper {
      padding: 30px;
      margin-bottom: 40px;
   }
   /* タブレット時は2カラム */
   .search_field_grid {
      grid-template-columns: repeat(2, 1fr);
      gap: 20px;
   }
   /* 価格欄だけ横幅いっぱいに広げてバランスを取る */
   .price_range_field {
      grid-column: span 2;
   }
}

/* スマートフォンサイズ（768px以下）: リストを2カラムに変更 */
@media screen and (max-width: 768px) {
   .product_tabs {
      width: calc(100% - 30px); /* 左右の余白を少し詰める */
      margin-top: 30px;
      top: 60px !important;
   }
   .product_list_wrapper {
      padding: 0 15px;
   }
   .product_tabs li a {
      height: 46px;
      font-size: clamp(10px, 3.125vw, 13px);
   }
   .product_grid {
      grid-template-columns: repeat(2, 1fr); /* 2カラムに変形 */
      gap: 60px 20px; 
      background-image: none;
   }
   .product_item {
      padding-bottom: 0; 
   }
   .product_item .prod_model {
      font-size: clamp(13px, 0.67vw + 10.85px, 16px);
   }
   .product_item .prod_price,
   .product_item .prod_desc {
      font-size: clamp(12px, 0.67vw + 9.85px, 15px);
   }
   
   /* ① 横の点線：上下の隙間 60px のど真ん中（下に 30px 進んだ位置） */
   .product_item::after {
      left: -10px; 
      bottom: -30px; 
      width: calc(100% + 20px);
   }

   /* ② 縦の点線：左右の隙間 20px のど真ん中（右に 10px 進んだ位置） */
   .product_item::before {
      display: block !important;
      top: -30px; 
      right: -10px; 
      height: calc(100% + 60px); 
   }
   
   /* 【修正】縦線を消す条件の最適化（2カラム版） */
   .product_grid > .product_item:nth-child(3n)::before {
      display: block !important; /* タブレット用の消去設定をリセット */
   }
   
   /* 2の倍数（＝物理的に右端にいるカード）の時だけ縦線を消します。
      1つ（1列目）で終わった最後のカードの右側には、必ず縦線が残ります。 */
   .product_grid > .product_item:nth-child(2n)::before {
      display: none !important; 
   }

   /* 【検索フォーム】スマートフォン設定 */
   .search_form_wrapper {
      padding: 20px 15px; /* スマホ向けに内側の余白をスリムに */
   }
   /* 完全に縦一列に並べる */
   .search_field_grid {
      grid-template-columns: 1fr !important;
      gap: 16px;
   }
   /* タブレット用の横幅2マス指定をリセット */
   .price_range_field {
      grid-column: span 1;
   }
   /* 入力欄の文字サイズをスマホ向けに微調整 */
   .field_item input[type="text"],
   .field_item input[type="number"],
   .field_item select {
      font-size: 14px;
      height: 44px; /* 少し押しやすくコンパクトに */
   }
   .price_unit_wrap .unit_text {
      font-size: 14px; /* スマホ向けに文字サイズを少しコンパクトに */
   }
   .search_submit_btn button {
      max-width: 100%; /* スマホではボタンを横幅いっぱいに広げる */
      height: 48px;
   }
}
