/* =============================================
   KiRABiSEi - responsive.css
   ============================================= */

/* ----------------------------------------
   Tablet Landscape ~1024px
   ---------------------------------------- */
@media (max-width: 1024px) {

  /* Header */
  .header__nav-list { gap: 20px; }
  .header__nav-list a { font-size: 12px; }

  /* Series スライダーナビ */
  .series-prev { left: 4px; }
  .series-next { right: 4px; }

  /* Series slide */
  .series-slide__inner { gap: 32px; }
  .series-slide__name { font-size: 20px; }
  .series-slide__desc { font-size: 14px; }

  /* Series cards */
  .series-cards { gap: 16px; }

  /* Banner */
  .series-banner { max-width: 90%; }

  /* Reasons */
  .reasons-grid { grid-template-columns: repeat(2, 1fr); }

  /* Tech badge */
  .tech-badge-wrap { width: 360px; height: 360px; padding: 40px 32px; margin-bottom: calc(-360px * 9/15); }
  .tech-badge__ribbon { width: 130px; }
  .tech-badge__ribbon-text { font-size: 11px; }
  .tech-badge__title { font-size: 13px; }
  .tech-badge__title strong { font-size: 20px; }
  .tech-badge__laurel { width: 20px; }

  /* Tech grid */
  .tech-grid { grid-template-columns: repeat(2, 1fr); gap: 32px; }

  /* Accordion */
  .accordion__inner { gap: 24px; }

  /* Methods */
  .methods-grid { gap: 16px; }

  /* Merit */
  .merit-item { height: 420px; }
  .merit-item__img--01,
  .merit-item__img--02,
  .merit-item__img--03 { height: 300px; }
  .merit-item__img--04 { height: 240px; }
  .merit-item__text-box { padding: 20px 24px; }
  .merit-item__title { font-size: 15px; }
  .merit-item__text { font-size: 13px; }

  /* Flow */
  .flow-step__inner { padding: 16px 32px 20px 20px; }
  .flow-step__title { font-size: 13px; }
  .flow-step + .flow-step .flow-step__inner { padding-left: 36px; }

  /* Contact */
  .contact__cols { gap: 48px; }

  /* Footer */
  .footer__cols { gap: 24px; }
  .footer__col-company { font-size: 14px; }
}

/* ----------------------------------------
   Tablet Portrait ~768px
   ---------------------------------------- */
