/* Booking Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0);
  backdrop-filter: blur(0px);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 40px 20px;
  opacity: 0;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              backdrop-filter 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal.active {
  display: flex;
  opacity: 1;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
}

.modal-content {
  background: var(--surface-elevated);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 30px;
  padding: 40px;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--modal-shadow);
  border: 1px solid var(--border-color);
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  margin: auto;
  transform: scale(0.85) translateY(30px);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
              opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform, opacity;
}

.modal.active .modal-content {
  transform: scale(1) translateY(0);
  opacity: 1;
  box-shadow: var(--modal-shadow-active);
}

.modal-content .info-content {
  flex: 1;
  padding-top: 0;
  padding-bottom: 0;
  min-height: 0;
}

.modal-content form {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* Scrollbar styles for modal content */
.modal-content::-webkit-scrollbar {
  width: 10px;
}

.modal-content::-webkit-scrollbar-track {
  background: transparent;
  margin: 8px 0;
}

.modal-content::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 5px;
  border: 2px solid var(--surface-elevated);
}

.modal-content::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* Firefox scrollbar */
.modal-content {
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
}

#bookingForm {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.modal-header {
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  margin-bottom: 30px;
  flex-shrink: 0;
  gap: 15px;
  padding-right: 0;
}

.modal-header .close-btn {
  display: none;
}

.modal-header h2 {
  font-size: 28px;
  font-weight: 400;
  margin: 0;
  flex: 1;
  word-wrap: break-word;
  overflow-wrap: break-word;
  line-height: 1.3;
  min-width: 0;
}

.close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: var(--surface-control);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 10;
  box-shadow: 0 4px 12px rgba(107, 114, 128, 0.15);
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Убеждаемся, что все кнопки закрытия находятся в одном месте */
#bookingModal .close-btn,
#wellnessModal .close-btn,
#infoModal .close-btn,
#menuModal .close-btn {
  top: 20px;
  right: 20px;
}

.close-btn::before,
.close-btn::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 1px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.close-btn::before {
  transform: rotate(45deg);
}

.close-btn::after {
  transform: rotate(-45deg);
}

.close-btn:hover {
  background: var(--primary-color);
  box-shadow: 0 6px 20px rgba(107, 114, 128, 0.3);
  transform: scale(1.1) rotate(90deg);
}

.close-btn:hover::before,
.close-btn:hover::after {
  background: white;
}

.close-btn:active {
  transform: scale(1.05) rotate(90deg);
}

.form-group {
  margin-bottom: 25px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 400;
  margin-bottom: 8px;
  color: var(--text-secondary);
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  font-size: 16px;
  font-family: inherit;
  background: var(--surface-input);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(107, 114, 128, 0.1);
}

/* Guests Input with Icons */
.guests-input-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.guest-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: var(--bg-gray);
  color: var(--text-primary);
  font-size: 24px;
  font-weight: 400;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.guest-btn:hover:not(:disabled) {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  transform: scale(1.05);
}

.guest-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.guests-input-container {
  position: relative;
  display: flex;
  width: auto;
  min-width: 60px;
}

.guests-input-container input {
  width: 60px;
  min-width: 60px;
  text-align: center;
  font-size: 18px;
  font-weight: 400;
  cursor: default;
  padding: 12px 8px;
  height: 40px;
  box-sizing: border-box;
}

.guests-icons {
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  min-height: 28px;
  padding: 8px 0 0 0;
  margin-top: 8px;
}

.guest-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #9CA3AF;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: popIn 0.3s ease;
}

.guest-icon svg {
  width: 16px;
  height: 16px;
}

@keyframes popIn {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Custom Calendar Styles */
.calendar-group {
  margin-bottom: 30px;
}

.custom-calendar {
  background: var(--bg-gray);
  border-radius: 20px;
  padding: 25px;
  border: 1px solid var(--border-color);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(107, 114, 128, 0.1);
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--border-color);
}

.calendar-nav-btn {
  background: var(--primary-color);
  color: white;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  font-weight: 400;
}

.calendar-nav-btn:hover {
  background: #4B5563;
  transform: scale(1.1);
}

