/* ============================================================
   RAHLA DISCOVERY — Transfer Page Redesign
   Same design language as hotel-detail-redesign.css (rd-* tokens)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;500;600;700;800&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,400&display=swap');

:root {
  --rd-navy:      #1a2b4e;
  --rd-blue:      #1255CC;
  --rd-blue-light:#5191fa;
  --rd-blue-pale: #e8f0fe;
  --rd-gold:      #D4A843;
  --rd-green:     #00875A;
  --rd-red:       #C0392B;
  --rd-red-soft:  #fff0ee;
  --rd-surface:   #f8f9fc;
  --rd-border:    #e4e8ef;
  --rd-text:      #1a2b4e;
  --rd-muted:     #6b7a8f;
  --rd-white:     #ffffff;
  --rd-shadow-sm: 0 1px 4px rgba(26,43,78,.06);
  --rd-shadow-md: 0 4px 20px rgba(26,43,78,.10);
  --rd-shadow-lg: 0 8px 40px rgba(26,43,78,.14);
  --rd-radius-sm: 8px;
  --rd-radius-md: 14px;
  --rd-radius-lg: 20px;
  --rd-transition: 0.22s cubic-bezier(.4,0,.2,1);
  --rd-font-display: 'Syne', sans-serif;
  --rd-font-body:    'DM Sans', sans-serif;
}

.rihla-transfer-page {
  font-family: var(--rd-font-body);
  color: var(--rd-text);
  background: var(--rd-surface);
}

.rihla-transfer-page h1,
.rihla-transfer-page h2,
.rihla-transfer-page h3 {
  font-family: var(--rd-font-display);
}

/* ============================================================
   SECTION 1 — HERO
   ============================================================ */

.rd-transfer-hero {
  position: relative;
  background: var(--rd-navy);
  overflow: hidden;
  padding: 90px 0 50px;
}

.rd-transfer-hero .masthead__bg {
  position: absolute;
  inset: 0;
}

.rd-transfer-hero .masthead__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .8;
}

.rd-transfer-hero .masthead__bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(26,43,78,.5) 0%, rgba(26,43,78,.62) 55%, var(--rd-navy) 100%);
}

.rd-transfer-hero__inner {
  position: relative;
  z-index: 2;
}

.rd-transfer-hero__title {
  font-family: var(--rd-font-display);
  font-size: clamp(28px, 4.2vw, 46px);
  font-weight: 800;
  color: #fff;
  margin: 0 0 12px;
  line-height: 1.15;
  letter-spacing: -0.4px;
}

.rd-transfer-hero__subtitle {
  font-family: var(--rd-font-body);
  font-size: 16px;
  color: rgba(255,255,255,.82);
  max-width: 620px;
  margin: 0 auto;
  line-height: 1.6;
}

.rd-transfer-hero__badges {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 22px;
}

.rd-transfer-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2px;
  background: rgba(255,255,255,.1);
  color: #fff;
  border: 1px solid rgba(255,255,255,.18);
  backdrop-filter: blur(6px);
}

.rd-transfer-badge i {
  color: var(--rd-gold);
  font-size: 13px;
}

/* ── Search card sits above the hero's gradient overlay ── */
.rd-transfer-search-wrap {
  position: relative;
  z-index: 3;
  margin-top: 40px;
}

/* ============================================================
   SECTION 3 — SEARCH CARD
   ============================================================ */

.rd-transfer-search-card {
  background: #fff;
  border-radius: var(--rd-radius-lg);
  box-shadow: var(--rd-shadow-lg);
  padding: 26px;
}

.rd-transfer-grid {
  display: grid;
  gap: 14px;
  align-items: stretch;
}

.rd-transfer-grid--route {
  grid-template-columns: minmax(0,1fr) 56px minmax(0,1fr) minmax(140px, auto);
}

.rd-transfer-grid > * {
  min-width: 0;
}

