/* ============================================================
   IATE Core — Frontend Styles
   Enquiry modal, booking widget, floating button
   ============================================================ */

:root {
  --iate-green:    #1e6e4e;
  --iate-green-dk: #155a3e;
  --iate-amber:    #e67e22;
  --iate-red:      #e74c3c;
  --iate-border:   #dee2e6;
  --iate-shadow:   0 8px 40px rgba(0, 0, 0, .22);
  --iate-radius:   10px;
}

/* ── Overlay ────────────────────────────────────────────────── */
.iate-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .6);
  z-index: 99990;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}

/* ── Modal container ────────────────────────────────────────── */
.iate-modal-container {
  background: #fff;
  border-radius: var(--iate-radius);
  width: 100%;
  max-width: 620px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: var(--iate-shadow);
  animation: iate-slide-in .25s ease;
}

@keyframes iate-slide-in {
  from { opacity: 0; transform: translateY(20px) scale(.97); }
  to   { opacity: 1; transform: none; }
}

.iate-modal-close {
  position: absolute;
  top: 14px;
  right: 18px;
  background: none;
  border: none;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  color: #aaa;
  z-index: 1;
  transition: color .15s;
}

.iate-modal-close:hover {
  color: #333;
}

/* ── Modal header ───────────────────────────────────────────── */
.iate-modal-header {
  background: linear-gradient(135deg, var(--iate-green) 0%, var(--iate-green-dk) 100%);
  color: #fff;
  padding: 28px 32px 20px;
  text-align: center;
}

.iate-modal-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  background: rgba(255, 255, 255, .2);
  border-radius: 50%;
  margin-bottom: 10px;
  font-size: 22px;
}

.iate-modal-title {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 700;
}

.iate-modal-subtitle {
  margin: 0;
  opacity: .85;
  font-size: 14px;
}

/* ── Form ───────────────────────────────────────────────────── */
.iate-enquiry-form {
  padding: 24px 32px 28px;
}

.iate-form-row {
  margin-bottom: 14px;
}

.iate-form-row--2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 520px) {
  .iate-form-row--2col { grid-template-columns: 1fr; }
  .iate-enquiry-form   { padding: 20px 20px 24px; }
  .iate-modal-header   { padding: 22px 20px 16px; }
}

.iate-form-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.iate-form-field label {
  font-size: 13px;
  font-weight: 600;
  color: #444;
}

.iate-form-field label span {
  color: var(--iate-red);
  margin-left: 2px;
}

.iate-form-field input,
.iate-form-field select,
.iate-form-field textarea {
  border: 1px solid var(--iate-border);
  border-radius: 6px;
  padding: 9px 13px;
  font-size: 14px;
  background: #fff;
  color: #333;
  transition: border-color .15s, box-shadow .15s;
  box-sizing: border-box;
  width: 100%;
  font-family: inherit;
  appearance: auto;
}

.iate-form-field input:focus,
.iate-form-field select:focus,
.iate-form-field textarea:focus {
  outline: none;
  border-color: var(--iate-green);
  box-shadow: 0 0 0 3px rgba(30, 110, 78, .15);
}

.iate-form-field input.is-error,
.iate-form-field select.is-error,
.iate-form-field textarea.is-error {
  border-color: var(--iate-red);
}

.iate-form-field textarea {
  resize: vertical;
  min-height: 90px;
}

/* ── Alert ──────────────────────────────────────────────────── */
.iate-form-alert {
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 14px;
  margin-bottom: 14px;
}

.iate-form-alert.is-success {
  background: #d1fae5;
  color: #064e3b;
  border: 1px solid #a7f3d0;
}

.iate-form-alert.is-error {
  background: #fee2e2;
  color: #7f1d1d;
  border: 1px solid #fca5a5;
}

/* ── Submit button ──────────────────────────────────────────── */
.iate-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background .2s, opacity .2s;
  font-family: inherit;
}

.iate-btn--primary {
  background: var(--iate-green);
  color: #fff;
  width: 100%;
}

