/* ================================
   Global Search（Suggest + 虫眼鏡）統一版
   ※「虫眼鏡を入力欄内に表示」「ボタン非表示でも動作」
   ※モバイルで幅100%にするまで含んだ修正版
================================ */

/* 横並び固定（PC/モバイル共通） */
.ch-global-search__form {
  display: flex;
  align-items: stretch;
  gap: 8px;
  width: 100%;
  flex-wrap: nowrap; /* 縦落ち防止 */
  position: relative; /* 擬似要素アイコンの基準 */
}

/* input：残り幅全部 / 高さ固定 */
.ch-global-search__input {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  height: 44px;               /* 高さ固定 */
  padding: 8px 12px;
  padding-right: 44px !important; /* 右に虫眼鏡スペース */
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 16px;            /* iOSズーム防止 */
  background: #fff;
  box-shadow: none !important;
  box-sizing: border-box;
}

/* focusで太らないように */
.ch-global-search__input:focus {
  border-color: #006341 !important;
  box-shadow: 0 0 0 2px rgba(0,99,65,.15) !important;
  outline: none !important;
}

/* placeholder 緑 */
.ch-global-search__input::placeholder {
  color: #006341;
  opacity: 1;
}

/* 虫眼鏡アイコンをinput内の右側に表示 */
.ch-global-search__form::after{
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;

  background: no-repeat center / contain
    url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23006341' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'>\
<circle cx='11' cy='11' r='7'/>\
<line x1='21' y1='21' x2='16.65' y2='16.65'/>\
</svg>");

  pointer-events: none;
  opacity: .9;
}

/* 既存の黒い検索ボタンは“見た目だけ消す”（DOMは残す） */
.ch-global-search__btn{
  width: 0 !important;
  height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  overflow: hidden !important;
  opacity: 0 !important;
  position: absolute !important;
  right: 0;
  top: 0;
  pointer-events: none !important; /* Enter検索だけ使う */
}