.calendar-month-year {
  font-size: 18px;
  font-weight: 400;
  color: var(--text-primary);
  text-transform: capitalize;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.calendar-weekday {
  text-align: center;
  font-size: 13px;
  font-weight: 400;
  color: var(--text-secondary);
  padding: 8px 0;
}

.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 400;
  color: var(--text-primary);
  background: transparent;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  position: relative;
}

.calendar-day:hover:not(.calendar-day.disabled):not(.calendar-day.selected) {
  background: var(--bg-gray);
  border-color: var(--border-color);
  transform: scale(1.1);
}

.calendar-day.disabled {
  color: var(--text-secondary);
  opacity: 0.3;
  cursor: not-allowed;
}

.calendar-day.other-month {
  color: var(--text-secondary);
  opacity: 0.4;
}

.calendar-day.today {
  background: rgba(107, 114, 128, 0.1);
  border-color: var(--primary-color);
  font-weight: 400;
}

.calendar-day.selected {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  font-weight: 400;
  box-shadow: 0 4px 12px rgba(107, 114, 128, 0.3);
}

.calendar-day.selected:hover {
  background: #4B5563;
  transform: scale(1.05);
}

.submit-btn {
  width: 100%;
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 16px;
  font-size: 17px;
  font-weight: 400;
  border-radius: 12px;
  cursor: pointer;
  margin-top: 10px;
  transition: background 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 2px 10px rgba(107, 114, 128, 0.2);
}

.submit-btn:hover {
  background: #4B5563;
  box-shadow: 0 4px 15px rgba(107, 114, 128, 0.3);
}

.submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.success-message {
  display: none;
  text-align: center;
  padding: 40px 20px;
}

.success-message.active {
  display: block;
}

.success-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 30px;
  font-weight: 400;
}

.success-message h3 {
  font-size: 24px;
  margin-bottom: 10px;
}

.success-message p {
  color: var(--text-secondary);
  font-size: 17px;
}

.info-content {
  text-align: center;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

.info-content > * {
  max-width: 100%;
}

/* Tour Picture в Info Modal - СТРОГО ФИКСИРОВАННЫЕ РАЗМЕРЫ */
#infoModal .tour-picture-wrapper {
  width: 350px !important;
  height: 350px !important;
  min-width: 350px !important;
  max-width: 350px !important;
  min-height: 350px !important;
  max-height: 350px !important;
  aspect-ratio: 1 !important;
  margin: 20px auto;
  position: relative;
  border-radius: 30px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  box-shadow: 
    0 25px 80px rgba(107, 114, 128, 0.35),
    0 10px 30px rgba(107, 114, 128, 0.25);
  cursor: pointer;
  background: var(--bg-gray);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  flex-shrink: 0;
  box-sizing: border-box;
}

.tour-picture-wrapper:hover {
  transform: scale(1.02);
  box-shadow: 
    0 30px 90px rgba(107, 114, 128, 0.4),
    0 15px 40px rgba(107, 114, 128, 0.3);
}

#infoModal .tour-picture-wrapper .shimmer-modal {
  position: absolute;
  top: 0;
  left: 0;
  width: 350px !important;
  height: 350px !important;
  border-radius: 30px;
  z-index: 1;
}

#infoModal .tour-picture-wrapper picture {
  display: block;
  width: 350px !important;
  height: 350px !important;
  position: relative;
  z-index: 2;
  flex-shrink: 0;
}

#infoModal .tour-picture-wrapper .modal-image {
  width: 350px !important;
  height: 350px !important;
  min-width: 350px !important;
  max-width: 350px !important;
  min-height: 350px !important;
  max-height: 350px !important;
  object-fit: cover;
  border-radius: 30px;
  display: block;
  flex-shrink: 0;
}

.info-title {
  font-size: 20px;
  font-weight: 400;
  color: var(--text-primary);
  margin-top: 0;
  margin-bottom: 15px;
}

.info-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 15px;
}

.contact-info {
  margin-top: 20px;
  width: 100%;
  max-width: 500px;
  text-align: left;
}

.contact-info p {
  margin: 8px 0;
  font-size: 16px;
  color: var(--text-primary);
}

.contact-info a {
  transition: all 0.2s ease;
}

.contact-info a:hover {
  text-decoration: underline;
  opacity: 0.8;
}

.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 16px 0;
}

