/* ===== ベースリセット ===== */
html {
  width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
}

*,
*::before,
*::after {
  box-sizing: inherit;
}

body {
  margin: 0;
  padding: 0;
  width: 100%;
  font-family: var(--font-zen-kaku-gothic-new);
  color: var(--color-primary);
  line-height: 2;
  background-color: #fff;
  overflow-x: hidden;
}

/* ===== 共通クラス ===== */
.container {
  max-width: 1000px;
  margin: 0 auto;
  color: var(--color-primary);

  @media screen and (max-width: 1000px) {
    max-width: 100%;
    padding: 0 20px;
  }
}

.btn {
  display: inline-block;
  padding: 15px 40px;
  border: 1px solid var(--color-primary);
  text-decoration: none;
  color: var(--color-primary);
  font-size: 14px;
  font-family: var(--font-zen-kaku-gothic-new);
  transition: 0.3s;
  letter-spacing: 0.1em;

  &:hover {
    background: var(--color-primary);
    color: #fff;
    transform: translateY(-5px);
  }

  &:focus,
  &:active {
    outline: none;
    box-shadow: none;
  }

  @media (max-width: 768px) {
    padding: 12px 28px;
    font-size: 13px;
  }
}

/* 白抜きボタン（茶背景セクション用） */
.btn-ghost-white {
  border-color: #fff;
  color: #fff;

  &:hover {
    background: #fff;
    color: var(--color-primary);
  }
}

/* 詳細はこちら・商品カタログ・一覧を見るボタンを角丸（ピル型）に */
.panel-more .btn,
.points-more .btn,
.service-pamphlet .btn,
.community-pamphlet .btn,
.card-more .btn {
  border-radius: 999px;
}

/* ===== メインコンテンツ（固定ヘッダー分の余白） ===== */
.subtop-page {
  padding-top: 80px;
}

/* 見出しは和文ゴシック（WPのtheme.jsonが見出しにRokkittを指定するため明示上書き）
   ブロック単体で配置されても効くよう、各セクションクラスを起点にする */
.subtop-page h1,
.subtop-page h2,
.subtop-page h3,
.subtop-title h1,
.subtop-points h2,
.subtop-points h3,
.subtop-services h2,
.subtop-services h3,
.subtop-community h2,
.subtop-community h3,
.subtop-cta h2 {
  font-family: var(--font-zen-kaku-gothic-new);
}

/* ===== パンくずリスト ===== */
.breadcrumb {
  padding: 14px 0 0;
}

.breadcrumb-list {
  list-style: none;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  margin: 0 auto;
  padding: 0 20px;
  max-width: 1200px;
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--color-sub-text);

  li {
    display: flex;
    align-items: center;
    line-height: 1.4;
  }

  li + li::before {
    content: ">";
    margin: 0 8px;
    color: var(--color-sub-text);
  }

  a {
    color: var(--color-sub-text);
    text-decoration: none;
    transition: color 0.2s;

    &:hover {
      color: var(--color-primary);
    }
  }

  .current {
    color: var(--color-primary);
  }
}

/* ===== ページタイトル ===== */
.subtop-title {
  padding: 60px 20px 40px;
  text-align: center;

  h1 {
    margin: 0;
    font-size: 32px;
    font-weight: 500;
    letter-spacing: 0.05em;
    line-height: 1.4;
    color: var(--color-primary);
  }

  .en {
    display: block;
    margin-top: 6px;
    font-family: var(--font-rokkitt);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.08em;
    color: var(--color-gold);
  }

  @media (max-width: 768px) {
    padding: 40px 20px 24px;

    h1 {
      font-size: 24px;
    }

    .en {
      font-size: 14px;
    }
  }
}

