/**
 * Amadex Mobile Responsive Styles
 * Mobile-friendly flight results page and filters
 */

/* ==================== Mobile Filter Modal ==================== */
.amadex-mobile-filter-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    transition: opacity 0.3s ease;
}
button#amadex-mobile-edit-search {
    border: none !important;
}

input#amadex-filter-meal {
    display: block !important;
}

.amadex-filter-options.amadex-filter-list-scroll input[type="checkbox"] {
    display: block !important;
}

.amadex-filter-options.amadex-filter-chip-grid input[type="checkbox"] {
    display: block !important;
}

.amadex-mobile-filter-overlay.active {
    display: block;
    opacity: 1;
}
.amadex-support-illustration{
    display: none;
}

.amadex-mobile-filter-modal {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    border-radius: 24px 24px 0 0;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 9999;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 24px 20px;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.15);
}

.amadex-mobile-filter-modal.active {
    transform: translateY(0);
}

.amadex-mobile-filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #E6E6E6;
    position: sticky;
    top: 0;
    background: #ffffff;
    z-index: 10;
}

.amadex-mobile-filter-title {
    font-size: 20px;
    font-weight: 700;
    color: #000000;
    margin: 0;
}

.amadex-mobile-filter-count {
    font-size: 14px;
    color: #6B7280;
    margin-top: 4px!important;
}

.amadex-mobile-filter-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    font-size: 24px;
    color: #6B7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.amadex-mobile-filter-close:hover {
    background: #F3F4F6;
    color: #000000;
}

