* {
  box-sizing: border-box
}

html,
body {
  margin: 0
}

body {
  font-family: 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, 'Noto Sans JP', system-ui, sans-serif;
  background: #fff;
  color: #1d2088;
  -webkit-font-smoothing: antialiased
}

a {
  color: inherit
}

.pc {
  display: inline;
}

.sp {
  display: none;
}


/* ---------- photo lightbox ---------- */
#svc-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(9, 15, 45, .72);
  backdrop-filter: blur(4px)
}

#svc-modal.open {
  display: flex
}

#svc-modal .svc-modal-card {
  background: #fff;
  border-radius: 16px;
  max-width: 700px;
  width: 100%;
  max-height: 88vh;
  overflow: auto;
  box-shadow: 0 30px 80px rgba(8, 15, 50, .5)
}

#svc-modal .svc-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 34px 18px;
  position: sticky;
  top: 0;
  background: #fff
}

#svc-modal .svc-modal-grid {
  padding: 0 34px 34px
}

#svc-modal .svc-modal-main {
  width: 500px;
  max-width: 100%;
  height: 320px;
  object-fit: cover;
  border-radius: 0;
  display: block;
  background: #eef2f8;
  margin: 0 auto 12px
}

#svc-modal .svc-modal-thumbs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px
}

#svc-modal .svc-modal-thumbs img {
  width: 100%;
  height: 70px;
  object-fit: cover;
  border-radius: 0;
  display: block;
  background: #eef2f8;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color .15s
}

#svc-modal .svc-modal-thumbs img.active {
  border-color: #1d2088
}

#svc-modal .svc-close {
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 50%;
  background: #eef2f8;
  color: #1d2088;
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
  flex: none
}

[data-gallery] {
  cursor: pointer
}

[data-gallery] .svc-photo-hint {
  position: absolute;
  right: 14px;
  bottom: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(29, 32, 136, .9);
  color: #fff;
  font: 700 12px 'Noto Sans JP';
  padding: 7px 14px;
  border-radius: 20px;
  pointer-events: none
}

@media (max-width:438px) {
  #svc-modal .svc-modal-grid {
    grid-template-columns: 1fr
  }

  #svc-modal .svc-modal-grid img {
    height: 200px
  }
}

/* ---------- inline accordion gallery ---------- */
.svc-acc {
  max-height: 0;
  overflow: hidden;
  transition: max-height .4s ease;
  background: #f7f9fc
}

.svc-acc.open {
  max-height: 640px
}

.svc-acc-inner {
  padding: 22px 26px 26px
}

.svc-acc-main {
  width: 100%;
  height: 300px;
  object-fit: cover;
  display: block;
  background: #eef2f8;
  margin-bottom: 10px
}

.svc-acc-thumbs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px
}

.svc-acc-thumbs img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
  background: #eef2f8;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color .15s
}

.svc-acc-thumbs img.active {
  border-color: #1d2088
}

.svc-thumbs-static img.active {
  border-color: #1d2088 !important
}

.svc-acc-cap {
  margin-top: 12px;
  font: 400 13px/1.85 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, 'Noto Sans JP';
  color: #4a5578
}

.svc-acc-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(29, 32, 136, .92);
  color: #fff;
  font: 700 12px 'Noto Sans JP';
  padding: 7px 14px;
  border-radius: 20px;
  position: absolute;
  right: 14px;
  bottom: 14px;
  border: none;
  cursor: pointer
}

/* ---------- product slider ---------- */
#prod-track {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 4px 4px 20px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none
}

#prod-track::-webkit-scrollbar {
  display: none
}

.prod-card {
  flex: 0 0 calc((100% - 72px)/4);
  scroll-snap-align: start;
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 6px 22px rgba(20, 33, 107, .07)
}

.prod-card image-slot,
.prod-card img {
  display: block;
  width: 100%;
  height: 150px;
  object-fit: cover
}

.prod-card .prod-name {
  text-align: center;
  font: 700 15px 'Noto Sans JP';
  color: #1d2088;
  padding: 12px 10px 14px
}

.prod-dots {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 8px
}

.prod-dots button {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: none;
  background: #c7d0e0;
  cursor: pointer;
  padding: 0
}

.prod-dots button.active {
  background: #1d2088
}

@media (max-width:768px) {
  .prod-card {
    flex-basis: calc((100% - 24px)/2)
  }
}

@media (max-width:438px) {
  .prod-card {
    flex-basis: calc(100% - 24px)
  }
}

