*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy-deep:   #0b1f3a;
  --gold-bright: #f7c238;
  --gold-mid:    #d9aa4a;
  --gold-warm:   #e5bb63;
  --blue-light:  #7dd8f8;
  --white:       #fdfcf9;
  --white-dim:   rgba(253,252,249,.80);
  --white-faint: rgba(253,252,249,.45);
  --card-bg:     rgba(10,20,45,.82);
}

html, body {
  width: 100%; min-height: 100%;
  background: var(--navy-deep);
  font-family: system-ui, -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  color: var(--white);
}

/* ---- Background ---- */
.bg-svg {
  position: fixed;
  inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: .55;
  overflow: hidden;
}
.bg-svg img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.bg-vignette {
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at 50% 30%, rgba(10,20,45,.25) 0%, rgba(10,20,45,.70) 70%, rgba(10,20,45,.92) 100%);
  z-index: 1;
}

/* ---- Page layout ---- */
.page {
  position: relative;
  z-index: 2;
  max-width: 1180px;
  margin: 0 auto;
  padding: 12px 20px 60px;
}

/* ---- Header ---- */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 8px;
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.wordmark-icon {
  width: 44px; height: 44px;
  flex-shrink: 0;
}
.wordmark-icon img {
  width: 100%; height: 100%;
  display: block;
  filter: brightness(0) invert(1);
}
.wordmark-text {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: .10em;
  text-transform: uppercase;
  color: var(--white);
}

.header-right { text-align: right; }
.page-title {
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 800;
  color: var(--gold-bright);
  letter-spacing: -.01em;
}
.page-sub {
  font-size: 13px;
  color: var(--white-faint);
  margin-top: 3px;
}

/* ---- Nav breadcrumb ---- */
.breadcrumb {
  display: flex;
  align-items: center;
  font-size: 15px;
  color: var(--white-faint);
  margin-bottom: 20px;
}
.breadcrumb a {
  color: var(--gold-mid);
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.breadcrumb a:hover { text-decoration: underline; }

/* ---- Sort controls ---- */
.sort-controls {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.sort-btn {
  appearance: none;
  border: 1px solid rgba(217,170,74,.30);
  background: rgba(217,170,74,.06);
  color: var(--gold-mid);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  border-radius: 8px;
  padding: 5px 12px;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.sort-btn:hover  { background: rgba(217,170,74,.14); border-color: rgba(217,170,74,.55); }
.sort-btn.active { background: rgba(217,170,74,.18); border-color: var(--gold-mid); color: var(--gold-bright); }

/* ---- Deals grid ---- */
.deals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  max-width: 1100px;
  margin: 0 auto;
}

/* ---- Deal card ---- */
.deal-card {
  background: var(--card-bg);
  border: 1px solid rgba(217,170,74,.22);
  border-radius: 12px;
  box-shadow: 0 2px 16px rgba(0,0,0,.45);
  overflow: hidden;
  transition: box-shadow .2s ease, border-color .2s ease;
  display: flex;
  flex-direction: column;
  cursor: pointer;
}
.deal-card:hover {
  border-color: rgba(217,170,74,.55);
  box-shadow: 0 4px 28px rgba(0,0,0,.60), 0 0 18px rgba(247,194,56,.10);
}

/* Card header — trip type badge + stops */
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px 6px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.trip-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  border-radius: 4px;
  padding: 2px 7px;
}
.trip-badge.ow { background: rgba(125,216,248,.12); color: var(--blue-light); }
.trip-badge.rt { background: rgba(247,194,56,.12);  color: var(--gold-warm); }
.stops-badge {
  font-size: 11px;
  font-weight: 600;
  margin-left: 6px;
}
.stops-badge.nonstop    { color: #6ee49a; }
.stops-badge.stops-text { color: var(--white-faint); }
.card-actions {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.deal-action-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(253,252,249,0.38);
  padding: 3px 5px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 0;
  transition: color .15s ease, background .15s ease;
}
.deal-action-btn:hover {
  color: var(--gold-bright);
  background: rgba(247,194,56,0.10);
}
.deal-action-btn.is-success {
  color: #6ee49a;
  background: rgba(110,228,154,0.12);
}
.deal-action-btn.is-error {
  color: #ff9a9a;
  background: rgba(255,154,154,0.12);
}

/* Journey section */
.journey-section {
  display: flex;
  align-items: center;
  padding: 14px 14px 10px;
  gap: 8px;
}
.dep-section, .arr-section {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}
.dep-section { align-items: flex-end; }
.arr-section { align-items: flex-start; }
.route-date {
  font-size: 10px;
  font-weight: 600;
  color: var(--gold-mid);
  letter-spacing: .03em;
  white-space: nowrap;
  margin-bottom: 3px;
}
.route-date-dim {
  color: rgba(253,252,249,.35);
  font-weight: 400;
}
.iata-code {
  font-size: 26px;
  font-weight: 800;
  color: var(--white);
  letter-spacing: -.01em;
  line-height: 1;
}
.city-name {
  font-size: 12px;
  color: rgba(253,252,249,.62);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  margin-top: 2px;
}
.route-indicator {
  flex: 0 0 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 2px;
}
.route-arrow-svg {
  width: 100%;
  height: 32px;
}
.route-arrow-line { stroke: rgba(217,170,74,.65); stroke-width: 2.5; }
.route-arrow-dot  { fill: var(--blue-light); }
.route-arrow-head { fill: rgba(217,170,74,.85); }

/* Price section */
.price-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 12px 12px;
  margin-top: auto;
}
.price-left {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: 10px;
}
.card-price {
  font-size: 24px;
  font-weight: 800;
  color: var(--blue-light);
  letter-spacing: -.02em;
  line-height: 1;
  flex-shrink: 0;
}
.price-meta {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  flex-wrap: wrap;
  padding-bottom: 1px;
}
.savings-pct {
  font-size: 12px;
  font-weight: 700;
  border-radius: 5px;
  padding: 2px 6px;
  white-space: nowrap;
}
.savings-high { background: rgba(247,194,56,.18); color: var(--gold-bright); }
.savings-mid  { background: rgba(247,194,56,.11); color: var(--gold-warm); }
.savings-low  { background: rgba(255,255,255,.07); color: var(--white-dim); }
.avg-price {
  font-size: 12px;
  color: var(--white-faint);
  text-decoration: line-through;
  text-decoration-color: rgba(253,252,249,.35);
}
.row-cta {
  display: inline-block;
  background: linear-gradient(135deg, var(--gold-mid) 0%, var(--gold-bright) 100%);
  color: var(--navy-deep);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 50px;
  padding: 6px 14px;
  white-space: nowrap;
  flex-shrink: 0;
}
.row-cta:hover { opacity: .88; }

/* ---- Footer ---- */
.footer {
  margin-top: 28px;
  text-align: center;
  font-size: 12px;
  color: var(--white-faint);
}
.footer a { color: var(--gold-mid); text-decoration: none; }

/* ---- Loading / empty states ---- */
.loading-msg, .no-deals {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--white-faint);
  font-size: 15px;
  padding: 40px 0;
}
.no-deals a { color: var(--gold-mid); }

@media (max-width: 580px) {
  .deals-grid  { grid-template-columns: repeat(auto-fill, minmax(205px, 1fr)); gap: 16px; }
  .iata-code   { font-size: 22px; }
  .card-price  { font-size: 20px; }
}