/* ==================== Mobile Filter Button ==================== */
.amadex-mobile-filter-trigger {
    display: none;
    position: fixed;
    bottom: 80px;
    left: 20px;
    right: 20px;
    background: #0E7D3F;
    color: #ffffff;
    border: none;
    border-radius: 12px;
    padding: 14px 20px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(14, 125, 63, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.amadex-mobile-filter-trigger:hover {
    background: #0a6835;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(14, 125, 63, 0.4);
}

.amadex-mobile-filter-trigger svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* ==================== Mobile Bottom Sort Bar ==================== */
.amadex-mobile-sort-bar {
    display: none!important;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    border-top: 1px solid #E6E6E6;
    padding: 12px 16px;
    z-index: 99;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05);
}

/* .amadex-field-description {
    display: none!important;
} */
.amadex-route-title {
    font-weight: 700;
}
.amadex-route-details {
    font-weight: 700;
}/* Desktop only */

@media (min-width: 1024px) {
    .amadex-route-header {
        display: none !important;
    }
    .amadex-results-header-mobile{
        display: none !important;
        
    }
}


/* ==================== Universal Mobile Media Query (320px - 767px) ==================== */
/* ALL mobile devices: iPhone, Android, Samsung, Small & Large Phones */
@media only screen and (min-width: 320px) and (max-width: 767px) {
    .amadex-booking-page .amadex-mobile-sort-bar,
    #amadex-results-page .amadex-mobile-sort-bar,
    body:has(.amadex-flight-card) .amadex-mobile-sort-bar,
    .amadex-mobile-sort-bar:has(+ .amadex-flight-card),
    .amadex-flights-list:has(.amadex-flight-card) ~ .amadex-mobile-sort-bar,
    .amadex-flights-list:has(.amadex-flight-card) + .amadex-mobile-sort-bar {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .amadex-seat-map-tab {
        font-size: 10px;
    }
    
    .amadex-modal-body {
        padding-top: 0;
    }

    /* .amadex-field-input-wrap div#departure-display {
        width: 40% !important;
    }

    .amadex-field-input-wrap div#departure-display {
        width: 40% !important;
    } */

    .amadex-trip-selector .amadex-trip-option {
        width: 33% !important;
    }

    .amadex-trip-selector {
        gap:0!important;
    }

    input#amadex-updates-consent {
         min-height: 12px!important;
    }

    .booking-step-label{
        font-size: 10px!important;
    }
    
    /* Mobile: Hide text labels in booking progress, show only icons and dividers */
    .amadex-booking-progress .booking-step-label {
        display: none !important;
    }
    
    .amadex-booking-progress {
        gap: 4px !important; /* Reduced gap between steps for compact display with lines */
        padding: 0 8px !important; /* Add small padding on sides */
        width: 100% !important;
        max-width: 100% !important;
        justify-content: center !important; /* Center icons instead of space-between */
    }
    
    .amadex-booking-progress .booking-step {
        gap: 0 !important; /* Remove gap between icon and label (since label is hidden) */
        flex: 0 0 auto !important;
    }
    
    .amadex-booking-progress .booking-step-icon {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        min-height: 32px !important;
    }
    
    /* Divider styling is handled in amadex-booking.css with more specific selectors */
    .amadex-booking-progress .booking-step-divider {
        flex: 0 0 24px !important; /* Fixed width dividers on mobile - slightly wider for visibility */
        max-width: 24px !important;
        min-width: 24px !important;
    }
    .amadex-filter-time-grid {
        display: grid!important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .amadex-mobile-filter-modal .amadex-filter-option input[type="checkbox"] {
        position: absolute;
        left: 16px;
        top: 50%;
        transform: translateY(-50%);
        display: none;
    }

    table.amadex-passenger-table thead {
        display: none!important;
    }

    button.amadex-mobile-filter-apply-btn {
        width: 100%;
        padding: 16px;
        background: #0E7D3F;
        color: #ffffff;
        border: none;
        border-radius: 12px;
        font-size: 16px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.2s ease;
    }

    .amadex-confirmation-page,
    .amadex-booking-page {
        padding: 16px 0!important;
    }
    
    .amadex-flight-card-header {
        padding: 10px!important;
    }
    .amadex-results-content{
        padding: 0!important;
    }
    
    .amadex-segment-timeline-wrapper {
        padding: 15px 0;;
    }
    /* Ensure sort bar is always visible on results page */
    .amadex-booking-page .amadex-mobile-sort-bar,
    #amadex-results-page .amadex-mobile-sort-bar {
        display: block !important;
    }
    
    /* Hide sort bar on non-results pages */
    body:not(:has(.amadex-flight-card)):not(.amadex-booking-page):not(#amadex-results-page) .amadex-mobile-sort-bar {
        display: none !important;
    }
    
    /* Mobile Sort Bar Styles */
    .amadex-mobile-sort-bar-content {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        max-width: 100%;
    }

    .amadex-mobile-filter-icon {
        width: 24px;
        height: 24px;
        cursor: pointer;
        color: #6B7280;
        flex-shrink: 0;
    }

    .amadex-route-header {
        display: flex!important;
        justify-content: center;
        align-items: center;
        padding: 12px 20px;
        border-bottom-width: 0px;
        border-bottom-color: rgba(0, 0, 0, 0);
        border-bottom-style: none;
        border-image: none;
        background: rgba(14, 113, 31, 1) 0% 0% no-repeat;
        border-radius: 20px;
        text-align: left;
        vertical-align: middle;
        color: rgba(255, 255, 255, 1);
        background-clip: unset;
        -webkit-background-clip: unset;
    }

    .amadex-mobile-sort-options {
        display: flex;
        gap: 8px;
        flex: 1;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        /* justify-content: center; */
    }

    .amadex-mobile-sort-options::-webkit-scrollbar {
        display: none;
    }

    .amadex-mobile-sort-btn {
        padding: 8px 16px;
        border: 1px solid #E6E6E6;
        border-radius: 20px;
        background: #ffffff;
        color: #0E7D3F;
        font-size: 14px;
        font-weight: 500;
        white-space: nowrap;
        cursor: pointer;
        transition: all 0.2s ease;
        flex-shrink: 0;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
        user-select: none;
        min-height: 36px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .amadex-mobile-sort-btn.active {
        background: #0E7D3F;
        color: #ffffff;
        border-color: #0E7D3F;
    }

    .amadex-mobile-sort-btn:hover:not(.active),
    .amadex-mobile-sort-btn:active:not(.active) {
        border-color: #0E7D3F;
        color: #0E7D3F;
        background: #f0f9f4;
    }

    /* Better touch targets for small devices - Nested */
    @media only screen and (min-width: 320px) and (max-width: 480px) {
    .amadex-mobile-sort-bar {
        padding: 10px 12px;
    }
    
    .amadex-mobile-sort-btn {
        padding: 8px 12px;
        font-size: 13px;
        min-height: 34px;
    }
    
    .amadex-mobile-sort-options {
        gap: 6px;
    }
}

    /* Extra small devices (320px to 375px) - Nested */
    @media only screen and (min-width: 320px) and (max-width: 375px) {
    .amadex-mobile-sort-bar {
        padding: 8px 10px;
    }
    
    .amadex-mobile-sort-btn {
        padding: 6px 10px;
        font-size: 12px;
        min-height: 32px;
    }
    
    .amadex-mobile-sort-options {
        gap: 4px;
    }
    
    .amadex-mobile-filter-icon {
        width: 20px;
        height: 20px;
    }
}

/* ==================== Mobile Results Page Header ==================== */
    /* Hide desktop-only elements on mobile */
    /* .amadex-route-header,
    .amadex-booking-progress,
    .amadex-results-header-mobile {
        display: block;
    } */
    .amadex-booking-page .amadex-booking-header {
    flex-direction: column;
    align-items: flex-start;
    padding: 0!important;
}

.amadex-booking-page .amadex-booking-progress {

    margin-bottom: 0!important;
}

.amadex-search-modern .amadex-search-fields {
    box-shadow: none!important;
}
    
    .amadex-confirmation-content {
    display: flex;
    flex-direction: column;
}
.amadex-confirmation-content{
    width:100%;
}
.booking-step-divider{
    display: none;
}

.amadex-flight-card-price {
    border-left: none;
    border-top: 1px solid #e0e0e0;
    min-width: auto;
    flex-direction: row;
    flex-wrap: wrap;
    padding: 0;
    justify-content: space-between;
    padding-top: 0 !important;
}


    @media (min-width: 769px) {
        .amadex-route-header,
        .amadex-booking-progress,
        .amadex-results-header-mobile {
            display: none;
        }
    }

    .amadex-results-page {
        padding-bottom: 120px; /* Space for bottom bar */
        padding-top: 2rem;
    }

    .amadex-booking-progress {
    margin-bottom: 15px!important;
}

    /* Mobile: Hide text labels in booking progress, show only icons and dividers */
    .amadex-booking-progress .booking-step-label {
        display: none !important;
    }
    
    .amadex-booking-progress {
        gap: 8px !important; /* Reduce gap between steps for compact display */
        padding: 0 8px !important; /* Add small padding on sides */
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .amadex-booking-progress .booking-step {
        gap: 0 !important; /* Remove gap between icon and label (since label is hidden) */
    }
    
    .amadex-booking-progress .booking-step-icon {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        min-height: 32px !important;
    }
    
    .amadex-booking-progress .booking-step-divider {
        flex: 0 0 20px !important; /* Fixed width dividers on mobile */
        max-width: 20px !important;
        min-width: 20px !important;
    }

    .amadex-results-header-mobile {
        display: none!important;
    }

    /* Search Bar Wrapper - Mobile */
    .amadex-search-bar-wrapper {
        display: none !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        background-color: #EEF9F2 !important;
        position: relative !important;
        z-index: 1000 !important;
        box-sizing: border-box !important;
        overflow: visible !important;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        transform-origin: top !important;
        opacity: 0 !important;
        max-height: 0 !important;
    }
    
    /* Active state - Show search bar with slide-down animation */
    .amadex-search-bar-wrapper.amadex-search-bar-active {
        display: block !important;
        opacity: 1 !important;
        max-height: 100% !important;
        padding: 16px 0 !important;
        overflow: visible !important;
        animation: slideDownFade 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards !important;
    }
    
    /* When travellers dropdown is active, ensure search bar wrapper allows overflow */
    .amadex-search-bar-wrapper.amadex-search-bar-active:has(.amadex-travellers-dropdown.active),
    .amadex-search-bar-wrapper.amadex-search-bar-active:has(#travellers-field.active),
    .amadex-search-bar-wrapper.amadex-search-bar-active:has(#travellers-field.field-active) {
        overflow: visible !important;
        padding-bottom: 0 !important; /* Extra space for dropdown */
    }
    
    /* Slide-down animation keyframes */
    @keyframes slideDownFade {
        from {
            opacity: 0;
            max-height: 0;
            transform: translateY(-20px);
            padding: 0;
        }
        to {
            opacity: 1;
            max-height: 100%;
            transform: translateY(0);
            padding: 16px 0;
        }
    }
    
    /* Slide in down animation for travellers dropdown */
    @keyframes slideInDown {
        0% {
            opacity: 0;
            transform: translateY(-12px);
            visibility: hidden;
        }
        100% {
            opacity: 1;
            transform: translateY(0);
            visibility: visible;
        }
    }
    
    /* Route edit button active state - Mobile and Tablet */
    .amadex-route-edit.active,
    #amadex-mobile-edit-search.active {
        background: #0E7D3F !important;
        color: #ffffff !important;
    }
    
    .amadex-route-edit.active svg,
    #amadex-mobile-edit-search.active svg {
        color: #ffffff !important;
    }

/* Tablet: Search Bar Wrapper (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
    /* Search Bar Wrapper - Tablet */
    .amadex-search-bar-wrapper {
        display: none !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        background-color: #EEF9F2 !important;
        position: relative !important;
        z-index: 1000 !important;
        box-sizing: border-box !important;
        overflow: visible !important;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        transform-origin: top !important;
        opacity: 0 !important;
        max-height: 0 !important;
    }
    
    /* Active state - Show search bar with slide-down animation */
    .amadex-search-bar-wrapper.amadex-search-bar-active {
        display: block !important;
        opacity: 1 !important;
        max-height: 100%!important;
        padding: 20px 0 !important;
        overflow: visible !important;
        animation: slideDownFade 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards !important;
    }
    
    /* When travellers dropdown is active, ensure search bar wrapper allows overflow */
    .amadex-search-bar-wrapper.amadex-search-bar-active:has(.amadex-travellers-dropdown.active),
    .amadex-search-bar-wrapper.amadex-search-bar-active:has(#travellers-field.active),
    .amadex-search-bar-wrapper.amadex-search-bar-active:has(#travellers-field.field-active) {
        overflow: visible !important;
        padding-bottom: 0 !important; /* Extra space for dropdown */
    }
    
    .amadex-search-bar-container {
        padding: 16px 24px !important;
        max-width: 1200px !important;
        margin: 0 auto !important;
    }
    
    /* Route edit button - Tablet */
    .amadex-route-edit,
    #amadex-mobile-edit-search {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        cursor: pointer !important;
    }
    
    .amadex-route-edit:hover,
    #amadex-mobile-edit-search:hover {
        background: rgba(14, 125, 63, 0.1) !important;
    }
    
    .amadex-route-edit.active,
    #amadex-mobile-edit-search.active {
        background: #0E7D3F !important;
        color: #ffffff !important;
    }
    
    .amadex-route-edit.active svg,
    #amadex-mobile-edit-search.active svg {
        color: #ffffff !important;
    }

    .amadex-search-bar-container {
        padding: 12px 16px;
        border-radius: 0;
        background: transparent;
    }

    /* Search Summary - Mobile Compact (Results Page) */
    .amadex-results-page .amadex-search-summary-modern {
        margin-bottom: 16px;
        padding: 0 16px;
    }

    .amadex-results-page .amadex-search-summary-modern .amadex-modern-form {
        padding: 20px 16px;
        border-radius: 20px;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
        background: #ffffff;
        transition: all 0.3s ease;
    }

    /* Multi-city mode - expandable background */
    .amadex-results-page .amadex-search-summary-modern .amadex-modern-form.amadex-multi-city-mode {
        background: #ffffff;
        min-height: auto;
        max-height: none;
        transition: all 0.4s ease;
    }

    .amadex-results-page .amadex-search-summary-modern .amadex-trip-selector {
        display: flex;
        gap: 0;
        margin-bottom: 16px;
        background: transparent;
        border-radius: 0;
        padding: 0;
        box-shadow: none;
        width: 100%;
        max-width: 100%;
    }

    .amadex-results-page .amadex-search-summary-modern .amadex-trip-label {
        padding: 8px 16px !important;
        border-radius: 16px !important;
        font-size: 13px !important;
    }

    .amadex-results-page .amadex-search-summary-modern .amadex-search-fields {
        display: flex !important;
        flex-direction: column !important;
        gap: 0 !important;
        border: none !important;
        min-height: auto !important;
        width: 100% !important;
        max-width: 100% !important;
        background: transparent !important;
    }

    /* Hide search fields in multi-city mode on results page */
    .amadex-results-page .amadex-search-summary-modern .amadex-modern-form.amadex-multi-city-mode > .amadex-search-fields {
        display: none !important;
    }

    /* Show flight segments in multi-city mode on results page */
    .amadex-results-page .amadex-search-summary-modern .amadex-modern-form.amadex-multi-city-mode .amadex-multi-city-flights {
        display: flex !important;
    }

    .amadex-results-page .amadex-search-summary-modern .amadex-modern-form.amadex-multi-city-mode .amadex-flight-segment {
        display: block !important;
    }

    .amadex-results-page .amadex-search-summary-modern .amadex-modern-form.amadex-multi-city-mode .amadex-add-city-btn {
        display: flex !important;
    }
    
    .amadex-results-header-mobile {
    display: none;
    }

    .amadex-results-page .amadex-search-summary-modern .amadex-modern-field {
        border: none !important;
        border-radius: 0 !important;
        padding: 14px 0 !important;
        margin: 0 !important;
        min-height: auto !important;
        background: transparent !important;
    }

    .amadex-results-page .amadex-search-summary-modern .amadex-modern-field:hover {
        background: transparent !important;
    }

    .amadex-results-page .amadex-search-summary-modern .amadex-modern-field.field-active {
        background: transparent !important;
        border: none !important;
    }

    .amadex-results-page .amadex-search-summary-modern .amadex-field-label {
        font-size: 12px !important;
        margin-bottom: 6px !important;
        color: #0E7D3F !important;
        font-weight: 500;
    }

    .amadex-results-page .amadex-search-summary-modern .amadex-field-value {
        font-size: 15px !important;
        font-weight: 600;
        color: #000000 !important;
    }

    .amadex-results-page .amadex-search-summary-modern .amadex-field-description {
        font-size: 12px !important;
        color: #6B7280 !important;
    }

    .amadex-results-page .amadex-search-summary-modern button.amadex-swap-button {
        display: flex !important;
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
        position: absolute;
        right: 0;
        top: 50%;
        transform: translateY(-50%) rotate(0deg);
        border-radius: 50% !important;
        background: #0E7D3F !important;
        transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1), 
                    background-color 0.3s ease !important;
        will-change: transform;
        border: 2px solid #ffffff !important;
        box-shadow: 0 2px 8px rgba(14, 125, 63, 0.3) !important;
    }

    .amadex-results-page .amadex-search-summary-modern button.amadex-search-btn {
        position: static !important;
        width: 100% !important;
        max-width: 100% !important;
        height: 50px !important;
        margin-top: 20px !important;
        border-radius: 16px !important;
        font-size: 16px !important;
        left: auto !important;
        background: #0E7D3F !important;
        color: #ffffff !important;
        font-weight: 600;
        box-shadow: 0 4px 12px rgba(14, 125, 63, 0.3);
    }
  .amadex-booking-page{
    padding: 20px 15px 20px;
  }
    /* Results Content - Mobile */
    .amadex-results-content-wrapper {
        padding: 16px 0;
    }

    .amadex-results-content {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 0!important;
    }

    /* Hide Desktop Filters Sidebar on Mobile (320px - 767px) */
    .amadex-filters-sidebar {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        height: 0 !important;
        overflow: hidden !important;
        position: absolute !important;
        left: -9999px !important;
        width: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    /* Exception: Show sidebar only inside mobile filter modal */
    .amadex-mobile-filter-modal .amadex-filters-sidebar {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        height: auto !important;
        overflow: visible !important;
        position: static !important;
        left: auto !important;
        width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
        flex-direction: column !important;
    }

    /* Show Mobile Filter Trigger */
    .amadex-mobile-filter-trigger {
        display: flex;
    }

    /* Show Mobile Sort Bar only on results page */
    .amadex-booking-page .amadex-mobile-sort-bar,
    #amadex-results-page .amadex-mobile-sort-bar,
    body:has(.amadex-flight-card) .amadex-mobile-sort-bar,
    .amadex-mobile-sort-bar:has(+ .amadex-flight-card),
    .amadex-flights-list:has(.amadex-flight-card) ~ .amadex-mobile-sort-bar {
        display: block !important;
    }
    
    /* Hide sort bar on non-results pages */
    body:not(:has(.amadex-flight-card)) .amadex-mobile-sort-bar:not(.amadex-booking-page *) {
        display: none !important;
    }

    /* Flight Cards - Mobile */
    .amadex-flight-card {
        padding: 16px;
        margin-bottom: 16px;
        border-radius: 16px;
        background: #ffffff;
        box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.08);
    }

    .amadex-flight-card-header {
        flex-direction: row;
        align-items: flex-start;
        gap: 12px;
        margin-bottom: 0;
        padding: 12px!important;
        border-bottom: 1px solid #E6E6E6;
    }

    .amadex-flight-badge {
        font-size: 12px;
        padding: 4px 10px;
    }

    .amadex-flight-seats {
        font-size: 12px;
        padding: 4px 10px;
    }

    .amadex-flight-card-main {
        flex-direction: column;
        gap: 16px;
        padding: 16px;
    }

    .amadex-flight-card-info {
        gap: 12px;
    }

    .amadex-flight-airline-chip {
        font-size: 14px;
        margin-bottom: 8px;
    }

    .amadex-flight-airline-chip img {
        width: 36px;
        height: 36px;
    }

    .amadex-flight-legs {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .amadex-flight-leg {
        border-right: none;
        border-bottom: 1px solid #E6E6E6;
        padding-right: 0;
        padding-bottom: 16px;
        margin-bottom: 0;
    }

    .amadex-flight-leg:last-child {
        border-bottom: none;
        padding-bottom: 0;
        margin-bottom: 0;
    }

    .amadex-flight-leg-title {
        font-size: 13px;
        margin-bottom: 12px;
        color: #6B7280;
    }

    .amadex-flight-times {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 8px;
    }

    .amadex-flight-time {
        font-size: 18px;
        font-weight: 700;
        color: #000000;
    }

    .amadex-flight-airport {
        font-size: 13px;
        color: #6B7280;
    }

    .amadex-flight-duration {
        font-size: 13px;
        color: #6B7280;
        text-align: center;
        margin: 8px 0;
    }

    .amadex-flight-stops {
        font-size: 12px;
        color: #6B7280;
        text-align: center;
    }

    /* Price Box - Mobile */
    .amadex-price-box {
        width: 100%;
        margin-top: 16px;
        padding-top: 16px;
        border-top: 1px solid #E6E6E6;
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .amadex-price-box-price {
        font-size: 24px;
        font-weight: 700;
        color: #000000;
    }

    .amadex-price-box-price-label {
        font-size: 12px;
        color: #6B7280;
        margin-top: 4px;
    }

    .amadex-price-box-select,
    .amadex-select-flight-btn {
        width: 100%;
        margin-top: 0;
        padding: 0;
        font-size: 14px;
        font-weight: 600;
        border-radius: 12px;
        /* background: #0E7D3F; */
        color: #0E7D3F;
        border: none;
        cursor: pointer;
        transition: all 0.2s ease;
    }

    /* .amadex-price-box-select:hover,
    .amadex-select-flight-btn:hover {
        background: #0a6835;
    } */

    .amadex-price-box-call {
        width: 100%;
        margin-top: 8px;
        padding: 12px;
        font-size: 14px;
        border-radius: 12px;
        background: #F0FDF4;
        color: #0E7D3F;
        border: 1px solid #0E7D3F;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
    }
    
    .amadex-timer-badge {
        font-size: 10px;
    }
    /* Progress Bar - Mobile */
    .amadex-booking-progress {
        display: flex;
        /* justify-content: space-between; */
        align-items: center;
        padding: 10px 0;
        background: none!important;
        border: none!important;
        margin-bottom: 16px;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
    }
    /* Divider visibility overridden in amadex-booking.css with more specific selector */
    span.booking-step-divider {
    display: none;
}

/* Modern Progress Bar Mobile Fixes */
.amadex-booking-progress-modern {
    width: 100% !important;
    max-width: 100% !important;

    padding: 10px 6px !important;
    gap: 4px !important;
    flex-wrap: wrap !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
}

.booking-step-modern {
    min-width: auto !important;
    flex: 1 !important;
    padding: 6px 8px !important;
    font-size: 10px !important;
    gap: 4px !important;
    justify-content: center !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
}

.booking-step-label-modern {
    font-size: 10px !important;
    white-space: nowrap !important;
}

.booking-step-icon-modern {
    width: 28px !important;
    height: 28px !important;
    font-size: 14px !important;
    flex-shrink: 0 !important;
}

.booking-step-divider-modern {
    display: none !important;
}

.amadex-price-box-call{
    margin-top: 0;
    }

    .amadex-progress-step {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 8px;
        flex: 1;
        position: relative;
    }

     .amadex-flight-card-price {
    flex-direction: row;
    flex-wrap: wrap;
    padding: 0;
    justify-content: space-between;
    padding-top: 0!important;
}
 a.amadex-price-box-call.amadex-call-btn{
        color:#fff;
    }

    .amadex-progress-step::after {
        content: '';
        position: absolute;
        top: 20px;
        left: 50%;
        right: -50%;
        height: 2px;
        background: #E6E6E6;
        z-index: 0;
    }

    .amadex-progress-step:last-child::after {
        display: none;
    }

    .amadex-progress-step.active::after {
        background: #0E7D3F;
    }

    .amadex-progress-icon {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background: #E6E6E6;
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
        z-index: 1;
    }

    .amadex-progress-step.active .amadex-progress-icon {
        background: #0E7D3F;
        color: #ffffff;
    }

    .amadex-progress-label {
        font-size: 12px;
        color: #6B7280;
        text-align: center;
    }

    .amadex-progress-step.active .amadex-progress-label {
        color: #0E7D3F;
        font-weight: 600;
    }

    /* Route Header - Mobile */
    .amadex-route-header {
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 12px 20px;
        border-bottom-width: 0px;
        border-bottom-color: rgba(0, 0, 0, 0);
        border-bottom-style: none;
        border-image: none;
        background: rgba(14, 113, 31, 1) 0% 0% no-repeat;
        border-radius: 20px;
        text-align: left;
        vertical-align: middle;
        color: rgba(255, 255, 255, 1);
        background-clip: unset;
        -webkit-background-clip: unset;
    }

    .amadex-route-info {
        flex: 1;
    }

    /* Hide Desktop Results Sort Bar on Mobile (320px - 767px) */
    .amadex-results-sort-bar {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        height: 0 !important;
        overflow: hidden !important;
        position: absolute !important;
        left: -9999px !important;
        width: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    /* Note: Mobile sort bar (.amadex-mobile-sort-bar) is shown instead */
    .amadex-route-title {
        font-size: 16px;
        font-weight: 700;
        color: #000000;
        margin-bottom: 4px;
    }

    #amadex-mobile-route-title {
        color: rgba(238, 249, 242, 1) !important;
    }

    .amadex-route-details {
        font-size: 13px;
        color: #6B7280;
    }

    #amadex-mobile-route-details {
        color: rgba(238, 249, 242, 1) !important;
    }

    .amadex-route-edit,
    #amadex-mobile-edit-search {
        width: 32px;
        height: 32px;
        border: none;
        background-color: rgba(14, 113, 31, 1);
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 8px;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        position: relative;
        z-index: 1001;
        color: rgba(238, 249, 242, 1);
        padding-top: 4px;
        padding-bottom: 4px;
    }

    .amadex-route-edit:hover,
    #amadex-mobile-edit-search:hover {
        background: #F3F4F6;
        transform: scale(1.05);
    }
    
    .amadex-route-edit:active,
    #amadex-mobile-edit-search:active {
        transform: scale(0.95);
    }

    .amadex-route-edit svg,
    #amadex-mobile-edit-search svg {
        width: 20px;
        height: 20px;
        color: rgba(238, 249, 242, 1);
        transition: all 0.3s ease;
    }
    
    /* Active state styling */
    .amadex-route-edit.active,
    #amadex-mobile-edit-search.active {
        background: #0E7D3F !important;
        box-shadow: 0 2px 8px rgba(14, 125, 63, 0.3);
    }
    
    .amadex-route-edit.active svg,
    #amadex-mobile-edit-search.active svg {
        color: #ffffff !important;
    }

    /* Mobile Filter Modal Content */
    .amadex-mobile-filter-modal .amadex-filters-sidebar {
        display: block !important;
        position: static !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        padding: 0 !important;
        background: transparent !important;
        height: auto !important;
        top: auto !important;
    }

    .amadex-mobile-filter-modal .amadex-filter-tags {
        display: flex !important;
        flex-wrap: wrap;
        gap: 8px;
        margin-bottom: 16px;
        padding-bottom: 16px;
        border-bottom: 1px solid #E6E6E6;
    }

    .amadex-mobile-filter-modal .amadex-filter-group {
        border-top: 1px solid #E6E6E6;
        padding: 20px 0;
        display: block !important;
    }

    .amadex-mobile-filter-modal .amadex-filter-group:first-of-type {
        border-top: none;
        padding-top: 0;
    }

    .amadex-mobile-filter-modal .amadex-filter-group-heading {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 14px;
    }

    .amadex-mobile-filter-modal .amadex-filter-group h4 {
        font-size: 16px;
        font-weight: 700;
        color: #000000;
        margin: 0;
    }

    .amadex-mobile-filter-modal .amadex-filter-options {
        max-height: none !important;
        display: flex !important;
        flex-direction: column;
        gap: 12px;
    }

    .amadex-mobile-filter-modal .amadex-filter-chip-grid {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    /* Filter Time Grid - Mobile Only (320px - 767px) */
    .amadex-mobile-filter-modal .amadex-filter-time-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px;
        display: grid !important;
    }

     .amadex-time-card {
        min-height: 90px !important;
        padding: 50px 8px 10px !important;
        display: flex !important;
    }

    .amadex-mobile-filter-modal .amadex-price-slider,
    .amadex-mobile-filter-modal .amadex-duration-slider {
        padding: 16px 0;
        position: relative;
        height: 32px;
    }

    .amadex-mobile-filter-modal .amadex-filter-option {
        display: block !important;
        min-height: 40px;
        padding: 5px 14px 5px 48px;
    }

    .amadex-mobile-filter-modal .amadex-price-range,
    .amadex-mobile-filter-modal .amadex-duration-range {
        padding: 8px 0 0;
    }

    .amadex-mobile-filter-modal .amadex-price-values,
    .amadex-mobile-filter-modal .amadex-duration-values {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        font-size: 13px;
        color: #0E7D3F;
        font-weight: 600;
        margin-top: 8px;
    }



    .amadex-mobile-filter-modal .amadex-filter-option input[type="checkbox"] {
        position: absolute;
        left: 16px;
        top: 50%;
        transform: translateY(-50%);
        display: none;
    }

    .amadex-mobile-filter-modal .amadex-switch {
        display: flex;
        align-items: center;
    }

    /* Ensure all filter elements are visible in modal */
    .amadex-mobile-filter-modal .amadex-filter-group-popular,
    .amadex-mobile-filter-modal .amadex-filter-group-price,
    .amadex-mobile-filter-modal .amadex-filter-group-duration,
    .amadex-mobile-filter-modal .amadex-filter-group-airlines {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    /* Mobile Filter Apply Button */
    .amadex-mobile-filter-apply {
        position: sticky;
        bottom: 0;
        background: #ffffff;
        /* padding: 16px 0 0; */
        border-top: 1px solid #E6E6E6;
        margin-top: 24px;
    }
     .amadex-booking-progress {
        margin-top: 10px !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* Confirmation page mobile fixes */
    body.amadex-confirmation-page,
    .amadex-confirmation-page {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }
    
    .amadex-confirmation-greeting.amadex-greeting-banner * {
        word-wrap: break-word !important;
        white-space: normal !important;
    }
    
    .amadex-greeting-title,
    .amadex-greeting-message {
        font-size: 14px !important;
        line-height: 1.5 !important;
    }
    
    .amadex-booking-id,
    .amadex-booking-status {
        font-size: 13px !important;
        padding: 0 10px !important;
    }
    .amadex-add-adult-btn{
        width: 60%;
    }
    .amadex-mobile-filter-apply-btn {
        width: 100%;
        padding: 16px;
        background: #0E7D3F;
        color: #ffffff;
        border: none;
        border-radius: 12px;
        font-size: 16px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.2s ease;
    }

    .amadex-mobile-filter-apply-btn:hover {
        background: #0a6835;
    }

    /* Results Count - Mobile */
    .amadex-results-header-mobile {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px 16px;
        background: #ffffff;
        border-bottom: 1px solid #E6E6E6;
    }

    .amadex-results-count-mobile {
        font-size: 14px;
        color: #6B7280;
    }

    .amadex-results-count-mobile strong {
        color: #000000;
        font-weight: 700;
    }
}

/* ==================== Desktop - Hide Mobile Elements ==================== */
@media (min-width: 769px) {
    .amadex-route-header,
    .amadex-booking-progress,
    .amadex-results-header-mobile,
    .amadex-mobile-filter-trigger,
    .amadex-mobile-sort-bar {
        display: none !important;
    }

    /* Desktop search summary - proper background */
    .amadex-results-page .amadex-search-summary-modern .amadex-modern-form {
        background: none!important;
        padding: 24px;
        border-radius: 24px;
        box-shadow:none!important;
        transition: all 0.3s ease;
    }

    /* Multi-city mode on desktop - expandable */
    .amadex-results-page .amadex-search-summary-modern .amadex-modern-form.amadex-multi-city-mode {
        background: #ffffff;
        min-height: auto;
        transition: all 0.4s ease;
    }

    /* Hide regular fields in multi-city mode on desktop */
    .amadex-results-page .amadex-search-summary-modern .amadex-modern-form.amadex-multi-city-mode > .amadex-search-fields {
        display: none;
    }

    /* Show multi-city elements on desktop */
    .amadex-results-page .amadex-search-summary-modern .amadex-modern-form.amadex-multi-city-mode .amadex-multi-city-flights {
        display: flex;
    }

    .amadex-results-page .amadex-search-summary-modern .amadex-modern-form.amadex-multi-city-mode .amadex-flight-segment {
        display: block;
    }

    .amadex-results-page .amadex-search-summary-modern .amadex-modern-form.amadex-multi-city-mode .amadex-add-city-btn {
        display: flex;
    }
}

/* ==================== Tablet Responsive ==================== */
@media (min-width: 769px) and (max-width: 1024px) {
    .amadex-results-content {
        grid-template-columns: 280px 1fr;
        gap: 20px;
    }

    .amadex-filters-sidebar {
        padding: 12px;
    }
}

    /* ==================== Small Mobile (320px - 480px) - Nested ==================== */
    @media only screen and (min-width: 320px) and (max-width: 480px) {
    .amadex-mobile-filter-modal {
        padding: 20px 16px;
        max-height: 95vh;
    }
    
    .amadex-call-now-banner.amadex-call-now-floating.amadex-call-now-pulse {
    border-radius: 20px !important;
    width: 96% !important;
    margin: 0 auto !important;
    bottom: 2rem !important;
    }

    .amadex-mobile-filter-title {
        font-size: 18px;
    }

    .amadex-flight-card {
        padding: 0!important;
    }

    .amadex-mobile-sort-btn {
        padding: 6px 12px;
        font-size: 13px;
    }

    .amadex-mobile-filter-trigger {
        bottom: 70px;
        left: 16px;
        right: 16px;
        padding: 12px 16px;
        font-size: 15px;
    }
    /* Sticky Call Now Banner - Mobile */
    .amadex-call-now-banner {
        padding: 12px 16px;
        border-radius: 20px !important;
        width: 100% !important;
        box-shadow: 0 0 15px rgb(14 125 63);
    }

    .amadex-call-banner-content {
        gap: 12px;
        flex-wrap: wrap;
    }

    .amadex-call-banner-left {
        gap: 10px;
        flex: 1 1 auto;
        min-width: 0;
    }

    .amadex-call-icon-circle {
        width: 40px;
        height: 40px;
        flex-shrink: 0;
    }

    .amadex-call-icon-circle svg {
        width: 20px;
        height: 20px;
    }

    .amadex-call-phone-number {
        font-size: 23px!important;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .amadex-call-banner-middle {
        order: 3;
        width: 100%;
        flex: 1 1 100%;
        justify-content: center;
    }

    .amadex-call-cta-text {
        padding: 6px 16px;
        font-size: 12px;
        width: 100%;
        max-width: 280px;
    }

    .amadex-call-banner-right {
        flex-shrink: 0;
    }

    .amadex-call-service-image {
        width: 60px;
        height: 60px;
    }

    .amadex-call-service-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
 .amadex-call-now-banner {
        padding: 10px 12px;
        border-radius: 0 !important;
    }

    .amadex-call-banner-content {
        gap: 0!important;
        flex-wrap: wrap;
        padding: 10px 20px;
        background: #0e7d3f;
        border-radius: 20px;
    }

    .amadex-call-icon-circle {
        width: 36px;
        height: 36px;
    }

    .amadex-call-icon-circle svg {
        width: 18px;
        height: 18px;
    }

    .amadex-call-phone-number {
        font-size: 20px;
    }

    .amadex-call-cta-text {
        padding: 5px 8px;
        font-size: 16px;
    }

    .amadex-call-service-image {
        width: 50px;
        height: 50px;
    }

    .amadex-call-service-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    /* Flight Details Modal - Mobile */
    div#amadex-flight-details-modal {
        padding: 16px;
    }

    .amadex-flight-details-modern {
        gap: 16px;
    }

    .amadex-flight-tabs {
        gap: 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .amadex-flight-tab-panels{
        padding: 10px 6px;
    }

    .amadex-segment-timeline-row{
        gap: 10px;
    }

    .amadex-flight-tabs::-webkit-scrollbar {
        display: none;
    }

    .amadex-flight-tab {
        flex: 0 0 auto;
        min-width: 100px;
        padding: 10px 16px;
        font-size: 13px;
        white-space: nowrap;
        background: none;
        border: none;
    }

    .amadex-connecting-banner {
        flex-direction: row;
        align-items: flex-start;
        gap: 8px;
        padding: 10px 14px;
    }

    .amadex-connecting-text,
    .amadex-connecting-time {
        font-size: 12px;
    }

    .amadex-segment-detailed {
        padding: 0;
    }

    .amadex-segment-airline-header {
        flex-direction: row;
        align-items: flex-start;
        gap: 12px;
    }

    button.amadex-flight-continue-btn.amadex-book-now-btn {
        background: #0e7d3f!important;
        color: #fff!important;
        border-radius: 15px !important;
    width: 30%;
    }

    .amadex-segment-departure-section,
    .amadex-segment-arrival-section {
        margin-bottom: 16px;
    }

    .amadex-segment-time-main {
        font-size: 18px;
    }

    .amadex-baggage-info-section {
        padding: 12px;
        gap: 10px;
    }

    .amadex-amenities-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .amadex-amenity-item {
        padding: 10px 12px;
    }

    .amadex-fare-rules-buttons {
        flex-direction: row;
        gap: 8px;
        flex-wrap: nowrap;
    }

    .amadex-fare-rule-btn {
        width: 100%;
        text-align: center;
        padding: 6px 6px;
        font-size: 11px;
    }

    .amadex-flight-footer-bar {
        flex-direction: row;
        gap: 16px;
        padding: 16px;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        border-radius: 0;
    }

    .amadex-price-row{
        justify-content: flex-start;
    }

    .amadex-flight-price-wrap {
        width: 100%;
    }

    .amadex-flight-continue-btn {
        width: 100%;
        padding: 16px;
    }

    .amadex-flight-tab-panels {
        padding-bottom: 10px; /* Space for fixed footer */
    }

}

/* .amadex-modern-form.amadex-multi-city-mode .amadex-search-fields {
    grid-template-columns: 2fr 2fr 1.5fr 2fr !important;
} */
/* ==================== Multi-City Search - Mobile (Matching Adobe XD) ==================== */
    /* Hide multi-city container by default (show only when multi-city is selected) */
    /* .amadex-modern-form:not(.amadex-multi-city-mode) .amadex-multi-city-flights {
        display: none !important;
    } */

    /* Show multi-city elements ONLY when multi-city mode is active */
    .amadex-multi-city-mode .amadex-multi-city-flights {
        display: flex !important;
        flex-direction: column;
        gap: 16px;
        margin-bottom: 20px;
    }

    .amadex-multi-city-mode .amadex-flight-segment {
        display: block !important;
        background: none !important;
        border-radius: 16px !important;
        padding: 0 !important;
        position: relative;
        margin-bottom: 0 !important;
        border: none !important;
    }

    .amadex-multi-city-mode .amadex-add-city-btn,
    .amadex-multi-city-mode .amadex-add-segment-btn,
    .amadex-multi-city-mode button.amadex-add-city-btn,
    .amadex-multi-city-mode button.amadex-add-segment-btn {
        display: flex !important;
        width: 100% !important;
        max-width: 100% !important;
        margin-top: 16px !important;
        margin-bottom: 0 !important;
        padding: 14px 20px !important;
        background: #0E7D3F !important;
        color: #ffffff !important;
        border: none !important;
        border-radius: 16px !important;
        font-size: 16px !important;
        font-weight: 600 !important;
        cursor: pointer !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 10px !important;
        box-shadow: 0 2px 8px rgba(14, 125, 63, 0.25) !important;
        transition: all 0.3s ease;
        opacity: 2;
    }

    /* Multi-city mode wrapper */
    .amadex-multi-city-mode {
        width: 100%;
    }

    /* Multi-city container - only visible in multi-city mode */
    .amadex-multi-city-mode .amadex-multi-city-flights {
        display: flex;
        flex-direction: column;
        gap: 16px;
        margin-bottom: 20px;
    }

    /* Flight Segment - Gray Rounded Box - only in multi-city mode */
    .amadex-multi-city-mode .amadex-flight-segment {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        /* background: #F5F5F5 !important;
        border-radius: 16px !important;
        padding: 16px !important;
        position: relative;
        margin-bottom: 0 !important;
        border: none !important; */
    }

    /* Hide regular search fields when in multi-city mode */
    .amadex-multi-city-mode > .amadex-search-fields:not(.amadex-flight-segment .amadex-search-fields) {
        display: none !important;
    }

    /* Show regular search fields in Round Trip and One Way modes - GRID LAYOUT */
    .amadex-modern-form:not(.amadex-multi-city-mode) .amadex-search-fields {
        display: flex !important;
        gap: 10px !important;
    }
    
    /* Ensure fields are visible in round trip and one way */
    .amadex-modern-form:not(.amadex-multi-city-mode) .amadex-modern-field {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    /* Segment Header with Title and X Button */
    .amadex-segment-header {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        margin-bottom: 12px !important;
        padding-bottom: 10px !important;
        border-bottom: 1px solid #E0E0E0 !important;
    }

    .amadex-segment-title {
        font-size: 14px !important;
        font-weight: 600 !important;
        color: #0E7D3F !important;
        margin: 0 !important;
    }

    /* Remove Button (X icon in circle) */
    .amadex-segment-remove-btn,
    .amadex-remove-segment-btn {
        width: 28px !important;
        height: 28px !important;
        border-radius: 50% !important;
        background: #ffffff !important;
        border: 1px solid #E0E0E0 !important;
        color: #666666 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        cursor: pointer !important;
        font-size: 16px !important;
        padding: 0 !important;
        line-height: 1 !important;
        transition: all 0.2s ease;
    }

    .amadex-segment-remove-btn:hover,
    .amadex-remove-segment-btn:hover {
        background: #FEE2E2 !important;
        border-color: #DC2626 !important;
        color: #DC2626 !important;
    }

    /* Add City Button - Green Solid (only visible in multi-city mode) */
    .amadex-multi-city-mode .amadex-add-city-btn:hover,
    .amadex-multi-city-mode .amadex-add-segment-btn:hover,
    .amadex-multi-city-mode button.amadex-add-city-btn:hover,
    .amadex-multi-city-mode button.amadex-add-segment-btn:hover {
        background: #0a6835 !important;
        box-shadow: 0 4px 12px rgba(14, 125, 63, 0.35) !important;
        transform: translateY(-1px);
    }

    /* Add City button expands the form height smoothly */
    .amadex-multi-city-mode .amadex-add-city-btn:active {
        transform: scale(0.98);
    }

    /* Ensure proper spacing when segments are added */
    .amadex-multi-city-mode .amadex-multi-city-flights .amadex-flight-segment:last-child {
        margin-bottom: 16px;
    }

    .amadex-add-city-icon,
    .amadex-add-segment-icon {
        width: 20px !important;
        height: 20px !important;
        border-radius: 50% !important;
        /* border: 2px solid #ffffff !important; */
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-size: 16px !important;
        color: #ffffff !important;
        line-height: 1 !important;
    }

    /* Multi-city fields within segment - only in multi-city mode */
    .amadex-multi-city-mode .amadex-flight-segment .amadex-search-fields {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
        border: none !important;
        background: transparent !important;
        padding: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        min-height: auto !important;
    }

    .amadex-multi-city-mode .amadex-flight-segment .amadex-modern-field {
        padding: 8px 20px !important;
        padding: 8px 20px !important;
    border: 1px solid #E5E5E5 !important;
    border-radius: 12px !important;
    background: #FFFFFF !important;
    }

    .amadex-multi-city-mode .amadex-flight-segment .amadex-modern-field:hover {
        background: transparent !important;
    }

    .amadex-multi-city-mode .amadex-flight-segment .amadex-modern-field.field-active {
        background: transparent !important;
        border: none !important;
    }

    /* Labels inside segments - only in multi-city mode */
    .amadex-multi-city-mode .amadex-flight-segment .amadex-field-label {
        font-size: 12px !important;
        font-weight: 500 !important;
        color: #0E7D3F !important;
        margin-bottom: 6px !important;
    }

    .amadex-multi-city-mode .amadex-flight-segment .amadex-field-value {
        font-size: 16px !important;
        font-weight: 500 !important;
        color: #000000 !important;
    }

    .amadex-multi-city-mode .amadex-flight-segment .amadex-field-description {
        font-size: 13px !important;
        color: #6B7280 !important;
    }

    /* Swap button inside multi-city segments - only in multi-city mode */
    .amadex-multi-city-mode .amadex-flight-segment .amadex-swap-button {
        display: flex !important;
        position: absolute !important;
        right: 16px !important;
        top: 50% !important;
        transform: translateY(-50%) rotate(0deg) !important;
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
        border-radius: 50% !important;
        background: #0E7D3F !important;
        transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1), 
                    background-color 0.3s ease !important;
        will-change: transform;
    }

    /* Anticlockwise rotation for multi-city swap button */
    .amadex-multi-city-mode .amadex-flight-segment .amadex-swap-button.rotating {
        transform: translateY(-50%) rotate(-180deg) !important;
        background: #0a6835 !important;
    }

    /* Travellers field - shared at bottom (outside segments) */
    .amadex-multi-city-mode .amadex-travellers-field {
        margin-top: 20px !important;
        padding: 16px 0 !important;
        background: transparent !important;
        border: none !important;
    }

    /* Search button at very bottom */
    .amadex-multi-city-mode .amadex-search-btn {
        margin-top: 24px !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Hide regular swap button in multi-city mode */
    .amadex-multi-city-mode > .amadex-swap-button {
        display: none !important;
    }

    /* Ensure proper spacing between segments */
    .amadex-flight-segment + .amadex-flight-segment {
        margin-top: 0 !important;
    }

    /* Date field styling in segments - only in multi-city mode */
    .amadex-multi-city-mode .amadex-flight-segment .amadex-date-field {
        position: relative;
    }

    .amadex-multi-city-mode .amadex-flight-segment .amadex-date-field .amadex-field-value {
        width: 100% !important;
    }

    /* Multi-city specific field adjustments - only in multi-city mode */
    .amadex-multi-city-mode .amadex-flight-segment .amadex-location-field {
        position: relative;
    }

    /* Remove any borders between fields in segments - only in multi-city mode */
    /* .amadex-multi-city-mode .amadex-flight-segment .amadex-modern-field:not(:last-child) {
        border-bottom: none !important;
    }
     */
    /* Ensure all fields are visible in Round Trip and One Way */
    .amadex-modern-form:not(.amadex-multi-city-mode) .amadex-modern-field {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        flex-direction: column !important;
        border: 1px solid #E5E5E5 !important;
        /* border-radius: 12px !important; */
        background: #FFFFFF !important;
    }
    
    /* Make travellers field span full width (both columns) */
    .amadex-modern-form:not(.amadex-multi-city-mode) .amadex-travellers-field,
    .amadex-modern-form:not(.amadex-multi-city-mode) #travellers-field {
        grid-column: 1 !important;
    }

    /* Hide ONLY multi-city specific elements when not in multi-city mode */
    /* .amadex-modern-form:not(.amadex-multi-city-mode) .amadex-multi-city-flights{
        display: none !important;
    } */

/* ==================== Touch Interactions & Accessibility ==================== */
    /* Increase touch target sizes for better mobile UX */
    .amadex-modern-field {
        min-height: 44px;
        -webkit-tap-highlight-color: rgba(14, 125, 63, 0.1);
    }

    div#travellers-field {
        border-right: 1px solid #E6E6E6 !important;
    }
    .amadex-trip-label {
        min-height: 44px;
        display: inline-flex !important;
        align-items: center;
        -webkit-tap-highlight-color: transparent;
    }

    .amadex-swap-button {
        min-height: 44px;
        -webkit-tap-highlight-color: transparent;
    }

    .amadex-search-btn {
        min-height: 50px;
        -webkit-tap-highlight-color: transparent;
    }

    /* Prevent text selection on interactive elements */
    .amadex-trip-label,
    .amadex-swap-button,
    .amadex-search-btn {
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
    }

    /* Smooth scrolling for dropdowns */
    .amadex-autocomplete-list,
    .amadex-travellers-dropdown {
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }

    /* Focus states for better accessibility */
    .amadex-modern-field:focus-within {
        outline: 2px solid #0E7D3F;
        outline-offset: 2px;
        border-radius: 8px;
    }

    /* Loading state */
    .amadex-modern-form.searching {
        pointer-events: none;
        opacity: 0.7;
    }

    .amadex-modern-form.searching .amadex-search-btn,
    .amadex-search-btn.loading {
        position: static !important;
        transform: none !important;
    }
/* 
    .amadex-modern-form.searching .amadex-search-btn::after {
        content: '';
        position: absolute;
        width: 20px;
        height: 20px;
        border: 3px solid rgba(255, 255, 255, 0.3);
        border-top-color: #ffffff;
        border-radius: 50%;
        animation: spin 0.8s linear infinite;
    } */

    @keyframes spin {
        to { transform: rotate(360deg); }
    }
    
    /* Hide loading spinner in search field suggestions on mobile */
    .amadex-suggestions-empty .spinner,
    .amadex-suggestions-scroll .spinner,
    .amadex-autocomplete-list .spinner,
    .amadex-dropdown .spinner {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        width: 0 !important;
        height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        animation: none !important;
    }
    
    /* Hide loading text when spinner is present on mobile */
    .amadex-suggestions-empty:has(.spinner) {
        display: none !important;
    }
    
    /* Alternative: Hide the entire empty state with spinner on mobile */
    .amadex-suggestions-empty {
        padding: 20px 18px !important;
    }
    
    .amadex-suggestions-empty .spinner + * {
        display: none !important;
    }


div#travellers-field {
    border-right: none !important;
}

    /* Mobile CSS */
    .amadex-field-input-wrap {
    padding-right: 0 !important;
}


