/* room-search.css - 2カラム構成統合版（中央配置修正済み） */

/* --- 空室検索セクション全体 --- */
.con_search {
  max-width: 800px;
  margin: 40px auto;
  padding: 20px;
  background: #f9f9f9;
  border: 1px solid #ddd;
  border-radius: 4px;
}

/* タイトルスタイル */
.con_search h2,
.search_title {
  font-size: 24px;
  text-align: center;
  color: #333;
  margin-bottom: 0;
  border-bottom: 2px solid #ea6800;
  padding-bottom: 10px;
}

/* フォームのボックス */
.box_search {
  width: 100%;
  box-sizing: border-box;
}

/* -------------------------------------------------------------------------------- */
/* --- 最重要: form要素に Flexbox を強制適用（PC横並び親要素） --- */
#frmplanseek {
  display: flex !important;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: nowrap;
  width: 100%;
}
/* -------------------------------------------------------------------------------- */

/* --- 各カラムに共通のスタイル --- */
.search-col {
  padding: 12px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  border: 1px solid #ccc; /* PC表示の各カラムの枠線 */
  background: #fff; /* PC表示の各カラムの背景色 */
  border-radius: 4px;
}

/* === PC表示のカラムごとの幅設定と順序設定 === */

/* --- 左カラム (日付 + 検索ボタン) --- */
.left-col {
  flex: 1 1 60%; 
  justify-content: flex-start;
  gap: 15px;
  min-width: 0;
  order: 1; 
}

/* --- 右カラム (リンク) --- */
.right-col {
  flex: 1 1 40%; 
  display: flex;
  align-items: center; /* 子要素 (.searchtypeareaL) を垂直中央に配置 */
  justify-content: center;
  min-width: 0;
  order: 2; 
}

/* === フォーム内の要素スタイル === */

/* #nitteiarea（日付エリア）*/
#nitteiarea {
  margin-bottom: 0;
  padding: 10px;
  border: 1px solid #eee;
  background: #fff;
  border-radius: 4px;
}

/* 宿泊プラン/部屋タイプ/カレンダーの選択 (リンクブロック) の修正 */
.searchtypeareaL {
  flex-grow: 1; 
  display: flex;          /* 🌟 修正: これをFlexコンテナにする */
  flex-direction: column; /* 🌟 修正: 垂直方向に配置 */
  justify-content: center;/* 🌟 修正: 中の要素を垂直方向の中央に配置 */
  padding: 0; 
  border: none; 
  background: transparent; 
  border-radius: 0; 
  text-align: center;
  width: 100%;
}

/* 検索ボタンの配置調整 (左カラム内で日付エリアの下に配置) */
.searchtypeareaR {
  text-align: center;
  width: 100%;
  margin-top: 15px; 
}

/* ボタンのスタイル */
.button {
  background-color: #ea6800;
  color: white;
  border: none;
  padding: 12px 0;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  border-radius: 4px;
  transition: background-color 0.3s;
  width: 100%;
}

.button:hover {
  background-color: #cf5a00;
}

/* 入力欄の共通スタイル */
#nitteiarea input[type="text"],
#nitteiarea select,
#ninzuarea select,
#ryokinarea select {
  padding: 5px;
  border: 1px solid #ccc;
  border-radius: 2px;
}

/* === PC表示用：日付入力グループ（年/月/日）の調整 === */
.date_input_group {
  display: block; 
  text-align: center;
  gap: 0;
}

.date_input_group input[type="text"] {
  flex-grow: 0;
  flex-shrink: 0;
  flex-basis: auto;
  box-sizing: border-box;
  display: inline-block;
  margin: 0 0.5%;
  padding: 5px;
}

.date_input_group .year_input {
  width: 30%;
}

.date_input_group .month_input,
.date_input_group .day_input {
  width: 20%;
}

.date_separator {
  display: inline-block;
  width: 3%;
  text-align: center;
  flex-shrink: 0;
}


/* === 非表示項目 === */
.hidden_options, 
.guests_section, 
#ninzuarea,
.budget_section, 
#ryokinarea,
.display_toggle_section {
  display: none !important;
}

/* === 右カラムのリンクスタイル（中央配置のためのマージンリセット） === */
.search_links {
  list-style: none;
  padding-left: 0;
  margin: 0; /* 🌟 修正: マージンをリセット */
}
.search_links li {
  margin-bottom: 8px;
}
.search_links a {
  display: block;
  color: #007bff;
  text-decoration: underline;
  font-size: 14px;
  padding: 5px 0;
}
.search_links a:hover {
  color: #0056b3;
}


/* ====================================
   5. 右カラムのリンクをボタン風に装飾 (中央寄せ対応)
==================================== */

.search-col.right-col {
    /* Flexboxでアイテムを中央に揃える */
    display: flex;
    flex-direction: column;
    justify-content: center; /* 垂直方向の中央寄せ (コンテンツが複数ある場合) */
    align-items: center;     /* ★★★ 水平方向の中央寄せ ★★★ */
    padding: 10px; /* 必要に応じて内側の余白を確保 */
    width: 100%;
    /* border: 1px solid red; /* 確認用 */
}