@media (max-width: 768px) {
  .container { padding: 0 20px; }
  .sec-title { font-size: 19px; }

  /* ===== Header ===== */
  .header__inner {
    padding: 14px 20px;
    flex-direction: row;
    justify-content: center;
  }
  .header__logo { margin: 5px 0; }
  .header__nav {
    display: none;
    position: fixed;
    top: 67px; left: 0; right: 0;
    background: #fff;
    padding: 24px 20px 32px;
    border-bottom: 1px solid #eee;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    z-index: 999;
  }
  .header__nav.is-open { display: block; }
  .header__nav-list { flex-direction: column; gap: 0; }
  .header__nav-list li {
    width: 100%;
    padding: 14px 0;
    border-bottom: 1px solid #f0f0f0;
    overflow: hidden;
  }
  .header__nav-list a {
    display: block;
    font-size: 15px;
  }
  .header__hamburger { display: flex; }
  /* ハンバーガーアイコン切り替えはmain.jsで制御 */
  .header.is-scrolled .header__inner {
    flex-direction: row;
    justify-content: center;
    max-width: 100%;
    padding: 14px 20px;
  }

  /* ドロップダウンはSPで非表示 */
  .header__dropdown {
    display: none !important;
  }

  /* SP版商品カード：グリッド表示 */
  .header__sp-products {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    box-sizing: border-box;
    width: 100%;
    overflow: hidden;
  }

  /* カード本体 */
  .header__sp-product-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 0 4px 8px;
	margin-top: 10px;
    text-decoration: none;
    background: var(--color-gray-bg, #f8f9fa);
    transition: background 0.15s ease;
    box-sizing: border-box;
  }

  .header__sp-product-card:hover,
  .header__sp-product-card:active {
    background: #eef0f2;
  }

  /* 画像エリア */
  .header__sp-product-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 4px;
    box-sizing: border-box;
  }

  .header__sp-product-img img {
    width: 80%;
    height: 80%;
    object-fit: contain;
    display: block;
  }

  /* 商品名テキスト */
  .header__sp-product-name {
    display: block;
    width: 100%;
    font-size: 9px;
    font-weight: 500;
    color: var(--color-dark);
    text-align: center;
    line-height: 1.4;
    letter-spacing: 0.02em;
    word-break: keep-all;
  }

  /* ===== MV ===== */
  .mv { margin-top: 56px; }
  .mv__grid {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(3, 1fr);
  }
  .mv__img { aspect-ratio: 4/3; }
  .mv__img img { width: auto; height: 100%;}
  .mv__content {
    max-width: 100%;
    padding: 0 20px;
    bottom: 8%;
  }
  .mv__title { font-size: clamp(36px, 8vw, 64px); }
  .mv__sub { font-size: clamp(13px, 2vw, 16px); }

  /* ===== Series ===== */

  /* バナー：フルワイド・テキスト画像に重ねて右下 */
  .series-banner {
    display: block;
    position: relative;
    max-width: 100%;
  }
  .series-banner__img {
    height: 200px;
    width: 100%;
  }
  .series-banner__img::after {
    background: linear-gradient(to bottom, transparent 30%, rgba(40,41,48,0.75) 100%);
  }
  .series-banner__text {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: transparent;
    padding: 16px 20px;
    justify-content: flex-end;
  }
  .series-banner__text p {
    font-size: 13px;
    text-align: right;
  }

  /* スライダー：左右余白・縦1列・サブ画像非表示 */
  .series-swiper-overflow { padding: 0 20px; }
  .series-slide__inner {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 0 0 32px;
  }
  /* SP: テキスト部→画像→ボタンの順に並べ替え */
  .series-slide__text {
    display: contents; /* gridの子として各要素を直接並べる */
  }
  .series-slide__name  { order: 1; }
  .series-slide__tag   { order: 2; width: fit-content; margin: 0 auto 20px;}
  .series-slide__desc  { order: 3; }
  .series-slide__imgs  { order: 4; margin-bottom: 20px;}
  .series-slide__text .series-card__btn { order: 5; margin: 10px auto;}
  .series-slide__name { font-size: 18px; text-align: center;}
  .series-slide__desc { font-size: 14px; margin-bottom: 20px;}
  .series-slide__imgs {
    grid-template-columns: 1fr;
    justify-items: center;
  }
  .series-slide__img--main { height: 200px; }
  .series-slide__img--main img { height: 200px; width: auto; }
  .series-slide__img--sub { display: none; }
  .series-prev,
  .series-next { display: none; }

  /* 商品カード：コンパクト横並び2列 */
  .series-cards {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding-bottom: 48px;
  }
  .series-card {
    padding: 6px 6px 16px;
  }
  .series-card__img {
    height: 120px;
    padding: 12px;
  }
  .series-card__btn {
    font-size: 11px;
    padding: 8px 10px;
    text-align: center;
    width: calc(100% - 16px);
  }

  /* ===== Innovation reasons ===== */
  .innovation-hero { height: 150px;}
  .innovation-reasons { padding: 48px 0 260px; }
  .reasons-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .reason-card__title { font-size: 15px; }
  .reason-card__text { font-size: 14px; }

  /* ===== Tech badge ===== */
  .tech-badge-wrap {
    width: 300px;
    height: 300px;
    padding: 28px 24px;
    margin-bottom: calc(-300px * 9/15);
  }
  .tech-badge__ribbon { width: 100px; }
  .tech-badge__ribbon-text { font-size: 10px; }
  .tech-badge__title { font-size: 11px; }
  .tech-badge__title strong { font-size: 16px; }
  .tech-badge__laurel { width: 18px; }

  /* ===== Tech grid ===== */
  .tech-grid { grid-template-columns: 1fr; gap: 40px; }
  .tech-item__num svg { width: 60px; height: 42px; }
  .tech-item__title { font-size: 16px; overflow: hidden; text-overflow: ellipsis; }
  .tech-item__title br { display: none; }
  .tech-item__text { font-size: 14px; }

  /* ===== Accordion ===== */
  .accordion__inner { grid-template-columns: 1fr; }
  .accordion__img { width: 100%; height: 120px; overflow: hidden; }
  .accordion__img img { width: 100%; height: 100%; object-fit: cover; }
  .accordion__title { font-size: 15px; padding-right: 20px;}
  .accordion__text { font-size: 14px; }

  /* ===== Methods ===== */
  .methods-grid { grid-template-columns: 1fr; }
  .method-card__title { font-size: 16px; }
  .method-card__text { font-size: 14px; }
  .method-card__note { font-size: 13px; }

  /* ===== CTA buttons ===== */
  .cta-buttons__inner { flex-direction: column; align-items: center; }
  .cta-btn { width: 100%; max-width: 320px; flex: none; }

  /* ===== Solution hero ===== */
  .solution-icons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }
  .solution-hero__title { font-size: clamp(24px, 5vw, 36px); }
  .solution-hero__sub { font-size: 16px; }
  .solution-hero__lead { font-size: 14px; text-align: left;}
  .solution-icon__label { font-size: 13px; }

  /* ===== What is pure ===== */
  .what-is-pure__grid { grid-template-columns: 1fr; gap: 40px; }
  .what-is-pure__text p { font-size: 14px; }

  /* ===== Water diff ===== */
  .water-diff__grid { grid-template-columns: 1fr; gap: 32px; }
  .water-diff__text p { font-size: 14px; }
  .water-table { font-size: 12px; }
  .water-table__th { padding: 8px 6px; white-space: nowrap; }
  .water-table__th-title { font-size: 12px; }
  .water-table__th-sub { font-size: 10px; }
  .water-table__th-inner { gap: 8px; padding-left: 8px; }
  .water-table__logo { width: 28px; height: 28px; }
  .water-table td { padding: 6px 8px; }
  .water-table__label { font-size: 11px; }
  .water-table__unit { font-size: 10px; }
  .water-table__tap { font-size: 14px; }
  .water-table__pure strong { font-size: 14px; }
  .water-table__pure-inner { gap: 6px; padding-left: 8px; }
  .water-table__circle { width: 20px; height: 20px; }
  .water-table__circle::after { width: 10px; height: 10px; }
  .water-compare__grid { grid-template-columns: repeat(2, 1fr); }
  .water-compare__caption { font-size: 12px; }
  .water-compare__lead{ font-size:12px; }

  /* ===== Merits ===== */
  .merits-list { gap: 64px; }
  .merits__title { font-size: 18px; }
  .merit-item {
    height: auto !important;
    min-height: 0 !important;
    display: flex;
    flex-direction: column;
  }
  .merit-item__img--01,
  .merit-item__img--02,
  .merit-item__img--02b,
  .merit-item__img--03,
  .merit-item__img--04,
  .merit-item__img--04b {
    position: relative !important;
    width: 100% !important;
    height: 240px !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    z-index: auto !important;
    order: 1;
  }
  .merit-item__img--02b,
  .merit-item__img--04b { display: none; }
  .merit-item__text-box--01,
  .merit-item__text-box--02,
  .merit-item__text-box--03,
  .merit-item__text-box--04 {
    position: relative !important;
    width: 100% !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    transform: none !important;
    padding: 40px 20px 24px;
    order: 2;
  }
  .merit-item__num {
    top: -32px !important;
    left: 0 !important;
    right: auto !important;
  }
  .merit-item__title { font-size: 16px; }
  .merit-item__text { font-size: 14px; }

  /* ===== Flow ===== */
  .flow-steps { flex-direction: column; gap: 0; }
  .flow-step { margin-left: 0; margin-top: -1px; }
  .flow-step__inner {
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 20px), 50% 100%, 0 calc(100% - 20px));
    padding: 24px 24px 44px;
    height: auto;
  }
  /* 最初のステップはそのまま（上部フラット） */
  .flow-step:first-child .flow-step__inner {
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 20px), 50% 100%, 0 calc(100% - 20px));
  }
  /* 2番目以降は上部もくぼんだシェブロン型 */
  .flow-step + .flow-step .flow-step__inner {
    clip-path: polygon(0 0, 50% 20px, 100% 0, 100% calc(100% - 20px), 50% 100%, 0 calc(100% - 20px));
    padding-left: 24px;
    padding-top: 36px;
  }

  .flow-step__title { font-size: 15px; }
  .flow-step__text { font-size: 14px; }
  .flow-cta-btn { min-width: auto; width: 100%; max-width: 320px; padding: 16px 24px; margin-top: 16px; }

  /* ===== Cases ===== */
  .cases-swiper .swiper-wrapper { align-items: stretch; }
  .cases-swiper .swiper-slide { height: auto !important; }
  .case-card {
    grid-template-columns: 1fr;
    height: 100%;
    display: flex;
    flex-direction: column;
  }
  .case-card__img { width: 100%; height: 160px; flex-shrink: 0; }
  .case-card__body { flex: 1; padding-top:10px;}
  .case-card__type { font-size: 15px; }
  .case-card__text { font-size: 14px; }

  /* ===== Video ===== */
  .video-section .container { padding: 0; }
	.video-section { padding: 0;}
  .video-wrap { max-width: 100%; border-radius: 0; }
  .video-controls { padding: 10px 12px; gap: 8px; }
  .water-divider__video { margin: 30px 0; }

  /* ===== Contact ===== */
  .contact__cols { grid-template-columns: 1fr; gap: 32px; }
  .contact__info-title { font-size: 16px; }
  .contact__info-text { font-size: 14px; }

  /* ===== Footer ===== */
  .footer__inner { padding: 40px 20px 32px; }
  .footer__cols { grid-template-columns: 1fr; gap: 32px; }
  .footer__col-company { font-size: 14px; }
  .footer__col-address { font-size: 12px; }
  .footer__links a { font-size: 13px; }

  /* ===== Page Top ===== */
  .page-top { bottom: 20px; right: 20px; width: 40px; height: 40px; font-size: 15px; }
}

