/* 팝업 오버레이 */
.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 20014;
  display: none; /* 기본적으로 숨김 */
  justify-content: center;
  align-items: center;
  padding: 20px;
  box-sizing: border-box;
}

/* 팝업 컨테이너 */
.popup-container {
  display: flex;
  gap: 20px;
  /* max-width: 1200px; */
  width: 100%;
  position: relative;
  justify-content: center;
  align-items: center;
}

/* 개별 팝업 */
.popup-item {
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  position: relative;
  flex: 1;
  min-height: 400px;
  display: none; /* 기본적으로 숨김 */
  flex-direction: column;
}

/* 팝업 이미지 */
.popup-image {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* 팝업 내용 */
.popup-content {
  padding: 20px 20px 20px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.popup-title {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 10px;
  color: #333;
}

.popup-description {
  font-size: 14px;
  color: #666;
  line-height: 1.5;
  margin-bottom: 20px;
  flex: 1;
}

.popup-buttons {
  display: flex;
  gap: 10px;
  margin-top: auto;
  justify-content: space-between;
  align-items: center;
}

.popup-button {
  background: #007bff;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.3s;
  flex: 1;
}

.popup-button:hover {
  background: #0056b3;
}

.popup-close-button {
  background: #6c757d;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 18px;
  transition: background-color 0.3s;
  /* flex: 1; */
}

.popup-close-button:hover {
  background: #545b62;
}

/* 닫기 버튼 */
.popup-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s;
}

.popup-close:hover {
  background: rgba(0, 0, 0, 0.8);
}

/* 전체 닫기 버튼 */
.popup-close-all {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.9);
  color: #333;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  z-index: 10000;
}

.popup-close-all:hover {
  background: white;
  transform: scale(1.1);
}

/* 오늘 하루 보지 않기 체크박스 */
.popup-dont-show-today {
  /* margin-top: 15px; */
  /* padding-top: 15px; */
  /* border-top: 1px solid #eee; */
}

.popup-dont-show-today label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  color: #666;
  cursor: pointer;
  margin: 0;
  transition: color 0.2s;
}

.popup-dont-show-today label:hover {
  color: #333;
}

.popup-dont-show-today input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: #007bff;
  margin: 0;
  vertical-align: middle;
}

/* PC 스타일 (1024px 이상) */
@media (min-width: 1024px) {
  .popup-container {
    flex-direction: row;
    gap: 20px;
  }

  .popup-item {
    flex: 1;
    max-width: 550px;
  }
}

/* 태블릿 스타일 (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
  .popup-container {
    flex-direction: row;
    gap: 15px;
  }

  .popup-item {
    flex: 1;
    max-width: 300px;
  }
}

/* 모바일 스타일 (767px 이하) */
@media (max-width: 767px) {
  .popup-overlay {
    padding: 10px;
    overflow: hidden;
  }

  .popup-container {
    flex-direction: column;
    gap: 0; /* 팝업 간 간격 제거 */
    max-height: 90vh;
    /* overflow: hidden; 스크롤 방지 */
    justify-content: center;
    align-items: center;
    width: 100%;
    position: relative; /* 겹침을 위한 상대 위치 */
  }

  .popup-item {
    flex: none;
    min-height: 300px;
    width: 100%;
    max-width: 400px;
    position: absolute; /* 절대 위치로 겹침 */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1; /* 기본 z-index */
    display: none; /* 기본적으로 숨김 */
  }

  /* 모바일에서 팝업이 표시될 때 */
  .popup-item[style*="display: flex"] {
    display: flex !important;
  }

  /* 첫 번째 팝업이 맨 위에 */
  .popup-item:nth-child(1) {
    z-index: 3 !important;
  }

  /* 두 번째 팝업이 중간에 */
  .popup-item:nth-child(2) {
    z-index: 2;
  }

  /* 세 번째 팝업이 맨 아래에 */
  .popup-item:nth-child(3) {
    z-index: 1;
  }

  .popup-image {
    height: 100%;
  }

  .popup-content {
    padding: 15px 15px 10px 15px;
  }

  .popup-title {
    font-size: 16px;
  }

  .popup-description {
    font-size: 13px;
  }

  .popup-buttons {
    flex-direction: row;
    gap: 8px;
  }

  .popup-button,
  .popup-close-button {
    font-size: 13px;
    padding: 8px 16px;
  }

  /* 모바일에서 체크박스 스타일 */
  .popup-dont-show-today {
    margin-top: 12px;
    padding-top: 12px;
    display: block !important; /* 모바일에서 강제 표시 */
  }

  .popup-dont-show-today label {
    font-size: 12px;
    gap: 6px;
    display: inline-flex !important; /* 모바일에서 강제 표시 */
  }

  .popup-dont-show-today input[type="checkbox"] {
    width: 14px;
    height: 14px;
    display: inline-block !important; /* 모바일에서 강제 표시 */
  }
}

/* 숨김 클래스 */
.popup-hidden {
  display: none !important;
}
