/* ==========================================================================
   Design tokens
   These fall back to Astra's own Global Color Palette CSS variables first,
   so the widget automatically matches whatever palette is set in
   Appearance > Customize > Global > Colors. If those variables aren't
   present (non-Astra theme), it falls back to this palette instead.
   ========================================================================== */
#cfr-search-widget {
    --cfr-ink:        var(--ast-global-color-0, #101828);
    --cfr-primary:    var(--ast-global-color-1, #155EEF);
    --cfr-primary-dk: var(--ast-global-color-2, #0E3FA0);
    --cfr-accent:     var(--ast-global-color-3, #F59E0B);
    --cfr-surface:    #FFFFFF;
    --cfr-bg-subtle:  #F7F8FA;
    --cfr-border:     #E4E7EC;
    --cfr-error:      #DC2626;
    --cfr-success:    #12805C;
    --cfr-radius:     10px;
    --cfr-font:       var(--ast-body-font-family, 'Inter', system-ui, -apple-system, sans-serif);
}

#cfr-search-widget {
    max-width: 900px;
    margin: 0 auto;
    background: var(--cfr-surface);
    padding: 28px;
    border-radius: 14px;
    font-family: var(--cfr-font);
    color: var(--cfr-ink);
}

#cfr-search-widget * { box-sizing: border-box; }

/* Shared field styling across search form and passenger form */
#cfr-search-widget label {
    display: flex;
    flex-direction: column;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: #475467;
    flex: 1;
    min-width: 160px;
}

#cfr-search-widget input,
#cfr-search-widget select {
    margin-top: 6px;
    padding: 11px 12px;
    border: 1px solid var(--cfr-border);
    border-radius: 8px;
    font-size: 14.5px;
    font-family: var(--cfr-font);
    color: var(--cfr-ink);
    background: var(--cfr-surface);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

#cfr-search-widget input:focus,
#cfr-search-widget select:focus {
    outline: none;
    border-color: var(--cfr-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--cfr-primary) 18%, transparent);
}

/* Keep a visible focus ring for keyboard users on buttons too */
#cfr-search-widget button:focus-visible {
    outline: 2px solid var(--cfr-primary);
    outline-offset: 2px;
}

.cfr-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 16px;
}

#cfr-search-btn {
    background: var(--cfr-primary);
    color: #fff;
    border: none;
    padding: 13px 30px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 14.5px;
    cursor: pointer;
    transition: background 0.15s ease;
}
#cfr-search-btn:hover { background: var(--cfr-primary-dk); }

#cfr-search-status {
    margin: 14px 0;
    font-size: 14px;
    color: #667085;
}

/* ---------------------------- Results cards ---------------------------- */

#cfr-results {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}

.cfr-offer-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    border: 1px solid var(--cfr-border);
    border-radius: var(--cfr-radius);
    background: var(--cfr-surface);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.cfr-offer-card:hover {
    border-color: var(--cfr-primary);
    box-shadow: 0 2px 10px rgba(16, 24, 40, 0.06);
}

.cfr-offer-airline {
    font-weight: 700;
    font-size: 15px;
}

.cfr-offer-times {
    color: #667085;
    font-size: 13px;
    margin-top: 2px;
}

.cfr-offer-price {
    font-weight: 800;
    font-size: 19px;
    color: var(--cfr-ink);
}

.cfr-select-btn {
    background: var(--cfr-ink);
    color: #fff;
    border: none;
    padding: 11px 22px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    font-size: 13.5px;
    white-space: nowrap;
}
.cfr-select-btn:hover { background: var(--cfr-primary); }

/* --------------------------- Passenger panel ---------------------------- */

#cfr-passenger-panel {
    margin-top: 18px;
    padding: 24px;
    background: var(--cfr-bg-subtle);
    border: 1px solid var(--cfr-border);
    border-radius: var(--cfr-radius);
}

#cfr-passenger-panel h3 {
    margin: 0 0 14px;
    font-size: 19px;
    font-weight: 800;
    letter-spacing: -0.01em;
}