/* ===== メインビジュアル ===== */
.subtop-hero {
  position: relative;
  padding: 0 30px;

  img {
    display: block;
    width: 100%;
    max-width: 1380px;
    height: 400px;
    margin: 0 auto;
    object-fit: cover;
    border-radius: 20px;
  }

  @media (max-width: 1200px) {
    img {
      height: 330px;
    }
  }

  @media (max-width: 1000px) {
    img {
      height: 280px;
    }
  }

  .hero-deco {
    position: absolute;
    left: calc(50% - 460px);
    bottom: -40px;
    width: 115px;
    max-width: none;
    height: auto;
    margin: 0;
    object-fit: contain;
    border-radius: 0;
    z-index: 2;
  }

  @media (max-width: 1040px) {
    .hero-deco {
      left: 24px;
      bottom: -35px;
      width: 110px;
    }
  }

  @media (max-width: 768px) {
    padding: 0 15px;

    img {
      height: 220px;
      border-radius: 12px;
    }

    .hero-deco {
      left: 12px;
      bottom: -28px;
      width: 84px;
    }
  }

  /* アイコンを右側に配置する場合（ブロック設定で切替） */
  .hero-deco--right {
    left: auto;
    right: calc(50% - 460px);
  }

  @media (max-width: 1040px) {
    .hero-deco--right {
      left: auto;
      right: 24px;
    }
  }

  @media (max-width: 768px) {
    .hero-deco--right {
      left: auto;
      right: 12px;
    }
  }
}

/* ===== サブメニュー（ヒーロー下端に重ねるピル型ナビ） ===== */
.subtop-submenu {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  margin-top: -34px;
  /* ヒーロー（padding 0 30px）より常に狭くなるよう左右に余白を広く取る */
  padding: 0 70px;
}

.submenu-list {
  list-style: none;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  width: 100%;
  max-width: 990px;
  margin: 0;
  padding: 9px;
  background: #f9f5f2;
  border-radius: 40px;

  li {
    display: flex;
  }
}

.submenu-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 6px 50px;
  border-radius: 30px;
  text-decoration: none;
  text-align: center;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.03em;
  color: var(--color-primary);
  transition: 0.3s;

  &:hover {
    background: rgba(102, 57, 31, 0.08);
  }

  &.is-active {
    background: #653a20;
    color: #fff;
  }

  br {
    display: block;
  }
}

@media (max-width: 1000px) {
  .submenu-link {
    padding: 6px 24px;
    font-size: 13px;
  }
}

@media (max-width: 768px) {
  .subtop-submenu {
    margin-top: -22px;
    padding: 0 32px;
  }

  .submenu-list {
    flex-wrap: wrap;
    justify-content: center;
    border-radius: 24px;
    padding: 6px;
  }

  .submenu-link {
    min-height: 40px;
    padding: 4px 18px;
    font-size: 12px;

    br {
      display: none;
    }
  }
}

/* ===== リード文 ===== */
.subtop-lead {
  position: relative;
  padding: 60px 20px 90px;
  text-align: center;

  .lead-title {
    margin: 0 0 25px;
    font-size: 28px;
    font-weight: 500;
    letter-spacing: 0.05em;
    color: var(--color-primary);
  }

  p {
    margin: 0;
    font-size: 22px;
    font-weight: 300;
    line-height: 3;
    letter-spacing: 0.05em;
    color: var(--color-primary);
  }

  .lead-accent {
    color: #74a92d;
  }

  .deco-coffee {
    position: absolute;
    right: calc(50% - 380px);
    bottom: -45px;
    width: 80px;
    z-index: 2;

    img {
      width: 100%;
      height: auto;
    }
  }

  @media (max-width: 1200px) {
    .deco-coffee {
      right: 20px;
    }
  }

  /* アイコンを左側に配置する場合（ブロック設定で切替） */
  .deco-coffee--left {
    right: auto;
    left: calc(50% - 380px);
  }

  @media (max-width: 1200px) {
    .deco-coffee--left {
      right: auto;
      left: 20px;
    }
  }

  @media (max-width: 1000px) {
    p {
      font-size: 18px;
      line-height: 2.6;
    }
  }

  @media (max-width: 768px) {
    padding: 30px 20px 60px;

    .lead-title {
      font-size: 20px;
      margin-bottom: 15px;
    }

    p {
      font-size: 14px;
      line-height: 2.4;
      text-align: center;
    }

    .deco-coffee {
      width: 60px;
      bottom: -30px;
    }
  }
}

