/* Flight Deals Premium filter / AI search conversion modal + gated Apply CTAs.
   Match premium-discovery Midnight Blue language; beat page typography specificity. */

/* ——— Conversion modal ——— */

.fd-premium-gate-modal .modal-dialog {
    max-width: 420px;
}

.page-flight-deals-finder .fd-premium-gate-modal .modal-content,
.fd-premium-gate-modal .modal-content {
    --fd-prem-ink: #f7f9ff;
    --fd-prem-muted: rgba(232, 238, 255, 0.88);
    --fd-prem-soft: rgba(214, 224, 255, 0.78);
    --fd-prem-check: #9ec5ff;
    --fd-prem-benefit: rgba(247, 249, 255, 0.96);
    /* Override page + Bootstrap tokens so text never inherits dark-on-navy failure. */
    --text-color-primary: #ffffff;
    --text-color-heading: #ffffff;
    --text-color-secondary: var(--fd-prem-muted);
    --text-color-muted: var(--fd-prem-soft);
    --text-color-label: var(--fd-prem-soft);
    --bs-modal-bg: #102c52;
    --bs-modal-color: #f7f9ff;
    --bs-body-color: #f7f9ff;
    border: 1px solid rgba(120, 170, 230, 0.22) !important;
    border-radius: 16px !important;
    overflow: hidden;
    position: relative;
    background-color: #102c52 !important;
    background:
        radial-gradient(120% 80% at 100% 0%, rgba(50, 110, 190, 0.26) 0%, transparent 55%),
        radial-gradient(90% 70% at 0% 100%, rgba(15, 50, 110, 0.42) 0%, transparent 50%),
        linear-gradient(155deg, #08172b 0%, #102c52 48%, #1b4d82 100%) !important;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.06) inset,
        0 18px 40px rgba(8, 23, 43, 0.35);
    color: var(--fd-prem-ink);
    isolation: isolate;
}

.fd-premium-gate-modal .modal-content::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.045) 0%, transparent 42%),
        repeating-linear-gradient(
            -18deg,
            transparent 0,
            transparent 11px,
            rgba(255, 255, 255, 0.012) 11px,
            rgba(255, 255, 255, 0.012) 12px
        );
    opacity: 0.9;
}

.fd-premium-gate-modal .modal-header {
    position: relative;
    z-index: 1;
    border: 0;
    padding: 18px 20px 0;
    background: transparent;
}

.fd-premium-gate-modal .btn-close {
    filter: invert(1) brightness(1.4);
    opacity: 0.72;
}

.fd-premium-gate-modal .btn-close:hover {
    opacity: 1;
}

.fd-premium-gate-modal__body {
    position: relative;
    z-index: 1;
    padding: 8px 20px 8px;
    color: var(--fd-prem-ink);
}

.page-flight-deals-finder .fd-premium-gate-modal p.fd-premium-gate-modal__eyebrow,
.fd-premium-gate-modal p.fd-premium-gate-modal__eyebrow,
.fd-premium-gate-modal__eyebrow {
    margin: 0 0 12px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(214, 224, 255, 0.92) !important;
}

.page-flight-deals-finder .fd-premium-gate-modal h2.fd-premium-gate-modal__headline,
.fd-premium-gate-modal h2.fd-premium-gate-modal__headline,
.fd-premium-gate-modal__headline {
    margin: 0 0 8px;
    font-family: Overpass, sans-serif;
    font-size: clamp(22px, 2.5vw, 26px);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.03em;
    color: #ffffff !important;
}

.page-flight-deals-finder .fd-premium-gate-modal p.fd-premium-gate-modal__copy,
.fd-premium-gate-modal p.fd-premium-gate-modal__copy,
.fd-premium-gate-modal__copy {
    margin: 0 0 14px;
    font-size: 13px;
    line-height: 1.45;
    font-weight: 400;
    color: var(--fd-prem-muted) !important;
}

.fd-premium-gate-modal__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 16px;
    padding: 0;
    list-style: none;
}

.fd-premium-gate-modal__chips:empty {
    display: none;
    margin: 0;
}

.fd-premium-gate-modal__chip {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid rgba(210, 224, 255, 0.55);
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff !important;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
}

