/* ============================================
   TOUR BOOKING PAGE STYLES
   ============================================ */

/* 메인 컨테이너 */
.booking-main {
  min-height: calc(100vh - 80px);
  background: #f8f9fa;
  padding: 100px 0 80px 0;
}

.booking-container {
  max-width: 800px;
  margin: 0 auto;
  background: white;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

/* ============================================
   사이드바 스타일 (이제 메인 컨테이너)
   ============================================ */
.booking-sidebar {
  width: 100%;
  background: white;
  overflow-y: auto;
  max-height: calc(100vh - 120px);
}

/* 사이드바 로고 영역 */
.sidebar-logo {
  padding: 25px 30px;
  border-bottom: 1px solid #e9ecef;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: white;
  position: sticky;
  top: 0;
  z-index: 5;
}

.allvan-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-logo .logo-text {
  font-size: 22px;
  font-weight: bold;
  color: #333;
}

.sidebar-logo .logo-box {
  background: #333;
  color: white;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: bold;
}

.close-btn {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  padding: 10px 18px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  color: #495057;
  transition: all 0.2s ease;
}

.close-btn:hover {
  background: #e9ecef;
  color: #333;
}

/* ============================================
   투어 패키지 섹션
   ============================================ */
.tour-packages {
  padding: 30px;
  border-bottom: 1px solid #e9ecef;
}

.tour-packages h3 {
  margin: 0 0 25px 0;
  font-size: 20px;
  font-weight: 600;
  color: #333;
  text-align: center;
}

.tour-package-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 20px;
}

.tour-package-item {
  display: flex;
  gap: 18px;
  padding: 20px;
  border: 2px solid #e9ecef;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  background: white;
}

.tour-package-item:hover {
  border-color: #007bff;
  box-shadow: 0 6px 20px rgba(0, 123, 255, 0.15);
  transform: translateY(-3px);
}

.tour-package-item.selected {
  border-color: #007bff;
  background: #f8f9ff;
  box-shadow: 0 6px 20px rgba(0, 123, 255, 0.2);
}

.tour-package-image {
  flex-shrink: 0;
  width: 100px;
  height: 100px;
  border-radius: 12px;
  overflow: hidden;
}

.tour-package-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tour-package-content {
  flex: 1;
  min-width: 0;
}

.tour-package-title {
  margin: 0 0 10px 0;
  font-size: 17px;
  font-weight: 600;
  color: #333;
  line-height: 1.3;
}

.tour-package-description {
  margin: 0 0 15px 0;
  font-size: 14px;
  color: #666;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tour-package-price {
  font-size: 18px;
  font-weight: 700;
  color: #007bff;
  margin-bottom: 6px;
}

.tour-package-duration {
  font-size: 13px;
  color: #868e96;
  background: #f8f9fa;
  padding: 6px 12px;
  border-radius: 15px;
  display: inline-block;
}

/* ============================================
   예약 폼 스타일
   ============================================ */
.booking-form {
  padding: 30px;
}

.booking-form h3 {
  margin: 0 0 25px 0;
  font-size: 20px;
  font-weight: 600;
  color: #333;
  text-align: center;
}

/* 폼 섹션 스타일 */
.form-section {
  background: #f8f9ff;
  border: 1px solid #e3f2fd;
  border-radius: 12px;
  padding: 25px;
  margin-bottom: 30px;
}

.section-title {
  margin: 0 0 20px 0;
  font-size: 16px;
  font-weight: 600;
  color: #007bff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-row {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
}

.form-row:last-child {
  margin-bottom: 0;
}

.form-group {
  margin-bottom: 25px;
}

.form-group.half {
  flex: 1;
  margin-bottom: 0;
}

.form-group label {
  display: block;
  margin-bottom: 10px;
  font-size: 15px;
  font-weight: 500;
  color: #333;
}

.form-help {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: #666;
  font-style: italic;
}

.total-field {
  background: #e9ecef !important;
  font-weight: 600;
  color: #007bff !important;
}

.selected-tour-container {
  display: flex;
  gap: 10px;
  align-items: center;
}