/* リンクブロックの親要素 (HTMLでは .searchtypeareaL も持つ) */
.link_block {
    width: 100%;
    max-width: 300px; /* .search_linksと同じ最大幅を設定 */
    /* border: 1px solid blue; /* 確認用 */
}

.search_links {
    list-style: none;
    padding: 0;
    margin: 0 auto; /* ★★★ これにより search_links (ul) が中央に配置されます ★★★ */
    width: 100%; 
    max-width: 300px; 
}

.link_item {
    margin-bottom: 10px;
}

/* 3つのリンクすべてに共通デザインを設定 */
.plan_list_link,
.calendar_link,
.reservation_link {
    /* (デザイン設定は前回と同じ) */
    display: block; 
    width: 100%;
    padding: 12px 20px;
    text-align: center;
    text-decoration: none;
    font-size: 16px;
    font-weight: bold;
    border-radius: 4px;
    transition: background-color 0.3s, color 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); 
    background-color: #f0f0f0; 
    color: #333;
    border: 1px solid #ccc;
}

/* ホバー時の設定 */
.plan_list_link:hover,
.calendar_link:hover,
.reservation_link:hover {
    background-color: #e0e0e0;
    color: #000;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}


/* --- レスポンシブ対応（768px以下で縦積みに戻す） --- */
@media (max-width: 768px) {

  /* Flexboxを縦積みに変更 */
  #frmplanseek {
    display: flex !important;
    flex-direction: column;
    gap: 0;
  }
  
  /* SP表示での順序設定: 日付+ボタン -> リンクの順序を維持 */
  .left-col {
      order: 1; 
  }
  .right-col {
      order: 2; 
  }

  .search-col {
    flex: auto;
    width: 100%;
    padding: 15px;
    border: none;
    border-bottom: 1px dashed #ccc;
    margin-bottom: 0;
    background: transparent;
    justify-content: flex-start;
    gap: 0;
    text-align: center;
  }

  /* モバイルでは左カラムの個別のボーダー/背景を削除 */
  .left-col {
    background: transparent;
    border: none;
  }

  /* モバイルでは内側のエリアに背景とボーダーを適用 */
  #nitteiarea {
    margin-bottom: 15px;
    padding: 10px;
    border: 1px solid #eee;
    background: #fff;
  }

  /* 右カラムのリンク表示エリアにもモバイルスタイルを適用 */
  .searchtypeareaL {
    margin-bottom: 15px;
    padding: 10px;
    border: 1px solid #eee;
    background: #fff;
    /* SPでは中央配置をしないため、Flex設定を解除（上書き） */
    display: block; 
    justify-content: flex-start;
  }

  .search-col:last-child {
    border-bottom: none;
    align-items: center;
    justify-content: center;
    padding-bottom: 0;
  }

  /* 【SP表示用】空室検索の日付入力フィールドの幅調整 */
  .date_input_group {
    display: block; 
    align-items: initial;
    gap: 0;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    text-align: center; 
  }

  .date_input_group .inp_txt {
    flex-grow: 0;
    flex-basis: auto;
    min-width: 0;
    display: inline-block;
    box-sizing: border-box;
    font-size: 14px;
    padding: 8px 3px;
    vertical-align: middle;
  }

  .date_separator {
    display: inline-block;
    vertical-align: middle;
    width: 2%; 
    margin: 0;
    padding: 0;
  }

  .date_input_group .year_input {
    width: calc(35% - 4px); 
    margin: 0 1px;
  }

  .date_input_group .month_input,
  .date_input_group .day_input {
    width: calc(28% - 4px);
    margin: 0 1px;
  }
}

/* ==========================================================================
   空室検索パネル（DYNA IBE 2.0） カスタムスタイル
   ========================================================================== */

/* --- 1. チェックボックスの共通設定（PC・SP共通） --- */
input[type="checkbox"] {
    /* 縦方向の揃えを中央に固定 */
    vertical-align: middle !important;
}

.search-panel-frame input[type="checkbox"] {
    position: relative !important;
    /* 【PC調整】下にズレるのを防ぐため1px上に持ち上げ */
    /* ズレが残る場合は -2px や 0px に調整してください */
    top: -1px !important;
    appearance: checkbox !important;
    margin: 0 6px 0 0 !important;
    padding: 0 !important;
}

/* --- 2. スマートフォン表示用設定（768px以下） --- */
@media (max-width: 768px) {
    
    /* A. 検索パネル全体の中央寄せ */
    .search-panel-frame {
        display: block !important;
        margin: 0 auto !important;
        text-align: center !important;
    }

    /* B. 各項目（宿泊日・人数など）を縦並びにして中央揃え */
    .search-panel-frame .di-search-panel-item {
        margin: 0 auto 15px !important;
        text-align: center !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }

    /* C. 「日程未定」行の横方向中央揃え */
    .search-panel-frame .di-search-panel-date-not-fixed {
        justify-content: center !important;
        display: flex !important;
        width: 100% !important;
    }

    /* D. 【SP調整】スマホでのチェックボックス高さ位置微調整 */
    .search-panel-frame input[type="checkbox"] {
        position: relative !important;
        /* スマホのフォントに合わせて位置を再調整 */
        top: 2px !important; 
    }
}