* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  height: 100vh;
  overflow: hidden;
}

/* メインコンテンツ */
.main-content {
  position: relative;
  width: 100%;
  height: 100vh;
  background-color: #f5f5f5;
  /* 追加：変化をふわっとさせる設定 */
  transition: filter 0.3s ease, brightness 0.3s ease;
}

.main-content.is-blurred {
  filter: blur(6px) brightness(0.7);
  pointer-events: none;
  user-select: none;
}

#backBtn {
  display: none;
  position: absolute;
  top: 24px;
  left: 16px;
  z-index: 3000;
  width: 66px;
  height: 32px;
  border: none;
  border-radius: 16px;
  background: #fff;
  color: #00754A;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  text-align: center;
  padding: 0;
}

#researchBtn {
  display: none;
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1500;
  height: 32px;
  padding: 0 20px;
  border: none;
  border-radius: 18px;
  background: #fff;
  color: #00704A;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

#backBtn:hover,
#researchBtn:hover {
  background: #f0f0f0;
}

#currentLocationBtn {
  display: none;
  position: absolute;
  bottom: 24px;
  right: 16px;
  z-index: 2500;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  padding: 0;
  background-image: url("/cafe/the-star-frappuccino/s/icons/geolocate.svg");
  background-repeat: no-repeat;
  background-position: center;
  background-position: left 10px top 13px;
  background-size: 18px;
  /* 吸着アニメーションに同期させる */
  transition: bottom 0.4s cubic-bezier(0.34, 1.3, 0.64, 1);
}

#currentLocationBtn.no-transition {
  transition: none !important;
}

/* ハーフモーダル */
.half-modal {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: #31462F;
  transition: height 0.4s cubic-bezier(0.34, 1.3, 0.64, 1);
  touch-action: none;
  border-radius: 15px 15px 0 0;
  z-index: 2100;
}

/* ハンドルバー */
.handle-bar {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 120px;
  height: 24px;
  left: 50%;
  transform: translateX(-50%);
  cursor: grab;
}

.handle-bar::after {
  position: relative;
  content: "";
  display: block;
  width: 80px;
  height: 4px;
  background: #fff;
  border-radius: 10px;
  opacity: 0.3;
}

/* ハーフモーダル用ヘッダー */
.modal-header {
  display: flex;
  justify-content: flex-end;
  border-radius: 15px 15px 0 0;
  padding: 24px 16px 16px;
  background: linear-gradient(180deg, #006242 0%, #31462F 100%);
}

/* ハーフモーダル用ヘッダー内のカード件数 */
.card-count-container {
  display: flex;
  align-items: center;
  padding: 0 8px 0 0;
}

.card-count {
  font-size: 18px;
  font-weight: 600;
  color: white;
  margin-right: 4px;
}

.card-count-text {
  font-size: 10px;
  color: white;
}

/* 絞込みモーダル用ヘッダー内のボタン */
.filter-button {
  background-color: inherit;
  color: #ffffff;
  border: 1px solid #ffffff;
  padding: 5px 13px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 14px;
}

.filter-modal-footer {
  display: flex;
  justify-content: flex-end;
  padding: 16px;
  flex-shrink: 0;
}

#filterSubmit {
  background-color: #006241;
  color: white;
  border: none;
  padding: 16px 27px;
  border-radius: 28px;
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
  box-shadow: 0 0px 6px rgba(0, 0, 0, 0.25);
}

#filterSubmit:hover {
  background-color: #004d33;
}

#filterSubmit:disabled {
  background-color: #ccc;
  color: #fff;
  cursor: not-allowed;
}

