/* SmartLink Course Booking Styles */
.slb-booking-wrapper {
  width: 100%;
  max-width: none;
  margin: 30px 0;
  padding: 0;
  box-sizing: border-box;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu,
    Cantarell, "Helvetica Neue", sans-serif;
  display: flex;
  flex-direction: column;
  align-items: stretch; /* stretch so children fill full width */
}

/* ======= Search Bar ======= */
.slb-booking-form {
  display: flex;
  align-items: center;
  background: #ffffff;
  border-radius: 60px;
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.08);
  padding: 12px 12px 12px 35px;
  gap: 0;
  flex-wrap: nowrap;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  box-sizing: border-box;
}

.slb-field {
  flex: 1;
  min-width: 0;
  padding: 10px 20px;
  position: relative;
}

.slb-field-course {
  flex: 1.2;
}
.slb-field-location {
  flex: 1;
}

.slb-divider {
  width: 1px;
  height: 50px;
  background-color: #e0e0e0;
  flex-shrink: 0;
}

.slb-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  color: #555;
  text-transform: uppercase;
  margin-bottom: 6px;
  cursor: pointer;
}

.slb-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.slb-icon-course,
.slb-icon-location {
  color: #b71c3c;
}

.slb-select {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  font-size: 16px;
  font-weight: 600;
  color: #222;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding: 0;
  line-height: 1.4;
  font-family: inherit;
}

.slb-select option {
  font-weight: 400;
  font-size: 14px;
  padding: 8px;
}
.slb-select:focus {
  outline: none;
}

.slb-button-wrap {
  flex-shrink: 0;
  margin-left: 10px;
}

.slb-book-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: #b71c3c;
  color: #ffffff;
  border: none;
  border-radius: 50px;
  padding: 18px 50px;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  transition:
    background-color 0.3s ease,
    transform 0.15s ease,
    box-shadow 0.3s ease;
  white-space: nowrap;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(183, 28, 60, 0.3);
  font-family: inherit;
  line-height: 1;
}

.slb-book-btn:hover {
  background-color: #9a1632;
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(183, 28, 60, 0.4);
}

.slb-book-btn:active {
  transform: translateY(0);
}

/* ======= Results Section ======= */
.slb-results-section {
  margin-top: 35px;
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}

/* Header bar showing selected course + location + close */
.slb-results-header {
  display: flex;
  align-items: stretch;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.07);
  overflow: hidden;
  margin-bottom: 25px;
}

.slb-rh-course,
.slb-rh-location {
  flex: 1;
  padding: 18px 28px;
  min-width: 0;
}

.slb-rh-course {
  border-right: 1px solid #e8e8e8;
}

.slb-rh-tag {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.5px;
  color: #888;
  text-transform: uppercase;
  margin-bottom: 5px;
}

.slb-rh-tag svg {
  width: 14px;
  height: 14px;
}

.slb-rh-tag .slb-tag-icon {
  color: #b71c3c;
}

.slb-rh-value {
  font-size: 20px;
  font-weight: 700;
  color: #1a1a1a;
  line-height: 1.3;
  word-break: break-word;
}

.slb-rh-close {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0 30px;
}

.slb-close-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: #b71c3c;
  color: #ffffff;
  border: none;
  border-radius: 50px;
  padding: 14px 32px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease;
  font-family: inherit;
  white-space: nowrap;
}

.slb-close-btn:hover {
  background-color: #9a1632;
}

/* Subtitle text */
.slb-results-subtitle {
  font-size: 16px;
  color: #444;
  margin-bottom: 18px;
  padding: 0 5px;
}

.slb-results-subtitle strong {
  color: #1a1a1a;
}

/* ======= iFrame Wrapper ======= */
.slb-iframe-wrap {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.06);
  /* Allow horizontal scroll so iframe never gets crushed narrow */
  display: block;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  width: 100%;
  max-width: 100%;
}

