.calendar-header {
  margin: 0 0 10px;
}

/* フォームのスタイリング */
#calendarSearch {
  max-width: 800px;
  /* margin: 30px auto; */
  margin: 0 auto;
  padding: 20px;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.72);
  border-radius: 10px;

  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
}

#calendarSearch .cs-date,
#calendarSearch .cs-number {
  width: 49%;
  display: flex;
  align-items: center;
  border: 2px solid #ccc;
  border-radius: 6px;
  background: #f5f1ed;
  font-weight: bold;
}

#calendarSearch .cs-date label,
#calendarSearch .cs-number label {
  width: 40%;
  text-align: center;
  font-size: 12px;
}
#calendarSearch .cs-date input,
#calendarSearch .cs-number button {
  width: 60%;
  text-align: center;
  background: #fff;
  padding: 8px 0;
  border: none;
  font-size: 14px;
  cursor: pointer;
}
#calendarSearch .cs-number button {
  position: relative;
}

#calendarSearch .cs-number button::after {
  content: "";
  display: inline-block;
  border-style: solid;
  border-width: 6px 0 6px 6px;
  border-color: transparent transparent transparent #ccc;
  display: inline-block;
  width: 0;
  height: 0;
  position: absolute;
  top: 50%;
  right: 20px;
  transform: translateY(-50%) rotate(90deg);
}

#calendarSearch .cs-btn {
  width: 100%;
  margin: 10px auto 0;
}
#calendarSearch .cs-btn button {
  width: 100%;
  display: block;
  background: #ed9c00;
  border: none;
  border-radius: 6px;
  padding: 10px 0;
  color: #fff;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
}

/* #calendarSearch label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
}

#calendarSearch input,
#calendarSearch select {
  width: calc(100% - 20px);
  padding: 10px;
  margin-bottom: 20px;
  border: 1px solid #ddd;
  border-radius: 4px;
  box-sizing: border-box;
}

#calendarSearch button {
  width: 100%;
  padding: 10px;
  background-color: #5cb85c;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

#calendarSearch button:hover {
  background-color: #4cae4c;
} */

#bgCalendarSearch,
#bgPopup {
  display: none;
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.6);
  opacity: 0;
  z-index: 1000;
}
.searchBox #bgPopup {
  background-color: rgba(0, 0, 0, 0.1);
}
#bgCalendarSearch.show,
#bgPopup.show {
  display: block;
  animation: fadeIn 0.6s forwards;
}
@keyframes fadeIn {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

#framePopup {
  display: inline-block;
  font-size: 14px;
}

#frameCalendarSearch {
  position: absolute;
  top: 224px;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: white;
  padding: 0;
  border-radius: 10px;
  width: 96%;
  max-width: 800px;
}
#frameCalendarSearch #calendarSearch {
  padding: 0 4%;
  margin: 0 auto 20px;
}
.calendarSearchTitle {
  width: 100%;
  background: #eee;
  display: flex;
  justify-content: center;
  position: relative;
  padding: 10px 0;
  margin-bottom: 20px;
  border-radius: 10px 10px 0 0;
}
.calendarSearchTitle p {
  font-size: 16px;
  font-weight: bold;
}
.peoplePopupTitle {
  display: flex;
  justify-content: center;
  position: relative;
}

#closeBtnTop,
.calendarSearchTitle #closeBtn,
.peoplePopupTitle #closeBtn {
  background: none;
  border: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  position: absolute;
  top: 4px;
  right: 4px;
}
#closeBtnTop {
  top: 8px;
  right: 8px;
}
.peoplePopupTitle #closeBtn {
  top: -16px;
  right: -16px;
  padding: 0;
  margin: 0;
}
.peoplePopupTitle #closeBtn:hover {
  background: none;
}
#closeBtnTop::before,
#closeBtnTop::after,
.calendarSearchTitle #closeBtn::before,
.calendarSearchTitle #closeBtn::after,
.peoplePopupTitle #closeBtn::before,
.peoplePopupTitle #closeBtn::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4px;
  height: 20px;
  background: #aaa;
}
#closeBtnTop::before,
.calendarSearchTitle #closeBtn::before,
.peoplePopupTitle #closeBtn::before {
  transform: translate(-50%, -50%) rotate(45deg);
}
#closeBtnTop::after,
.calendarSearchTitle #closeBtn::after,
.peoplePopupTitle #closeBtn::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.calendarSearchText {
  width: 92%;
  margin: 20px auto 0;
  text-align: center;
  font-size: 14px;
  color: #999;
}

