/* =============================================================
   さくらレンタカー 予約状況カレンダー — スタイルシート
   ============================================================= */

/* ラッパー */
.src-cal-wrap {
  background: #fff;
  border: 1px solid rgba(194, 199, 201, 0.3);
  border-radius: 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  padding: 2rem;
  font-family: 'Noto Sans JP', sans-serif;
  color: #1b1c1c;
}

/* ヘッダー行 */
.src-cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
}

.src-cal-header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* 年月タイトル */
.src-cal-title {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: #1b1c1c;
  margin: 0 !important;
  line-height: 1.2;
}

/* 前月・次月ボタン */
.src-cal-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  align-self: center;
}

.src-cal-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  padding: 0.5rem;
  border-radius: 9999px;
  cursor: pointer;
  color: #424849;
  transition: background 0.15s ease;
  line-height: 0;
}

.src-cal-btn:hover:not(:disabled) {
  background: #f3f4f6;
}

.src-cal-btn:disabled {
  cursor: default;
}

/* 凡例 */
.src-cal-legend {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.75rem;
  color: #1b1c1c;
  flex-wrap: wrap;
}

.src-cal-legend-item {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.src-cal-dot {
  display: inline-block;
  width: 0.75rem;
  height: 0.75rem;
  flex-shrink: 0;
  background: none;
}

/* ◯ 空車あり */
.src-cal-dot--avail {
  border-radius: 9999px;
  border: 2px solid #296863;
}

/* △ 残りわずか（SVG背景で描画・正三角形） */
.src-cal-dot--few {
  width: 0.85rem;
  height: 0.75rem;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='12' viewBox='0 0 14 12' fill='none'%3E%3Cpolygon points='7,1 13,11 1,11' stroke='%23e8854a' stroke-width='1.5' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E") no-repeat center / contain;
}

/* ✕ 満車（SVG背景で描画） */
.src-cal-dot--full {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cline x1='2' y1='2' x2='10' y2='10' stroke='%235a5f60' stroke-width='2' stroke-linecap='round'/%3E%3Cline x1='10' y1='2' x2='2' y2='10' stroke='%235a5f60' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center / contain;
}

/* カレンダーグリッド */
.src-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.5rem;
}

/* 曜日ヘッダー */
.src-cal-weekday {
  padding: 0.5rem 0;
  text-align: center;
  font-size: 0.75rem;
  color: #737879;
}

