/* ============================================
   カスタムカレンダーピッカー
   来店予約フォーム用 — 水曜・木曜は選択不可
   大きめUIで操作しやすく
   ============================================ */

/* ─── 選択表示ボックス ─── */
.cal-display {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border: 2px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: #fff;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-size: 1.05rem;
  color: var(--text-dark);
  -webkit-tap-highlight-color: transparent;
  min-height: 56px;
}

.cal-display i {
  color: var(--primary-green);
  font-size: 1.35rem;
}

.cal-display:hover {
  border-color: var(--primary-green-light);
  box-shadow: 0 2px 8px rgba(140,198,63,0.12);
}

.cal-display.has-value .cal-display-text {
  font-weight: 600;
}

.cal-display-text {
  flex: 1;
  color: var(--text-light);
}

.cal-display.has-value .cal-display-text {
  color: var(--text-dark);
}

/* エラー時 */
.form-group.error .cal-display {
  border-color: #e74c3c;
}

/* ─── ドロップダウンカレンダー ─── */
.cal-dropdown {
  position: fixed;
  z-index: 9000;
  display: none;
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 16px 56px rgba(0,0,0,0.2), 0 4px 12px rgba(0,0,0,0.08);
  width: 400px;
  max-width: calc(100vw - 20px);
  padding: 24px;
  animation: calDropIn 0.2s ease;
}

.cal-dropdown.open {
  display: block;
}

@keyframes calDropIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─── カレンダーヘッダー（月ナビ） ─── */
.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.cal-header-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-dark);
  letter-spacing: 0.02em;
}

.cal-nav-btn {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: var(--bg-soft);
  border-radius: 14px;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--text-medium);
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.cal-nav-btn:hover {
  background: var(--primary-green-bg);
  color: var(--primary-green);
}

.cal-nav-btn:active {
  transform: scale(0.92);
}

/* ─── 曜日ヘッダー ─── */
.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 8px;
}

.cal-weekday {
  text-align: center;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-light);
  padding: 6px 0;
}

.cal-weekday.sun { color: #e74c3c; }
.cal-weekday.sat { color: #3498db; }

/* ─── 日付グリッド ─── */
.cal-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cal-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  border-radius: 14px;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-dark);
  cursor: pointer;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
  font-family: 'Montserrat', var(--font-ja);
  min-width: 42px;
  min-height: 42px;
}

.cal-day:hover:not(.disabled):not(.empty) {
  background: var(--primary-green-bg);
  color: var(--primary-green);
  transform: scale(1.08);
}

.cal-day.today {
  border: 2.5px solid var(--primary-green);
  font-weight: 800;
}

.cal-day.selected {
  background: var(--primary-green);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(140,198,63,0.3);
}

.cal-day.selected:hover {
  background: var(--primary-green-dark);
  color: #fff;
}

/* 選択不可（水曜・木曜 / 過去日） */
.cal-day.disabled {
  color: #d0d0d0;
  cursor: not-allowed;
  position: relative;
}

.cal-day.disabled::after {
  content: '';
  position: absolute;
  width: 60%;
  height: 1.5px;
  background: #d0d0d0;
  top: 50%;
  left: 20%;
  transform: rotate(-12deg);
}

/* 日曜 */
.cal-day.sun:not(.disabled):not(.empty) { color: #e74c3c; }
.cal-day.sun.selected { background: #e74c3c; color: #fff; }

/* 土曜 */
.cal-day.sat:not(.disabled):not(.empty) { color: #3498db; }
.cal-day.sat.selected { background: #3498db; color: #fff; }

/* 空セル */
.cal-day.empty {
  cursor: default;
}

/* ─── カレンダー下部の凡例 ─── */
.cal-legend {
  display: flex;
  gap: 16px;
  margin-top: 16px;
  font-size: 0.75rem;
  color: var(--text-light);
  justify-content: center;
  font-weight: 500;
}

.cal-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cal-legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 5px;
}

.cal-legend-dot.closed {
  background: #eee;
  position: relative;
}

.cal-legend-dot.closed::after {
  content: '';
  position: absolute;
  width: 70%;
  height: 1.5px;
  background: #ccc;
  top: 50%;
  left: 15%;
  transform: rotate(-12deg);
}

.cal-legend-dot.today-dot {
  border: 2.5px solid var(--primary-green);
  background: #fff;
}

/* ─── 定休日バッジ ─── */
.cal-closed-note {
  text-align: center;
  margin-top: 12px;
  font-size: 0.72rem;
  color: var(--text-light);
  background: #fef4e5;
  border: 1px solid #fde3b1;
  border-radius: 8px;
  padding: 6px 10px;
}

.cal-closed-note i {
  color: #f0a830;
  margin-right: 4px;
}