.selected-tour-container input {
  flex: 1;
}

.change-tour-btn {
  background: #6c757d;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.change-tour-btn:hover {
  background: #5a6268;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid #e9ecef;
  border-radius: 10px;
  font-size: 15px;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 4px rgba(0, 123, 255, 0.1);
}

.form-group input[readonly] {
  background: #f8f9fa;
  color: #495057;
  cursor: not-allowed;
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
}

/* 총 요금 섹션 */
.total-price {
  background: #f8f9ff;
  border: 2px solid #e3f2fd;
  border-radius: 15px;
  padding: 25px;
  margin: 30px 0;
}

.price-breakdown {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.price-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 15px;
}

.price-item.total {
  border-top: 2px solid #dee2e6;
  padding-top: 15px;
  font-size: 18px;
  font-weight: 600;
  color: #007bff;
}

/* 예약 버튼 */
.booking-submit-btn {
  width: 100%;
  background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
  color: white;
  border: none;
  border-radius: 15px;
  padding: 20px 25px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.booking-submit-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(0, 123, 255, 0.3);
}

.booking-submit-btn:active {
  transform: translateY(0);
}

.btn-icon {
  font-size: 24px;
}

.btn-text {
  font-size: 18px;
  font-weight: 600;
}

.btn-subtitle {
  font-size: 13px;
  opacity: 0.9;
  font-weight: 400;
}

/* ============================================
   반응형 디자인
   ============================================ */
@media (max-width: 1024px) {
  .booking-container {
    max-width: 90%;
    margin: 0 auto;
  }

  .tour-package-list {
    grid-template-columns: 1fr;
  }

  .tour-package-item {
    padding: 18px;
  }
}

@media (max-width: 768px) {
  .booking-main {
    padding: 80px 15px 80px 15px; /* 모바일에서도 헤더와 푸터와 겹치지 않도록 패딩 추가 */
  }

  .booking-container {
    max-width: 100%;
    border-radius: 12px;
  }

  .sidebar-logo {
    padding: 20px 25px;
  }

  .tour-packages {
    padding: 25px;
  }

  .booking-form {
    padding: 25px;
  }

  .tour-package-list {
    gap: 15px;
  }

  .tour-package-item {
    padding: 15px;
    gap: 15px;
  }

  .tour-package-image {
    width: 80px;
    height: 80px;
  }

  .tour-package-title {
    font-size: 16px;
  }

  .tour-package-description {
    font-size: 13px;
    -webkit-line-clamp: 2;
  }
}