.slb-booking-iframe {
  display: block;
  /* Stretch iframe to full available width */
  width: 100%;
  min-width: 100%;
  max-width: none;
  min-height: 900px;
  border: 0;
}

/* ======= Results Table ======= */
.slb-results-table {
  width: 100%;
  max-width: none;
  margin-left: auto;
  margin-right: auto;
  border-collapse: separate;
  border-spacing: 0;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  box-sizing: border-box;
}

.slb-results-table thead th {
  background: #f7f7f7;
  padding: 16px 24px;
  text-align: left;
  font-size: 13px;
  font-weight: 700;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid #eee;
}

.slb-results-table thead th:last-child {
  text-align: center;
}

.slb-results-table tbody tr {
  transition: background-color 0.2s ease;
  border-left: 4px solid transparent;
}

.slb-results-table tbody tr:hover {
  background-color: #fdf5f6;
}

.slb-results-table tbody tr:not(:last-child) td {
  border-bottom: 1px solid #f0f0f0;
}

.slb-results-table tbody td {
  padding: 18px 24px;
  vertical-align: middle;
  font-size: 15px;
  color: #333;
}

.slb-results-table tbody tr {
  border-left: 4px solid #b71c3c;
}

.slb-td-course {
  font-weight: 600;
  color: #222;
}

.slb-td-location {
  color: #555;
}

/* Course Dates link */
.slb-dates-link {
  color: #b71c3c;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s ease;
}

.slb-dates-link:hover {
  color: #9a1632;
  text-decoration: underline;
}

/* Enrol Now button */
.slb-enrol-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: #b71c3c;
  color: #ffffff;
  border: none;
  border-radius: 50px;
  padding: 10px 28px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.3s ease;
  white-space: nowrap;
  font-family: inherit;
}

.slb-enrol-btn:hover {
  background-color: #9a1632;
  color: #ffffff;
  text-decoration: none;
}

/* ======= Tablet (≤ 900px) ======= */
@media (max-width: 900px) {
  .slb-booking-wrapper {
    padding: 0 16px;
  }

  .slb-booking-form {
    flex-wrap: wrap;
    align-items: flex-start; /* CRITICAL: let items align top when wrapping */
    border-radius: 20px;
    padding: 20px;
  }

  .slb-field {
    flex: 1 1 calc(50% - 20px);
    padding: 12px 10px;
    min-width: 0;
    box-sizing: border-box;
  }

  .slb-field-course,
  .slb-field-location {
    flex: 1 1 calc(50% - 20px);
  }

  .slb-divider {
    display: none;
  }

  .slb-button-wrap {
    flex: 0 0 100%;
    width: 100%;
    margin-left: 0;
    margin-top: 10px;
    box-sizing: border-box;
  }

  .slb-book-btn {
    width: 100%;
    padding: 16px 30px;
    box-sizing: border-box;
  }

  .slb-results-header {
    flex-direction: column;
    border-radius: 12px;
  }

  .slb-rh-course {
    border-right: none;
    border-bottom: 1px solid #e8e8e8;
  }

  .slb-rh-close {
    padding: 15px;
  }

  .slb-close-btn {
    width: 100%;
    justify-content: center;
  }
}