/* Signature touch: the price summary reads like a boarding-pass stub,
   since this is specifically a flight booking form - a dashed "tear line"
   separates the route from the fare, like the perforation on a real ticket. */
.cfr-passenger-summary {
    display: flex;
    align-items: center;
    gap: 14px;
    font-weight: 700;
    font-size: 14px;
    color: var(--cfr-ink);
    background: var(--cfr-surface);
    border: 1px solid var(--cfr-border);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
    position: relative;
}
.cfr-passenger-summary::before {
    content: '';
    display: inline-block;
    width: 1px;
    align-self: stretch;
    border-left: 2px dashed var(--cfr-border);
    margin: -12px 0;
    flex-shrink: 0;
    order: 1;
}

#cfr-passenger-form .cfr-form-error {
    color: var(--cfr-error);
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 12px;
    min-height: 18px;
}

#cfr-back-btn {
    background: transparent;
    border: 1px solid var(--cfr-border);
    padding: 11px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    font-size: 13.5px;
    color: #475467;
}
#cfr-back-btn:hover { border-color: var(--cfr-ink); color: var(--cfr-ink); }

#cfr-continue-btn {
    background: var(--cfr-primary);
    color: #fff;
    border: none;
    padding: 11px 26px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    font-size: 13.5px;
}
#cfr-continue-btn:hover { background: var(--cfr-primary-dk); }

/* ---------------------------- Confirmation ------------------------------ */

#cfr-confirmation {
    padding: 28px;
    background: #F0FBF6;
    border: 1px solid var(--cfr-success);
    border-radius: var(--cfr-radius);
    text-align: center;
}
#cfr-confirmation h3 {
    color: var(--cfr-success);
    font-size: 20px;
    margin-top: 0;
}

/* ------------------------------ Mock modal ------------------------------ */

.cfr-mock-overlay {
    position: fixed;
    inset: 0;
    background: rgba(16, 24, 40, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.cfr-mock-modal {
    background: var(--cfr-surface);
    padding: 30px;
    border-radius: 14px;
    width: 320px;
    text-align: center;
    box-shadow: 0 12px 32px rgba(16, 24, 40, 0.25);
    font-family: var(--cfr-font);
}
.cfr-mock-modal h3 { margin-top: 0; }

.cfr-mock-pay-btn {
    display: block;
    width: 100%;
    background: var(--cfr-primary);
    color: #fff;
    border: none;
    padding: 13px;
    border-radius: 8px;
    font-weight: 700;
    margin: 16px 0 8px;
    cursor: pointer;
}
.cfr-mock-pay-btn:hover { background: var(--cfr-primary-dk); }

.cfr-mock-cancel-btn {
    display: block;
    width: 100%;
    background: transparent;
    color: #667085;
    border: 1px solid var(--cfr-border);
    padding: 11px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
    #cfr-search-widget * { transition: none !important; }
}

/* Mobile: stack rows, full-width buttons */
@media (max-width: 640px) {
    .cfr-row { flex-direction: column; }
    .cfr-offer-card { flex-direction: column; align-items: flex-start; }
    .cfr-select-btn { width: 100%; }
    #cfr-back-btn, #cfr-continue-btn { width: 100%; }
}

/* ==========================================================================
   Homepage Flights/Hotels tabs (Elementor Tabs widget, CSS ID: cfr-home-tabs)
   ========================================================================== */
#cfr-home-tabs {
    --cfr-ink:     var(--ast-global-color-0, #101828);
    --cfr-primary: var(--ast-global-color-1, #155EEF);
    --cfr-border:  #E4E7EC;
    max-width: 900px;
    margin: 0 auto;
}

/* Tab title row - pill-style buttons instead of Elementor's plain underline default */
#cfr-home-tabs .elementor-tabs-wrapper {
    display: flex;
    justify-content: center;
    gap: 8px;
    border: none;
    margin-bottom: 20px;
}

#cfr-home-tabs .elementor-tab-title {
    padding: 12px 32px;
    border-radius: 999px;
    background: #F1F3F6;
    color: #667085;
    font-weight: 700;
    font-size: 15px;
    border: none;
    transition: background 0.15s ease, color 0.15s ease;
}

#cfr-home-tabs .elementor-tab-title:hover {
    background: #E4E7EC;
}

