/* ============================================================
   Hiro Clinic Header（名前空間: hch-）
   既存サイトと衝突しないよう全セレクタを .hch- にスコープ
   ============================================================ */

/* 表示切替（独自ユーティリティ） */
@media (max-width: 768px) { .hch-pc { display: none !important; } }
@media (min-width: 769px) { .hch-sp { display: none !important; } }

/* ---- ヘッダー外枠 ---- */
.hch-header { background: #fff; border-bottom: 1px solid #eee; position: sticky; z-index: 100; font-size: 16px; }
.hch-header *, .hch-header *::before, .hch-header *::after { box-sizing: border-box; }
.hch-header a { text-decoration: none; color: inherit; }
.hch-header ul { list-style: none; margin: 0; padding: 0; }
.hch-header img { max-width: none; }

/* ---- 最上部：言語切替バー（右揃え） ---- */
.hch-topbar { background: #f7f3ea; border-bottom: 1px solid #ece6d8; }
.hch-topbar__inner { max-width: 1200px; margin: 0 auto; padding: 5px 20px; display: flex; justify-content: flex-end; }
.hch-lang { display: flex; align-items: center; }
.hch-lang li { display: flex; align-items: center; }
.hch-lang li + li { border-left: 1px solid #d8cfb8; }
.hch-lang a { display: inline-flex; align-items: center; gap: 5px; padding: 2px 12px; font-size: .78rem; color: #6a6250; transition: color .2s; }
.hch-lang a:hover { color: #333; }
.hch-lang .is-active a { color: #333; font-weight: 700; }
.hch-lang img { width: 18px; height: auto; display: block; border-radius: 2px; }

/* ---- メイン行 ---- */
.hch-inner { display: flex; align-items: center; gap: 20px; max-width: 1200px; margin: 0 auto; padding: 12px 20px; flex-wrap: wrap; }

/* ロゴ */
.hch-logo img { display: block; width: auto; height: 64px; object-fit: contain; }

/* アクション（ボタン群＋検索）：ハンバーガーの左 */
.hch-actions { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.hch-btns { display: flex; gap: 10px; }
.hch-btn { display: inline-flex; align-items: center; padding: 8px 16px; border: 1px solid #d8c39a; border-radius: 999px; font-size: .85rem; white-space: nowrap; transition: background .2s; }
.hch-btn:hover { background: #edd2a5; }
.hch-btn--accent { background: #edd2a5; border-color: #edd2a5; font-weight: 600; }

/* PC用 検索フォーム */
.hch-search form { display: flex; align-items: center; }
.hch-search-field { border: 1px solid #ffa9b7; border-radius: 999px 0 0 999px; border-right: none; padding: 7px 14px; font-size: .85rem; width: 140px; outline: none; background: #fff; }
.hch-search-submit { border: 1px solid #ffa9b7; border-left: none; border-radius: 0 999px 999px 0; background: #fff; padding: 6px 12px 6px; cursor: pointer; }
.hch-search-submit svg { width: 18px; height: 18px; fill: #888; display: block; }

/* SP用 検索ボタン */
.hch-search-toggle { width: 44px; height: 44px; border: none; background: none; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; }
.hch-search-toggle svg { width: 22px; height: 22px; fill: #333; }

/* ハンバーガー */
.hch-menu-toggle { width: 44px; height: 44px; border: none; background: none; cursor: pointer; position: relative; padding: 0; }
.hch-menu-toggle span { position: absolute; left: 10px; right: 10px; height: 2px; background: #333; transition: transform .3s, opacity .3s; }
.hch-menu-toggle span:nth-child(1) { top: 15px; }
.hch-menu-toggle span:nth-child(2) { top: 21px; }
.hch-menu-toggle span:nth-child(3) { top: 27px; }
.hch-header.is-open .hch-menu-toggle span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.hch-header.is-open .hch-menu-toggle span:nth-child(2) { opacity: 0; }
.hch-header.is-open .hch-menu-toggle span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---- グローバルメニュー（ドロップダウン） ---- */
.hch-nav { width: 100%; }
.hch-nav > ul { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px 0 0; }
.hch-nav li { position: relative; }
.hch-nav a { display: block; padding: 10px 16px; font-size: .92rem; border-radius: 6px; transition: background .2s; }
.hch-nav > ul > li > a:hover { background: #f6f1e6; }

/* 親項目キャレット（PC） */
.hch-nav .menu-item-has-children > a { display: inline-flex; align-items: center; }
.hch-nav .menu-item-has-children > a::after { content: ""; width: 6px; height: 6px; margin-left: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform .2s; }

/* サブメニュー（PC：ホバー）。既存テーマの .sub-menu を上書きするため明示指定 */
.hch-nav .sub-menu {
  position: absolute; top: 100%; left: 0;
  min-width: 220px; margin: 0; padding: 6px 0;
  background: #e8dcc3; border-radius: 0 0 10px 10px;
  box-shadow: 0 10px 24px rgba(0,0,0,.14);
  opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s;
  z-index: 50; display: block;
}
.hch-nav .menu-item-has-children:hover > .sub-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.hch-nav .sub-menu li { width: 100%; }
.hch-nav .sub-menu a { border-radius: 0; padding: 12px 22px; font-size: .9rem; white-space: nowrap; }
.hch-nav .sub-menu a:hover { background: rgba(255,255,255,.5); }

/* SP用サブメニュー開閉ボタン（PCでは非表示） */
.hch-subtoggle { display: none; }

/* ---- 検索モーダル ---- */
.hch-modal { position: fixed; inset: 0; z-index: 9999; display: none; }
.hch-modal.is-open { display: block; }
.hch-modal__overlay { position: absolute; inset: 0; background: rgba(0,0,0,.5); }
.hch-modal__dialog {
  position: relative; width: calc(100% - 32px); max-width: 560px;
  margin: 18vh auto 0; background: #fff; border-radius: 14px;
  padding: 30px 22px 24px; box-shadow: 0 20px 50px rgba(0,0,0,.25);
  animation: hchModalIn .2s ease;
}
@keyframes hchModalIn { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }
.hch-modal__title { margin: 0 0 14px; font-size: .95rem; font-weight: 700; color: #555; }
.hch-modal__close { position: absolute; top: 10px; right: 10px; width: 40px; height: 40px; border: none; background: none; cursor: pointer; font-size: 1.7rem; line-height: 1; color: #999; }
.hch-modal__close:hover { color: #555; }
.hch-modal__form { display: flex; border: 1px solid #ffa9b7; border-radius: 999px; overflow: hidden; }
.hch-modal__input { flex: 1; border: none; padding: 13px 18px; font-size: 1rem; outline: none; min-width: 0; background: #fff; }
.hch-modal__submit { border: none; background: #ffa9b7; padding: 0 22px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.hch-modal__submit svg { width: 20px; height: 20px; fill: #5a4a2a; display: block; }

/* ============================================================
   SP（768px以下）
   ============================================================ */
@media (max-width: 768px) {
  .hch-topbar__inner { padding: 4px 14px; }
  .hch-inner { gap: 8px; padding: 10px 14px; }
  .hch-actions { gap: 6px; }
  .hch-btn { padding: 7px 11px; font-size: .74rem; }

  .hch-nav { display: none; }
  .hch-header.is-open .hch-nav { display: block; }
  .hch-nav > ul { flex-direction: column; gap: 0; padding-top: 0; }
  .hch-nav > ul > li { border-top: 1px solid #f0f0f0; }

  .hch-nav .menu-item-has-children { display: flex; flex-wrap: wrap; align-items: center; }
  .hch-nav .menu-item-has-children > a { flex: 1; }
  .hch-nav .menu-item-has-children > a::after { display: none; }

  .hch-subtoggle { display: flex; align-items: center; justify-content: center; width: 48px; height: 44px; border: none; background: none; cursor: pointer; padding: 0; }
  .hch-subtoggle::before { content: ""; width: 8px; height: 8px; border-right: 2px solid #333; border-bottom: 2px solid #333; transform: rotate(45deg); transition: transform .2s; }
  .hch-nav .menu-item-has-children.is-open > .hch-subtoggle::before { transform: rotate(-135deg); }

  .hch-nav .sub-menu { position: static; opacity: 1; visibility: visible; transform: none; width: 100%; min-width: 0; padding: 0; box-shadow: none; border-radius: 0; background: #f4eee0; display: none; }
  .hch-nav .menu-item-has-children.is-open > .sub-menu { display: block; }
  .hch-nav .sub-menu a { padding-left: 32px; }

  .hch-modal__dialog { margin-top: 14vh; }
}