/* ===== 3つのサービスポイント ===== */
.subtop-points {
  background: #f9f6f3;
  padding: 100px 0 120px;

  .points-label {
    display: block;
    text-align: center;
    font-size: 14px;
    letter-spacing: 0.1em;
    color: var(--color-gold);
    margin: 0 0 5px;
  }

  h2 {
    margin: 0 0 80px;
    text-align: center;
    font-size: 28px;
    font-weight: 500;
    letter-spacing: 0.05em;
    color: var(--color-primary);

    .num-accent {
      color: #74a92d;
    }
  }

  .points-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
  }

  .point-item {
    .point-thumb {
      position: relative;

      img {
        display: block;
        width: 100%;
        aspect-ratio: 3 / 2;
        object-fit: cover;
        border-radius: 8px;
      }
    }

    .point-badge {
      position: absolute;
      top: -40px;
      left: 50%;
      transform: translateX(-50%);
      width: 84px;
      height: 84px;
      border-radius: 50%;
      background: #7ab929;
      color: #fff;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      padding-top: 12px;
      line-height: 1;
      box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);

      .txt {
        font-family: var(--font-rokkitt);
        font-size: 15px;
        letter-spacing: 0.08em;
        margin-bottom: 0;
      }

      .num {
        font-family: var(--font-rokkitt);
        font-size: 36px;
        font-weight: 600;
        line-height: 1;
      }
    }

    .point-title {
      margin: 20px 0 10px;
      text-align: center;
      font-size: 17px;
      font-weight: 700;
      line-height: 1.8;
      letter-spacing: 0.05em;

      .accent {
        color: #7ab929;
      }
    }

    .point-text {
      margin: 0;
      font-size: 14px;
      line-height: 1.8;
      letter-spacing: 0.03em;
      color: var(--color-primary);
    }
  }

  .points-more {
    text-align: center;
    margin-top: 60px;

    .btn {
      min-width: 410px;
      background: #fff;

      &:hover {
        background: var(--color-primary);
        color: #fff;
      }
    }
  }

  @media (max-width: 768px) {
    padding: 60px 0 70px;

    h2 {
      font-size: 20px;
      margin-bottom: 40px;
    }

    .points-grid {
      grid-template-columns: 1fr;
      gap: 45px;
    }

    .points-more {
      margin-top: 45px;
      padding: 0 20px;

      .btn {
        min-width: 0;
        width: 100%;
      }
    }

    .point-item .point-badge {
      top: -34px;
      left: 50%;
      transform: translateX(-50%);
      width: 70px;
      height: 70px;

      .num {
        font-size: 25px;
      }
    }
  }
}

/* ===== 提供するサービス（タブ） ===== */
.subtop-services {
  background: #fff;
  position: relative;

  .services-truck {
    position: absolute;
    top: 0;
    left: calc(50% - 330px);
    transform: translate(-50%, -38%);
    width: 190px;
    height: auto;
    z-index: 2;
    pointer-events: none;
  }

  @media (max-width: 1040px) {
    .services-truck {
      left: 40px;
      transform: translate(0, -62%);
    }
  }

  .services-header {
    padding: 100px 20px 0;
    text-align: center;

    h2 {
      margin: 0 0 40px;
      font-size: 28px;
      font-weight: 500;
      letter-spacing: 0.05em;
      color: var(--color-primary);
    }
  }

  .service-tabs {
    display: flex;
    width: fit-content;
    max-width: calc(100% - 40px);
    margin: 0 auto 35px;
    gap: 4px;
    padding: 5px;
    background: #f9f6f3;
    border-radius: 999px;
  }

  .service-tab {
    appearance: none;
    cursor: pointer;
    padding: 12px 42px;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: var(--color-primary);
    font-family: var(--font-zen-kaku-gothic-new);
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0.05em;
    line-height: 1.4;
    transition: 0.3s;

    &:hover {
      background: var(--color-bg-cream);
    }

    &.active {
      background: var(--color-primary);
      border-color: var(--color-primary);
      color: #fff;
      pointer-events: none;
      position: relative;
    }
  }

  @media (max-width: 768px) {
    .services-truck {
      left: 20px;
      width: 130px;
    }

    .services-header {
      padding-top: 60px;

      h2 {
        font-size: 18px;
        letter-spacing: 0.05em;
        margin-bottom: 30px;
      }
    }

    .service-tabs {
      width: 100%;
      max-width: 360px;
      gap: 3px;
    }

    .service-tab {
      flex: 1;
      padding: 10px 6px;
      font-size: 12px;
    }
  }
}