/* カレンダーのスタイリング */
/* #calendarPopup {
  position: absolute;
  left: 50%;
  width: 50%;
  transform: translateX(-50%);
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  padding: 10px;
} */

#calendarPopup {
  width: 96%;
  max-width: 800px;
  text-align: center;
  position: absolute;
  top: 440px;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: #fefefe;
  padding: 20px 10px;
}

.calendar {
  margin-bottom: 20px;
}

.calendar table {
  width: 100%;
  min-height: 340px;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid #ccc;
  border-radius: 10px;
  overflow: hidden;
}

.calendar th {
  background-color: #f7f7f7;
  vertical-align: middle;
  border-bottom: 1px solid #ccc;
  text-align: center !important;
  padding: 4px 0 !important;
  width: auto !important;
}
.calendar .sunday {
  color: #e17f7e;
  background-color: #f8e4e2;
}
.calendar .saturday {
  color: #7ab6f3;
  background-color: #e7f6fd;
}

.calendar td {
  text-align: center;
  vertical-align: middle;
  padding: 10px 0;
  /* border-spacing: 10px; */
  cursor: pointer;
}

#calendar_usages {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.return_date span,
.return_date-i {
  background-color: #fba8bc;
}
.delivery_date span,
.delivery_date-i {
  background-color: #6ad7db;
}
.rental_period span,
.rental_period-i {
  background-color: #f1eeab;
}
.unavailable_date,
.unavailable_date-i {
  background-color: #ddd;
  cursor: pointer;
}

.calendar td.unavailable_date {
  color: #ccc;
}

.calendar td:hover:not(.unavailable_date) {
  background-color: #eaeaea;
  padding: 0;
}

td.return_date,
td.delivery_date,
td.rental_period {
  padding: 0;
}

.return_date span,
.delivery_date span,
.rental_period span {
  width: 92%;
  display: block;
  margin: 0 auto;
  padding: 10px 0;
  border-radius: 10px;
}
#calendar_usages div {
  width: 22%;
  text-align: center;
  padding: 10px;
  border-radius: 10px;
}

/* 月変更ボタンのスタイリング */
.calendar-navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 10px auto;
}
.calendar-navigation button {
  padding: 5px 10px;
  background-color: #ddd;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.calendar-navigation button:hover {
  background-color: #ccc;
}

/* 人数選択ポップアップのスタイリング */
/* #peoplePopup {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  top: 20%;
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  padding: 10px;
  z-index: 1000;
  display: none;
  width: auto;
} */

#peoplePopup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  padding: 20px;
  z-index: 1000;
  display: none;
  width: 92%;
  max-width: 320px;
}

#peoplePopup button {
  padding: 10px 20px;
  margin-top: 5px;
  background-color: #5cb85c;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  display: block; /* ブロックレベルで表示 */
  width: 100%; /* ボタンの幅をポップアップ幅に合わせる */
}

.peoplePopup button:hover,
#peoplePopup button:hover {
  background-color: #4cae4c;
}

/* 日曜日のヘッダースタイル */
.calendar th.sunday {
  color: red;
}

/* 土曜日のヘッダースタイル */
.calendar th.saturday {
  color: blue;
}

#closeButton {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  color: #fff;
  position: absolute;
  left: 50%;
  transform: translate(-50%, 50%);
}
/* #closeButton.calendarPopupCloseButton {
  bottom: 16%;
}
#closeButton.peoplePopupCloseButton {
  bottom: 36%;
} */