/* ----------------------------------------
   SP ~480px
   ---------------------------------------- */
@media (max-width: 480px) {

  /* Reasons */
  .reasons-grid { grid-template-columns: 1fr; }
  .reason-card__title { font-size: 14px; }
  .reason-card__text { font-size: 13px; }

  /* Series */
  .series-slide__name { font-size: 17px; }
  .series-slide__desc { font-size: 13px; }
  .series-card__btn { font-size: 10px; padding: 6px 8px; }

  /* Solution icons */
  .solution-icons { grid-template-columns: repeat(2, 1fr); }
  .solution-icon__label { font-size: 12px; }

  /* CTA */
  .cta-btn { padding: 16px 32px; }

  /* Water compare */
  .water-compare__grid { grid-template-columns: repeat(2, 1fr); }
  .pure-legend { flex-wrap: nowrap; gap: 8px; font-size: 11px; }
  .pure-legend__dot { width: 8px; height: 8px; margin-right: 2px; }

  /* Merit */
  .merit-item__img--01,
  .merit-item__img--02,
  .merit-item__img--03,
  .merit-item__img--04 { height: 200px !important; }
  .merit-item__title { font-size: 15px; }
  .merit-item__text { font-size: 13px; }

  /* Flow */
  .flow-step__title { font-size: 14px; }
  .flow-step__text { font-size: 13px; }
  .flow-cta-btn { min-width: auto; width: 100%; padding: 16px 24px; }

  /* Tech badge */
  .tech-badge-wrap {
    width: 260px;
    height: 260px;
    padding: 24px 20px;
    margin-bottom: calc(-260px * 9/15);
  }
  .tech-badge__ribbon { width: 86px; }
  .tech-badge__ribbon-text { font-size: 9px; }
  .tech-badge__title { font-size: 10px; }
  .tech-badge__title strong { font-size: 14px; }
  .tech-badge__laurel { width: 16px; }
	
  .contact {
    padding: 48px 0;
  }
}

/* ----------------------------------------
   Large 1920px+
   ---------------------------------------- */
@media (min-width: 1920px) {
  .header__inner {
    padding-left: 80px;
    padding-right: 80px;
  }
}