/* ======= Mobile (≤ 600px) ======= */
@media (max-width: 600px) {
  .slb-booking-wrapper {
    padding: 0 12px;
    margin: 20px auto;
  }

  /* Force column layout — override all flex shorthand for each child */
  .slb-booking-form {
    display: block; /* Use block instead of flex to guarantee full-width stacking */
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    width: 100%;
    box-sizing: border-box;
  }

  .slb-field,
  .slb-field-course,
  .slb-field-location {
    display: block;
    width: 100%;
    padding: 10px 0;
    box-sizing: border-box;
  }

  .slb-label {
    font-size: 11px;
    letter-spacing: 1.2px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
  }

  /* iOS fix: font-size must be ≥ 16px to prevent auto-zoom on focus */
  .slb-select {
    font-size: 16px;
    min-height: 44px;
    width: 100%;
    display: block;
    border-radius: 8px;
    padding: 10px 12px;
    background: #f7f7f7;
    border: 1px solid #e0e0e0;
    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
    color: #222;
    font-weight: 600;
    font-family: inherit;
  }

  .slb-divider {
    display: block;
    width: 100%;
    height: 1px;
    margin: 4px 0;
    background: #ececec;
  }

  .slb-button-wrap {
    display: block;
    width: 100%;
    margin-top: 12px;
    margin-left: 0;
    box-sizing: border-box;
  }

  .slb-book-btn {
    display: block;
    width: 100%;
    font-size: 16px;
    padding: 16px;
    min-height: 52px;
    border-radius: 12px;
    font-weight: 800;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(183, 28, 60, 0.25);
    box-sizing: border-box;
    text-align: center;
  }

  /* Results */
  .slb-results-section {
    margin-top: 20px;
    width: 100%;
  }

  .slb-results-header {
    flex-direction: column;
    border-radius: 12px;
    margin-bottom: 16px;
  }

  .slb-rh-course,
  .slb-rh-location {
    padding: 14px 18px;
  }

  .slb-rh-value {
    font-size: 16px;
  }

  .slb-rh-close {
    padding: 12px 16px;
  }

  .slb-close-btn {
    width: 100%;
    justify-content: center;
    padding: 14px 20px;
  }

  .slb-results-subtitle {
    font-size: 14px;
    padding: 0 2px;
    margin-bottom: 12px;
  }

  /* iframe: allow horizontal scroll for external content */
  .slb-iframe-wrap {
    border-radius: 10px;
    display: block;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    margin-left: -12px;
    margin-right: -12px;
    border-radius: 0;
    box-shadow: none;
    width: calc(100% + 24px);
    box-sizing: border-box;
  }

  .slb-booking-iframe {
    min-height: 600px;
    /* Override desktop 1024px — mobile gets a narrower iframe with scroll */
    width: 480px;
    min-width: 480px;
    max-width: none;
    border-radius: 0;
  }

  /* Stack table as cards on mobile */
  .slb-results-table thead {
    display: none;
  }
  .slb-results-table tbody tr {
    display: block;
    margin-bottom: 15px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    border-left: 4px solid #b71c3c;
    overflow: hidden;
  }
  .slb-results-table tbody td {
    display: block;
    padding: 10px 16px;
    text-align: left;
    font-size: 15px;
  }
  .slb-results-table tbody td::before {
    content: attr(data-label);
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
  }
  .slb-results-table tbody tr:not(:last-child) td {
    border-bottom: none;
  }
  .slb-enrol-btn {
    width: 100%;
    text-align: center;
    min-height: 44px;
    font-size: 16px;
    border-radius: 8px;
  }
}

/* ======= Extra small (< 400px) ======= */
@media (max-width: 400px) {
  .slb-booking-wrapper {
    padding: 0 10px;
  }

  .slb-booking-form {
    padding: 12px 10px;
    border-radius: 12px;
  }

  .slb-select {
    min-height: 44px;
    padding: 8px 10px;
  }

  .slb-book-btn {
    font-size: 15px;
    min-height: 48px;
    padding: 14px;
    border-radius: 10px;
  }

  .slb-iframe-wrap {
    margin-left: -10px;
    margin-right: -10px;
    width: calc(100% + 20px);
  }

  .slb-booking-iframe {
    min-height: 500px;
    width: 440px;
    min-width: 440px;
    max-width: none;
  }
}

/* ======= Coming Soon ======= */
.slb-coming-soon {
  text-align: center;
  padding: 50px 30px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.06);
}

.slb-coming-soon-icon {
  margin-bottom: 15px;
}

.slb-coming-soon-title {
  font-size: 24px;
  font-weight: 700;
  color: #b71c3c;
  margin: 0 0 10px;
}

.slb-coming-soon-text {
  font-size: 16px;
  color: #555;
  line-height: 1.6;
  margin: 0;
}

.slb-coming-soon-text strong {
  color: #222;
}