.iate-btn--primary:hover {
  background: var(--iate-green-dk);
}

.iate-btn--primary:disabled {
  opacity: .65;
  cursor: not-allowed;
}

/* ── Floating trigger button ────────────────────────────────── */
/* Positioned on the LEFT so it doesn't collide with the Sherpa AI chat widget (bottom-right) */
.iate-floating-btn {
  position: fixed;
  bottom: 28px;
  left: 28px;
  z-index: 99980;
  background: var(--iate-green);
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 13px 22px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 20px rgba(30, 110, 78, .45);
  transition: transform .2s, box-shadow .2s;
  font-family: inherit;
}

.iate-floating-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 26px rgba(30, 110, 78, .55);
}

@media (max-width: 480px) {
  .iate-floating-btn span { display: none; }
  .iate-floating-btn {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    padding: 0;
    justify-content: center;
    font-size: 20px;
  }
}

/* ── Booking widget (inline on single trip page) ─────────────── */
.iate-booking-widget {
  background: #fff;
  border: 1px solid var(--iate-border);
  border-radius: var(--iate-radius);
  padding: 24px;
  box-shadow: 0 2px 16px rgba(0,0,0,.08);
}

.iate-booking-widget h3 {
  margin: 0 0 16px;
  font-size: 18px;
  color: var(--iate-green);
  border-bottom: 2px solid #e8f5ee;
  padding-bottom: 10px;
}

.iate-booking-widget .price-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 16px;
}

.iate-booking-widget .price {
  font-size: 28px;
  font-weight: 700;
  color: var(--iate-green);
}

.iate-booking-widget .price-label {
  font-size: 13px;
  color: #888;
}

.iate-departures-list {
  margin-bottom: 16px;
}

.iate-departure-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border: 1px solid var(--iate-border);
  border-radius: 6px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  gap: 8px;
}

.iate-departure-item:hover,
.iate-departure-item.is-selected {
  border-color: var(--iate-green);
  background: #f0faf4;
}

.iate-departure-item.is-sold-out {
  opacity: .5;
  cursor: not-allowed;
}

.iate-departure-item .dep-date {
  font-weight: 600;
  font-size: 14px;
}

.iate-departure-item .dep-seats {
  font-size: 12px;
  color: #888;
}

.iate-departure-item .dep-price {
  font-weight: 700;
  color: var(--iate-green);
}

/* Loading spinner */
.iate-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: iate-spin .7s linear infinite;
}

@keyframes iate-spin {
  to { transform: rotate(360deg); }
}

/* ============================================================
   CAPTCHA
   ============================================================ */