/* カードコンテナ */
.cards-container {
  padding: 0 16px 16px 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  overscroll-behavior: none;
  /* スクロールバーのデザインを維持 */
  scrollbar-color: #888 transparent;
  scrollbar-width: thin;
}
.cards-container::-webkit-scrollbar { width: 8px; }
.cards-container::-webkit-scrollbar-track { background: transparent; }
.cards-container::-webkit-scrollbar-thumb { background: #888; border-radius: 10px; }

/* カード */
.card {
  position: relative;
  overflow: visible;
  background-color: #F6F1EB;
  border-radius: 12px;
  padding: 16px;
  margin-top: 8px;
  margin-bottom: 8px;
  min-height: 146px;
  order: 1;
  flex-shrink: 0;
}

/* トップカードを上段に表示 */
.card.top-card {
  order: 0;
}

.card-label-container {
  display: flex;
  align-items: center;
  margin-bottom: 32px;
}

.card-icon {
  position: absolute;
  top: -4px;
  left: 16px;
  width: 40px;
  height: 46px;
  background-size: 119%;
  background-position: center;
}

.card-label {
  position: absolute;
  top: 10px;
  right: 16px;
  font-size: 11px;
  font-weight: 700;
  text-align: right;
  overflow-wrap: break-word;
}

.card-label .checkbox-note{
  display: none;
}

.card.product-p1 .card-icon {
  background-image: url('/cafe/the-star-frappuccino/s/icons/selected_p1.svg');
}

.card.product-p1 .card-label {
  color: #604633;
}

.card.product-p2 .card-icon {
  background-image: url('/cafe/the-star-frappuccino/s/icons/selected_p2.svg');
}

.card.product-p2 .card-label {
  color: #9F3A10;
}

.card.product-p3 .card-icon {
  background-image: url('/cafe/the-star-frappuccino/s/icons/selected_p3.svg');
}

.card.product-p3 .card-label {
  color: #E54154;
}

.card.product-p4 .card-icon {
  background-image: url('/cafe/the-star-frappuccino/s/icons/selected_p4.svg');
}

.card.product-p4 .card-label {
  color: #9D6C2B;
}

.card.product-p5 .card-icon {
  background-image: url('/cafe/the-star-frappuccino/s/icons/selected_p5.svg');
}

.card.product-p5 .card-label {
  color: #2AA003;
}

.card.product-p6 .card-icon {
  background-image: url('/cafe/the-star-frappuccino/s/icons/selected_p6.svg');
}

.card.product-p6 .card-label {
  color: #C42B17;
}

.card-content-container {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 12px;
}

.card-text-container {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 25px;
}

.card-text {
  font-size: 12px;
  line-height: 1.5;
  color: rgba(0, 0, 0, 0.87);
}

.card-button {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 66px;
  height: 32px;
  border: 1px solid #00754A;
  border-radius: 15px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: #00754A;
  background-color: transparent;
}

.card-button:hover {
  background-color: #e0e0e0;
  color: #006241;
}

.empty-card {
  color: #FFFFFFDE;
  background: none;
  text-align: center;
  padding-top: 0;
  margin-top: 40px;
}

.empty-card .card-text {
  color: #FFFFFFDE;
}

.empty-card .card-title {
  margin-bottom: 16px;
}

/* 該当なしメッセージ */
.no-results {
  color: white;
  text-align: center;
  padding: 40px 16px;
  font-size: 16px;
}

/* 絞込みモーダル */
.filter-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: white;
  z-index: 3001;
  display: none;
  flex-direction: column;
}

.filter-modal.active {
  display: flex;
}

.filter-modal-header {
  display: flex;
  justify-content: flex-end;
  padding: 16px;
}

.close-button {
  position: relative;
  background: none;
  border: solid 1px #006242;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  width: 32px;
  height: 32px;
  color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  appearance: none;
  -webkit-appearance: none;
}

.close-button::before,
.close-button::after {
  position: absolute;
  content: "";
  display: block;
  background: #006242;
  border-radius: 2px;
  width: 18px;
  height: 1.5px;
  rotate: 45deg;
}

.close-button::after {
  rotate: -45deg;
}

.select__item {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-top: 24px;
  align-items: flex-start;
  padding: 0 16px;
}