.rd-field {
  border: 1.5px solid var(--rd-border);
  border-radius: var(--rd-radius-sm);
  padding: 10px 16px;
  transition: all var(--rd-transition);
  background: #fff;
  min-height: 70px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.rd-field:hover,
.rd-field:focus-within {
  border-color: var(--rd-blue);
  background: var(--rd-blue-pale);
}

.rd-field__label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--rd-muted);
  font-weight: 600;
  margin-bottom: 4px;
}

.rd-field__label .required {
  color: var(--rd-red);
}

.rd-field select,
.rd-field input[type="date"],
.rd-field input[type="time"],
.rd-field input[type="number"],
.rd-field input[type="text"] {
  border: none;
  background: transparent;
  padding: 0;
  width: 100%;
  font-family: var(--rd-font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--rd-text);
  min-height: auto;
}

.rd-field select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7a8f' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 2px center;
  padding-right: 22px;
  cursor: pointer;
}

.rd-field select:disabled {
  color: var(--rd-muted);
  cursor: not-allowed;
}

.rd-field select:focus,
.rd-field input:focus {
  outline: none;
  box-shadow: none;
  border: none;
}

/* Match the searchable destination controls used elsewhere in the theme. */
.rihla-transfer-page .rd-field .select2-container {
  width: 100% !important;
}

.rihla-transfer-page .rd-field .select2-container .select2-selection--single {
  height: 28px;
  min-height: 28px;
  border: 0;
  border-radius: 0;
  background: transparent;
  outline: 0;
}

.rihla-transfer-page .rd-field .select2-selection--single .select2-selection__rendered {
  height: 28px;
  line-height: 28px;
  padding: 0 28px 0 0;
  color: var(--rd-text);
  font-family: var(--rd-font-body);
  font-size: 14px;
  font-weight: 500;
}

.rihla-transfer-page .rd-field .select2-selection--single .select2-selection__placeholder,
.rihla-transfer-page .rd-field .select2-container--disabled .select2-selection__rendered {
  color: var(--rd-muted);
}

.rihla-transfer-page .rd-field .select2-selection--single .select2-selection__arrow {
  top: 1px;
  right: 0;
  height: 26px;
}

.rihla-transfer-page .select2-dropdown {
  border-color: var(--rd-border);
  border-radius: var(--rd-radius-sm);
  box-shadow: var(--rd-shadow-md);
  overflow: hidden;
}

.rihla-transfer-page .select2-results__option--highlighted[aria-selected] {
  background: var(--rd-blue) !important;
}

/* Segmented radio control (transfer type) */
.rd-segmented {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 8px;
  width: 100%;
}

.rd-segmented--2 {
  grid-template-columns: repeat(2, minmax(0,1fr));
}

.rd-segmented label {
  cursor: pointer;
}

.rd-segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}

.rd-segmented span {
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6px 8px;
  border: 1.5px solid var(--rd-border);
  border-radius: 8px;
  color: var(--rd-muted);
  font-size: 12.5px;
  font-weight: 600;
  transition: all var(--rd-transition);
}

.rd-segmented input:checked + span {
  border-color: var(--rd-blue);
  background: var(--rd-blue-pale);
  color: var(--rd-blue);
}

.rd-field-block {
  margin-top: 14px;
}

.rd-transfer-datetime {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 14px;
  margin-top: 18px;
}