/* ============================================================
   RESPONSIVE  (PC 表示は不変 / SP を最適化)
   breakpoints: 960px / 768px / 438px
   ※ 各要素はインラインstyleを持つためクラスへ !important で上書き
   ============================================================ */

/* ---- 960px: 主にタブレット幅での溢れ対策 ---- */
@media (max-width: 960px) {
  .pc {
    display: none;
  }

  .sp {
    display: inline;
  }

  /* 料金ボックスの固定幅(width:1160px)がビューポートを溢れるのを防ぐ */
  .price-note-box {
    width: auto !important;
    max-width: 100% !important;
    height: auto !important;
  }
}

/* ---- 768px: モバイルレイアウトへ集約 ---- */
@media (max-width: 768px) {

  /* SPヒーロー(mv_sp)にはボタンが無いため、PC画像用の透過リンクは隠す */
  .hero-cta-pc {
    display: none !important;
  }

  /* 事例見出し(B社)：全角スペースの字下げを畳み、2・3行目を本文開始位置(「冷凍食品」)に揃える */
  .case-h3-indent {
    display: none !important;
  }

  /* 「B企業さま：」(=5.75em)分のハンギングインデント。1行目は左端、折返し・改行後は本文位置に揃う */
  .case-h3-hang {
    padding-left: 5.75em !important;
    text-indent: -5.75em !important;
  }

  /* コンテンツ節の上下余白を圧縮（ヒーロー/コンタクトは対象外） */
  .lp-sec {
    padding-top: 54px !important;
    padding-bottom: 58px !important;
  }

  .contact-inner {
    padding-top: 56px !important;
    padding-bottom: 62px !important;
  }

  /* 見出し縮小 */
  .sec-h2 {
    font-size: 26px !important;
  }

  .contact-h2 {
    font-size: 23px !important;
  }

  /* 主要グリッドを1カラムへ */
  .resp-svc,
  .resp-case2,
  .benefits-grid {
    grid-template-columns: 1fr !important;
  }

  /* FLOWの温度ログ：固定高さ550pxをやめて下部の余白を排除 */
  .flow-box {
    height: auto !important;
    padding: 28px 16px 30px !important;
  }

  /* ヘッダーナビ：ページ内アンカーは畳み、ロゴ＋問い合わせCTAのみ表示 */
  .site-nav a[href^="#"] {
    display: none !important;
  }

  .site-nav {
    gap: 14px !important;
  }

  /* 温度帯行：SPではABT/保冷コンテナのバッジを次の段へ送り、右揃えにする */
  .temp-row {
    flex-wrap: wrap !important;
    justify-content: flex-end !important;
    gap: 8px 10px !important;
  }

  /* 商材テキスト(2番目の子)で1段目を埋め、バッジ群を2段目へ落とす */
  .temp-row>div:nth-child(2) {
    flex: 1 1 calc(100% - 90px) !important;
  }

  /* バッジ包みdiv/空divの固定幅(min-width:120px)を解除し右揃えのズレを防ぐ */
  .temp-row>div {
    min-width: 0 !important;
  }

  /* 事例テーブル：セルの固定高さを解除して文字を折り返す */
  .case-tbl>div {
    height: auto !important;
    min-height: 40px !important;
    min-width: 0 !important;
    padding-top: 8px !important;
    padding-bottom: 8px !important;
    white-space: normal !important;
    word-break: break-word;
    overflow-wrap: anywhere;
    line-height: 1.5 !important;
  }
}

/* ---- 438px: 小型スマートフォン ---- */
@media (max-width: 438px) {

  /* 見出しをさらに縮小 */
  .sec-h2 {
    font-size: 22px !important;
  }

  .contact-h2 {
    font-size: 20px !important;
  }

  .case-h3 {
    font-size: 19px !important;
  }

  /* 節の左右余白を微調整 */
  .lp-sec,
  .contact-inner {
    padding-left: 18px !important;
    padding-right: 18px !important;
  }

  .ftr-inner {
    padding: 34px 20px !important;
  }

  /* カード内の余白を圧縮 */
  .svc-card-body {
    padding: 20px 18px 22px !important;
  }

  .case-body {
    padding: 24px 18px 0 !important;
  }

  /* スペック3列は縦積みにして長い寸法値の溢れを防ぐ */
  .stat-grid {
    grid-template-columns: 1fr !important;
  }

  /* 事例テーブルのラベル列を狭め、文字も少し縮小 */
  .case-tbl {
    grid-template-columns: 88px 1fr !important;
  }

  .case-tbl>div {
    font-size: 13px !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
}
