/* ============================================================
   booking-calendar.css
   予約バー タブUI + カレンダーウィジェット スタイル
   ============================================================ */

/* ---------- タブUI ---------- */
.booking-tabs-wrap {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -70%);
  white-space: nowrap;
}
.booking-tabs {
  display: inline-flex;
  background: #E6E7E8;
  border-radius: 100px;
  padding: 3px;
}
.booking-tab {
  padding: .38em 1.4em;
  border: none;
  border-radius: 100px;
  background: transparent;
  cursor: pointer;
  font-size: .8em;
  color: #777;
  transition: background .2s, color .2s, box-shadow .2s;
  white-space: nowrap;
  letter-spacing: .03em;
}
.booking-tab.is-active {
  background: #fff;
  color: #1e3c72;
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .18);
}
.booking-tab:hover:not(.is-active) {
  color: #444;
}
.booking-panel.is-hidden {
  display: none;
}

/* ---------- ウィジェット ベース ---------- */
.searchCalWidget * { margin: 0; padding: 0; color: #474747; text-decoration: none; box-sizing: border-box; }
.searchCalWidget select { padding: .25em 1em; font-size: 16px; outline: none; border: 1px solid #999; border-radius: 3px; -webkit-appearance: none; -moz-appearance: none; appearance: none; cursor: pointer; }
.searchCalWidget select::-ms-expand { display: none; }

/* ---------- 2カラムレイアウト（CSS Grid） ---------- */
.searchCalLayout { display: grid; grid-template-columns: 1fr 2fr; grid-template-rows: auto auto; gap: 2em; }
.searchCalLeft   { grid-column: 1; grid-row: 1; min-width: 0; }
.searchCalRight  { grid-column: 2; grid-row: 1 / 3; min-width: 0; }
.searchCalNote   { grid-column: 1; grid-row: 2; align-self: end; }
@media (max-width: 768px) {
  .searchCalLayout { grid-template-columns: 1fr; grid-template-rows: auto; }
  .searchCalLeft   { grid-column: 1; grid-row: 1; }
  .searchCalRight  { grid-column: 1; grid-row: 2; }
  .searchCalNote   { grid-column: 1; grid-row: 3; }
}

/* ---------- 左カラム：条件入力 ---------- */
.searchCalLabel { font-size: clamp(0.65em, 2vw, 0.75em); font-weight: 600; color: #555; letter-spacing: .05em; margin: 0 0 .5em; }
.searchCalElement > ul { list-style: none; margin: 0 0 1em; display: flex; flex-direction: column; gap: 0; }
.searchCalElement > ul > li { width: 100%; border-bottom: 1px solid #e8e8e8; }
.searchCalElement > ul > li:first-child { border-top: 1px solid #e8e8e8; }
.searchCalElement > ul > li.searchCalChild1 { border-bottom: none; }
.searchCalElement > ul > li.searchCalChild1 dl { padding-bottom: 0; }
.searchCalElement > ul > li dl { display: flex; align-items: center; flex-wrap: wrap; padding: .5em 0; }
.searchCalElement > ul > li dl dt { font-size: 14px; }
.searchCalElement > ul > li dl dt span { margin-left: .25em; font-size: 11px; }
.searchCalElement > ul > li dl dd { margin-left: auto; }
/* ネスト li が生成される場合のフォールバック */
.searchCalElement > ul > li li { list-style: none; margin: 0; }
.searchCalElement > ul > li li dl { padding: .8em .5em; }

.searchCalButton { padding: 0; display: flex; align-items: center; justify-content: center; }
.searchCalButton input { padding: .4em 2em; font-size: 14px; font-weight: 700; color: #fff; background: #8b4513; border: none; border-radius: 4px; cursor: pointer; }

#searchCalFrom.is-calendar-loading .searchCalElement,
#searchCalFrom.is-calendar-loading .searchCalButton,
#searchCalFrom.is-calendar-loading .searchCalSelect {
  pointer-events: none;
}

#searchCalFrom.is-calendar-loading .searchCalElement,
#searchCalFrom.is-calendar-loading .searchCalButton,
#searchCalFrom.is-calendar-loading .searchCalSelectBox {
  opacity: .65;
}

#searchCalFrom.is-calendar-maintenance .searchCalLeft,
#searchCalFrom.is-calendar-maintenance .searchCalSelectBox,
#searchCalFrom.is-calendar-maintenance .searchCalNote {
  display: none;
}

#searchCalFrom.is-calendar-maintenance .searchCalLayout {
  grid-template-columns: 1fr;
  grid-template-rows: auto;
}

#searchCalFrom.is-calendar-maintenance .searchCalRight {
  grid-column: 1;
  grid-row: 1;
}

.searchCalAdult dt > span   { color: #666; margin-left: 1em; }
.searchCalChildren          { font-size: 14px; }
.searchCalChildren dt > span { color: #666; margin-left: 1em; }
.searchCalChildren dd > span { margin: 0 2px; }

/* form-group に合わせたスタイル上書き */
.searchCalLeft dl    { display: flex; align-items: center; gap: .5em; }
.searchCalLeft dl dt { font-size: clamp(0.6em, 2vw, 0.7em); font-weight: 400; color: #333; white-space: nowrap; }
.searchCalLeft dl dd { margin-left: auto; }
.searchCalLeft select {
  padding: 8px 24px 8px 10px;
  border: 1px solid #cccccc;
  font-size: clamp(0.8em, 2.5vw, 0.85em);
  height: 40px;
  border-radius: 6px;
  background: #fff url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e") no-repeat right 8px center / 12px;
  color: #333;
  box-shadow: none;
  outline: none;
  width: 100%;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}
.searchCalLeft select:focus { border-color: #1e3c72; box-shadow: 0 0 0 2px #1A2A4A33; outline: none; }

/* ---------- 月ナビ ---------- */
.searchCalSelectBox { padding: 0 0 .5em; }
.searchCalSelect { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: .2em 0; }
.searchCalSelect p { flex: 1; text-align: center; margin: 0; }
.searchCalSelect > button { padding: 5px; display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; border: 1px solid #999; border-radius: 3px; background: transparent; cursor: pointer; flex-shrink: 0; }
.searchCalSelect > button:disabled { opacity: .5; }
.searchCalSelect > button svg { width: 16px; height: 16px; fill: #666; pointer-events: none; }

/* ---------- 凡例 ---------- */
.searchCalNote { display: flex; flex-direction: column; gap: .5em; padding: .75em 1em; border: 1px solid #ddd; border-radius: 4px; font-size: clamp(0.6em, 2vw, 0.7em); }
.searchCalNote ol { list-style: none; display: flex; flex-direction: column; gap: .35em; }
.searchCalNote li { line-height: 1.4; display: flex; align-items: center; }
.searchCalNote li svg { margin-right: 5px; width: 1.1em; height: 1.1em; fill: #474747; flex-shrink: 0; }
.searchCalNote p { color: #666; line-height: 1.5; }
@media (max-width: 768px) {
  .searchCalNote     { flex-direction: row; flex-wrap: wrap; gap: .25em 1em; padding: .5em .75em; }
  .searchCalNote ol  { flex-direction: row; flex-wrap: wrap; gap: .25em .75em; }
  .searchCalNote p   { width: 100%; }
}

/* ---------- スケルトンローダー ---------- */
@keyframes cal-shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position:  600px 0; }
}
#cal-skeleton { width: 100%; }
.cal-sk-days { display: flex; margin-bottom: 2px; }
.cal-sk-days span { flex: 1; text-align: center; font-size: 11px; padding: .25em; background: #eee; color: #aaa; }
.cal-sk-days span:first-child { color: #ffaaaa; }
.cal-sk-days span:last-child  { color: #aac4ff; }
.cal-sk-grid { display: flex; flex-wrap: wrap; border: solid #ddd; border-width: 1px 0 0 1px; }
.cal-sk-cell {
  width: 14.28571%; min-height: 70px; border: solid #ddd; border-width: 0 1px 1px 0;
  background: linear-gradient(90deg, #f0f0f0 25%, #e4e4e4 50%, #f0f0f0 75%);
  background-size: 1200px 100%; animation: cal-shimmer 1.6s infinite linear;
}
.cal-sk-cell:nth-child(7n+1) {
  background: linear-gradient(90deg, #fdf0f0 25%, #f5e4e4 50%, #fdf0f0 75%);
  background-size: 1200px 100%; animation: cal-shimmer 1.6s infinite linear;
}
.cal-sk-cell:nth-child(7n) {
  background: linear-gradient(90deg, #f0f0fd 25%, #e4e4f5 50%, #f0f0fd 75%);
  background-size: 1200px 100%; animation: cal-shimmer 1.6s infinite linear;
}

/* ---------- 条件変更案内 ---------- */
#cal-stale-notice,
#cal-error-notice,
#cal-maintenance-notice {
  position: absolute; inset: 0;
  background: rgba(255,255,255,.82);
  display: flex; align-items: center; justify-content: center;
  z-index: 5;
  font-size: clamp(0.75em, 2vw, 0.85em);
  color: #1e3c72;
  font-weight: 600;
  text-align: center;
  padding: 1em;
  line-height: 1.6;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
#cal-error-notice {
  background: rgba(255,248,248,.92);
  color: #8a2d2d;
}
#cal-maintenance-notice {
  background: rgba(250, 248, 244, .96);
  color: #6b4c2f;
  text-decoration: none;
  cursor: default;
  position: static;
  min-height: 180px;
  border: 1px solid #e7ddd0;
  border-radius: 8px;
  padding: 2em 1.5em;
}

/* ---------- 月移動ローディング ---------- */
#searchCal { position: relative; }
#searchCal > dl > dt { display: none; }
#cal-nav-loading { position: absolute; inset: 0; background: rgba(255,255,255,.65); display: flex; align-items: center; justify-content: center; z-index: 5; }
@keyframes cal-spin { to { transform: rotate(360deg); } }
.cal-nav-spinner { width: 32px; height: 32px; border: 3px solid #ddd; border-top-color: #1e3c72; border-radius: 50%; animation: cal-spin .7s linear infinite; }

/* ---------- カレンダーグリッド ---------- */
#searchCal > dl > dd ul { list-style: none; display: flex; }
#searchCal > dl > dd ul li { padding: .25em; font-size: 11px; text-align: center; background: #eee; flex: 1; }
#searchCal > dl > dd ul li:first-child { color: #ff4d4d; }
#searchCal > dl > dd ul li:last-child  { color: #006dd9; }
#searchCal > dl > dd ol { list-style: none; display: flex; flex-wrap: wrap; border: solid #ddd; border-width: 1px 0 0 1px; }
#searchCal > dl > dd ol li { width: 14.28571%; min-height: 70px; position: relative; border: solid #ddd; border-width: 0 1px 1px 0; }
#searchCal > dl > dd ol li dl { padding-bottom: 1.25em; }
#searchCal > dl > dd ol li dt { padding-top: .25em; font-size: 18px; font-weight: 700; text-align: center; }
#searchCal > dl > dd ol li:nth-child(7n) dt    { color: #006dd9; }
#searchCal > dl > dd ol li:nth-child(7n-6) dt  { color: #ff4d4d; }
#searchCal > dl > dd ol li.none dl { opacity: .25; cursor: not-allowed; }
#searchCal > dl > dd ol li dl dd { padding: .25em 0; display: flex; justify-content: center; }
#searchCal > dl > dd ol li dl dd svg { width: 20px; height: 20px; fill: #474747; }
#searchCal > dl > dd ol li dd p { font-size: 10px; font-weight: 700; text-align: center; text-indent: -.4em; width: 100%; position: absolute; bottom: 5px; left: 0; }
@media screen and (max-width: 640px) {
  .searchCalElement > ul > li li dl dt      { font-size: 12px; }
  .searchCalElement > ul > li li dl dt span { font-size: 10px; }
  /* アイコンと価格を縦積みにして重なりを解消 */
  #searchCal > dl > dd ol li dl            { padding-bottom: 0; }
  #searchCal > dl > dd ol li dl dd        { flex-direction: column; align-items: center; gap: 2px; padding: .15em 0; }
  #searchCal > dl > dd ol li dl dd svg    { width: 13px; height: 13px; }
  #searchCal > dl > dd ol li dd p         { position: static; font-size: 8px; transform: none; text-indent: 0; text-align: center; width: 100%; }
}
