/* Force plugin styles to take priority */
/* Load fonts (safe repeat in inline to ensure availability when only inline CSS is used) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Rubik:wght@700&display=swap');

/* Ensure step connectors remain visible on small screens */
@media (max-width: 768px) {
  .wpbp-step:before,
  .wpbp-step:after {
    top: 16px !important;
    width: calc(50% - 16px) !important;
  }
}
@media (max-width: 480px) {
  .wpbp-step:before,
  .wpbp-step:after {
    top: 14px !important;
    width: calc(50% - 14px) !important;
  }
}

body .wpbp-booking-form,
.wpbp-booking-form {
  max-width: 600px !important;
  margin: 20px auto !important;
  padding: 20px !important;
  border: 1px solid #ddd !important;
  border-radius: 8px !important;
  background: #fff !important;
  font-family: 'Inter', Arial, sans-serif !important;
  box-sizing: border-box !important;
}

.wpbp-booking-form * {
  box-sizing: border-box !important;
  font-family: 'Inter', Arial, sans-serif !important;
}

/* Headings and strong/bold text use Rubik Bold */
.wpbp-booking-form h1,
.wpbp-booking-form h2,
.wpbp-booking-form h3,
.wpbp-booking-form h4,
.wpbp-booking-form h5,
.wpbp-booking-form h6,
.wpbp-booking-form strong,
.wpbp-booking-form b {
  font-family: 'Rubik', 'Inter', Arial, sans-serif !important;
  font-weight: 700 !important;
}

/* Ensure buttons explicitly use Inter */
.wpbp-booking-form button,
.wpbp-booking-form .wpbp-btn {
  font-family: 'Inter', Arial, sans-serif !important;
}

/* Multi-step progress */
.wpbp-step-progress {
  display: flex !important;
  justify-content: space-between !important;
  margin-bottom: 30px !important;
  padding: 0 5px !important;
  position: relative !important;
  overflow-x: auto !important; /* enable horizontal scroll on small screens */
  min-height: 80px !important;
  border-bottom: none !important;
}

.wpbp-step {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  position: relative !important;
  flex: 1 !important;
  max-width: 200px !important;
  z-index: 2 !important; /* circles above connectors */
}

/* Connector lines between steps - MOBILE ONLY */
@media (max-width: 768px) {
  .wpbp-step:before,
  .wpbp-step:after {
    content: '' !important;
    position: absolute !important;
    top: 16px !important; /* match 32px circle */
    height: 2px !important;
    background: #e0e0e0 !important;
    z-index: 1 !important;
  }
  .wpbp-step:before {
    left: 0 !important;
    width: calc(50% - 16px) !important;
  }
  .wpbp-step:after {
    right: 0 !important;
    width: calc(50% - 16px) !important;
  }
  .wpbp-step:first-child:before {
    display: none !important;
  }
  .wpbp-step:last-child:after {
    display: none !important;
  }
}

@media (max-width: 480px) {
  .wpbp-step:before,
  .wpbp-step:after {
    top: 14px !important;
    width: calc(50% - 14px) !important;
  }
}

.wpbp-step .step-number {
  width: 40px !important;
  height: 40px !important;
  border-radius: 50% !important;
  background: #e0e0e0 !important;
  color: #999 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-weight: bold !important;
  font-size: 16px !important;
  margin-bottom: 8px !important;
  position: relative !important;
  z-index: 2 !important;
  transition: all 0.3s ease !important;
}

.wpbp-step.active .step-number {
  background: #0073aa !important;
  color: white !important;
}

.wpbp-form-step {
  display: none !important;
}

.wpbp-form-step.active {
  display: block !important;
}

/* Calendar styles */
.wpbp-calendar-widget {
  background: #fff !important;
  border: 2px solid #e0e0e0 !important;
  border-radius: 12px !important;
  padding: 20px !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
  max-width: 600px !important;
  margin: 0 auto !important;
}

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

.wpbp-calendar-day {
  aspect-ratio: 1 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 8px !important;
  font-weight: 500 !important;
  font-size: 14px !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  position: relative !important;
  /* Default styling to prevent flashing */
  background: #f8f9fa !important;
  border: 1px solid #e9ecef !important;
  color: #333 !important;
}

.wpbp-day-available {
  background: #f8f9fa !important;
  color: #333 !important;
  border: 1px solid #e9ecef !important;
}

.wpbp-day-selected {
  background: #0073aa !important;
  color: white !important;
  border-color: #0073aa !important;
  font-weight: 600 !important;
}