button#swap-locations {
    display: none !important;
}

    /* Ensure input fields are properly styled */
    .amadex-field-input-wrap input {
        width: 100%;
        background: transparent;
        border: none;
        padding: 0;
        font-size: inherit;
        color: inherit;
        font-weight: inherit;
    }

    .amadex-field-input-wrap input:focus {
        outline: none;
    }

    /* Hide desktop-only elements */
    .amadex-support-illustration {
        display: none;
    }

    /* Modern field mobile styles */
  .amadex-modern-field {
        overflow: visible !important;
    }

    /* Autocomplete Dropdown - Mobile */
    .amadex-autocomplete-list {
        position: fixed !important;
        left: 16px !important;
        right: 16px !important;
        width: auto !important;
        max-width: none !important;
        border-radius: 16px !important;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15) !important;
        max-height: 60vh !important;
        z-index: 9999 !important;
    }

    .amadex-autocomplete-item {
        padding: 14px 16px !important;
        font-size: 15px !important;
    }

    .amadex-autocomplete-item:hover,
    .amadex-autocomplete-item.active {
        background: #F0FFF7 !important;
    }

    /* Date Picker - Mobile */
    .flatpickr-calendar {
        position: fixed !important;
        left: 50% !important;
        top: 50% !important;
        transform: translate(-50%, -50%) !important;
        width: calc(100vw - 32px) !important;
        max-width: 400px !important;
        border-radius: 20px !important;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2) !important;
        z-index: 9999 !important;
    }

    .flatpickr-calendar.open {
        z-index: 9999 !important;
    }

    .flatpickr-months {
        border-radius: 20px 20px 0 0 !important;
        padding: 16px !important;
    }

    .flatpickr-day {
        height: 40px !important;
        line-height: 40px !important;
        font-size: 15px !important;
    }

    .flatpickr-day.selected {
        background: #0E7D3F !important;
        border-color: #0E7D3F !important;
    }

   
    .amadex-search-bar-wrapper.amadex-search-bar-active {
        overflow: visible !important;
        padding-bottom: 0 !important;
        margin-bottom: 0 !important;
    }

 

    .amadex-traveller-controls button {
        width: 36px !important;
        height: 36px !important;
        font-size: 18px !important;
    }

    .amadex-traveller-count {
        font-size: 18px !important;
        min-width: 40px !important;
    }

    /* Cabin Class Selector - Mobile */
    .amadex-cabin-selector {
        margin-top: 16px !important;
    }

    .amadex-cabin-option {
        padding: 12px 16px !important;
        font-size: 15px !important;
        border-radius: 12px !important;
    }

    .amadex-cabin-option.selected {
        background: #0E7D3F !important;
        color: #ffffff !important;
    }

    /* Modal Overlay for Dropdowns */
    .amadex-dropdown-overlay {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        background: rgba(0, 0, 0, 0.5) !important;
        z-index: 9998 !important;
    }

    /* ==================== Modern Search Bar Mobile (Matching Adobe XD Design) ==================== */
    /* Search Bar Container */
    .amadex-search-modern {
        padding: 0 16px;
        margin-top: 10px;
    }

    /* Modern Form Card - Clean white card with shadow */
    .amadex-modern-form {
        background: #ffffff;
        border-radius: 20px;
        padding: 20px 16px;
        box-shadow: 0px 2px 12px rgba(0, 0, 0, 0.08);
        margin: 0;
    }

    .amadex-modern-form:hover {
        transform: none;
        box-shadow: 0px 2px 12px rgba(0, 0, 0, 0.08);
    }
    
    /* Override any desktop grid on mobile - use 2-column grid */
    .amadex-search-modern .amadex-search-fields,
    .amadex-modern-form .amadex-search-fields {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 12px !important;
        border: none !important;
        background: transparent !important;
        width: 100% !important;
        max-width: 100% !important;
        min-height: auto !important;
    }
    
    /* Force all fields to be visible and vertical on mobile */
    .amadex-modern-field,
    #origin-field,
    #destination-field,
    #departure-field,
    #return-field,
    #travellers-field {
        display: flex !important;
        flex-direction: column !important;
        visibility: visible !important;
        opacity: 1 !important;
        padding: 16px 0 !important;
        border: none !important;
        border-right: none !important;
        min-height: auto !important;
        background: transparent !important;
    }

    /* Trip Type Selector - Pills matching XD design */
    .amadex-trip-selector {
        display: flex;
        gap: 0;
        margin-bottom: 10px;
        background: transparent;
        border-radius: 0;
        padding: 0;
        box-shadow: none;
        width: 100%;
        max-width: 100%;
        justify-content: flex-start;
    }

    .amadex-trip-option {
        flex: 0 0 auto!important;
    }

    .amadex-trip-label {
        padding: 10px 20px !important;
        border-radius: 20px !important;
        font-size: 14px !important;
        font-weight: 500;
        color: #000000 !important;
        background: transparent !important;
        border: none !important;
        white-space: nowrap;
    }

    .amadex-trip-option input[type="radio"]:checked + .amadex-trip-label {
        color: #ffffff !important;
        font-weight: 600;
        background: #0E7D3F !important;
        box-shadow: 0 2px 8px rgba(14, 125, 63, 0.3);
        transform: scale(1);
    }

    /* Search Fields Container - 2-column grid on mobile */
    /* .amadex-search-modern .amadex-search-fields {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 12px !important;
        border: none !important;
        border-radius: 0 !important;
        background: transparent !important;
        width: 100% !important;
        max-width: 100% !important;
        min-height: auto !important;
        padding: 0 !important;
    } */

    /* Individual Field Styling - Mobile Vertical Stack */
    .amadex-modern-field {
        display: flex !important;
        flex-direction: column !important;
        padding: 16px 0 !important;
        border: none !important;
        border-right: none !important;
        border-radius: 0 !important;
        min-height: auto !important;
        background: transparent !important;
        margin: 0 !important;
    }

    .amadex-modern-field:not(:last-child):not(.amadex-swap-button) {
        border-right: none !important;
    }

    .amadex-modern-field:hover {
        background: transparent !important;
        border-radius: 0 !important;
    }

    .amadex-modern-field.field-active {
        background: transparent !important;
        border: none !important;
        border-radius: 0 !important;
        margin: 0 !important;
        padding: 16px 0 !important;
    }

    /* Field Label - Green color matching XD */
    .amadex-field-label {
        font-size: 12px !important;
        font-weight: 500;
        color: #0E7D3F !important;
        margin-bottom: 6px !important;
        text-transform: capitalize;
    }

    /* Field Value - Bold black text */
    .amadex-field-value {
        font-size: 16px !important;
        font-weight: 600;
        color: #000000 !important;
        line-height: 1.4;
    }

    /* Field Description - Light gray */
    .amadex-field-description {
        font-size: 13px !important;
        color: #6B7280 !important;
        margin-top: 2px;
    }

    /* Origin and Destination Fields */
    .amadex-location-field {
        position: relative;
    }

    .amadex-field-input-wrap {
        display: flex;
        flex-direction: row;
        gap: 2px;
        padding-right: 0 !important;
    }

    #origin-field .amadex-field-input-wrap,
    #destination-field .amadex-field-input-wrap {
        padding-right: 0 !important;
    }

    /* Swap Button - Circular green icon between fields */
    .amadex-swap-button {
        display: flex !important;
        position: absolute;
        right: 0;
        top: 50%;
        transform: translateY(-50%) rotate(0deg);
        width: 40px !important;
        height: 40px !important;
        min-width: 40px !important;
        border-radius: 50% !important;
        background: #0E7D3F !important;
        border: 3px solid #ffffff !important;
        box-shadow: 0 2px 8px rgba(14, 125, 63, 0.3) !important;
        z-index: 10;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        margin: 0 !important;
        padding: 0 !important;
        transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1), 
                    background-color 0.3s ease !important;
        will-change: transform;
        -webkit-tap-highlight-color: rgba(14, 125, 63, 0.2);
    }

    .amadex-swap-button:active {
        transform: translateY(-50%) rotate(0deg) scale(0.9);
    }

    /* Anticlockwise rotation animation for mobile */
    .amadex-swap-button.rotating {
        transform: translateY(-50%) rotate(-180deg);
        background: #0a6835 !important;
        box-shadow: 0 4px 12px rgba(14, 125, 63, 0.4) !important;
    }

    /* Keyframe for mobile button rotation */
    @keyframes rotateAnticlockwiseMobile {
        from {
            transform: translateY(-50%) rotate(0deg);
        }
        to {
            transform: translateY(-50%) rotate(-180deg);
        }
    }

    /* Animation class for mobile button */
    .amadex-swap-button.animating {
        animation: rotateAnticlockwiseMobile 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .amadex-swap-button svg,
    .amadex-swap-button i {
        color: #ffffff !important;
        font-size: 18px !important;
        width: 18px;
        height: 18px;
        transition: filter 0.3s ease;
        pointer-events: none;
    }

    .amadex-swap-button:active svg,
    .amadex-swap-button:active i {
        filter: brightness(1.1);
    }

    .amadex-swap-button.rotating svg,
    .amadex-swap-button.rotating i {
        filter: brightness(1.15);
    }

    /* Date Fields */
    .amadex-date-field .amadex-field-value {
        width: 100% !important;
    }

    /* Travellers Field - With chevron icon */
    .amadex-travellers-field {
        position: relative;
    }

    .amadex-travellers-field::after {
        display: none !important;
        content: '' !important;
    }

    .amadex-travellers-trigger::after {
        display: none !important;
        content: none !important;
        visibility: hidden !important;
    }

    .amadex-search-btn .amadex-search-icon {
        width: 20px;
        height: 20px;
        color: #ffffff;
    }

    /* Hide unnecessary elements on mobile */
    body.home .amadex-mobile-sort-bar {
        display: none !important;
    }

    /* Multi-city adjustments */
    .amadex-multi-city-flights .amadex-search-fields {
        gap: 0;
    }

    /* Disabled field state */
    .amadex-modern-field.field-disabled {
        opacity: 0.4;
    }

    .amadex-modern-field.field-disabled .amadex-field-label,
    .amadex-modern-field.field-disabled .amadex-field-value,
    .amadex-modern-field.field-disabled .amadex-field-description {
        color: #9CA3AF !important;
    }

    /* ==================== iPhone Specific (all sizes) - Nested ==================== */
    @media only screen and (min-width: 320px) and (max-width: 430px) {
#origin-field .amadex-field-input-wrap {
    padding-right: 0 !important;
}

    body.home .amadex-mobile-sort-bar {
        display: none !important;
    }

    /* Ensure swap button is visible on small screens */
.amadex-swap-button {
        display: flex !important;
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
  }

  label.amadex-trip-label {
    border: none;
        padding: 8px 5px !important;
        font-size: 12px !important;
    }

    /* Adjust field labels and values for smaller screens */
    .amadex-field-label {
        font-size: 11px !important;
    }

    .amadex-field-value {
        font-size: 14px !important;
    }

    /* Compact padding for small screens */
    .amadex-modern-form {
        padding: 16px 12px;
    }

    .amadex-modern-field {
        padding: 14px 0 !important;
    }
}

    /* ==================== Android & Larger Phones (430px - 767px) - Nested ==================== */
    @media only screen and (min-width: 431px) and (max-width: 767px) {
    .amadex-search-modern {
        padding: 0 20px;
    }

    .amadex-modern-form {
        padding: 24px 20px;
    }

    .amadex-trip-label {
        padding: 12px 24px !important;
        font-size: 15px !important;
    }

    .amadex-field-label {
        font-size: 13px !important;
    }

    .amadex-field-value {
        font-size: 17px !important;
    }

    .amadex-search-btn {
        height: 56px !important;
        font-size: 17px !important;
    }

    .amadex-swap-button {
        width: 42px !important;
        height: 42px !important;
        min-width: 42px !important;
    }
}

    /* ==================== Landscape Mode - Mobile Devices - Nested ==================== */
    @media only screen and (min-width: 320px) and (max-width: 767px) and (orientation: landscape) {
    .amadex-modern-form {
        padding: 16px 12px;
    }

    .amadex-trip-selector {
        margin-bottom: 12px;
    }

    .amadex-modern-field {
        padding: 10px 0 !important;
    }

    .amadex-search-btn {
        height: 44px !important;
        margin-top: 16px !important;
    }

    /* Make autocomplete and dropdowns take less space in landscape */
    .amadex-autocomplete-list {
        max-height: 40vh !important;
    }

    .amadex-travellers-dropdown {
        max-height: 50vh !important;
        overflow-y: auto !important;
    }
}