/* カプセルタブ 個別カラー（選択時・ホバー時に着色） */
.service-tab[data-tab="coffee"]:hover,
.service-tab[data-tab="coffee"].active {
  background: #66391f;
  color: #fff;
}

.service-tab[data-tab="tea"]:hover,
.service-tab[data-tab="tea"].active {
  background: #74a92d;
  color: #fff;
}

.service-tab[data-tab="water"]:hover,
.service-tab[data-tab="water"].active {
  background: #31a7da;
  color: #fff;
}

/* 選択中カプセルとパネルをつなぐ上向き矢印（パネル上端にくっつく・色に合わせる） */
.service-tab.active::after {
  content: "";
  position: absolute;
  top: calc(100% + 24px);
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-bottom: 16px solid var(--color-primary);
}

.service-tab[data-tab="coffee"].active::after {
  border-bottom-color: #66391f;
}

.service-tab[data-tab="tea"].active::after {
  border-bottom-color: #74a92d;
}

.service-tab[data-tab="water"].active::after {
  border-bottom-color: #31a7da;
}

/* SPではサブピクセルの丸めで三角とパネル背景の間に1〜2pxの隙間が出るため、
   三角を少し伸ばしてパネル側に重ねる */
@media (max-width: 768px) {
  .service-tab.active::after {
    border-bottom-width: 19px;
  }
}

/* タブパネル（茶テクスチャ背景） */
.service-panels {
  background:
    linear-gradient(rgba(84, 45, 18, 0.88), rgba(60, 30, 10, 0.92)),
    url("../images/ocs/bg_set01.jpg") center / cover no-repeat;
  color: #fff;
  padding: 60px 0 70px;

  .container {
    color: #fff;
  }
}

/* コーヒーマシーン選択時のパネル背景 */
.service-panels[data-active="coffee"] {
  background: url("../images/ocs/bg_coffee.png") center / cover no-repeat;
}

/* 給茶器選択時のパネル背景 */
.service-panels[data-active="tea"] {
  background: url("../images/ocs/bg_tea.png") center / cover no-repeat;
}

/* ウォーターサーバー選択時のパネル背景 */
.service-panels[data-active="water"] {
  background: url("../images/ocs/bg_water.png") center / cover no-repeat;
}

/* コーヒーパネルのグリッドは左寄せ（2段目を左揃えに） */
#panel-coffee .item-grid {
  justify-content: flex-start;
}