/* SVG虫眼鏡（旧ボタン用：残ってても害なし） */
.ch-global-search__icon {
  width: 20px;
  height: 20px;
  display: block;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

/* サジェストパネル */
.ch-global-search__panel {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(0,0,0,.08);
  padding: 8px;
  z-index: 9999;
}

/* サジェスト文字色 */
.ch-global-search__panel,
.ch-global-search__panel a,
.ch-suggest__item span,
.ch-suggest__group-title,
.ch-suggest__empty { color: #333; }

.ch-suggest__item a:hover span { color: #111; }

.ch-suggest__group { padding: 6px 4px; }
.ch-suggest__group-title {
  font-size: 12px;
  opacity: .7;
  margin: 4px 6px;
}

.ch-suggest__list { list-style: none; margin: 0; padding: 0; }

.ch-suggest__item a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  text-decoration: none;
}

.ch-suggest__item a:hover { background: #f7f7f7; }

.ch-suggest__item img {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: 4px;
  flex: 0 0 auto;
}

.ch-suggest__empty {
  padding: 10px;
  font-size: 14px;
  opacity: .7;
  text-align: center;
}

/* =========================
   モバイル時：検索窓を幅いっぱいに
========================= */
@media (max-width: 921px){

  .ch-global-search,
  .ch-global-search__form{
    width: 100% !important;
    max-width: 100% !important;
    flex: 1 1 100% !important;
  }

  .ch-global-search__input{
    width: 100% !important;
    max-width: 100% !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    height: 44px;
    box-sizing: border-box;
  }

  /* Astraヘッダー側の中央寄せ制約を潰す */
  .ast-header-break-point .header-main-layout-1 .ast-container,
  .ast-header-break-point .main-header-bar,
  .ast-header-break-point .ast-builder-grid-row-container{
    max-width: 100% !important;
  }

  .ast-header-break-point .ch-global-search{
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
}


/* =========================
   Category Thumb in Dropdown
========================= */

.main-header-menu .sub-menu .menu-category-thumb {
  width: 32px;
  height: 32px;
  object-fit: cover;
  border-radius: 6px;
  margin-right: 8px;
  flex: 0 0 auto;
  display: inline-block !important;
}

.main-header-menu .sub-menu > li > a {
  display: flex;
  align-items: center;
  gap: 8px;
}

.main-header-menu .sub-menu .menu-category-title {
  line-height: 1.3;
}


/* =========================
   Astra メニュー色
========================= */

/* PC */
.main-header-menu > li > a,
.main-header-menu > li.menu-item > a {
  color: #006341;
}

.main-header-menu .sub-menu > li > a {
  color: #006341;
}

.main-header-menu > li > a:hover,
.main-header-menu > li > a:focus,
.main-header-menu > li.current-menu-item > a,
.main-header-menu > li.current-menu-ancestor > a,
.main-header-menu .sub-menu > li > a:hover,
.main-header-menu .sub-menu > li > a:focus,
.main-header-menu .sub-menu > li.current-menu-item > a {
  color: #333;
}

/* モバイル */
.ast-header-break-point .main-header-menu > li > a,
.ast-header-break-point .main-header-menu .sub-menu > li > a {
  color: #006341;
}

.ast-header-break-point .main-header-menu > li > a:hover,
.ast-header-break-point .main-header-menu .sub-menu > li > a:hover,
.ast-header-break-point .main-header-menu > li > a:focus,
.ast-header-break-point .main-header-menu .sub-menu > li > a:focus {
  color: #333;
}


/* =========================
   メニューリンクの下線なし
========================= */

.main-header-menu a,
.main-header-menu a:hover,
.main-header-menu a:focus,
.main-header-menu a:active {
  text-decoration: none !important;
}


/* =========================
   Astra メニュー余白（詰まり解消）
========================= */

/* PC */
.main-header-menu > li > a {
  padding: 0.9em 1.1em !important;
  display: flex;
  align-items: center;
  gap: 8px;
}

.main-header-menu .sub-menu > li > a {
  padding: 0.7em 1em !important;
  display: flex;
  align-items: center;
  gap: 8px;
}

@media (min-width: 922px) {
  .main-header-menu { gap: 6px; }
  .main-header-menu > li { margin: 0 2px; }
}


/* =========================
   Off-Canvasの“右の空き”を完全に消す（最終版）
========================= */

.ast-header-break-point .ast-mobile-popup-drawer,
.ast-header-break-point .ast-mobile-popup-drawer .ast-mobile-popup-inner,
.ast-header-break-point .ast-mobile-popup-drawer .ast-mobile-popup-header,
.ast-header-break-point .ast-mobile-popup-drawer .ast-mobile-popup-content {
  width: 100vw !important;
  max-width: 100vw !important;
  left: 0 !important;
  right: 0 !important;
  margin: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  box-sizing: border-box;
}

/* 中のコンテンツだけ見た目用padding */
.ast-header-break-point .ast-mobile-popup-drawer .ast-mobile-popup-content {
  padding-left: 16px !important;
  padding-right: 16px !important;
}

/* ヘッダー行フル幅 */
.ast-header-break-point .main-header-bar,
.ast-header-break-point .main-header-bar .ast-builder-grid-row,
.ast-header-break-point .main-header-bar .ast-builder-grid-row-container {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding-left: 12px !important;
  padding-right: 12px !important;
  box-sizing: border-box;
}

/* ハンバーガー右端 */
.ast-header-break-point .main-header-bar .ast-mobile-menu-trigger,
.ast-header-break-point .main-header-bar .ast-button-wrap,
.ast-header-break-point .main-header-bar .ast-builder-menu-toggle {
  margin-left: auto !important;
}

/* 閉じる（×）右端 */
.ast-header-break-point .ast-mobile-popup-header .ast-mobile-popup-close {
  margin-left: auto !important;
}

/* 子ありメニューのトグル押しやすく */
.ast-header-break-point .main-header-menu .menu-item-has-children > .ast-menu-toggle {
  padding: 12px 14px;
  margin-left: auto;
}

/* サブメニューの左インデント */
.ast-header-break-point .main-header-menu .sub-menu {
  padding-left: 10px;
}

/* Productsだけ目立たせたい場合 */
.ast-header-break-point .main-header-menu .products-root > a {
  font-weight: 700;
  padding-top: 1em;
  padding-bottom: 1em;
}


/* =========================
   HERO VIDEO（minimum）
========================= */

.hero-video{
  position: relative;
  width: 100vw;
  min-height: 520px;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  overflow: hidden;
}

.hero-video__bg{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  background: #000;
}

.entry-content .hero-video.alignfull .hero-video__bg{
  object-fit: cover;
  background: transparent;
}

/* Sound Button */
.hero-video__sound-btn{
  position: absolute;
  z-index: 10;

  right: clamp(16px, 4vw, 70px);
  bottom: clamp(16px, 10vh, 120px);

  width: clamp(88px, 9vw, 120px);
  height: clamp(30px, 3.2vw, 34px);

  display: grid;
  place-items: center;

  background: rgba(255,255,255,0.22);
  border: 1px solid rgba(255,255,255,0.55);
  border-radius: 999px;
  backdrop-filter: blur(6px) saturate(120%);
  -webkit-backdrop-filter: blur(6px) saturate(120%);
  box-shadow:
    0 2px 10px rgba(0,0,0,0.18),
    inset 0 0 0 1px rgba(255,255,255,0.12);

  padding: 0;
  cursor: pointer;
  transition: background .25s ease, border-color .25s ease, transform .1s ease;
}

.hero-video__sound-btn:hover{
  background: rgba(255,255,255,0.32);
  border-color: rgba(255,255,255,0.75);
}

.hero-video__sound-btn:active{ transform: translateY(1px); }

.hero-video__sound-icon{
  width: clamp(56px, 6vw, 82px);
  height: auto;
  display: block;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,0.25));
}

@media (max-width: 768px){
  .hero-video__sound-btn{
    right: 12px;
    bottom: 12px;
    width: 86px;
    height: 30px;
  }
  .hero-video__sound-icon{ width: 58px; }
}


/* =========================
   Astraモバイルの展開トグル系（Off-Canvas専用・完全版）
   ✅ PCで幅縮小しても壊れない
   ✅ 実機モバイルでもOK
   ✅ サブメニューの右側スライド挙動は殺さない
========================= */

/* サムネクリック邪魔防止 */
.menu-category-thumb{ pointer-events: none; }

@media (max-width: 921px){

  /* ★ Off-Canvas（ハンバーガー内）だけ対象にする */
  .ast-mobile-popup-drawer .main-header-menu > li{
    position: relative !important;
  }

  /* トップ階層リンクは block 化してトグル分の右余白確保 */
  .ast-mobile-popup-drawer .main-header-menu > li > a.menu-link{
    display: block !important;
    width: 100% !important;
    padding-right: 52px !important; /* トグル分 */
  }

  /* ▼トグルを右端に固定（リンクと重ならず確実に押せる） */
  .ast-mobile-popup-drawer
  .main-header-menu
  > li.menu-item-has-children
  > .ast-menu-toggle{
    position: absolute !important;
    right: 6px !important;
    top: 0 !important;
    height: 100% !important;
    width: 44px !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    z-index: 10 !important;
    pointer-events: auto !important;
    background: transparent !important;
  }

  /* サブメニュー内リンクは flex OK */
  .ast-mobile-popup-drawer .main-header-menu .sub-menu > li > a.menu-link{
    display: flex !important;
    align-items: center !important;
    gap: 8px;
  }

  /* 念のため被り防止の階層 */
  .ast-mobile-popup-drawer .ast-mobile-popup-content{
    position: relative;
    z-index: 1;
  }
  .ast-mobile-popup-drawer .ast-mobile-popup-content .main-header-menu{
    position: relative;
    z-index: 2;
  }
}

/* PC：サブカテゴリサムネは確実に表示 */
.ast-desktop .main-header-menu .sub-menu .menu-category-thumb{
  display: inline-block !important;
  visibility: visible !important;
  opacity: 1 !important;
}
.ast-desktop .main-header-menu .sub-menu img{
  max-height: none !important;
}


/* =========================
   TOPの動画だけ横はみ出す問題の最終パッチ
========================= */

@media (max-width: 921px){

  .home .hero-video,
  .front-page .hero-video{
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    overflow: hidden !important;
  }

  .home .hero-video__bg,
  .front-page .hero-video__bg{
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    left: 0 !important;
    right: 0 !important;
    object-fit: cover !important;
  }

  .home,
  .front-page{
    overflow-x: hidden;
  }
}


/* =========================
   PCレスポンシブ時もハンバーガーを確実に開ける最終パッチ
========================= */
@media (max-width: 921px){

  .main-header-bar,
  .ast-builder-grid-row,
  .ast-builder-grid-row-container{
    position: relative !important;
    z-index: 10 !important;
  }

  .ast-mobile-menu-trigger,
  .ast-builder-menu-toggle,
  .ast-button-wrap{
    position: relative !important;
    z-index: 9999 !important;
    pointer-events: auto !important;
  }

  .ch-global-search{
    position: relative !important;
    z-index: 1 !important;
  }
}


/* =========================
   樹種塗装一覧（wood-finishes）
========================= */

.wood-finishes-wrap{
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
}

.wood-group{
  margin-bottom: 56px;
}

.wood-group-title{
  font-size: 24px;
  margin-bottom: 18px;
  border-bottom: 1px solid #ddd;
  padding-bottom: 6px;
}

.wood-cards{
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 18px;
}

@media (max-width: 1024px){
  .wood-cards{
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 640px){
  .wood-cards{
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }
}

.wood-card{
  background: #fff;
  border: 1px solid #eee;
  padding: 10px;
  border-radius: 8px;
}

.wood-card-img-wrap{
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 6px;
}

.wood-card-img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.wood-card-name{
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  margin: 8px 0 6px;
  word-break: break-word;
}

.wood-card-tag{
  font-size: 12px;
  color: #888;
  margin: 0 0 6px;
}

.wood-card-desc{
  font-size: 13px;
  line-height: 1.6;
  color: #555;
  margin: 0;
  word-break: break-word;
}

.wood-empty{
  color:#777;
  font-size:14px;
}
.wood-empty--in-group{
  grid-column: 1 / -1;
}


/* =====================================================
   張地一覧（materials-upholstery）
   ✅ page-id-2761 だけに効かせるスコープ版のみ
===================================================== */

.page-id-2761 .upholsteries-wrap{
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* フル幅タブ */
.page-id-2761 .uh-tabbar{
  display: flex;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  border-bottom: 1px solid #ddd;
  margin-bottom: 22px;
}

.page-id-2761 .uh-tab{
  flex: 1 1 0;
  padding: 14px 10px;
  background: #f7f7f7;
  color: #333;
  border: none;
  border-right: 1px solid #e5e5e5;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: background .2s ease, color .2s ease;
}
.page-id-2761 .uh-tab:last-child{ border-right: none; }

.page-id-2761 .uh-tab.is-active{
  background: #fff;
  color: #000;
  border-bottom: 2px solid #000;
}

/* パネル表示（JS主導） */
.page-id-2761 .uh-panel{ display:none; }
.page-id-2761 .uh-panel.is-active{ display:block; }

/* 1カラム・PC横並び */
.page-id-2761 .upholstery-cards{ display:block; }

.page-id-2761 .upholstery-card{
  display:flex;
  gap:18px;
  align-items:flex-start;
  background:#fff;
  border:1px solid #eee;
  padding:12px;
  border-radius:8px;
}

.page-id-2761 .upholstery-card-left{
  width:220px;
  flex:0 0 220px;
  text-align:center;
}

.page-id-2761 .upholstery-card-img-wrap{
  width:100%;
  aspect-ratio:4/3;
  overflow:hidden;
  border-radius:6px;
}
.page-id-2761 .upholstery-card-img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.page-id-2761 .upholstery-card-name{
  font-size:16px;
  font-weight:600;
  line-height:1.4;
  margin-top:8px;
  word-break:break-word;
  text-align:center;
}

.page-id-2761 .upholstery-card-right{
  flex:1 1 auto;
  min-width:0;
}

.page-id-2761 .upholstery-card-desc{
  font-size:14px;
  line-height:1.7;
  color:#555;
  margin:0;
  word-break:break-word;
}

/* モバイル縦並び */
@media (max-width: 640px){
  .page-id-2761 .upholstery-card{
    flex-direction:column;
    gap:10px;
  }
  .page-id-2761 .upholstery-card-left{
    width:100%;
    flex:0 0 auto;
  }
  .page-id-2761 .upholstery-card-name{ font-size:15px; }
  .page-id-2761 .upholstery-card-desc{ font-size:13px; }
}
