/* 전역 스타일 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
  line-height: 1.6;
  background-color: #f5f5f5;
  color: #333;
}

/* 헤더 스타일 */
.header {
  background-color: #fff;
  padding: 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
  color: #333;
  text-align: center;
  flex-grow: 1;
}

.cart-btn {
  position: absolute;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
}

/* 네비게이션 메뉴 */
.nav-menu {
  display: flex;
  justify-content: space-around;
  background-color: #fff;
  padding: 0.5rem;
  margin-bottom: 1rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.nav-button {
  border: none;
  background: none;
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-size: 1.1rem;
  color: #666;
}

.nav-button.active {
  color: #007bff;
  font-weight: bold;
}

/* 메인 컨텐츠 */
.main-content {
  padding: 1rem;
  max-width: 800px;
  margin: 0 auto;
  min-height: calc(100vh - 100px);
}

.content-section {
  display: none;
}

.content-section.active {
  display: block;
}

/* 쿠폰 카드 스타일 */
.coupon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  padding: 1rem;
}

.coupon-card {
  background: #fff;
  border-radius: 10px;
  padding: 1.5rem;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  height: 100%;
}

.coupon-value {
  text-align: center;
  padding: 10px 0;
  width: 100%;
  height: auto;
}

.coupon-value-image {
  max-width: 100%;
  height: auto;
  width: auto;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

/* 폼 스타일 */
.form-container {
  background: #fff;
  padding: 2rem;
  border-radius: 10px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.section-title {
  text-align: center;
  margin-bottom: 2rem;
  color: #333;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: bold;
}

.required {
  color: #dc3545;
}

.form-input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 1rem;
}

.form-textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 5px;
  min-height: 100px;
  resize: vertical;
}

/* 버튼 스타일 */
.submit-button {
  width: 100%;
  padding: 1rem;
  background-color: #007bff;
  color: #fff;
  border: none;
  border-radius: 5px;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.3s;
}

.submit-button:hover {
  background-color: #0056b3;
}

/* 모달 스타일 */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-content {
  background: #fff;
  padding: 2rem;
  border-radius: 10px;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-buttons {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

/* 로딩 오버레이 */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.8);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.loading-spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #007bff;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* 푸터 스타일 */
.dashboard-footer {
  display: none;
  width: 100%;
  background-color: #f8f9fa;
  padding: 20px 0;
  position: absolute;
  bottom: 0;
  left: 0;
  border-top: 1px solid #dee2e6;
}

#home .dashboard-footer {
  display: block;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.footer-info {
  text-align: center;
  margin-bottom: 15px;
}

.footer-info p {
  margin: 5px 0;
}

.footer-links {
  text-align: center;
}

.footer-links a {
  color: #666;
  text-decoration: none;
}

.footer-links a:hover {
  text-decoration: underline;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
  .nav-menu {
    flex-wrap: wrap;
  }

  .nav-button {
    flex: 1 1 auto;
    padding: 0.5rem;
    font-size: 1.1rem;
  }

  .form-container {
    padding: 1rem;
  }

  .footer-links {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 20px;
    font-size: 60%;
  }

  .footer-info {
    font-size: 50%;
    /* 80%에서 30% 감소한 크기 */
    line-height: 1;
    /* 줄 간격 유지 */
  }
}

.signature-container {
  width: 100%;
  max-width: 600px;
  margin: 20px auto;
}

canvas#signaturePad {
  border: 1px solid #ccc;
  border-radius: 4px;
  touch-action: none;
  transition: border-color 0.3s;
}

canvas#signaturePad.active {
  border-color: #007bff;
}

.signature-controls {
  margin-top: 10px;
  text-align: right;
}

.signature-controls button {
  margin-left: 10px;
  padding: 5px 15px;
  border: none;
  border-radius: 4px;
  background-color: #f0f0f0;
  cursor: pointer;
}

.signature-controls button:hover {
  background-color: #e0e0e0;
}

/* 서명 모달 관련 스타일 수정 */
#signatureModal .signature-container {
  width: 100%;
  max-width: 600px;
  margin: 20px auto;
}

#signatureModal canvas#signaturePad {
  border: 1px solid #ccc;
  border-radius: 4px;
  touch-action: none;
  transition: border-color 0.3s;
  width: 100%;
  background-color: #fff;
}

#signatureModal .signature-controls {
  margin-top: 15px;
  text-align: center;
}

#signatureModal .signature-controls button {
  margin: 0 5px;
}

#otherReasonContainer {
  margin-top: 10px;
}

#otherReason {
  width: 100%;
  min-height: 80px;
  padding: 8px;
  resize: vertical;
}

.confirm-item {
  margin: 10px 0;
  display: flex;
  align-items: flex-start;
}

.confirm-item label {
  min-width: 120px;
  font-weight: bold;
}

.confirm-item span {
  flex: 1;
  word-break: break-all;
}

/* 푸터 스타일 - 모바일 기본 스타일 */
.footer-info {
  text-align: center;
  margin-bottom: 1rem;
  font-size: 80%;
  /* PC 기본 글자 크기 유지 */
  line-height: 1.2;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  font-size: 60%;
  /* 모바일 기본 글자 크기 */
}

