/* Booking / affiliate UI — loaded only when feature is enabled */

.aff-book-btn {
  flex-shrink: 0;
  background: #1a4a8a;
  color: #fff;
  border: none;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.aff-book-btn:hover {
  background: #2563b0;
}

.aff-pinned-item {
  flex-wrap: wrap;
  align-items: center;
}
.aff-pinned-item .pinned-text {
  min-width: 0;
}
.aff-pinned-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

#info-panel .aff-route-book {
  margin-left: auto;
  flex-shrink: 0;
}

.flight-route-header .aff-book-btn {
  margin-left: auto;
}

/* Compare fares modal */
#aff-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.55);
  align-items: center;
  justify-content: center;
  padding: 16px;
}
#aff-overlay.open {
  display: flex;
}

.aff-modal {
  background: #16213e;
  border: 1px solid #0f3460;
  border-radius: 8px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.aff-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid #0f3460;
}

.aff-header-main {
  flex: 1;
  min-width: 0;
}

.aff-route-title {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.aff-origin-city,
.aff-dest-city {
  flex: 1;
  font-size: 14px;
  font-weight: 700;
  color: #e0e0e0;
  line-height: 1.25;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.aff-origin-city {
  text-align: left;
}

.aff-dest-city {
  text-align: right;
}

.aff-swap-btn {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid #0f3460;
  background: #1a1a2e;
  color: #a0a0c0;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.aff-swap-btn:hover {
  border-color: #e94560;
  color: #e94560;
  background: #1e2440;
}

.aff-route-codes {
  font-size: 11px;
  color: #a0a0c0;
  margin-top: 6px;
  font-weight: 400;
}

.aff-modal-close {
  background: none;
  border: none;
  color: #888;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
  flex-shrink: 0;
}
.aff-modal-close:hover {
  color: #e94560;
}

.aff-modal-body {
  padding: 12px 16px 16px;
}

.aff-dates-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin-bottom: 12px;
}

.aff-date-field {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.aff-date-field label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #a0a0c0;
}

.aff-date-input-wrap {
  display: flex;
  align-items: stretch;
  gap: 4px;
}

.aff-date-text {
  flex: 1;
  min-width: 0;
  background: #1a1a2e;
  border: 1px solid #0f3460;
  color: #e0e0e0;
  padding: 6px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-family: inherit;
}

.aff-date-text:focus {
  outline: none;
  border-color: #1a4a8a;
}

.aff-date-text.aff-oneway-placeholder {
  color: #888;
  cursor: pointer;
  font-style: italic;
}

.aff-date-text.aff-oneway-placeholder:focus {
  font-style: normal;
}

.aff-date-native {
  position: fixed;
  left: -9999px;
  top: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
}

.aff-date-cal {
  flex-shrink: 0;
  width: 32px;
  background: #1a1a2e;
  border: 1px solid #0f3460;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0;
  transition: border-color 0.15s, background 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.aff-date-cal:hover:not(:disabled) {
  border-color: #1a4a8a;
  background: #1e2440;
}
.aff-date-cal:focus {
  outline: none;
}
.aff-date-cal:focus-visible {
  outline: 2px solid #1a4a8a;
  outline-offset: 1px;
}
.aff-date-cal:active:not(:disabled) {
  background: #1e2440;
}
.aff-date-cal:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.aff-cal-icon {
  display: block;
  width: 14px;
  height: 12px;
  border: 1.5px solid currentColor;
  border-radius: 2px;
  position: relative;
  margin: 0 auto;
  color: #a0a0c0;
}
.aff-cal-icon::before {
  content: '';
  position: absolute;
  top: -4px;
  left: 2px;
  width: 2px;
  height: 4px;
  background: currentColor;
  box-shadow: 7px 0 0 currentColor;
  border-radius: 1px;
}
.aff-cal-icon::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 2px;
  right: 2px;
  height: 1px;
  background: currentColor;
  opacity: 0.6;
}
.aff-date-cal:hover:not(:disabled) .aff-cal-icon {
  color: #e0e0e0;
}

.aff-oneway-row {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  flex-shrink: 0;
  padding-bottom: 7px;
  font-size: 10px;
  color: #888;
  user-select: none;
  white-space: nowrap;
}
.aff-oneway-row input[type="checkbox"] {
  width: 11px;
  height: 11px;
  margin: 0;
  cursor: pointer;
  accent-color: #e94560;
  flex-shrink: 0;
}
.aff-oneway-row label {
  cursor: pointer;
  line-height: 1;
  font-size: 10px;
}

.aff-link-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.aff-link-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  text-align: left;
  background: #1a1a2e;
  border: 1px solid #0f3460;
  color: #e0e0e0;
  padding: 10px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.aff-link-btn:hover {
  border-color: #e94560;
  background: #1e2440;
}
.aff-link-btn .aff-link-label {
  font-size: 13px;
  font-weight: 600;
}
.aff-link-btn .aff-link-desc {
  font-size: 11px;
  color: #888;
}
.aff-link-btn.aff-direct .aff-link-label {
  color: #6eb5ff;
}

.aff-hint {
  font-size: 12px;
  color: #888;
  padding: 4px 0;
}

.aff-modal-footnote {
  margin-top: 12px;
  font-size: 10px;
  color: #555;
  line-height: 1.4;
}

body.aff-disabled .aff-ui {
  display: none !important;
}
