/* Experience Booking Widget - New Design */

/* Container wrapper to ensure proper spacing in any template */
.experience-booking-widget-container {
  width: 100%;
  padding: 20px 0;
  background: transparent;
}

.experience-booking-widget {
  max-width: 460px;
  margin: 20px auto;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: white !important;
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  /* Reset styles to ensure consistency across templates */
  box-sizing: border-box;
  color: #333;
  font-size: 16px;
  line-height: 1.5;
  /* Ensure widget is always visible */
  position: relative;
  z-index: 1;
}

/* Ensure all child elements use border-box */
.experience-booking-widget *,
.experience-booking-widget *::before,
.experience-booking-widget *::after {
  box-sizing: border-box;
}

/* First Section - Booking Form */
.booking-form {
  background: transparent;
  border-radius: 20px;
  padding: 30px;
  margin-bottom: 20px;
  border: 1px solid #e0e0e0;
}

/* Dropdown Container */
.dropdown-container {
  position: relative;
  margin-bottom: 16px;
}

.dropdown-button {
  width: 100%;
  padding: 16px 20px;
  background: white;
  border: 1px solid #ddd;
  border-radius: 50px;
  font-size: 16px;
  text-align: left;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s ease;
  color: #333;
  /* iOS Safari fixes */
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  touch-action: manipulation;
  user-select: none;
  min-height: 44px;
}

.button-content {
  display: flex;
  align-items: center;
  gap: 8px;
}

.globe-icon {
  color: #666;
  flex-shrink: 0;
}

.dropdown-button:hover {
  border-color: #999;
}

.dropdown-button.error {
  border-color: #ff4444;
}

.field-error {
  display: block;
  color: #ff4444;
  font-size: 13px;
  margin-top: 4px;
  margin-left: 20px;
}

.dropdown-arrow {
  width: 20px;
  height: 20px;
  transition: transform 0.2s ease;
}

.dropdown-container.open .dropdown-arrow {
  transform: rotate(180deg);
}

/* Dropdown Menu */
.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #ddd;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  overflow: hidden;
  /* iOS Safari fixes */
  -webkit-overflow-scrolling: touch;
  -webkit-tap-highlight-color: transparent;
}

.dropdown-item {
  padding: 14px 20px;
  cursor: pointer;
  transition: background 0.2s ease;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  /* iOS Safari fixes */
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  min-height: 44px;
}

.dropdown-item:hover {
  background: #f5f5f5;
}

.dropdown-item.selected {
  background: #fff5ed;
  color: #ff9b4e;
}

/* Language Dropdown Specific */
.language-dropdown {
  padding: 8px;
}

.language-dropdown .dropdown-item {
  border-radius: 8px;
  margin: 2px 0;
}

.language-flag {
  font-size: 20px;
  line-height: 1;
}

.language-name {
  flex: 1;
}

/* Participants Dropdown */
.participants-dropdown {
  padding: 8px;
}

.participant-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  border-radius: 8px;
  transition: background 0.2s ease;
}

.participant-row:hover {
  background: #f5f5f5;
}

.participant-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex: 1;
  margin-right: 20px;
}

.participant-label {
  font-size: 16px;
  color: #333;
}

.participant-price {
  font-size: 16px;
  color: #666;
}

.participant-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

.control-btn {
  width: 44px;
  height: 44px;
  border: 1px solid #ddd;
  /* iOS Safari fixes */
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  border-radius: 50%;
  background: white;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  color: #333;
}

.control-btn:hover:not(:disabled) {
  background: #f5f5f5;
  border-color: #999;
}

.control-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.participant-count {
  min-width: 20px;
  text-align: center;
  font-size: 16px;
  font-weight: 500;
}

/* Calendar Icon in Button */
.calendar-icon {
  width: 24px;
  height: 24px;
  color: #666;
}

/* Calendar Dropdown */
.calendar-dropdown {
  padding: 20px;
  min-width: 580px;
  max-width: 600px;
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.month-nav {
  width: 44px;
  height: 44px;
  border: none;
  background: white;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  border: 1px solid #ddd;
  /* iOS Safari fixes */
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
}

.month-nav:hover:not(:disabled) {
  background: #f5f5f5;
  border-color: #999;
}

.month-nav:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.month-name {
  font-size: 16px;
  font-weight: 600;
  color: #333;
  text-align: center;
  margin: 0 0 12px 0;
}

/* Calendar Months */
.calendar-months {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-bottom: 20px;
}

.calendar-month {
  min-width: 250px;
}

.weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin-bottom: 8px;
}

.weekday {
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: #666;
  padding: 8px;
}

.month-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.day {
  aspect-ratio: 1;
  border: none;
  background: white;
  cursor: pointer;
  font-size: 14px;
  border-radius: 8px;
  transition: all 0.2s ease;
  color: #333;
  font-weight: 500;
  /* iOS Safari fixes */
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  min-width: 44px;
  min-height: 44px;
}

.day.empty {
  visibility: hidden;
}

.day.past {
  color: #ccc;
  cursor: not-allowed;
  text-decoration: line-through;
}

.day.available {
  background: #e8f4ff;
  color: #333;
}