.wpbp-day-disabled {
  background: #f5f5f5 !important;
  color: #ccc !important;
  border: 1px solid #e0e0e0 !important;
  cursor: not-allowed !important;
}

.wpbp-day-unavailable {
  background: #fff2f2 !important;
  color: #999 !important;
  border: 1px solid #f0c0c0 !important;
  cursor: not-allowed !important;
}

/* Blackout label pill — two-line clamp (keeps grid even) */
.wpbp-calendar-day.wpbp-day-blackout::after {
  content: attr(data-label) !important;
  position: absolute !important;
  left: 4px !important;
  right: 4px !important;
  bottom: 2px !important;
  background: #20c997 !important;
  color: #fff !important;
  font-size: 7px !important;
  line-height: 1.1 !important;
  padding: 3px !important;
  border-radius: 8px !important;
  text-align: center !important;

  /* Wrap to 2 lines with ellipsis */
  display: -webkit-box !important;
  -webkit-box-orient: vertical !important;
  -webkit-line-clamp: 2 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: normal !important;
  max-height: calc(1.2em * 2 + 6px) !important; /* 2 lines + padding */
}

@media (max-width: 420px) {
  .wpbp-calendar-day.wpbp-day-blackout::after {
    font-size: 10px !important;
    padding: 3px 4px !important;
  }
}

.wpbp-day-available:hover {
  background: #e3f2fd !important;
  border-color: #0073aa !important;
}

/* Additional Guest Names Styles */
.wpbp-additional-guests {
  margin-top: 25px !important;
  padding: 20px !important;
  background: #f8f9fa !important;
  border-radius: 8px !important;
  border: 1px solid #e9ecef !important;
}

.wpbp-additional-guests h5 {
  margin: 0 0 10px 0 !important;
  color: #333 !important;
  font-size: 16px !important;
  font-weight: 600 !important;
}

.wpbp-guest-info {
  margin: 0 0 15px 0 !important;
  color: #666 !important;
  font-size: 14px !important;
  font-style: italic !important;
}

.wpbp-guest-name-field {
  margin-bottom: 15px !important;
}

.wpbp-guest-name-field label {
  display: block !important;
  margin-bottom: 5px !important;
  font-weight: 500 !important;
  color: #333 !important;
}

.wpbp-guest-name-field input {
  width: 100% !important;
  padding: 10px !important;
  border: 1px solid #ddd !important;
  border-radius: 4px !important;
  font-size: 14px !important;
  transition: border-color 0.3s ease !important;
  box-sizing: border-box !important;
}

.wpbp-guest-name-field input:focus {
  outline: none !important;
  border-color: #0073aa !important;
  box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.1) !important;
}

/* Checkbox Styling Fix */
.wpbp-addon-item input[type='checkbox'] {
  width: 18px !important;
  height: 18px !important;
  margin-right: 12px !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  cursor: pointer !important;
  accent-color: #0073aa !important;
  flex-shrink: 0 !important;
}

/* Guide Dropdown Styling */
.wpbp-guide-dropdown option:disabled {
  color: #999 !important;
  background-color: #f5f5f5 !important;
  font-style: italic !important;
}

.wpbp-guide-dropdown {
  width: 100% !important;
  padding: 10px !important;
  border: 1px solid #ddd !important;
  border-radius: 4px !important;
  font-size: 14px !important;
  background-color: #fff !important;
  transition: border-color 0.3s ease !important;
}

.wpbp-guide-dropdown:focus {
  outline: none !important;
  border-color: #0073aa !important;
  box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.1) !important;
}

/* Loading Spinner */
.wpbp-spinner {
  display: inline-block !important;
  width: 16px !important;
  height: 16px !important;
  border: 2px solid #f3f3f3 !important;
  border-top: 2px solid #0073aa !important;
  border-radius: 50% !important;
  animation: wpbp-spin 1s linear infinite !important;
  margin-right: 8px !important;
  vertical-align: middle !important;
}

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

/* Larger spinner for PayPal redirect */
.wpbp-paypal-redirect .wpbp-spinner {
  width: 40px !important;
  height: 40px !important;
  border: 4px solid #f3f3f3 !important;
  border-top: 4px solid #0066cc !important;
  margin: 0 auto !important;
  margin-right: 0 !important;
}

/* Coupon Section Styles */
.wpbp-coupon-section {
  background: #f8f9fa !important;
  border: 1px solid #e9ecef !important;
  border-radius: 8px !important;
  padding: 20px !important;
  margin-bottom: 20px !important;
}

.wpbp-coupon-input-group {
  display: flex !important;
  gap: 10px !important;
  align-items: flex-end !important;
  margin-top: 8px !important;
}