.iate-captcha-wrap {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 14px 16px;
  margin: 16px 0;
}
.iate-captcha-label {
  display: block;
  font-size: 13px;
  color: #555;
  margin-bottom: 8px;
}
.iate-captcha-question {
  color: #1e6e4e;
  font-size: 16px;
  margin-left: 6px;
}
.iate-captcha-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.iate-captcha-input {
  width: 80px !important;
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  border: 2px solid #dee2e6;
  border-radius: 8px;
  padding: 6px 8px;
}
.iate-captcha-input.is-error { border-color: #ef4444; }
.iate-captcha-refresh {
  background: none;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  width: 34px;
  height: 34px;
  cursor: pointer;
  font-size: 14px;
  color: #666;
  display: flex;
  align-items: center;
  justify-content: center;
}
.iate-captcha-refresh:hover { background: #f1f3f5; color: #333; }

/* ============================================================
   Booking Section (single trip page)
   ============================================================ */
.iate-booking-section {
  margin: 48px 0 32px;
  padding: 32px;
  background: #fff;
  border: 1px solid #e9ecef;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,.07);
}
.iate-section-title {
  font-size: 24px;
  font-weight: 700;
  color: #1e6e4e;
  margin: 0 0 24px;
  padding-bottom: 12px;
  border-bottom: 2px solid #e9ecef;
}
/* ── Two-tab booking toggle ─────────────────────────────────────── */
.iate-bk-mode-toggle {
  display: flex;
  gap: 0;
  border: 2px solid var(--iate-green);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 24px;
  width: fit-content;
}
.iate-bk-mode-btn {
  background: #fff;
  border: none;
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 600;
  color: var(--iate-green);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: background .15s, color .15s;
  font-family: inherit;
}
.iate-bk-mode-btn + .iate-bk-mode-btn {
  border-left: 2px solid var(--iate-green);
}
.iate-bk-mode-btn:hover {
  background: #f0faf4;
}
.iate-bk-mode-btn.is-active {
  background: var(--iate-green);
  color: #fff;
}
@media (max-width: 480px) {
  .iate-bk-mode-toggle { width: 100%; }
  .iate-bk-mode-btn { flex: 1; justify-content: center; padding: 10px 12px; font-size: 13px; }
}

/* ── Booking panels ─────────────────────────────────────────────── */
.iate-bk-panel {
  max-width: 680px;
}
.iate-bk-panel-custom__hint {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #555;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 7px;
  padding: 9px 13px;
  margin-bottom: 14px;
}
.iate-bk-panel-custom__hint i { color: var(--iate-green); }

/* ── Departure locked badge ─────────────────────────────────────── */
.iate-dep-locked {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f0fdf4;
  border: 2px solid #86efac;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 16px;
}
.iate-dep-locked > .fa-solid.fa-lock {
  font-size: 20px;
  color: #22c55e;
  flex-shrink: 0;
}
.iate-dep-locked__info {
  flex: 1;
}
.iate-dep-locked__info strong {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: #15803d;
  margin-bottom: 3px;
}
.iate-dep-locked__info span {
  font-size: 14px;
  font-weight: 600;
  color: #166534;
}
.iate-dep-change-btn {
  background: none;
  border: 1px solid #86efac;
  border-radius: 6px;
  color: #15803d;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: background .15s;
  font-family: inherit;
  white-space: nowrap;
}
.iate-dep-change-btn:hover { background: #dcfce7; }

/* Departures column */
.iate-book-departures-col { }
.iate-col-title {
  font-size: 15px;
  font-weight: 600;
  color: #333;
  margin: 0 0 12px;
}
.iate-dep-card {
  border: 2px solid #e9ecef;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.iate-dep-card:hover { border-color: #1e6e4e; background: #f0faf4; }
.iate-dep-card.is-selected { border-color: #1e6e4e; background: #e8f5ee; }
.iate-dep-card.is-sold-out { opacity: .55; cursor: not-allowed; }
.iate-dep-card__date { font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.dep-return { color: #888; font-weight: 400; }
.iate-dep-card__seats { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #666; }
.iate-seat-bar { flex: 1; height: 4px; background: #e9ecef; border-radius: 2px; max-width: 100px; }
.iate-seat-bar__fill { height: 100%; background: #1e6e4e; border-radius: 2px; transition: width .3s; }
.dep-sold { color: #ef4444; font-weight: 600; font-size: 12px; }
.iate-loading-text { font-size: 13px; color: #888; }

/* Enhanced departure card layout */
.iate-dep-card__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.dep-price {
  font-size: 13px;
  font-weight: 700;
  color: #1e6e4e;
  background: #e8f5ee;
  padding: 2px 8px;
  border-radius: 4px;
}
.dep-seats { font-size: 12px; color: #666; }
.dep-seats--low { color: #dc2626; font-weight: 600; }
.dep-arrow { color: #1e6e4e; }
.iate-dep-card--urgent { border-color: #fca5a5; background: #fff8f8; }
.iate-dep-card--urgent:hover { border-color: #ef4444; }
.iate-dep-col-hint { font-size: 12px; color: #888; margin: -6px 0 10px; }

/* Booking form */
.iate-booking-form h3.iate-form-section-title {
  font-size: 15px;
  font-weight: 600;
  color: #333;
  margin: 20px 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid #f1f3f5;
}
.iate-pax-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.iate-pax-label { font-size: 11px; color: #888; display: block; margin-bottom: 3px; }
.iate-pax-ctrl {
  display: flex;
  align-items: center;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  overflow: hidden;
}
.iate-pax-btn {
  background: #f8f9fa;
  border: none;
  width: 32px;
  height: 32px;
  font-size: 18px;
  cursor: pointer;
  color: #555;
  line-height: 1;
}
.iate-pax-btn:hover { background: #e9ecef; }
.iate-pax-ctrl input {
  flex: 1;
  border: none !important;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  width: 40px;
  padding: 0 !important;
  background: #fff;
}

/* Payment options */
.iate-payment-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
@media (max-width: 600px) {
  .iate-payment-options { grid-template-columns: 1fr 1fr; }
}
.iate-pay-opt {
  border: 2px solid #e9ecef;
  border-radius: 8px;
  padding: 10px;
  text-align: center;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: border-color .15s, background .15s;
}
.iate-pay-opt input[type="radio"] { display: none; }
.iate-pay-opt:hover { border-color: #1e6e4e; background: #f0faf4; }
.iate-pay-opt.is-selected { border-color: #1e6e4e; background: #e8f5ee; }
.iate-pay-opt__icon { font-size: 22px; }
.iate-pay-opt__name { font-size: 11px; font-weight: 600; color: #444; }

/* Payment panels */
.iate-pay-panels { margin-bottom: 16px; }
.iate-pay-panel { display: none; }
.iate-pay-panel.is-active { display: block; }
.iate-pay-info {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 12px;
}
.iate-pay-info i, .iate-pay-info .fa-solid, .iate-pay-info .fa-regular { flex-shrink: 0; margin-top: 2px; }
.iate-pay-info--blue   { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }
.iate-pay-info--yellow { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.iate-pay-info--green  { background: #f0fdf4; border: 1px solid #bbf7d0; color: #14532d; }
.iate-pay-qr-wrap { text-align: center; margin-bottom: 12px; }
.iate-pay-qr { max-width: 180px; border: 2px solid #e9ecef; border-radius: 8px; }
.iate-pay-qr-wrap p { font-size: 12px; color: #666; margin-top: 6px; }
.iate-pay-number {
  font-size: 14px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.iate-bank-details { margin-bottom: 12px; }
.iate-bank-details h4 { font-size: 13px; font-weight: 700; margin-bottom: 8px; color: #333; }
.iate-bank-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.iate-bank-table tr + tr td { border-top: 1px solid #f1f3f5; }
.iate-bank-label { color: #888; padding: 5px 10px 5px 0; white-space: nowrap; width: 1%; }
.iate-bank-value { padding: 5px 0; }

/* Booking form footer */
.iate-btn--book { width: 100%; justify-content: center; font-size: 16px; padding: 14px; margin-top: 8px; }
.iate-btn--book i { margin-right: 8px; }
.iate-book-note { font-size: 12px; color: #888; text-align: center; margin-top: 10px; display: flex; align-items: center; justify-content: center; gap: 5px; }
.req { color: #ef4444; }

/* ── Stripe card element ────────────────────────────────────────── */
.iate-stripe-wrap { padding: 4px 0; }
.iate-stripe-card-element {
  background: #f9fafb; border: 1.5px solid var(--iate-border);
  border-radius: 8px; padding: 12px 14px;
  transition: border-color .15s;
}
.iate-stripe-card-element:focus-within { border-color: var(--iate-green); }
.iate-stripe-errors { color: #ef4444; font-size: 13px; margin-top: 6px; min-height: 18px; }
.iate-stripe-note { font-size: 12px; color: #6b7280; display: flex; align-items: center; gap: 5px; margin: 8px 0 0; }
.iate-stripe-note i { color: #22c55e; }

/* ── Fonepay gateway panel ─────────────────────────────────────── */
.iate-fonepay-gateway { padding: 4px 0; }
.iate-fonepay-logo-wrap { text-align: center; margin-bottom: 12px; }
}