.service-panel {
  display: none;

  &.active {
    display: block;
  }

  .panel-title {
    margin: 0 0 20px;
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.15em;
    color: #fff;
  }

  .panel-text {
    max-width: 820px;
    margin: 0 auto 30px;
    font-size: 16px;
    line-height: 2;
    letter-spacing: 0.03em;
    text-align: center;
  }

  .panel-more {
    text-align: center;
    margin-bottom: 50px;
  }

  .item-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 24px 20px;
  }

  .item-card {
    display: block;
    width: calc((100% - 80px) / 5);
    text-decoration: none;
    text-align: center;
    transition: opacity 0.3s;

    /* リンク（URL設定あり）の場合のみホバー効果 */
    &:is(a):hover {
      opacity: 0.8;
    }

    .item-thumb {
      background: #fff;
      border-radius: 10px;
      padding: 12px;

      img {
        display: block;
        width: 100%;
        aspect-ratio: 1 / 1;
        object-fit: contain;
      }
    }

    .item-name {
      margin: 10px 0 0;
      font-size: 13px;
      line-height: 1.5;
      letter-spacing: 0.03em;
      color: #fff;
    }
  }

  @media (max-width: 768px) {
    .panel-title {
      font-size: 18px;
    }

    .panel-text {
      font-size: 14px;
      line-height: 2;
      text-align: left;
    }

    .item-grid {
      gap: 20px 15px;
    }

    .item-card {
      width: calc((100% - 15px) / 2);
    }
  }
}

.service-pamphlet {
  text-align: center;
  margin-top: 55px;

  @media (max-width: 768px) {
    margin-top: 40px;
  }
}

/* 茶背景内に置く商品カタログボタン（黄色） */
.service-pamphlet--emphasis .btn {
  min-width: 410px;
  background: #fff200;
  border-color: #fff200;

  &:hover {
    background: #fff200;
    color: var(--color-primary);
    opacity: 0.7;
  }

  @media (max-width: 768px) {
    min-width: 0;
    width: 100%;
  }
}

/* ===== 憩いのコミュニケーション ===== */
.subtop-community {
  position: relative;
  padding: 140px 0;
  overflow: hidden;

  .container {
    position: relative;
    z-index: 2;
  }

  .community-deco {
    position: absolute;
    z-index: 1;
    height: auto;
    pointer-events: none;
  }

  .community-deco--lt {
    left: -100px;
    top: -190px;
    width: 800px;
  }

  .community-deco--rt {
    right: -200px;
    top: -190px;
    width: 800px;
  }

  .community-deco--lb {
    left: -275px;
    bottom: -140px;
    width: 650px;
  }

  .community-deco--br {
    right: -165px;
    bottom: -140px;
    width: 800px;
  }

  .community-deco--l {
    left: -310px;
    top: 200px;
    width: 450px;
    height: auto;
  }

  .community-deco--r {
    right: -250px;
    top: 600px;
    width: 450px;
    height: auto;
  }

  h2 {
    margin: 0 0 80px;
    text-align: center;
    font-size: 28px;
    font-weight: 500;
    line-height: 1.7;
    letter-spacing: 0.05em;
    color: var(--color-primary);

    .comm-accent {
      color: #74a92d;
    }
  }

  .community-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 1fr;
    column-gap: 30px;
    row-gap: 50px;
    align-items: stretch;
  }

  .community-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #d7e8b9;
    border-radius: 10px;
    /* 画像をカード枠いっぱいに見せるため上・左右のパディングなし */
    padding: 0 0 30px;
    overflow: hidden;

    .card-thumb img {
      display: block;
      width: 100%;
      aspect-ratio: 8 / 5;
      object-fit: cover;
    }

    .card-title {
      margin: 18px 0 10px;
      padding: 0 25px;
      text-align: center;
      font-size: 17px;
      font-weight: 700;
      line-height: 1.6;
      letter-spacing: 0.03em;
      color: var(--color-primary);
    }

    .card-text {
      flex-grow: 1;
      margin: 0 0 20px;
      padding: 0 25px;
      font-size: 14px;
      line-height: 1.8;
      letter-spacing: 0.03em;
      color: var(--color-primary);
    }

    .card-more {
      text-align: center;

      .btn {
        border-color: var(--color-gold);
        color: var(--color-gold);
        padding: 10px 40px;
        font-size: 13px;

        &:hover {
          background: var(--color-gold);
          color: #fff;
        }
      }
    }
  }

  .community-pamphlet {
    text-align: center;
    margin-top: 55px;
  }

  @media (max-width: 768px) {
    padding: 60px 0 70px;

    h2 {
      font-size: 20px;
      margin-bottom: 40px;
    }

    .community-grid {
      grid-template-columns: 1fr;
      gap: 25px;
    }

    .community-pamphlet {
      margin-top: 40px;
    }

    .community-deco {
      width: 220px;
    }

    .community-deco--lt {
      left: -30px;
      top: -55px;
      width: 280px;
    }

    .community-deco--rt {
      right: -75px;
      top: -75px;
      width: 320px;
    }

    .community-deco--lb {
      left: -95px;
      bottom: -59px;
    }

    .community-deco--br {
      right: -85px;
      bottom: -74px;
      width: 410px;
    }
  }
}