.select__item::after {
  content: "";
  display: block;
  width: calc(100% + 32px);
  height: 1px;
  margin-top: 8px;
  margin-left: -16px;
  background: rgba(0, 0, 0, 0.302);
}

.pref__wrap,
.city__wrap {
  position: relative;
}

.pref,
.city {
  font-family: "Noto Sans JP", sans-serif;
  color: var(--text-color);
  padding: 13px 34px 13px 16px;
  border-radius: 50px;
  border-color: #00754A;
  font-size: 14px;
  font-weight: 500;
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  outline: 0;
  background-color: #fff;
}

.city {
    outline: solid 3px #00754A;
    outline-offset: 2px;
}

.pref:focus,
.city:focus {
  box-shadow: 0px 0px 0px 2px #00754a;
  border-color: #fff0;
}

.pref__wrap svg,
.city__wrap svg {
  position: absolute;
  display: block;
  width: 14px;
  height: 8px;
  top: 50%;
  right: 16px;
  transform: translate3d(0, -50%, 0);
  pointer-events: none;
}

.pref__wrap:has(.pref:focus) svg,
.city__wrap:has(.city:focus) svg {
  filter: brightness(0) saturate(100%) invert(24%) sepia(80%) saturate(1082%) hue-rotate(129deg) brightness(91%) contrast(102%);
}

.pref__label,
.city__label {
  color: rgba(0, 0, 0, 0.87);
  font-family: "Noto Sans JP", sans-serif;
  background: #fff;
  font-size: 15px;
  line-height: 20px;
  font-weight: 500;
  position: absolute;
  pointer-events: none;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  transition: 0.2s ease all;
  -webkit-transition: 0.2s ease all;
}

.pref:valid:focus~.pref__label,
.city:valid:focus~.city__label {
  color: #00754a;
}

.pref:valid~.pref__label,
.city:valid~.city__label {
  color: rgba(0, 0, 0, 0.7);
  top: 0;
  font-size: 12px;
  font-weight: 400;
  padding: 0 8px;
  line-height: 1;
  left: 8px;
  transition: 0.2s ease all;
  -webkit-transition: 0.2s ease all;
  -moz-transition: 0.2s ease all;
  -ms-transition: 0.2s ease all;
  -o-transition: 0.2s ease all;
}

.filter-modal-content {
  padding: 16px;
  overflow-y: auto;
  flex: 1;
}

.checkbox-item {
  display: flex;
  align-items: center;
  padding: 12px 0;
}

.checkbox-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  margin-right: 12px;
  background-position: center;
  background-repeat: no-repeat;
}

.icon-p1 {
  background-image: url('/cafe/the-star-frappuccino/s/icons/active_p1.svg');
}

.icon-p2 {
  background-image: url('/cafe/the-star-frappuccino/s/icons/active_p2.svg');
}

.icon-p3 {
  background-image: url('/cafe/the-star-frappuccino/s/icons/active_p3.svg');
}

.icon-p4 {
  background-image: url('/cafe/the-star-frappuccino/s/icons/active_p4.svg');
}

.icon-p5 {
  background-image: url('/cafe/the-star-frappuccino/s/icons/active_p5.svg');
}

.icon-p6 {
  background-image: url('/cafe/the-star-frappuccino/s/icons/active_p6.svg');
}

.checkbox-disabled .icon-p1 {
  background-image: url('/cafe/the-star-frappuccino/s/icons/inactive_p1.svg');
}

.checkbox-disabled .icon-p2 {
  background-image: url('/cafe/the-star-frappuccino/s/icons/inactive_p2.svg');
}

.checkbox-disabled .icon-p3 {
  background-image: url('/cafe/the-star-frappuccino/s/icons/inactive_p3.svg');
}

.checkbox-disabled .icon-p4 {
  background-image: url('/cafe/the-star-frappuccino/s/icons/inactive_p4.svg');
}