/* ==================== Home Page Specific Mobile Styling ==================== */
    body.home .amadex-search-modern {
        padding: 0 16px;
        margin-top: 20px;
    }

    body.home .amadex-modern-form {
        margin-bottom: 30px;
    }

    /* Ensure proper spacing on home page */
    body.home .amadex-trip-selector {
        margin-bottom: 20px;
    }

    /* Hide mobile sort bar on home page */
    body.home .amadex-mobile-sort-bar,
    body.home .amadex-mobile-filter-trigger {
        display: none !important;
    }
    
    /* Global mobile styles */
    /* .amadex-field-description {
        display: none!important;
    } */

    .amadex-search-fields {
        background: #FFFFFF 0% 0% no-repeat padding-box;
        box-shadow: 0px 0px 6px #00000029;
        border: 1px solid #E6E6E6;
        border-radius: 15px;
    }
    
    /* Smooth scrolling and performance optimizations */
    * {
        -webkit-tap-highlight-color: rgba(14, 125, 63, 0.1);
        -webkit-touch-callout: none;
    }
    
    /* Prevent text selection on interactive elements for better UX */
    .amadex-mobile-sort-btn,
    .amadex-trip-label,
    .amadex-swap-button,
    .amadex-search-btn,
    .amadex-modern-field {
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
    }
    
    /* Smooth transitions for all interactive elements */
    .amadex-modern-field,
    .amadex-trip-label,
    .amadex-swap-button,
    .amadex-search-btn,
    .amadex-mobile-sort-btn {
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    /* Ensure proper touch targets (minimum 44x44px for accessibility) */
    .amadex-modern-field,
    .amadex-trip-label,
    .amadex-swap-button,
    .amadex-search-btn,
    .amadex-mobile-sort-btn,
    .amadex-mobile-filter-icon {
        min-height: 38px;
        min-width: 44px;
    }
    
    /* Better focus states for accessibility */
    .amadex-modern-field:focus-within,
    .amadex-trip-label:focus,
    .amadex-swap-button:focus,
    .amadex-search-btn:focus {
        outline: 2px solid #0E7D3F;
        outline-offset: 2px;
    }
    
    /* Prevent horizontal scroll */
    body {
        overflow-x: hidden;
        width: 100%;
        max-width: 100vw;
    }
    
    /* Smooth animations */
    @keyframes fadeIn {
        from { opacity: 0; }
        to { opacity: 1; }
    }
    
    @keyframes slideUp {
        from { transform: translateY(20px); opacity: 0; }
        to { transform: translateY(0); opacity: 1; }
    }
    
    /* Apply smooth animations to modals and dropdowns */
    .amadex-mobile-filter-modal,
    .amadex-travellers-dropdown,
    .amadex-autocomplete-list {
        animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
}

/* ==================== End Universal Mobile Media Query (320px - 767px) ==================== */

/* ==================== Tablet Portrait (768px - 1024px) ==================== */
@media only screen and (min-width: 769px) and (max-width: 1024px) and (orientation: portrait) {

        .amadex-modern-form {
        background: rgb(255, 255, 255);
        border-radius: 20px;
        padding: 20px 16px;
        box-shadow: rgba(0, 0, 0, 0.08) 0px 2px 12px;
        margin: 0px;
    }

    .amadex-travellers-trigger {
    flex-direction: row;
    align-items: center;
}

    /* ADVANCED: Override with 3-column grid to match desired layout */
    .amadex-modern-form:not(.amadex-multi-city-mode) .amadex-search-fields {
        display: grid !important;  /* Changed from flex to grid */
        grid-template-columns: 1fr 1fr 0.85fr !important; /* 3 columns */
        grid-template-rows: auto auto auto !important;   /* 3 rows */
        gap: 16px !important;  /* Increased from 10px for better spacing */
        border: none !important;
        background: transparent !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    /* ADVANCED: Field positioning for 3-column grid */
    #origin-field {
        grid-column: 1 !important;
        grid-row: 1 !important;
        padding-right: 60px !important;
    }

    #destination-field {
        grid-column: 2 !important;
        grid-row: 1 !important;
        padding-left: 60px !important;
    }

    #departure-field {
        grid-column: 1 !important;
        grid-row: 2 !important;
    }

    #return-field {
        grid-column: 2 !important;
        grid-row: 2 !important;
    }

    #travellers-field {
        grid-column: 3 !important;  /* Column 3, Row 2 */
        grid-row: 2 !important;
    }

    button.amadex-search-btn {
        grid-column: 1 / -1 !important; /* Full width */
        grid-row: 3 !important;
    }

    button.amadex-swap-button {
        grid-column: 1 / 3 !important;
        grid-row: 1 !important;
        justify-self: center !important;
        align-self: center !important;
        position: relative !important;
    }

    .amadex-search-modern {
        padding: 0 30px;
    }

    .amadex-modern-form {
        padding: 30px 24px;
    }

    /* Keep trip selector horizontal on tablets */
    .amadex-trip-selector {
        flex-direction: row;
        gap: 8px;
    }

    /* Show fields in 2 columns on tablets */
    .amadex-search-modern .amadex-search-fields {
        /* display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 16px !important;
        border: 1px solid #E8E8E8;
        border-radius: 16px;
        padding: 16px;
        background: #ffffff; */
    }

    .amadex-modern-field {
        border-right: none !important;
        padding: 16px !important;
    }

    .amadex-swap-button {
        position: relative !important;
        transform: none !important;
        margin: 16px auto !important;
        grid-column: span 2;
    }

    .amadex-search-btn {
        grid-column: span 2;
        margin-top: 16px !important;
    }
}

    /* ==================== Specific Device Fixes - Nested ==================== */