/* 日付セル */
.src-cal-day-cell {
  position: relative;
  border: 1px solid #f0eded;
  border-radius: 0.5rem;
  padding: 0.5rem;
  min-height: 5rem;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

/* クリック可能なセル */
.src-cal-day-cell--clickable {
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.src-cal-day-cell--clickable:hover {
  border-color: #296863;
  box-shadow: 0 0 0 1px #296863;
}

/* 選択中セル */
.src-cal-day-cell--active {
  border-color: #296863;
  box-shadow: 0 0 0 1px #296863;
}

/* ハイシーズンバッジ */
.src-cal-high-season {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 0.25rem;
  background: #e8854a;
  color: #fff;
  font-size: 0.55rem;
  font-weight: 700;
  line-height: 1;
  z-index: 1;
}

/* 凡例：ハイシーズン */
.src-cal-dot--high {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 0.2rem;
  background: #e8854a;
  color: #fff;
  font-size: 0.5rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* ステータスアイコン */
.src-cal-status-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.src-cal-status-icon {
  display: block;
}

/* スマホ対応 */
@media (max-width: 768px) {
  .src-cal-wrap {
    padding: 1.5rem 1rem;
  }
  .src-cal-header {
    margin-bottom: 1.5rem;
  }
  .src-cal-header-left {
    gap: 0.75rem;
    flex-wrap: nowrap;
  }
  .src-cal-title {
  font-family: 'Noto Sans JP', sans-serif;
    font-size: 1.25rem;
  }
  .src-cal-nav {
    flex-shrink: 0;
  }
  .src-cal-btn {
    padding: 0.4rem;
  }
  .src-cal-status-wrap {
    position: static;
    inset: auto;
    flex: 1;
  }

  .src-cal-status-icon {
    width: 16px;
    height: 16px;
  }

  .src-cal-high-season {
    width: 0.85rem;
    height: 0.85rem;
    font-size: 0.45rem;
    top: 0.15rem;
    right: 0.15rem;
  }
}

/* ===== モーダル ===== */

/* オーバーレイ */
.src-cal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0);
  backdrop-filter: blur(0);
  -webkit-backdrop-filter: blur(0);
  transition: background 0.25s ease, backdrop-filter 0.25s ease, -webkit-backdrop-filter 0.25s ease;
  padding: 1rem;
}

.src-cal-overlay--visible {
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* モーダル本体 */
.src-cal-modal {
  position: relative;
  background: #fff;
  border-radius: 1rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  padding: 2rem;
  width: 100%;
  max-width: 420px;
  max-height: 85vh;
  overflow-y: auto;
  font-family: 'Noto Sans JP', sans-serif;
  animation: srcCalModalIn 0.25s ease;
}

@keyframes srcCalModalIn {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* 閉じるボタン */
.src-cal-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: none;
  border-radius: 9999px;
  background: none;
  color: #737879;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.src-cal-modal-close:hover {
  background: #f3f4f6;
  color: #1b1c1c;
}

/* 日付ヘッダー */
.src-cal-modal-date {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1b1c1c;
  margin-bottom: 1.25rem;
  padding-right: 2rem;
}

/* セクションタイトル */
.src-cal-modal-section {
  font-size: 0.85rem;
  font-weight: 500;
  color: #424849;
  margin-bottom: 0.75rem;
}

/* 車両リスト */
.src-cal-modal-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.src-cal-modal-vehicle {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 0.875rem 1rem;
  border: 1px solid #f0eded;
  border-radius: 0.5rem;
  background: rgba(41, 104, 99, 0.02);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.src-cal-modal-vehicle:hover:not(:disabled) {
  border-color: #296863;
  box-shadow: 0 0 0 1px #296863;
}

/* 予約不可車両（グレーアウト） */
.src-cal-modal-vehicle--disabled {
  background: #f5f5f5;
  border-color: #e8e8e8;
  cursor: default;
  opacity: 0.55;
}

.src-cal-modal-vehicle--disabled .src-cal-modal-vehicle-name,
.src-cal-modal-vehicle--disabled .src-cal-modal-vehicle-desc {
  color: #a0a5a7;
}

.src-cal-modal-vehicle-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: #1b1c1c;
}

.src-cal-modal-vehicle-desc {
  font-size: 0.7rem;
  color: #737879;
  margin-left: 0.75rem;
}

.src-cal-modal-arrow {
  margin-left: auto;
  color: #c2c7c9;
  display: inline-flex;
  transition: color 0.15s ease;
}

.src-cal-modal-vehicle:hover:not(:disabled) .src-cal-modal-arrow {
  color: #296863;
}

/* 予約不可バッジ */
.src-cal-modal-vehicle-badge {
  margin-left: auto;
  font-size: 0.65rem;
  color: #a0a5a7;
  font-weight: 500;
  white-space: nowrap;
}

/* ===== スマホ対応 ===== */
@media (max-width: 768px) {
  .src-cal-modal {
    padding: 1.5rem;
    max-width: 100%;
    border-radius: 0.75rem;
  }

  .src-cal-modal-date {
    font-size: 1.1rem;
  }

  .src-cal-modal-vehicle {
    flex-wrap: wrap;
    gap: 0.125rem;
    padding: 0.75rem;
  }

  .src-cal-modal-vehicle-desc {
    margin-left: 0;
    width: 100%;
    order: 3;
  }

  .src-cal-modal-arrow,
  .src-cal-modal-vehicle-badge {
    order: 2;
  }
}