.checkbox-disabled .icon-p5 {
  background-image: url('/cafe/the-star-frappuccino/s/icons/inactive_p5.svg');
}

.checkbox-disabled .icon-p6 {
  background-image: url('/cafe/the-star-frappuccino/s/icons/inactive_p6.svg');
}

.checkbox-item label {
  flex: 1;
  font-size: 12px;
  line-height: 1.2;
  cursor: pointer;
}

.checkbox-item input[type="checkbox"] {
  flex-shrink: 0;
  appearance: none;
  -webkit-appearance: none;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 17px;
  height: 13px;
  margin-right: 8px;
  cursor: pointer;
}

.checkbox-item input[type="checkbox"]::after {
  content: '';
  display: block;
  width: 17px;
  height: 13px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='17.628' height='13.753' viewBox='0 0 17.628 13.753'%3E%3Cpath id='svgexport-4' d='M4.21,11.651a.7.7,0,1,0-1.045.944l4.209,4.658a.7.7,0,0,0,1.029.016L19.343,5.925a.7.7,0,0,0-1.014-.976L7.914,15.749l-3.7-4.1Z' transform='translate(-2.413 -4.232)' fill='%23ccc' stroke='%23ccc' stroke-width='1'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.checkbox-item input[type="checkbox"]:checked::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='17.628' height='13.753' viewBox='0 0 17.628 13.753'%3E%3Cpath id='svgexport-4' d='M4.21,11.651a.7.7,0,1,0-1.045.944l4.209,4.658a.7.7,0,0,0,1.029.016L19.343,5.925a.7.7,0,0,0-1.014-.976L7.914,15.749l-3.7-4.1Z' transform='translate(-2.413 -4.232)' fill='%2300754A' stroke='%2300754A' stroke-width='1'/%3E%3C/svg%3E");
}

.checkbox-disabled {
  opacity: 0.4;
  pointer-events: none;
}

.checkbox-disabled input[type="checkbox"] {
  visibility: hidden;
}

.checkbox-note {
  display: block;
  font-size: 11px;
  color: #999;
  margin-top: 2px;
}

.no-scroll {
  overflow: hidden;
}

/* PCサイズ（520px以上） */
@media (min-width: 520px) {
  .main-content {
    width: calc(100% - 430px);
  }

  .half-modal {
    left: auto;
    right: 0;
    width: 430px;
    height: 100vh;
    border-radius: 0;
    transform: none !important;
  }

  .filter-button:hover {
    background-color: #f0f0f0;
  }

  .handle-bar {
    display: none;
  }

  .modal-header {
    border-radius: 0;
    padding-top: 24px;
    padding-right: 40px;
  }

  .cards-container {
    max-height: calc(100vh - 42px);
    padding: 0 40px;
    overflow-y: auto;
    scrollbar-color: #888 transparent;
    scrollbar-width: thin;
  }

  .filter-modal {
    left: auto;
    right: 0;
    width: 430px;
  }

  #currentLocationBtn {
    bottom: 24px !important;
		right: 460px;
  }
}

/* customZoomMenu */
#map .customZoomMenu {
  width: 25px;
  height: auto;
  position: absolute;
  z-index: 1000;
  background: #fff;
  margin: 0 5px 0 5px;
  right: 16px;
  bottom: 80px;
  border-radius: 2px;
  box-shadow: 0 2px 4px 0 rgba(0, 0, 0, .5);
}

#map .customZoomMenu button {
  width: 25px;
  height: 25px;
  text-align: center;
  position: relative;
  transition: color .2s ease-out;
  border: none;
  -webkit-appearance: none;
  appearance: none;
  border-radius: 0;
}

#map .customZoomMenu button path,
#map .customZoomMenu button rect {
  fill: #0000004D;
}

#map .customZoomMenu button:hover path,
#map .customZoomMenu button:hover rect {
  fill: #000000B3;
}