/* iPhone SE, iPhone 8 and smaller */
    @media only screen and (min-width: 320px) and (max-width: 375px) {
    .amadex-search-modern {
        padding: 0 12px;
    }

    .amadex-modern-form {
        padding: 16px 12px;
        border-radius: 16px;
    }

    .amadex-trip-label {
        padding: 8px 14px !important;
        font-size: 12px !important;
    }

    .amadex-field-label {
        font-size: 10px !important;
    }

    .amadex-field-value {
        font-size: 13px !important;
    }

    .amadex-field-description {
        font-size: 11px !important;
    }

    .amadex-search-btn {
        height: 48px !important;
        font-size: 14px !important;
    }

    .amadex-swap-button {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
    }

    .amadex-swap-button svg,
    .amadex-swap-button i {
        font-size: 14px !important;
    }
}

    /* iPhone 12 Pro, iPhone 13, iPhone 14 - Nested */
@media only screen and (min-width: 390px) and (max-width: 430px) {
    .amadex-search-modern {
        padding: 0 16px;
    }

    .amadex-modern-form {
        padding: 20px 16px;
    }
}

    /* Large Android Phones (Samsung Galaxy, Pixel, etc.) - Nested */
@media only screen and (min-width: 411px) and (max-width: 430px) {
    .amadex-field-value {
        font-size: 15px !important;
    }

    .amadex-search-btn {
        height: 52px !important;
    }
}