.fd-premium-gate-modal__benefits {
    list-style: none;
    margin: 0 0 4px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.page-flight-deals-finder .fd-premium-gate-modal__benefit,
.fd-premium-gate-modal__benefit {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin: 0;
    padding: 0;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
    color: var(--fd-prem-benefit) !important;
}

.page-flight-deals-finder .fd-premium-gate-modal__benefit > span,
.fd-premium-gate-modal__benefit > span {
    color: var(--fd-prem-benefit) !important;
}

.fd-premium-gate-modal__check {
    display: inline-flex;
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    margin-top: 1px;
    color: var(--fd-prem-check);
}

.fd-premium-gate-modal__check svg {
    display: block;
    width: 16px;
    height: 16px;
    color: inherit;
}

.fd-premium-gate-modal__check svg path {
    stroke: currentColor;
}

.fd-premium-gate-modal .modal-footer {
    position: relative;
    z-index: 1;
    border: 0 !important;
    padding: 12px 20px 18px;
    background: transparent !important;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 8px;
}

.page-flight-deals-finder .fd-premium-gate-modal__cta,
.fd-premium-gate-modal__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 44px;
    padding: 10px 18px;
    border-radius: 11px;
    border: 0;
    background: #ffffff !important;
    color: #08172b !important;
    font-family: "Open Sans", sans-serif;
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.01em;
    text-decoration: none !important;
    box-shadow: 0 4px 16px rgba(8, 23, 43, 0.28);
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.page-flight-deals-finder .fd-premium-gate-modal__cta:hover,
.page-flight-deals-finder .fd-premium-gate-modal__cta:focus-visible,
.fd-premium-gate-modal__cta:hover,
.fd-premium-gate-modal__cta:focus-visible {
    background: #f4f6ff !important;
    color: #061222 !important;
    text-decoration: none !important;
    filter: none;
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(8, 23, 43, 0.34);
    outline: none;
}

.page-flight-deals-finder .fd-premium-gate-modal__secondary,
.fd-premium-gate-modal__secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 40px;
    padding: 8px 14px;
    border: 1px solid rgba(220, 230, 255, 0.55);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff !important;
    font-family: "Open Sans", sans-serif;
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.3;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.page-flight-deals-finder .fd-premium-gate-modal__secondary:hover,
.page-flight-deals-finder .fd-premium-gate-modal__secondary:focus-visible,
.fd-premium-gate-modal__secondary:hover,
.fd-premium-gate-modal__secondary:focus-visible {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(235, 242, 255, 0.75);
    color: #ffffff !important;
    outline: none;
}

.page-flight-deals-finder .fd-premium-gate-modal p.fd-premium-gate-modal__price,
.fd-premium-gate-modal p.fd-premium-gate-modal__price,
.fd-premium-gate-modal__price {
    margin: 2px 0 0;
    text-align: center;
    font-size: 12px;
    line-height: 1.35;
    font-weight: 500;
    letter-spacing: 0.01em;
    color: rgba(220, 230, 255, 0.88) !important;
}

/* ——— Filter footer: Premium Apply CTA + helper ——— */

.flight-deals-filter-premium-hint {
    flex: 1 0 100%;
    order: 3;
    margin: 6px 0 0;
    padding: 0 4px;
    font-size: 11px;
    line-height: 1.4;
    font-weight: 500;
    color: #94a3b8;
    text-align: center;
}

/* Clear uses the same base Clear styles as Premium (no gated override). */

.flight-deals-destination-filter__footer:has(.flight-deals-filter-premium-hint),
.flight-deals-when__footer:has(.flight-deals-filter-premium-hint),
.flight-deals-trip-len__footer:has(.flight-deals-filter-premium-hint),
.flight-deals-trip-type__footer:has(.flight-deals-filter-premium-hint),
.flight-deals-all-filters .modal-footer:has(.flight-deals-filter-premium-hint) {
    flex-wrap: wrap;
    align-items: center;
    row-gap: 0;
    column-gap: 8px;
}

.flight-deals-destination-filter__footer-btn--apply.is-premium-gate,
.flight-deals-all-filters__apply.is-premium-gate,
.flight-deals-trip-len__footer-btn--apply.is-premium-gate,
.flight-deals-trip-type__footer-btn--apply.is-premium-gate {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex: 0 1 auto;
    min-width: 0;
    max-width: 100%;
    margin-left: auto;
    min-height: 32px;
    padding: 6px 12px;
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    background: linear-gradient(180deg, #1b4d82 0%, #08172b 100%) !important;
    border: 1px solid rgba(110, 160, 220, 0.32) !important;
    color: #ffffff !important;
    box-shadow: 0 3px 10px rgba(8, 23, 43, 0.22);
}

.flight-deals-destination-filter__footer-btn--apply.is-premium-gate:hover,
.flight-deals-destination-filter__footer-btn--apply.is-premium-gate:focus-visible,
.flight-deals-all-filters__apply.is-premium-gate:hover,
.flight-deals-all-filters__apply.is-premium-gate:focus-visible,
.flight-deals-trip-len__footer-btn--apply.is-premium-gate:hover,
.flight-deals-trip-len__footer-btn--apply.is-premium-gate:focus-visible,
.flight-deals-trip-type__footer-btn--apply.is-premium-gate:hover,
.flight-deals-trip-type__footer-btn--apply.is-premium-gate:focus-visible {
    background: linear-gradient(180deg, #2468a8 0%, #0c2444 100%) !important;
    border-color: rgba(130, 175, 230, 0.48) !important;
    color: #ffffff !important;
    outline: none;
}

.fd-premium-apply__icon {
    display: inline-flex;
    flex: 0 0 auto;
    width: 13px;
    height: 13px;
    color: inherit;
}

.fd-premium-apply__icon svg {
    display: block;
    width: 13px;
    height: 13px;
}

.fd-premium-apply__label {
    display: inline-block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.flight-deals-destination-filter__footer-btn--clear,
.flight-deals-trip-len__footer-btn--clear,
.flight-deals-trip-type__footer-btn--clear,
.flight-deals-all-filters__clear {
    flex: 0 0 auto;
}

.flight-deals-all-filters__premium-hint {
    width: 100%;
    margin: 0;
    order: 3;
    text-align: center;
}

.flight-deals-all-filters .modal-footer {
    flex-wrap: wrap;
}

.flight-deals-trip-len {
    position: relative;
}

.flight-deals-trip-len.is-open .flight-deals-filter-button {
    background-color: #ffffff;
    border-color: #c8d8e7;
}

.flight-deals-trip-len__menu {
    position: absolute;
    top: calc(100% + 7px);
    left: 0;
    z-index: 1040;
    width: 260px;
    max-width: calc(100vw - 32px);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid rgb(229, 231, 235);
    border-radius: 14px;
    box-shadow: 0 4px 37.2px rgba(0, 0, 0, 0.15);
    padding: 8px;
    text-align: left;
}

.flight-deals-trip-len__option {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 0;
    background: transparent;
    border-radius: 9px;
    min-height: 36px;
    padding: 9px 10px;
    color: #10374c;
    font-family: "Open Sans", sans-serif;
    font-size: 13px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
}

.flight-deals-trip-len__option:hover,
.flight-deals-trip-len__option:focus-visible {
    background: #f4f8fc;
    outline: none;
}

.flight-deals-trip-len__option.is-selected {
    background: #f1f6ff;
    font-weight: 600;
}

.flight-deals-trip-len__option .flight-deals-destination-filter__mark {
    flex: 0 0 18px;
    border-radius: 999px;
}

.flight-deals-trip-len__option.is-selected .flight-deals-destination-filter__mark {
    border-color: #005fff;
    background: #ffffff;
    box-shadow: inset 0 0 0 4px #ffffff;
}

.flight-deals-trip-len__option.is-selected .flight-deals-destination-filter__mark::after {
    content: '';
    position: absolute;
    inset: 3px;
    width: auto;
    height: auto;
    border: 0;
    border-radius: 999px;
    background: #005fff;
    transform: none;
}

.flight-deals-trip-len__footer,
.flight-deals-trip-type__footer {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-top: 10px;
    padding-top: 9px;
    border-top: 1px solid #eef2f7;
    flex-wrap: wrap;
}

.flight-deals-trip-len__footer-btn,
.flight-deals-trip-type__footer-btn {
    border: 0;
    border-radius: 9px;
    min-height: 34px;
    padding: 8px 13px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.flight-deals-trip-len__footer-btn--clear,
.flight-deals-trip-type__footer-btn--clear {
    background: #f4f7fb;
    color: #64748b;
}

.flight-deals-trip-len__footer-btn--apply,
.flight-deals-trip-type__footer-btn--apply {
    margin-left: auto;
    background: var(--mf-primary, #005fff);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 95, 255, 0.18);
}

/* Non-gated Apply hover/active come from primaryCta.css */

.flight-deals-trip-type__footer.is-premium-only {
    display: none;
}

.flight-deals-trip-type.is-premium-gated .flight-deals-trip-type__footer.is-premium-only {
    display: flex;
}

.flight-deals-trip-type.is-premium-gated .flight-deals-trip-type__premium-hint,
.flight-deals-trip-len__premium-hint,
.flight-deals-destination-filter__premium-hint,
.flight-deals-when__premium-hint {
    width: 100%;
    text-align: center;
}

/* Narrow menus: keep Premium CTA on one line by giving the menu a bit more room */
.flight-deals-trip-type.is-premium-gated .flight-deals-trip-type__menu,
.flight-deals-trip-len:has(.is-premium-gate) .flight-deals-trip-len__menu,
.flight-deals-destination-filter:has(.is-premium-gate) .flight-deals-destination-filter__menu,
.flight-deals-when:has(.is-premium-gate) .flight-deals-when__menu {
    width: min(340px, calc(100vw - 32px));
}

@media (max-width: 575.98px) {
    .flight-deals-filter-premium-hint {
        text-align: center;
    }

    .flight-deals-destination-filter__footer-btn--apply.is-premium-gate,
    .flight-deals-trip-len__footer-btn--apply.is-premium-gate,
    .flight-deals-trip-type__footer-btn--apply.is-premium-gate {
        flex: 0 1 auto;
    }
}