/* ===== お問い合わせCTA ===== */
.subtop-cta {
  background: #bf944e;
  padding: 60px 0 95px;
  /* 前セクションとの境界にサブピクセルの白線が出ないよう1px重ねる */
  margin-top: -1px;
  text-align: center;
  color: #fff;
  position: relative;

  .cta-mascot {
    position: absolute;
    left: 50%;
    bottom: -43px;
    transform: translateX(-50%);
    width: 160px;
    height: auto;
    z-index: 2;
    pointer-events: none;
  }

  .cta-icon {
    width: 110px;
    margin: 0 auto 12px;

    img {
      width: 100%;
      height: auto;
    }
  }

  h2 {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 0.1em;
    line-height: 1.4;
    color: #fff;
  }

  .cta-en {
    display: block;
    margin: 4px 0 20px;
    font-family: var(--font-rokkitt);
    font-size: 14px;
    letter-spacing: 0.15em;
  }

  .cta-text {
    margin: 0 0 35px;
    font-size: 15px;
    line-height: 2.2;
    letter-spacing: 0.05em;
    color: #fff;
  }

  .cta-buttons {
    display: flex;
    justify-content: center;
    gap: 25px;
  }

  .cta-btn {
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 300px;
    padding: 42px 20px;
    background: #fff;
    border-radius: 14px;
    text-decoration: none;
    line-height: 1.5;
    transition: 0.3s;
    position: relative;

    .ja {
      font-size: 16px;
      font-weight: 700;
      letter-spacing: 0.1em;
      color: var(--color-primary);
      transition: color 0.3s;
    }

    .en {
      font-family: var(--font-rokkitt);
      font-size: 12px;
      letter-spacing: 0.1em;
      color: var(--color-gold);
      transition: color 0.3s;
    }

    /* トップページ .useful-item と同じホバー効果 */
    &:hover,
    &:active {
      background: var(--gradient-gold);
      transform: translateY(-5px);
      box-shadow: 0 4px 12px rgba(139, 90, 43, 0.25);

      .ja {
        color: #fff;
      }

      .en {
        color: rgba(255, 255, 255, 0.9);
      }
    }

    &::after {
      content: "";
      position: absolute;
      right: 16px;
      bottom: 16px;
      width: 18px;
      height: 18px;
      background-image: url("../images/arrow-r.svg");
      background-size: contain;
      background-repeat: no-repeat;
      opacity: 0;
      transform: translateX(0);
      transition:
        opacity 0.3s,
        transform 0.3s;
    }

    &:hover::after,
    &:active::after {
      opacity: 1;
      transform: translateX(2px);
    }
  }

  @media (max-width: 768px) {
    padding: 45px 0 55px;

    .cta-mascot {
      width: 100px;
      bottom: -27px;
    }

    .cta-icon {
      width: 70px;
      margin: 0 auto 10px;
    }

    h2 {
      font-size: 22px;
    }

    .cta-text {
      font-size: 14px;
      padding: 0 20px;
    }

    .cta-buttons {
      flex-direction: column;
      align-items: center;
      gap: 15px;
      padding: 0 20px;
    }

    .cta-btn {
      width: 100%;
      max-width: 340px;
    }
  }
}