@media (max-width: 480px) {
  .booking-main {
    padding: 70px 10px 80px 10px; /* 작은 화면에서도 헤더와 푸터와 겹치지 않도록 패딩 추가 */
  }

  .booking-container {
    border-radius: 8px;
  }

  .sidebar-logo {
    padding: 15px 20px;
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }

  .tour-packages {
    padding: 20px;
  }

  .booking-form {
    padding: 20px;
  }

  .tour-packages h3,
  .booking-form h3 {
    font-size: 18px;
  }

  .tour-package-item {
    flex-direction: column;
    text-align: center;
    padding: 15px;
  }

  .tour-package-image {
    width: 100%;
    height: 150px;
    align-self: center;
  }

  .form-section {
    padding: 20px;
    margin-bottom: 25px;
  }

  .form-row {
    flex-direction: column;
    gap: 20px;
  }

  .form-group.half {
    margin-bottom: 20px;
  }

  .section-title {
    font-size: 15px;
  }

  .form-group {
    margin-bottom: 20px;
  }

  .form-group input,
  .form-group select,
  .form-group textarea {
    padding: 12px 14px;
    font-size: 14px;
  }

  .selected-tour-container {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .change-tour-btn {
    padding: 10px 16px;
    font-size: 12px;
  }

  .booking-submit-btn {
    padding: 18px 20px;
    font-size: 16px;
  }

  .btn-text {
    font-size: 16px;
  }

  .btn-icon {
    font-size: 20px;
  }
}

/* ============================================
   스크롤바 커스터마이징
   ============================================ */
.booking-sidebar::-webkit-scrollbar {
  width: 8px;
}

.booking-sidebar::-webkit-scrollbar-track {
  background: #f8f9fa;
  border-radius: 4px;
}

.booking-sidebar::-webkit-scrollbar-thumb {
  background: #dee2e6;
  border-radius: 4px;
}

.booking-sidebar::-webkit-scrollbar-thumb:hover {
  background: #adb5bd;
}

/* ============================================
   애니메이션 효과
   ============================================ */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.tour-package-item {
  animation: fadeInUp 0.4s ease forwards;
}

.tour-package-item:nth-child(1) {
  animation-delay: 0.1s;
}
.tour-package-item:nth-child(2) {
  animation-delay: 0.2s;
}
.tour-package-item:nth-child(3) {
  animation-delay: 0.3s;
}
.tour-package-item:nth-child(4) {
  animation-delay: 0.4s;
}
.tour-package-item:nth-child(5) {
  animation-delay: 0.5s;
}
.tour-package-item:nth-child(6) {
  animation-delay: 0.6s;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.booking-form {
  animation: slideIn 0.5s ease 0.3s forwards;
  opacity: 0;
}

/* ============================================
   로딩 상태 스타일
   ============================================ */
.booking-submit-btn:disabled {
  background: #6c757d;
  cursor: not-allowed;
  transform: none;
}

.booking-submit-btn.loading {
  pointer-events: none;
}

.booking-submit-btn.loading::after {
  content: "";
  position: absolute;
  width: 24px;
  height: 24px;
  border: 3px solid transparent;
  border-top: 3px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* ============================================
   접근성 개선
   ============================================ */
.tour-package-item:focus {
  outline: 3px solid #007bff;
  outline-offset: 3px;
}

.form-group input:invalid,
.form-group select:invalid,
.form-group textarea:invalid {
  border-color: #dc3545;
}

.form-group input:invalid:focus,
.form-group select:invalid:focus,
.form-group textarea:invalid:focus {
  box-shadow: 0 0 0 4px rgba(220, 53, 69, 0.1);
}

/* ============================================
   다크모드 대응 (추후 확장용)
   ============================================ */
@media (prefers-color-scheme: dark) {
  .booking-container {
    background: #2d3748;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  }

  .booking-sidebar {
    background: #2d3748;
  }

  .sidebar-logo {
    background: #2d3748;
    border-color: #4a5568;
  }

  .sidebar-logo .logo-text {
    color: #e2e8f0;
  }

  .tour-packages,
  .booking-form {
    border-color: #4a5568;
  }

  .tour-packages h3,
  .booking-form h3 {
    color: #e2e8f0;
  }

  .tour-package-item {
    background: #374151;
    border-color: #4a5568;
  }

  .tour-package-item.selected {
    background: #1a365d;
  }

  .tour-package-title {
    color: #e2e8f0;
  }

  .tour-package-description {
    color: #a0aec0;
  }

  .form-group label {
    color: #e2e8f0;
  }

  .form-group input,
  .form-group select,
  .form-group textarea {
    background: #374151;
    border-color: #4a5568;
    color: #e2e8f0;
  }

  .form-group input[readonly] {
    background: #4a5568;
    color: #a0aec0;
  }

  .total-price {
    background: #1a365d;
    border-color: #2b6cb0;
  }
}

/* ============================================
   견적 요약 페이지 스타일
   ============================================ */
.page-title {
  text-align: center;
  margin-bottom: 30px;
  padding: 20px;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 12px;
  border-left: 4px solid #007bff;
}

.page-title h1 {
  margin: 0 0 10px 0;
  color: #2c3e50;
  font-size: 28px;
  font-weight: 700;
}

.page-title p {
  margin: 0;
  color: #6c757d;
  font-size: 16px;
}

.summary-section {
  background: white;
  border-radius: 12px;
  padding: 25px;
  margin-bottom: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  border: 1px solid #e9ecef;
}

.summary-section h3 {
  margin: 0 0 20px 0;
  color: #2c3e50;
  font-size: 18px;
  font-weight: 600;
  padding-bottom: 10px;
  border-bottom: 2px solid #f8f9fa;
}

.tour-summary-card {
  background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
  color: white;
  border-radius: 10px;
  padding: 20px;
}

.tour-info h4 {
  margin: 0 0 15px 0;
  font-size: 20px;
  font-weight: 600;
}

.tour-details {
  display: flex;
  gap: 20px;
  margin-bottom: 15px;
  flex-wrap: wrap;
}

.tour-duration,
.tour-price {
  background: rgba(255, 255, 255, 0.2);
  padding: 8px 15px;
  border-radius: 20px;
  font-weight: 500;
  font-size: 14px;
}

.tour-description {
  margin: 0;
  opacity: 0.9;
  line-height: 1.5;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
}

.info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 15px;
  background: #f8f9fa;
  border-radius: 8px;
  border-left: 3px solid #007bff;
}

.info-item.total {
  background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
  color: white;
  font-weight: 600;
  border-left: 3px solid #0056b3;
}

.info-item.full-width {
  grid-column: 1 / -1;
}

.info-item label {
  font-weight: 500;
  color: #495057;
  margin: 0;
}

.info-item.total label {
  color: white;
}

.info-item span {
  font-weight: 600;
  color: #2c3e50;
}

.info-item.total span {
  color: white;
}

.child-ages,
.special-luggage {
  margin-top: 15px;
  padding: 12px 15px;
  background: #e3f2fd;
  border-radius: 8px;
  border-left: 3px solid #2196f3;
}

.child-ages label,
.special-luggage label {
  display: block;
  font-weight: 500;
  color: #1976d2;
  margin-bottom: 5px;
}

.special-request-text {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 8px;
  border-left: 3px solid #28a745;
  line-height: 1.6;
  color: #495057;
}

.price-summary {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border: 2px solid #007bff;
}

.price-breakdown {
  margin-bottom: 15px;
}

.price-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #dee2e6;
}

.price-item:last-child {
  border-bottom: none;
}

.price-item.total-price {
  font-size: 20px;
  font-weight: 700;
  color: #007bff;
  padding-top: 15px;
  border-top: 2px solid #007bff;
  margin-top: 10px;
}

.price-note {
  margin: 0;
  font-size: 14px;
  color: #6c757d;
  font-style: italic;
  text-align: center;
}

.summary-actions {
  display: flex;
  gap: 15px;
  margin: 30px 0;
}

.secondary-btn {
  flex: 1;
  padding: 15px 20px;
  background: #6c757d;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.secondary-btn:hover {
  background: #5a6268;
  transform: translateY(-2px);
}

.contact-info {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  border: 1px solid #e9ecef;
}

.contact-info h4 {
  margin: 0 0 15px 0;
  color: #2c3e50;
  font-size: 16px;
}

.contact-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.contact-btn {
  padding: 10px 20px;
  border-radius: 25px;
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.contact-btn.kakao {
  background: #fee500;
  color: #3c1e1e;
}

.contact-btn.whatsapp {
  background: #25d366;
  color: white;
}

.contact-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.error-message {
  text-align: center;
  padding: 40px 20px;
}

.error-message h2 {
  color: #dc3545;
  margin-bottom: 15px;
}

.error-message p {
  color: #6c757d;
  margin-bottom: 25px;
  font-size: 16px;
}

.error-actions {
  display: flex;
  gap: 15px;
  justify-content: center;
}

/* 견적 요약 페이지 반응형 */
@media (max-width: 768px) {
  .page-title h1 {
    font-size: 24px;
  }

  .info-grid {
    grid-template-columns: 1fr;
  }

  .tour-details {
    flex-direction: column;
    gap: 10px;
  }

  .summary-actions {
    flex-direction: column;
  }

  .contact-buttons {
    flex-direction: column;
    align-items: center;
  }

  .contact-btn {
    width: 200px;
    justify-content: center;
  }

  .error-actions {
    flex-direction: column;
    align-items: center;
  }
}
