/**
 * Moovflex Search Bar — Homepage search form styling
 * Brand: Purple #6D3E8D, Orange #EC6523, Poppins font, 5px radius
 * Handles: .mvfx-search container, fields, filters panel, mobile fullscreen
 * Does NOT handle: daterangepicker (see search-override.css)
 */

/* === Backward Compatibility === */
.forMenuButtonSearch-filters-moovflex { display: block; }
@media (min-width: 992px) { .forMenuButtonSearch-filters-moovflex { display: grid; } }

.mvfx-search .book-search-left-items { list-style: none; padding-left: 0; }

/* Hidden checkbox lists used for form serialization */
.mvfx-search .book-search-left-items input[type="checkbox"] {
    position: absolute;
    left: -9999px;
}

/* === Font === */
.mvfx-search {
    font-family: 'Poppins', sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 9px;
    box-sizing: border-box;
}

/* === Container === */
.mvfx-search-form {
    background: #fff;
    border-radius: 5px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    padding: 20px;
}

/* === Main Bar (Desktop) === */
.mvfx-search-main {
    display: flex;
    align-items: stretch;
    gap: 12px;
}

.mvfx-search-field {
    position: relative;
}

.mvfx-search-field .f-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #6D3E8D;
    font-size: 16px;
    z-index: 1;
    cursor: pointer;
}

/* === Date Field === */
.mvfx-search-date {
    flex: 1;
    min-width: 0;
}

.mvfx-search-date .input-text {
    width: 100%;
    height: 48px;
    padding: 0 14px 0 40px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    color: #333;
    background: #fff;
    cursor: pointer;
    box-sizing: border-box;
    transition: border-color 0.2s ease;
}

.mvfx-search-date .input-text:focus {
    border-color: #6D3E8D;
    outline: none;
    box-shadow: 0 0 0 2px rgba(109, 62, 141, 0.1);
}

.mvfx-search-date .input-text::placeholder {
    color: #999;
}

/* === Location Select === */
.mvfx-search-location {
    flex: 1;
    min-width: 0;
}

/* === Category Select === */
.mvfx-search-category {
    flex: 1;
    min-width: 0;
}

/* Main bar selects have icon → left padding */
.mvfx-search-field .mvfx-select {
    padding-left: 40px;
}

/* Filter panel selects have no icon → normal padding */
.mvfx-filter-group .mvfx-select {
    padding-left: 14px;
}

.mvfx-select {
    width: 100%;
    height: 48px;
    padding: 0 36px 0 14px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    color: #333;
    background: #fff;
    cursor: pointer;
    box-sizing: border-box;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23666' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    transition: border-color 0.2s ease;
}

.mvfx-select:focus {
    border-color: #6D3E8D;
    outline: none;
    box-shadow: 0 0 0 2px rgba(109, 62, 141, 0.1);
}

/* === Actions (Filters + Search) === */
.mvfx-search-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* Filters toggle link */
.mvfx-btn-more {
    display: inline-flex;
    align-items: center;
    height: 48px;
    padding: 0 16px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: #fff;
    color: #6D3E8D;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
    transition: all 0.2s ease;
}

.mvfx-btn-more:hover {
    border-color: #6D3E8D;
    background: rgba(109, 62, 141, 0.05);
    color: #EC6523;
}

.mvfx-btn-more.advice-search-active {
    border-color: #EC6523;
    color: #EC6523;
    background: rgba(236, 101, 35, 0.05);
}

.mvfx-btn-more .fa-sliders-h {
    margin-left: 6px;
}

/* Search button */
.mvfx-btn-search {
    height: 48px;
    padding: 0 24px;
    border: none;
    border-radius: 5px;
    background: #6D3E8D;
    color: #fff;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s ease;
}

.mvfx-btn-search:hover {
    background: #EC6523;
}

.mvfx-btn-search .fa-search {
    margin-right: 6px;
}

/* === Filters Panel === */
.mvfx-filters-panel {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #eee;
    display: none;
    flex-wrap: wrap;
    gap: 20px;
}

.mvfx-filters-panel.mvfx-filters-open {
    display: flex;
}

.mvfx-filter-group {
    flex: 1;
    min-width: 200px;
}