.wpbp-coupon-input-group input {
  flex: 1 !important;
  padding: 10px !important;
  border: 1px solid #ddd !important;
  border-radius: 4px !important;
  font-size: 14px !important;
  transition: border-color 0.3s ease !important;
}

.wpbp-coupon-input-group input:focus {
  outline: none !important;
  border-color: #0073aa !important;
  box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.1) !important;
}

.wpbp-coupon-input-group button {
  padding: 10px 20px !important;
  background: #0073aa !important;
  color: white !important;
  border: none !important;
  border-radius: 4px !important;
  cursor: pointer !important;
  font-size: 14px !important;
  transition: background-color 0.3s ease !important;
  white-space: nowrap !important;
}

.wpbp-coupon-input-group button:hover {
  background: #005a87 !important;
}

.wpbp-coupon-input-group button:disabled {
  background: #ccc !important;
  cursor: not-allowed !important;
}

.wpbp-coupon-message {
  margin-top: 10px !important;
  padding: 12px !important;
  border-radius: 4px !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  line-height: 1.4 !important;
  position: relative !important;
  z-index: 9999 !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
  animation: wpbp-message-slide-in 0.3s ease-out !important;
}

@keyframes wpbp-message-slide-in {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.wpbp-coupon-message.success {
  background: #d4edda !important;
  color: #155724 !important;
  border: 1px solid #c3e6cb !important;
  border-left: 4px solid #28a745 !important;
}

.wpbp-coupon-message.error {
  background: #f8d7da !important;
  color: #721c24 !important;
  border: 1px solid #f5c6cb !important;
  border-left: 4px solid #dc3545 !important;
}

.wpbp-coupon-applied {
  margin-top: 15px !important;
  padding: 15px !important;
  background: #d4edda !important;
  border: 1px solid #c3e6cb !important;
  border-radius: 6px !important;
}

.coupon-success {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  margin-bottom: 8px !important;
}

.coupon-success .coupon-icon {
  color: #28a745 !important;
  font-weight: bold !important;
  margin-right: 8px !important;
}

.coupon-success .coupon-text {
  flex: 1 !important;
  color: #155724 !important;
  font-size: 14px !important;
}

.wpbp-remove-coupon {
  background: none !important;
  border: none !important;
  color: #dc3545 !important;
  cursor: pointer !important;
  font-size: 12px !important;
  text-decoration: underline !important;
  padding: 0 !important;
}

.wpbp-remove-coupon:hover {
  color: #c82333 !important;
}

.coupon-discount {
  color: #155724 !important;
  font-weight: 600 !important;
  font-size: 14px !important;
}

/* Ensure coupon applied section is hidden by default */
#wpbp_coupon_applied[style*='display: none'] {
  display: none !important;
}

@media screen and (max-width: 768px) {
  .wpbp-coupon-input-group {
    flex-direction: column !important;
    gap: 10px !important;
    align-items: flex-start !important;
  }
  .wpbp-coupon-input-group button {
    width: 100% !important;
  }
}

/* Keep steps on a single line on mobile with horizontal scroll */
@media (max-width: 768px) {
  .wpbp-step-progress {
    flex-wrap: nowrap !important;
  }
  .wpbp-step .step-number {
    width: 25px !important;
    height: 25px !important;
    font-size: 12px !important;
  }
  .wpbp-step {
    max-width: 50px !important;
  }
  .wpbp-step::before {
    display: none !important;
  }
  .wpbp-step .step-title {
    font-size: 10px !important;
  }
}

/* Removed duplicate legacy blackout label rule in favor of two-line clamp above */

/* Block interactions on disabled dates */
.wpbp-day-disabled {
  pointer-events: none !important;
}

/* Override: If a day is both disabled and unavailable, keep it grey and hide the red strike */
.wpbp-calendar-day.wpbp-day-disabled,
.wpbp-day-disabled {
  background: #f5f5f5 !important;
  color: #ccc !important;
  cursor: not-allowed !important;
  border: 1px solid #e0e0e0 !important;
}
.wpbp-calendar-day.wpbp-day-disabled:hover {
  background: #f5f5f5 !important;
  border-color: #e0e0e0 !important;
  transform: none !important;
}
.wpbp-calendar-day.wpbp-day-disabled.wpbp-day-unavailable {
  background: #f5f5f5 !important;
  color: #ccc !important;
  border: 1px solid #e0e0e0 !important;
}
.wpbp-calendar-day.wpbp-day-disabled.wpbp-day-unavailable::after {
  display: none !important;
}