.rd-swap-btn {
  width: 100%;
  height: 100%;
  min-height: 70px;
  border: 1.5px solid var(--rd-border);
  border-radius: var(--rd-radius-sm);
  background: #fff;
  color: var(--rd-blue);
  font-size: 16px;
  cursor: pointer;
  transition: all var(--rd-transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.rd-swap-btn:hover {
  border-color: var(--rd-blue);
  background: var(--rd-blue-pale);
  transform: rotate(180deg);
}

.rd-transfer-submit {
  width: 100%;
  min-height: 70px;
  border: none;
  border-radius: var(--rd-radius-sm);
  background: var(--rd-blue);
  color: #fff;
  font-family: var(--rd-font-body);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all var(--rd-transition);
}

.rd-transfer-submit:hover {
  background: var(--rd-navy);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(18,85,204,.3);
}

/* ============================================================
   SECTION 4 — RESULTS
   ============================================================ */

.rd-transfer-results-section {
  padding: 40px 0 70px;
}

.rd-transfer-results-card {
  background: #fff;
  border-radius: var(--rd-radius-lg);
  box-shadow: var(--rd-shadow-md);
  padding: 30px;
}

.rd-transfer-route-group {
  margin-bottom: 28px;
}

.rd-transfer-route-group:last-child {
  margin-bottom: 0;
}

.rd-section-heading {
  font-family: var(--rd-font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--rd-navy);
  margin: 0 0 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.rd-transfer-vehicles {
  display: grid;
  gap: 14px;
}

.rd-transfer-vehicle {
  position: relative;
  display: grid;
  grid-template-columns: 56px minmax(170px, 1fr) minmax(230px, 1.25fr) 100px 30px;
  gap: 16px;
  align-items: center;
  border: 1.5px solid var(--rd-border);
  border-radius: var(--rd-radius-md);
  padding: 16px;
  background: #fff;
  cursor: pointer;
  transition: box-shadow var(--rd-transition), border-color var(--rd-transition), transform var(--rd-transition);
  animation: rdTransferCardIn 0.35s ease both;
}

@keyframes rdTransferCardIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.rd-transfer-vehicle:nth-child(1) { animation-delay: 0ms; }
.rd-transfer-vehicle:nth-child(2) { animation-delay: 60ms; }
.rd-transfer-vehicle:nth-child(3) { animation-delay: 120ms; }
.rd-transfer-vehicle:nth-child(4) { animation-delay: 180ms; }

.rd-transfer-vehicle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}

.rd-transfer-vehicle:hover {
  border-color: var(--rd-blue-light);
  box-shadow: var(--rd-shadow-sm);
  transform: translateY(-1px);
}

.rd-transfer-vehicle:has(input:checked) {
  border-color: var(--rd-blue);
  box-shadow: 0 0 0 1px var(--rd-blue), var(--rd-shadow-md);
  background: var(--rd-blue-pale);
}

.rd-transfer-vehicle-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--rd-radius-sm);
  background: var(--rd-surface);
  border: 1px solid var(--rd-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--rd-blue);
  font-size: 22px;
  flex-shrink: 0;
}

.rd-transfer-vehicle:has(input:checked) .rd-transfer-vehicle-icon {
  background: var(--rd-blue);
  color: #fff;
  border-color: var(--rd-blue);
}

.rd-transfer-vehicle-main {
  min-width: 0;
}

.rd-transfer-vehicle-main strong {
  display: block;
  font-family: var(--rd-font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--rd-navy);
}

.rd-transfer-vehicle-main em {
  display: block;
  margin-top: 3px;
  font-style: normal;
  font-size: 12px;
  color: var(--rd-blue);
  font-weight: 600;
}

.rd-transfer-vehicle-description {
  display: -webkit-box;
  margin-top: 6px;
  color: var(--rd-muted);
  font-size: 13px;
  line-height: 1.45;
  overflow: hidden;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}

