/* Flight Search Form - Mobile Responsive Fix */

/* Desktop - Original behavior */
.banner-style-1 {
    min-height: 750px;
}

#js_frm_040,
#js_frm_040 .carousel-inner,
#js_frm_040 .carousel-item {
    min-height: 750px;
}

#js_frm_040 .carousel-item img {
    min-height: 750px;
    object-fit: cover;
}

.js_frm_subscribe {
    position: absolute;
    left: 0;
    right: 0;
    top: 175px;
    width: 75%;
    margin: auto;
    text-align: center;
}

.search-content-slider {
    padding: 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

/* Tablet - Medium screens */
@media (max-width: 991px) {
    .banner-style-1 {
        min-height: 600px;
    }
    
    #js_frm_040,
    #js_frm_040 .carousel-inner,
    #js_frm_040 .carousel-item {
        min-height: 600px;
    }
    
    #js_frm_040 .carousel-item img {
        min-height: 600px;
    }
    
    .js_frm_subscribe {
        width: 90%;
        top: 30px; /* Moved up 40% from 50px */
    }
    
    .search-content-slider {
        padding: 15px;
    }
    
    /* Stack form fields vertically */
    .search-content-slider .col-lg-3,
    .search-content-slider .col-lg-2 {
        width: 100%;
        margin-bottom: 10px;
    }
}

/* Mobile - Small screens */
@media (max-width: 767px) {
    /* CRITICAL: Override style.css that hides form on mobile */
    .banner-style-1 .js_frm_subscribe {
        display: block !important;
        visibility: visible !important;
    }
    
    .banner-style-1 {
        min-height: auto !important;
        height: auto !important;
        padding-bottom: 20px !important;
        overflow: visible !important;
    }
    
    #js_frm_040,
    #js_frm_040 .carousel-inner,
    #js_frm_040 .carousel-item {
        min-height: auto !important;
        height: auto !important;
    }
    
    #js_frm_040 .carousel-item img {
        min-height: 300px !important;
        max-height: 300px !important;
        object-fit: cover;
    }
    
    .js_frm_subscribe {
        position: relative !important;
        display: block !important;
        visibility: visible !important;
        width: 95% !important;
        top: -112px !important; /* Moved up 40% from -80px */
        margin: 0 auto 20px !important;
        z-index: 1000 !important;
        opacity: 1 !important;
    }
    
    .search-content-slider {
        padding: 12px 10px 15px !important;
        z-index: 1001 !important;
        position: relative;
        box-shadow: 0 1px 5px rgba(0, 0, 0, 0.08) !important;
        overflow: visible !important;
        margin-bottom: 0 !important;
        display: block !important;
        visibility: visible !important;
    }
    
    /* Trip type buttons - Full width on mobile */
    #trip-type-oneway,
    #trip-type-roundtrip {
        padding: 8px 15px !important;
        font-size: 12px !important;
    }
    
    /* All form columns full width */
    .search-content-slider .col-md-6,
    .search-content-slider .col-lg-3,
    .search-content-slider .col-lg-2 {
        width: 100% !important;
        padding: 0 10px !important;
        margin-bottom: 10px !important;
    }
    
    /* Last column (search button) - no bottom margin */
    .search-content-slider .col-lg-2:last-child {
        margin-bottom: 0 !important;
    }
    
    /* Form inputs */
    .search-content-slider .form-control {
        font-size: 14px !important;
        padding: 10px 12px !important;
        height: auto !important;
    }
    
    /* Helper text smaller on mobile */
    .search-content-slider small {
        font-size: 10px !important;
    }
    
    /* Passengers dropdown full width */
    #passengers-dropdown {
        width: 95% !important;
        left: 2.5% !important;
    }
    
    /* Class buttons side by side on mobile */
    .search-content-slider .class-btn {
        font-size: 11px !important;
        padding: 8px 5px !important;
    }
    
    /* Search button full width and prominent */
    .search-content-slider .btn-blue {
        width: 100% !important;
        padding: 14px 12px !important;
        font-size: 15px !important;
        font-weight: 600 !important;
        display: block !important;
        visibility: visible !important;
        margin-top: 5px !important;
    }
    
    /* Make sure search button container is visible */
    .search-content-slider .col-lg-2:last-child {
        display: block !important;
        width: 100% !important;
    }
    
    /* Hide trip type labels on mobile to save space */
    .search-content-slider .row:first-child {
        margin-bottom: 10px !important;
    }
    
    /* Slider content titles - smaller on mobile */
    .kenburns_061_slide h1 {
        font-size: 20px !important;
        margin-bottom: 5px !important;
        line-height: 1.2 !important;
    }
    
    .kenburns_061_slide h2 {
        font-size: 14px !important;
        margin-bottom: 10px !important;
        line-height: 1.3 !important;
    }
}

/* Very small mobile screens */
@media (max-width: 480px) {
    /* CRITICAL: Force form to display even on very small screens */
    .banner-style-1 .js_frm_subscribe {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    #js_frm_040 .carousel-item img {
        min-height: 250px !important;
        max-height: 250px !important;
    }
    
    .js_frm_subscribe {
        display: block !important;
        visibility: visible !important;
        width: 98% !important;
        margin: 0 auto 15px !important;
        top: -84px !important; /* Moved up 40% from -60px */
    }
    
    .search-content-slider {
        padding: 10px 8px 12px !important;
        box-shadow: 0 1px 5px rgba(0, 0, 0, 0.06) !important;
    }
    
    /* Make trip type buttons smaller */
    #trip-type-oneway,
    #trip-type-roundtrip {
        padding: 6px 12px !important;
        font-size: 11px !important;
    }
    
    /* Smaller form elements */
    .search-content-slider .form-control {
        font-size: 13px !important;
        padding: 8px 10px !important;
    }
    
    /* Search button - ensure visibility on small screens */
    .search-content-slider .btn-blue {
        padding: 12px !important;
        font-size: 14px !important;
        font-weight: 700 !important;
    }
    
    /* Passengers controls */
    #adults-minus, #adults-plus,
    #children-minus, #children-plus {
        width: 30px !important;
        height: 30px !important;
        font-size: 16px !important;
    }
    
    #adults-count, #children-count {
        font-size: 16px !important;
        min-width: 25px !important;
    }
    
    /* Airport results dropdown */
    .airport-results {
        max-height: 200px;
        overflow-y: auto;
    }
    
    /* Slider titles - even smaller */
    .kenburns_061_slide h1 {
        font-size: 18px !important;
        margin-bottom: 3px !important;
    }
    
    .kenburns_061_slide h2 {
        font-size: 12px !important;
        margin-bottom: 8px !important;
    }
}

/* Ensure form is visible and scrollable on mobile */
@media (max-width: 767px) {
    .carousel-item.active {
        display: flex !important;
        flex-direction: column !important;
    }
    
    /* Ensure banner section has proper z-index */
    #home_banner {
        position: relative;
        z-index: 1;
    }
    
    /* Make sure form is always visible above any overlays */
    .banner-with-form {
        position: relative;
        z-index: 2;
    }
}