.day.available:hover {
  background: #ff9b4e;
  color: white;
}

.day.selected {
  background: #ff9b4e;
  color: white;
}

.day:disabled {
  color: #ccc;
  cursor: not-allowed;
  background: #f5f5f5;
}

/* Calendar Legend */
.calendar-legend {
  display: flex;
  gap: 24px;
  justify-content: center;
  padding-top: 16px;
  border-top: 1px solid #e0e0e0;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #666;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 4px;
}

.legend-dot.available {
  background: #e8f4ff;
}

.legend-dot.unavailable {
  background: #f5f5f5;
}

/* Verify Button */
.verify-button {
  width: 100%;
  padding: 16px;
  background: #ff9b4e;
  color: white;
  border: none;
  border-radius: 50px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  /* iOS Safari fixes */
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  min-height: 44px;
  -webkit-appearance: none;
}

.verify-button:hover:not(:disabled) {
  background: #ff8a33;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 155, 78, 0.3);
}

.verify-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Second Section - Results */
.booking-results {
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.section-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 20px;
  color: #333;
}

/* Time Slots */
.time-slots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 30px;
}

.no-slots-message {
  grid-column: 1 / -1;
  text-align: center;
  color: #666;
  font-style: italic;
  padding: 20px;
}

.time-slot {
  padding: 12px 16px;
  background: white;
  border: 1px solid #ddd;
  border-radius: 12px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  /* iOS Safari fixes */
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  min-height: 60px;
  color: #333;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 60px;
  justify-content: center;
}

.time-slot:hover:not(:disabled) {
  border-color: #ff9b4e;
  box-shadow: 0 2px 8px rgba(255, 155, 78, 0.2);
}

.time-slot.selected {
  background: #ff9b4e;
  color: white;
  border-color: #ff9b4e;
}

.time-slot.selected .spots-available,
.time-slot.selected .spots-warning {
  color: white;
  opacity: 0.9;
}

.time-slot.limited {
  border-color: #ff6b6b;
  background: #fff5f5;
}

.time-slot:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #f5f5f5;
}

.slot-time {
  font-weight: 500;
  font-size: 15px;
}

.slot-availability {
  font-size: 13px;
}

.spots-available {
  color: #666;
}

.spots-warning {
  color: #ff6b6b;
  font-weight: 500;
}

/* Price Details */
.price-details {
  margin-bottom: 30px;
}

.price-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 16px;
  color: #333;
}

.price-line span:first-child {
  color: #666;
}

.price-line span:last-child {
  font-weight: 500;
}

/* Total Section */
.total-section {
  border-top: 1px solid #e0e0e0;
  padding-top: 20px;
}

.total-price {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}

.total-price span:first-child {
  font-size: 18px;
  color: #333;
}

.total-amount {
  font-size: 32px;
  font-weight: 700;
  color: #333;
}

.tax-info {
  font-size: 14px;
  color: #666;
  margin-bottom: 20px;
}

/* Purchase Button */
.purchase-button {
  width: 100%;
  padding: 16px;
  background: #ff9b4e;
  color: white;
  border: none;
  border-radius: 50px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* iOS Safari fixes */
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  min-height: 44px;
  -webkit-appearance: none;
}

.purchase-button:hover:not(:disabled) {
  background: #ff8a33;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 155, 78, 0.3);
}

.purchase-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Loading Spinner */
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #ff9b4e;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0;
}

.loading-container {
  text-align: center;
  padding: 40px;
  color: #666;
}

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

/* Special Requests */
.special-requests {
  margin-top: 30px;
  padding-top: 30px;
  border-top: 1px solid #e0e0e0;
}

.special-requests-label {
  font-size: 16px;
  font-weight: 500;
  color: #333;
  margin-bottom: 8px;
  display: block;
}

.special-requests-textarea {
  width: 100%;
  min-height: 80px;
  padding: 12px 16px;
  border: 1px solid #ddd;
  border-radius: 12px;
  font-size: 15px;
  font-family: inherit;
  resize: vertical;
  transition: border-color 0.2s ease;
  background-color: #fff;
  color: #303030;
}

.special-requests-textarea:focus {
  outline: none;
  border-color: #ff9b4e;
}

.special-requests-hint {
  font-size: 13px;
  color: #666;
  margin-top: 4px;
}

/* Error Messages */
.error-message {
  background: #fff5f5;
  border: 1px solid #ff6b6b;
  border-radius: 8px;
  padding: 12px 16px;
  color: #d32f2f;
  font-size: 14px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.error-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* Calendar Loading State */
.calendar-loading {
  position: relative;
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Responsive */
@media (max-width: 768px) {
  .calendar-dropdown {
    min-width: auto;
    width: calc(100vw - 40px);
    max-width: 500px;
  }

  .calendar-months {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

@media (max-width: 480px) {
  .experience-booking-widget {
    max-width: 100%;
  }

  .booking-form,
  .booking-results {
    padding: 20px;
  }

  .time-slots-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }

  .total-amount {
    font-size: 28px;
  }

  /* Ensure touch targets are large enough on mobile */
  .dropdown-button,
  .control-btn,
  .day,
  .month-nav {
    min-width: 44px;
    min-height: 44px;
  }
}

