* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #f4f7fb;
  color: #10233f;
}

header {
  background: #082c4c;
  color: white;
  padding: 22px 7%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 26px;
  font-weight: 800;
}

.hero {
  padding: 70px 7%;
  background: linear-gradient(135deg, #082c4c, #126b83);
  color: white;
  text-align: center;
}

.hero h1 {
  margin: 0 0 15px;
  font-size: 42px;
}

.hero p {
  margin: 0 auto;
  max-width: 700px;
  font-size: 20px;
  line-height: 1.5;
}

.search-card {
  width: 86%;
  max-width: 1000px;
  margin: -30px auto 50px;
  background: white;
  padding: 30px;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.12);
}

.search-card h2 {
  margin-top: 0;
  text-align: center;
  color: #082c4c;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  font-weight: 700;
  margin-bottom: 7px;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 12px;
  border: 1px solid #ccd6e0;
  border-radius: 8px;
  font-size: 16px;
  background: white;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #126b83;
}

.search-button {
  width: 100%;
  margin-top: 22px;
  padding: 15px;
  border: none;
  border-radius: 9px;
  background: #f2a900;
  color: #082c4c;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
}

.search-button:hover {
  filter: brightness(0.96);
}

@media (max-width: 700px) {
  header {
    padding: 18px 5%;
  }

  .hero {
    padding: 55px 5%;
  }

  .hero h1 {
    font-size: 34px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .search-card {
    width: 92%;
    padding: 22px;
  }
}

.results {
  width: 86%;
  max-width: 1100px;
  margin: 50px auto;
}

.results h2 {
  text-align: center;
  color: #082c4c;
  font-size: 32px;
  margin-bottom: 30px;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.result-card {
  background: white;
  border-radius: 16px;
  padding: 25px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.10);
}

.result-card h3 {
  margin-top: 0;
  color: #082c4c;
  font-size: 24px;
}

.result-card p {
  line-height: 1.6;
  color: #425466;
}

.price {
  font-size: 26px;
  font-weight: 800;
  color: #126b83;
  margin: 15px 0;
}

.badge {
  display: inline-block;
  background: #f2a900;
  color: #082c4c;
  padding: 7px 12px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 14px;
}

footer {
  margin-top: 60px;
  background: #082c4c;
  color: white;
  text-align: center;
  padding: 25px;
  font-size: 14px;
}

@media (max-width: 700px) {
  .result-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== V20 TRAVEL CARDS ===== */
.trip-visual {
    height: 120px;
    border-radius: 16px;
    margin-bottom: 16px;
    padding: 16px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    font-size: 38px;
}
.trip-visual small {
    background: rgba(255,255,255,.9);
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}
.trip-visual-family { background: linear-gradient(135deg,#c9e8ff,#fff0b8); }
.trip-visual-value { background: linear-gradient(135deg,#c9f2d8,#d9edff); }
.trip-visual-adventure { background: linear-gradient(135deg,#e3d4ff,#ffd8be); }
.trip-visual-upgrade { background: linear-gradient(135deg,#ffe4a6,#dae4ff); }
.trip-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin: 14px 0;
}
.trip-meta span {
    background: #f1f5f9;
    border-radius: 999px;
    padding: 6px 9px;
    font-size: 12px;
}
.why-fit {
    border-top: 1px solid #e5e7eb;
    padding-top: 12px;
    margin-top: 8px;
}
.why-fit strong { font-size: 14px; }
.why-fit p {
    margin: 6px 0 14px;
    font-size: 13px;
    line-height: 1.45;
}
.trip-button {
    width: 100%;
    border: 0;
    border-radius: 12px;
    padding: 12px 16px;
    background: #173b63;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

/* ===== V21 DESTINATION PHOTOS ===== */
.trip-photo {
    min-height: 190px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    overflow: hidden;
    align-items: flex-end;
    justify-content: flex-end;
    box-shadow: inset 0 -80px 70px rgba(0,0,0,.18);
}

.trip-photo small {
    color: #173b63;
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(4px);
    box-shadow: 0 4px 18px rgba(0,0,0,.12);
}

@media (max-width: 700px) {
    .trip-photo {
        min-height: 150px;
    }
}

/* ===== V22 VIEW TRIP MODAL ===== */
.modal-open {
    overflow: hidden;
}

.trip-modal {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 9999;
    padding: 24px;
}

.trip-modal.is-open {
    display: grid;
    place-items: center;
}

.trip-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .58);
    backdrop-filter: blur(5px);
}

.trip-modal-panel {
    position: relative;
    width: min(680px, 100%);
    max-height: 90vh;
    overflow-y: auto;
    background: white;
    border-radius: 24px;
    padding: 30px;
    box-shadow: 0 30px 80px rgba(0,0,0,.28);
    z-index: 1;
}

.trip-modal-close {
    position: absolute;
    right: 18px;
    top: 14px;
    border: 0;
    background: #eef2f7;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
}

.trip-modal-kicker {
    display: inline-block;
    background: #f4b942;
    color: #173b63;
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    margin-bottom: 12px;
}

.trip-modal-panel h2 {
    font-size: 34px;
    margin: 0 0 8px;
    color: #173b63;
}

.trip-modal-price {
    font-size: 18px;
    margin-bottom: 14px;
}

.trip-modal-price strong {
    color: #237aa5;
    font-size: 24px;
}

.trip-modal-panel > p {
    line-height: 1.55;
    color: #475569;
}

.trip-breakdown {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 22px 0;
}

.trip-breakdown div {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 16px;
}

.trip-breakdown strong,
.trip-breakdown span {
    display: block;
}

.trip-breakdown span {
    margin-top: 6px;
    font-size: 13px;
    color: #64748b;
    line-height: 1.4;
}

.trip-modal-note {
    background: #fff8df;
    border: 1px solid #f3df9c;
    border-radius: 14px;
    padding: 14px;
    font-size: 13px;
    line-height: 1.45;
    margin-bottom: 18px;
}

.trip-modal-primary {
    width: 100%;
    border: 0;
    border-radius: 13px;
    padding: 14px 16px;
    background: #173b63;
    color: white;
    font-weight: 800;
    cursor: pointer;
}

@media (max-width: 620px) {
    .trip-modal {
        padding: 12px;
    }

    .trip-modal-panel {
        padding: 24px 18px;
        border-radius: 20px;
    }

    .trip-modal-panel h2 {
        font-size: 28px;
    }

    .trip-breakdown {
        grid-template-columns: 1fr;
    }
}

/* ===== V23 COST BREAKDOWN ===== */
.cost-breakdown {
    margin: 22px 0 18px;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 13px 15px;
    border-bottom: 1px solid #eef2f7;
    font-size: 14px;
}

.cost-row:last-child {
    border-bottom: 0;
}

.cost-row span {
    color: #475569;
}

.cost-row strong {
    color: #173b63;
    white-space: nowrap;
}

.cost-total {
    background: #f8fafc;
    font-size: 16px;
}

.cost-total span,
.cost-total strong {
    font-weight: 800;
    color: #173b63;
}

/* ===== V24 BUDGET VS TRIP ===== */
.budget-compare { margin:18px 0; padding:16px; border:1px solid #dbe7f1; border-radius:16px; background:#f8fbfd; }
.budget-compare-title { font-weight:800; color:#173b63; margin-bottom:12px; }
.budget-compare-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; }
.budget-compare-grid div { background:white; border-radius:12px; padding:11px; }
.budget-compare-grid small { display:block; color:#64748b; margin-bottom:4px; }
.budget-compare-grid strong { display:block; color:#173b63; font-size:17px; }
.budget-compare-grid strong.over-budget { color:#b42318; }
.budget-message { margin-top:12px; color:#475569; font-size:13px; line-height:1.45; }
@media (max-width:600px) { .budget-compare-grid { grid-template-columns:1fr; } }

/* ===== V24.1 MODAL SCREEN FIT FIX ===== */
.trip-modal-content,
.modal-content {
    max-height: 88vh;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.trip-modal,
.modal {
    padding-top: 3vh;
    padding-bottom: 3vh;
}

.trip-modal-content::-webkit-scrollbar,
.modal-content::-webkit-scrollbar {
    width: 7px;
}

.trip-modal-content::-webkit-scrollbar-thumb,
.modal-content::-webkit-scrollbar-thumb {
    background: rgba(100,116,139,.35);
    border-radius: 999px;
}

@media (max-height: 750px) {
    .trip-modal-content,
    .modal-content {
        max-height: 92vh;
    }

    .cost-breakdown {
        margin-top: 14px;
        margin-bottom: 12px;
    }

    .budget-compare {
        margin-top: 12px;
        margin-bottom: 12px;
    }
}

/* V28 EDIT SEARCH */
html{scroll-behavior:smooth}#trip-search-form{scroll-margin-top:24px}
.results-toolbar{max-width:1120px;margin:8px auto 18px;padding:14px 16px;border:1px solid #dce6ef;border-radius:16px;background:#f8fbfd;display:flex;align-items:center;justify-content:space-between;gap:16px}
.results-toolbar strong,.results-toolbar span{display:block}.results-toolbar strong{color:#173b63;font-size:15px}.results-toolbar span{margin-top:3px;color:#64748b;font-size:12px}
.edit-search-button{text-decoration:none;border:1px solid #173b63;border-radius:11px;padding:10px 14px;color:#173b63;background:white;font-size:13px;font-weight:800}
@media(max-width:650px){.results-toolbar{align-items:stretch;flex-direction:column}.edit-search-button{text-align:center}}

/* ===== V29 TRIP SUMMARY ===== */
.trip-summary {
    min-width: 0;
}
.trip-summary strong {
    font-size: 16px;
}
.trip-summary span {
    line-height: 1.55;
}
@media (max-width: 650px) {
    .trip-summary span {
        line-height: 1.7;
    }
}

/* V33.20 modal screen-fit */
.trip-modal-panel{max-height:90vh;overflow-y:auto;overscroll-behavior:contain;}

.ffh-soft-launch {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 0.65rem 1rem;
  background: #f2b544;
  color: #071f31;
  font-size: 0.9rem;
  line-height: 1.35;
  text-align: center;
}

.ffh-soft-launch strong {
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

@media (max-width: 620px) {
  .ffh-soft-launch {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.15rem;
    text-align: left;
  }
}

.search-error {
  margin: 0.9rem 0 1rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid #f2a39d;
  border-radius: 12px;
  background: #fff4f2;
  color: #8a261f;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.4;
}

/* V33.83 MOBILE HORIZONTAL OVERFLOW GUARD */
html {
  max-width: 100%;
  overflow-x: clip;
}
body {
  max-width: 100%;
  overflow-x: hidden;
}
.results,
.result-grid,
.result-card,
.trip-visual,
.v3330-photo-wrap,
.v3329-price-wrap,
.v3353-budget-use,
.v3324-flight-panel,
.v3329-estimate,
.v3329-facts,
.why-fit,
.trip-button {
  min-width: 0;
  max-width: 100%;
}
.result-card * {
  min-width: 0;
}
.v3324-flight-top > *,
.v3324-flight-price,
.v3324-airline,
.v3324-route,
.v3329-destination-strip,
.v3332-card-intro,
.v3353-fit-line {
  overflow-wrap: anywhere;
  word-break: normal;
}
@media (max-width: 700px) {
  .results {
    overflow-x: clip;
  }
  .result-grid,
  .result-card {
    width: 100%;
  }
  .v3324-flight-top {
    align-items: flex-start;
  }
  .v3324-flight-price {
    width: 100%;
  }
}