.searchBox #closeBtnTop {
  display: none;
}

#selectBtn {
  width: 50%;
  margin: 0 auto;
  padding: 12px 0;
  border: none;
  background: #2ba8b7;
  border-radius: 16px;
  color: #fff;
  font-weight: bold;
}
#selectBtn:disabled {
  background: #efefef;
}

/* 検索ページ 追加分　*/
.searchResult {
  display: none;
  margin-bottom: 20px;
}
.searchResult span {
  font-weight: bold;
}
.searchBox {
  width: 64%;
  margin: 30px auto 0;
  text-align: center;
}

.searchKeyword {
  display: flex;
  justify-content: center;
  border: 1px solid #aaa;
  border-radius: 16px;
  overflow: hidden;
}

.searchKeyword input {
  border: none;
  font-size: 14px;
}

.searchKeyword button {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 50px;
  height: 45px;
  border: none;
  /* background-color: transparent; */
  cursor: pointer;
}

.searchKeyword button::after {
  content: "";
  width: 24px;
  height: 24px;
  background-image: url("https://campre.itembox.design/item/images/icon-search.svg");
  background-repeat: no-repeat;
}

.searchOption,
.searchCategory {
  display: flex;
  align-items: center;
  font-size: 14px;
  font-weight: bold;
  border-bottom: 1px solid #aaa;
  padding: 8px;
  margin-bottom: 10px;
}

.searchCategory select {
  -webkit-appearance: none;
  appearance: none;
  border: none;
  min-height: auto;
  cursor: pointer;
  background: initial;
}

.searchCategory .selectBox {
  position: relative;
  margin-left: auto;
  width: 50%;
}

.searchCategory .selectBox::after {
  content: "";
  position: absolute;
  top: 6px;
  right: 16px;
  width: 12px;
  height: 12px;
  border-right: 2px solid #aaa;
  border-bottom: 2px solid #aaa;
  transform: rotate(45deg);
}

.searchOption label {
  margin-right: 20px;
}

.searchOption label input[type="checkbox"] {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;

  position: relative;
  cursor: pointer;
  width: 20px;
  height: 20px;
  margin-top: -1px;
  margin-left: 10px;
  border-radius: 6px;
  border: 2px solid #aaa;
  vertical-align: middle;
}

.searchOption label input[type="checkbox"]:checked {
  background: #2374ff;
  border: none;
}

.searchOption label input[type="checkbox"]:checked:before {
  position: absolute;
  content: "";
  top: 4px;
  left: 7px;
  transform: rotate(50deg);
  width: 6px;
  height: 10px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
}

.searchBoxBtn,
#selectCalendar {
  width: 100%;
  max-width: 400px;
  margin: 10px auto 20px;
  padding: 10px 0;
  border: none;
  border-radius: 16px;
  background: #42c0c5;
  color: #fff;
  font-weight: bold;
  font-size: 16px;
}
#selectCalendar {
  background: #f3b236;
  margin: 0 auto;
}

@media screen and (max-width: 768px) {
  #calendarSearch {
    display: flex;
    flex-direction: column;

    max-width: none;
    width: 92%;
    margin: 0 auto;
    padding: 12px;
  }

  #calendarSearch .cs-date,
  #calendarSearch .cs-number {
    width: 100%;
  }
  #calendarSearch .cs-date,
  .calendar,
  #calendar_usages {
    margin-bottom: 10px;
  }
  .calendar td {
    /* padding: 0;
    border-spacing: 8px; */
  }
  #frameCalendarSearch {
    top: 216px;
  }
  #calendarPopup {
    top: 346px;
  }
  .calendar table {
    min-height: 264px;
  }
  #calendar_usages div {
    width: 22%;
    font-size: 12px;
  }
  .calendar-navigation button {
    margin: 0;
  }
  #selectBtn {
    width: 100%;
  }
  .searchBox {
    width: 92%;
    margin: 4% auto 0;
  }
  .searchOption label input[type="checkbox"]:checked:before {
    top: 3px;
    left: 7px;
  }
}