.mvfx-filter-label {
    display: block;
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.mvfx-filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Clear search row (outside filters panel) */
.mvfx-clear-row {
    margin-top: 12px;
    text-align: right;
}

/* Clear search link */
.mvfx-clear-link {
    color: #6D3E8D;
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s ease;
}

.mvfx-clear-link:hover {
    color: #EC6523;
}

/* === Price / Duration Sliders === */
.mvfx-price-display,
.mvfx-duration-display {
    display: block;
    text-align: center;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    font-size: 14px;
}

/* jQuery UI Slider Overrides — override .ui-widget-header blue */
.mvfx-search .ui-slider.ui-widget {
    height: 4px;
    background: #e0e0e0;
    border: none;
    border-radius: 2px;
}

.mvfx-search .ui-slider .ui-slider-range.ui-widget-header {
    background: #EC6523;
    border: none;
}

.mvfx-search .ui-slider .ui-slider-handle.ui-state-default {
    width: 16px;
    height: 16px;
    top: -6px;
    border-radius: 50%;
    background: #EC6523;
    border: 2px solid #EC6523;
    cursor: pointer;
}

.mvfx-search .ui-slider .ui-slider-handle.ui-state-default:hover {
    background: #6D3E8D;
    border-color: #6D3E8D;
}

/* === Language Flags === */
.mvfx-lang-flags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.language-flag {
    width: 36px;
    height: 28px;
    border: 2px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.language-flag:hover {
    border-color: #6D3E8D;
    transform: scale(1.1);
}

.moovflex-professional-language-li-label-active .language-flag {
    border: 3px solid #6D3E8D;
    box-shadow: 0 0 0 3px rgba(109, 62, 141, 0.25);
    transform: scale(1.1);
}

/* === Mobile === */
@media (max-width: 767px) {
    /* Hide the inline form on mobile */
    .mvfx-search .mvfx-search-form {
        display: none;
    }

    .mvfx-search-form {
        padding: 15px;
        box-shadow: none;
    }

    /* Mobile trigger button — high specificity to override Porto */
    .mvfx-search button.mvfx-mobile-trigger {
        display: block !important;
        width: 100%;
        padding: 14px 20px;
        background: #fff;
        color: #6D3E8D;
        border: 1px solid #6D3E8D;
        border-radius: 5px;
        font-family: 'Poppins', sans-serif;
        font-size: 16px;
        font-weight: 600;
        text-transform: uppercase;
        text-align: center;
        cursor: pointer;
        letter-spacing: 0.5px;
        transition: all 0.2s ease;
    }

    .mvfx-search button.mvfx-mobile-trigger:hover {
        border-color: #6D3E8D;
        color: #EC6523;
    }

    .mvfx-search button.mvfx-mobile-trigger .fa-search {
        margin-right: 8px;
        color: inherit;
    }

    /* Mobile close button */
    .mvfx-mobile-close {
        display: none;
        position: fixed;
        top: 12px;
        right: 16px;
        width: 40px;
        height: 40px;
        background: #fff;
        border: 1px solid #ddd;
        border-radius: 50%;
        font-size: 24px;
        color: #333;
        cursor: pointer;
        z-index: 10001;
        line-height: 1;
        align-items: center;
        justify-content: center;
    }

    /* Fullscreen overlay */
    .mvfx-search.mvfx-fullscreen {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 9999;
        background: #fff;
        overflow-y: auto;
        padding: 60px 20px 20px;
        box-sizing: border-box;
        border-radius: 0;
        box-shadow: none;
    }

    .mvfx-search.mvfx-fullscreen .mvfx-search-form {
        display: flex !important;
        flex-direction: column;
        box-shadow: none;
        padding: 0;
    }

    .mvfx-search.mvfx-fullscreen .mvfx-mobile-trigger {
        display: none !important;
    }

    .mvfx-search.mvfx-fullscreen .mvfx-mobile-close {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .mvfx-search.mvfx-fullscreen .mvfx-clear-row {
        position: fixed;
        top: 18px;
        left: 16px;
        margin: 0;
        z-index: 10001;
        height: 0;
        overflow: visible;
    }

    .mvfx-search.mvfx-fullscreen .mvfx-search-main {
        flex-direction: column;
    }

    .mvfx-search.mvfx-fullscreen .mvfx-search-actions {
        display: none;
    }

    /* Show filters in mobile fullscreen */
    .mvfx-search.mvfx-fullscreen .mvfx-filters-panel {
        display: flex !important;
        flex-direction: column;
        gap: 10px;
        margin-top: 10px;
        padding-top: 10px;
    }

    .mvfx-search.mvfx-fullscreen .mvfx-filter-group {
        min-width: 100%;
    }

    .mvfx-search.mvfx-fullscreen .mvfx-filter-label {
        margin-bottom: 4px;
    }

    /* Search button at the end (after filters + clear) */
    .mvfx-search.mvfx-fullscreen .mvfx-mobile-search-btn {
        display: block;
        width: 100%;
        height: 52px;
        margin-top: 16px;
        border: none;
        border-radius: 5px;
        background: #6D3E8D;
        color: #fff;
        font-family: 'Poppins', sans-serif;
        font-size: 16px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        cursor: pointer;
        transition: background 0.2s ease;
    }

    .mvfx-search.mvfx-fullscreen .mvfx-mobile-search-btn:hover {
        background: #EC6523;
    }
}

/* Hide mobile elements on desktop */
@media (min-width: 768px) {
    .mvfx-mobile-trigger,
    .mvfx-mobile-close {
        display: none !important;
    }
}

/* Mobile search button — hidden by default */
.mvfx-mobile-search-btn {
    display: none;
}

/* No scroll when overlay open */
body.mvfx-no-scroll {
    overflow: hidden;
}