.rd-transfer-vehicle-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.rd-transfer-vehicle-details span {
  min-height: 44px;
  border-radius: 6px;
  background: var(--rd-surface);
  border: 1px solid var(--rd-border);
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.rd-transfer-vehicle-details small {
  display: block;
  color: var(--rd-muted);
  font-size: 11px;
  line-height: 1.2;
}

.rd-transfer-vehicle-details strong {
  display: block;
  margin-top: 2px;
  color: var(--rd-navy);
  font-size: 12px;
  line-height: 1.25;
}

.rd-transfer-vehicle-price {
  text-align: right;
}

.rd-transfer-vehicle-price b {
  display: block;
  font-family: var(--rd-font-display);
  color: var(--rd-navy);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.15;
  white-space: nowrap;
}

.rd-transfer-vehicle-price small {
  display: block;
  margin-top: 2px;
  color: var(--rd-muted);
  font-size: 11px;
}

.rd-transfer-vehicle-check {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1.5px solid var(--rd-border);
  background: #fff;
  color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.rd-transfer-vehicle:has(input:checked) .rd-transfer-vehicle-check {
  border-color: var(--rd-blue);
  background: var(--rd-blue);
  color: #fff;
}

.rd-transfer-vehicle-lead-time {
  grid-column: 1 / -1;
  margin-top: 2px;
  font-size: 12px;
  color: var(--rd-red);
}

.rd-transfer-empty {
  border: 1.5px dashed var(--rd-border);
  border-radius: var(--rd-radius-md);
  padding: 24px;
  color: var(--rd-muted);
  text-align: center;
  font-size: 14px;
}

.rd-transfer-errors {
  background: var(--rd-red-soft);
  color: var(--rd-red);
  border-radius: var(--rd-radius-sm);
  padding: 14px 16px;
  font-size: 14px;
  margin-top: 20px;
}

/* ============================================================
   SECTION 5 — TRIP DETAILS
   ============================================================ */

.rd-transfer-trip-card {
  margin-top: 28px;
  padding-top: 28px;
  border-top: 1px solid var(--rd-border);
}

.rd-transfer-trip-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 14px;
}

.rd-transfer-trip-grid .rd-field {
  min-height: 56px;
}

.rd-transfer-trip-grid .rd-field--full {
  grid-column: 1 / -1;
}

.rd-transfer-note-field textarea {
  border: none;
  background: transparent;
  padding: 0;
  width: 100%;
  resize: vertical;
  min-height: 80px;
  font-family: var(--rd-font-body);
  font-size: 14px;
  color: var(--rd-text);
}

.rd-transfer-note-field textarea:focus {
  outline: none;
}

.rd-transfer-cancellation-note {
  font-size: 13px;
  color: var(--rd-muted);
  margin-top: 14px;
}

/* ============================================================
   SECTION 6 — SUMMARY / SUBMIT BAR
   ============================================================ */

.rd-transfer-summary-bar {
  margin-top: 22px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  flex-wrap: wrap;
}

@media (max-width: 767px) {
  .rd-transfer-summary-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 300;
    background: #fff;
    border-top: 1.5px solid var(--rd-border);
    padding: 12px 16px;
    box-shadow: 0 -4px 20px rgba(0,0,0,.12);
    margin-top: 0;
  }

  .rd-transfer-summary-bar .rd-transfer-submit {
    width: 100%;
  }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1100px) {
  .rd-transfer-grid,
  .rd-transfer-grid--route {
    grid-template-columns: 1fr;
  }

  .rd-transfer-vehicle {
    grid-template-columns: 48px 1fr 30px;
    grid-template-areas:
      "icon main check"
      "icon desc desc"
      "details details details"
      "price price price";
  }

  .rd-transfer-vehicle-icon { grid-area: icon; }
  .rd-transfer-vehicle-main { grid-area: main; }
  .rd-transfer-vehicle-check { grid-area: check; }
  .rd-transfer-vehicle-description { grid-area: desc; }
  .rd-transfer-vehicle-details { grid-area: details; margin-top: 4px; grid-template-columns: repeat(4, minmax(0,1fr)); }
  .rd-transfer-vehicle-price { grid-area: price; text-align: left; margin-top: 4px; }
}

@media (max-width: 767px) {
  .rd-transfer-hero {
    padding: 50px 0 40px;
  }

  .rd-transfer-search-card {
    padding: 18px;
  }

  .rd-transfer-results-card {
    padding: 18px;
    padding-bottom: 90px;
  }

  .rihla-transfer-page {
    padding-bottom: 70px;
  }

  .rd-transfer-datetime,
  .rd-transfer-trip-grid {
    grid-template-columns: 1fr;
  }

  .rd-transfer-vehicle-details {
    grid-template-columns: repeat(2, minmax(0,1fr));
  }
}