/* PC 및 노트북 화면에서 크기 50% 증가 (768px 초과) */
@media (min-width: 769px) {
  .footer-info {
    font-size: 90%;
    /* 60% * 1.5 = 90% */
    line-height: 1.8;
    /* 1.2 * 1.5 = 1.8 */
  }

  .footer-links {
    font-size: 90%;
    /* 60% * 1.5 = 90% */
  }
}

/* 모바일 화면에서는 기본 크기 유지 */
@media (max-width: 768px) {
  .footer-links {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 20px;
    font-size: 60%;
    /* 모바일 기본 크기 유지 */
  }

  .footer-info {
    font-size: 50%;
    /* 80%에서 30% 감소한 크기 */
    line-height: 1.2;
    /* 줄 간격 유지 */
  }
}

/* 약관 및 개인정보처리방침 모달 버튼 스타일 */
#termsConfirmBtn,
#privacyConfirmBtn {
  display: block;
  width: 200px;
  /* 버튼 너비 고정 */
  margin: 20px auto;
  /* 상하 여백 20px, 좌우 auto로 중앙 정렬 */
  padding: 15px 0;
  /* 상하 패딩 */
  background-color: #4CAF50;
  /* 녹색 계열 배경 */
  color: white;
  border: none;
  border-radius: 5px;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.3s;
}

#termsConfirmBtn:hover,
#privacyConfirmBtn:hover {
  background-color: #45a049;
  /* 호버시 더 진한 녹색 */
}

/* 약관 및 개인정보처리방침 모달 내용 스크롤 영역 조정 */
.terms-content,
.privacy-content {
  max-height: 80vh;
  overflow-y: auto;
  padding: 20px;
  margin-bottom: 20px;
  /* 버튼과의 간격 */
}

/* 모달 내용과 버튼을 감싸는 컨테이너 */
.modal-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  /* 내용 중앙 정렬 */
  padding: 30px;
  max-width: 600px;
  /* 모달 최대 너비 */
  width: 90%;
  margin: 20px auto;
  border-radius: 10px;
  background-color: white;
}

/* 모달 버튼 컨테이너 */
.modal-button-container {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 20px 0;
}

/* 모달 확인 버튼 */
.modal-confirm-button {
  width: 100px;
  padding: 5px 0;
  background-color: #4CAF50;
  color: white;
  border: none;
  border-radius: 5px;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.modal-confirm-button:hover {
  background-color: #45a049;
}

/* 모달 내용 스크롤 영역 */
.terms-content,
.privacy-content {
  max-height: 80vh;
  overflow-y: auto;
  padding: 20px;
}

/* 모달 컨텐츠 컨테이너 */
.modal-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 30px;
  max-width: 600px;
  width: 90%;
  margin: 20px auto;
  border-radius: 10px;
  background-color: white;
}

.form-section {
  margin-bottom: 2rem;
  padding: 1.5rem;
  border: 1px solid #ddd;
  border-radius: 5px;
}

.verify-button {
  margin-left: 10px;
  padding: 0.5rem 1rem;
  background-color: #28a745;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

.verify-button:hover {
  background-color: #218838;
}

.verified {
  border-color: #28a745;
}

/* 기존 footer 스타일 수정 */
footer {
  display: none;
  /* 기본적으로 숨김 */
  width: 100%;
  background-color: #f8f9fa;
  padding: 20px 0;
  text-align: center;
  position: fixed;
  bottom: 0;
  left: 0;
  border-top: 1px solid #dee2e6;
}

/* 홈화면에서만 푸터 표시 */
.home-section footer {
  display: block;
}

/* 홈화면 컨텐츠가 푸터와 겹치지 않도록 패딩 추가 */
.home-section {
  padding-bottom: 100px;
  /* 푸터 높이보다 큰 값으로 설정 */
  min-height: calc(100vh - 100px);
  /* 화면 전체 높이에서 푸터 높이를 뺀 값 */
  position: relative;
}

/* 다른 섹션에서는 푸터 숨김 */
.content-section:not(.home-section) footer {
  display: none;
}

/* 홈 섹션 스타일 수정 */
#home {
  position: relative;
  min-height: calc(100vh - 120px);
  /* 헤더 높이를 뺀 전체 높이 */
  padding-bottom: 160px;
  /* 푸터 높이보다 큰 값 */
}

/* 문의내용 확인 모달 버튼 스타일 */
#inquiryModal .modal-buttons button {
  width: auto;
  /* 글자 내용에 맞게 자동 조정 */
  min-width: 100px;
  /* 최소 너비 설정 */
  padding: 15px 30px;
  /* 좌우 여백 추가 */
  margin: 0 10px;
  /* 버튼 사이 간격 */
}

#inquiryModal #confirmInquiry,
#inquiryModal #cancelInquiry {
  width: auto;
  /* 글자 내용에 맞게 자동 조정 */
  min-width: 100px;
  /* 최소 너비 설정 */
  padding: 15px 30px;
  /* 좌우 여백 추가 */
}

/* 구매하기 버튼 스타일 */
.coupon-card .submit-btn.warm {
  display: inline-block;
  padding: 12px 30px;
  background-color: #4CAF50;
  /* 녹색 배경 */
  color: white;
  text-decoration: none;
  border-radius: 5px;
  font-weight: bold;
  transition: background-color 0.3s;
  border: none;
  cursor: pointer;
  margin-top: 15px;
}

.coupon-card .submit-btn.warm:hover {
  background-color: #45a049;
  /* 호버 시 더 진한 녹색 */
}