/* reservation/static/reservation/css/space_detail.css */

/* 共通セクション */
.detail-section {
  border-radius: 0.9rem;
  border: 1px solid rgba(148, 163, 184, 0.2);
  padding: 0.9rem 1rem;
  background-color: #ffffff;
}

.section-header h6 {
  font-size: 0.9rem;
}

/* 写真スライダー */
.photo-viewer {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.photo-main-wrapper {
  position: relative;
  border-radius: 0.8rem;
  overflow: hidden;
  background: #0f172a;
}

/* 写真枠：比率固定（モバイルに合わせる） */
.photo-main-wrapper {
  position: relative;
  border-radius: 0.8rem;
  overflow: hidden;
  background: #0f172a;

  /* ★ここが肝：比率を固定（まずは 4:3 推奨） */
  aspect-ratio: 4 / 3;
}

/* 写真：枠にぴったりフィット */
.photo-main {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* placeholderも枠に合わせる */
.photo-main.placeholder {
  height: 100%;
  min-height: 0;
}

.photo-main.placeholder {
  height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top left, #f8fafc, #e2e8f0);
}

.photo-main.placeholder .placeholder-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  color: #64748b;
}

.photo-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background-color: rgba(15, 23, 42, 0.55);
  color: #f9fafb;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.photo-nav.prev {
  left: 0.5rem;
}

.photo-nav.next {
  right: 0.5rem;
}

.photo-thumbs {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  padding-bottom: 0.2rem;
}

.photo-thumb-btn {
  border: none;
  padding: 0;
  background: transparent;
  border-radius: 0.5rem;
  overflow: hidden;
  flex: 0 0 56px;
  height: 56px;
  border: 2px solid transparent;
}

.photo-thumb-btn.active {
  border-color: rgba(79, 70, 229, 0.8);
}

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

/* 利用状況テーブル */
.availability-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.legend-box {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  display: inline-block;
}

.legend-available {
  background-color: #ffffff;
  border: 1px solid #E6E8EB;
}

.legend-unavailable {
  background-color: #E6E8EB;
}

/* スクロール可能なタイムスロットテーブル */
.availability-table-wrapper {
  width: 100%;
  overflow-x: auto;
}

.availability-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 520px;
}

.availability-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background-color: #f8fafc;
  font-size: 0.7rem;
  padding: 0.35rem 0.35rem;
  text-align: center;
  white-space: nowrap;
}

.availability-table tbody td,
.availability-table tbody th {
  padding: 0.2rem 0.2rem;
}

.room-col {
  text-align: left;
  min-width: 150px;
}

.time-col {
  min-width: 52px;
}

/* スロットセル */
.slot {
  width: 100%;
  height: 18px;
  border-radius: 4px;
}

.slot-available {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
}

.slot-unavailable {
  background-color: #E6E8EB;
}

/* ルームリンク */
.room-link {
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
}

.room-link:hover {
  text-decoration: underline;
}

/* 横スクロールバーがコンテンツに被らないように余白を確保 */
.ts-table-wrapper {
  padding-bottom: 20px;              /* ← ここが効く（スクロールバー分の下余白） */
  scrollbar-gutter: stable both-edges; /* 対応ブラウザならガタつき防止 */
}

/* 左列（ルーム列）を見やすくする：背景と余白 */
.ts-room-col {
  padding-bottom: 0.4rem; /* 行の下に少し余白。スクロールバーと視覚的に分離 */
}

/* ルーム名リンクを「押せる」見た目に*/
/*
.ts-room-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(13, 110, 253, 0.35);
  background: rgba(13, 110, 253, 0.06);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.82rem;
}*/

/* 右矢印を付ける（視覚的に「遷移する」ことが一目で分かる） */
.ts-room-link::after {
  content: "›";
  font-size: 1rem;
  line-height: 1;
  opacity: 0.75;
}

/* hover / focus で明確に */
.ts-room-link:hover {
  background: rgba(13, 110, 253, 0.12);
  border-color: rgba(13, 110, 253, 0.6);
}

.ts-room-link:focus-visible {
  outline: 3px solid rgba(13, 110, 253, 0.35);
  outline-offset: 2px;
}

/* ===============================
   Date picker: < [date] > unified (space_detail)
   =============================== */
.rr-date-group{
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 0.85rem;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(15,23,42,0.06);
}

.rr-date-group--sm{
  grid-template-columns: 36px 1fr 36px;
}

.rr-date-btn{
  height: 36px;
  border: 0;
  background: rgba(248,250,252,0.9);
  color: #0f172a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 120ms ease, opacity 120ms ease;
}

.rr-date-btn:hover{ background: rgba(13,110,253,0.08); }
.rr-date-btn:active{ background: rgba(13,110,253,0.14); }

.rr-date-btn:disabled{
  opacity: 0.45;
  cursor: not-allowed;
  background: rgba(248,250,252,0.7);
}

.rr-date-input{
  height: 36px;
  border: 0;
  padding: 0 0.6rem;
  font-size: 0.82rem;
  background: transparent;
  color: #0f172a;
}

.rr-date-input:focus{ outline: none; }

.rr-date-group:focus-within{
  border-color: rgba(13,110,253,0.55);
  box-shadow: 0 0 0 4px rgba(13,110,253,0.14);
}

/* Space description structured blocks */
.room-spec {
  border-radius: 0.9rem;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(248, 250, 252, 0.7);
  padding: 0.9rem 1rem;
}

.room-spec-header {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 0.65rem;
  color: #0f172a;
}

.room-spec-header i {
  width: 1.35rem;
  height: 1.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(31, 58, 95, 0.08);
  color: #1f3a5f;
  font-size: 0.85rem;
}

.spec-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.18rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(255, 255, 255, 0.95);
  color: #334155;
}

.map-embed-wrap {
  width: 100%;
  border-radius: 0.75rem;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: #fff;
}

.map-embed-wrap iframe {
  width: 100%;
  height: 260px;
  border: 0;
  display: block;
}

#booking-section {
  scroll-margin-top: 84px;
}

.space-mobile-cta {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1040;
  padding: 0.55rem 0.75rem calc(0.55rem + env(safe-area-inset-bottom));
  background: linear-gradient(
    to top,
    rgba(255, 255, 255, 0.98) 70%,
    rgba(255, 255, 255, 0)
  );
  border-top: 0;
  transition: opacity 160ms ease, transform 160ms ease;
}

.space-mobile-cta .btn {
  min-height: 46px;
  font-weight: 700;
}

.space-mobile-cta.is-hidden {
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
}

.space-mobile-cta-spacer {
  height: 84px;
}

@media (min-width: 992px) {
  .space-mobile-cta,
  .space-mobile-cta-spacer {
    display: none;
  }
}