#cfr-home-tabs .elementor-tab-title.elementor-active {
    background: var(--cfr-primary);
    color: #fff;
}

/* Content panel - soft card so it doesn't feel like it's floating on white */
#cfr-home-tabs .elementor-tab-content {
    border: 1px solid var(--cfr-border);
    border-radius: 14px;
    padding: 28px;
    background: #FAFBFC;
}

@media (max-width: 640px) {
    #cfr-home-tabs .elementor-tabs-wrapper { flex-wrap: wrap; }
    #cfr-home-tabs .elementor-tab-title { flex: 1; text-align: center; padding: 12px 16px; }
}

/* ==========================================================================
   Homepage hero container (Elementor Section, CSS ID: cfr-home-section)
   Wraps the search box + side image as one cohesive white card with a
   soft shadow, matching the boxed search-panel look of sites like CheapOair.
   ========================================================================== */
#cfr-home-section {
    background: #fff !important;
    border-radius: 18px;
    box-shadow: 0 8px 30px rgba(16, 24, 40, 0.08);
    overflow: hidden; /* keeps the image's corners rounded with the card */
    border: 1px solid #EEF1F4;
}

/* Elementor wraps each column's content in this inner div - padding lives
   here so the image column itself can still go edge-to-edge. */
#cfr-home-section > .elementor-container > .elementor-column:first-child .elementor-widget-wrap {
    padding: 40px !important;
}

#cfr-home-section img {
    height: 100%;
    width: 100%;
    object-fit: cover;
    display: block;
}

/* On smaller screens, stack image below the search box rather than beside it
   (Elementor's own responsive column stacking handles the layout switch -
   this just tidies up spacing once stacked). */
@media (max-width: 767px) {
    #cfr-home-section > .elementor-container > .elementor-column:first-child .elementor-widget-wrap {
        padding: 28px !important;
    }
    #cfr-home-section img {
        min-height: 220px;
    }
}

/* ==========================================================================
   Deals/destinations row (Elementor Image Box widgets, CSS class: cfr-deal-card)
   ========================================================================== */
.cfr-deal-card {
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
    border: 1px solid #EEF1F4;
    box-shadow: 0 2px 10px rgba(16, 24, 40, 0.05);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.cfr-deal-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 24px rgba(16, 24, 40, 0.12);
}

.cfr-deal-card .elementor-image-box-img {
    margin-bottom: 0;
}

.cfr-deal-card .elementor-image-box-img img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 0;
}

.cfr-deal-card .elementor-image-box-content {
    padding: 14px 16px 18px;
    text-align: left;
}

.cfr-deal-card .elementor-image-box-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--ast-global-color-0, #101828);
    margin-bottom: 4px;
}

/* This is the price line (set as the Image Box's Description field) -
   styled to read like a fare tag, not plain body text. */
.cfr-deal-card .elementor-image-box-description {
    font-size: 14px;
    font-weight: 800;
    color: var(--ast-global-color-1, #155EEF);
}

@media (prefers-reduced-motion: reduce) {
    .cfr-deal-card { transition: none; }
}

/* ==========================================================================
   Trust badges row (Elementor Icon Box widgets, CSS class: cfr-trust-badge)
   Deliberately minimal - no box/shadow, just icon + bold title + muted text,
   matching how real OTAs keep this row lightweight rather than competing
   visually with the search hero or the deals row.
   ========================================================================== */
.cfr-trust-badge {
    text-align: center;
    padding: 8px 12px;
}

.cfr-trust-badge .elementor-icon-box-icon {
    margin-bottom: 10px;
}

.cfr-trust-badge .elementor-icon-box-icon i,
.cfr-trust-badge .elementor-icon-box-icon svg {
    color: var(--ast-global-color-1, #155EEF);
    font-size: 30px;
}

.cfr-trust-badge .elementor-icon-box-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--ast-global-color-0, #101828);
    margin-bottom: 2px;
}

.cfr-trust-badge .elementor-icon-box-description {
    font-size: 13px;
    color: #667085;
    line-height: 1.4;
}