.contact-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--bg-gray);
  color: var(--primary-color);
  flex-shrink: 0;
}

.contact-icon .material-icons {
  font-size: 20px;
}

.contact-item > div[style*="flex: 1"] {
  flex: 1;
}

.contact-item strong {
  display: block;
  margin-bottom: 10px;
  font-size: 16px;
  color: var(--text-primary);
}

.contact-item p {
  margin: 6px 0;
  display: block;
}

.info-description {
  text-align: left;
  margin: 20px 0;
  line-height: 1.7;
  color: var(--text-secondary);
}

.info-description a:hover {
  opacity: 0.8;
  transform: translateY(-1px);
}

.modal-image-wrapper {
  width: 100%;
  max-width: 100%;
  margin: 20px 0;
  padding: 0;
  position: relative;
  border-radius: 30px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  box-shadow: 
    0 25px 80px rgba(107, 114, 128, 0.35),
    0 10px 30px rgba(107, 114, 128, 0.25);
  filter: drop-shadow(0 15px 40px rgba(107, 114, 128, 0.5));
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s ease, border-color 0.4s ease;
  cursor: pointer;
}

/* Исключение для аватарки в hero секции - должна быть круглой */
.guide-profile .modal-image-wrapper {
  border-radius: 50% !important;
  overflow: hidden !important; /* Обрезаем углы */
  border: none !important; /* Убираем border, он на ::before */
}

.guide-profile .modal-image-wrapper .modal-image,
.guide-profile .modal-image {
  border-radius: 50% !important;
}

.guide-profile .modal-image-wrapper picture,
.guide-profile .modal-image-wrapper picture img,
.guide-profile .modal-image-wrapper img {
  border-radius: 50% !important;
}

/* Скрываем ::after для обычных modal-image-wrapper, кроме studio-mode */
.modal-image-wrapper::after {
  display: none;
}

/* Разрешаем ::after только для studio-mode в hero */
.hero.studio-mode .guide-profile .modal-image-wrapper::after {
  display: block;
}

.modal-image-wrapper:hover {
  transform: scale(1.02);
  box-shadow: 
    0 30px 90px rgba(107, 114, 128, 0.4),
    0 15px 40px rgba(107, 114, 128, 0.3);
  border-color: rgba(107, 114, 128, 0.5);
}

.modal-image {
  width: 100%;
  height: auto;
  border-radius: 30px;
  object-fit: cover;
  display: block;
  position: relative;
  transition: none;
  z-index: 2;
  margin: 0;
}

/* Исключение для аватарки - должна быть круглой */
.guide-profile .modal-image {
  border-radius: 50% !important;
}

.modal-image-wrapper picture,
.modal-image-wrapper a {
  display: block;
  position: relative;
  z-index: 2;
}

.modal-image-wrapper .modal-image {
  position: relative;
  z-index: 2;
}


@media (max-width: 768px) {
  .modal-content {
    padding: 30px 20px;
  }

  #infoModal .tour-picture-wrapper {
    width: 300px !important;
    height: 300px !important;
    min-width: 300px !important;
    max-width: 300px !important;
    min-height: 300px !important;
    max-height: 300px !important;
    margin: 15px auto;
  }

  #infoModal .tour-picture-wrapper .shimmer-modal,
  #infoModal .tour-picture-wrapper picture,
  #infoModal .tour-picture-wrapper .modal-image {
    width: 300px !important;
    height: 300px !important;
    min-width: 300px !important;
    max-width: 300px !important;
    min-height: 300px !important;
    max-height: 300px !important;
  }
}

@media (max-width: 480px) {
  #infoModal .tour-picture-wrapper {
    width: 250px !important;
    height: 250px !important;
    min-width: 250px !important;
    max-width: 250px !important;
    min-height: 250px !important;
    max-height: 250px !important;
    margin: 15px auto;
  }

  #infoModal .tour-picture-wrapper .shimmer-modal,
  #infoModal .tour-picture-wrapper picture,
  #infoModal .tour-picture-wrapper .modal-image {
    width: 250px !important;
    height: 250px !important;
    min-width: 250px !important;
    max-width: 250px !important;
    min-height: 250px !important;
    max-height: 250px !important;
  }
}

[lang="th"] {
  display: none;
}

