/* Force the search form container to handle the layout */
.mphb_sc_search-form {
    display: flex;
    flex-wrap: wrap;
    gap: 15px; /* Spacing between fields */
    align-items: flex-end; /* Align bottom so labels don't mess up input alignment */
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
}

/* Make inputs take up space but respect the 2-row max limit on desktop */
.mphb_sc_search-wrapper {
    flex: 1 1 200px; /* Grow and shrink, min-width 200px */
    display: flex;
    flex-direction: column;
}

/* Ensure labels are visible and styled */
.mphb_sc_search-label {
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--e-global-color-text, #020401);
    display: block;
}

/* Style inputs */
.mphb_sc_search-element input,
.mphb_sc_search-element select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    height: 45px; /* Consistent height */
    box-sizing: border-box;
    color: var(--e-global-color-text, #020401);
}

/* Submit button container */
.mphb_sc_search-submit-button-wrapper {
    flex: 0 0 auto; /* Don't grow, take button width */
    display: flex;
    align-items: flex-end;
    margin-top: auto; /* Push to bottom if needed */
}

/* Submit button styling - Using Global Colors from movestaysol.be */
.mphb_sc_search-submit-button-wrapper input[type="submit"] {
    background-color: var(--e-global-color-primary, #94d283); /* Light Green Action Color */
    color: var(--e-global-color-secondary, #020401); /* Black Text for contrast */
    border: none;
    padding: 10px 25px;
    height: 45px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.mphb_sc_search-submit-button-wrapper input[type="submit"]:hover {
    background-color: var(--e-global-color-accent, #94d283); /* Same base, rely on opacity */
    opacity: 0.9;
    transform: translateY(-1px);
}

/* Specific adjustments for Date Pickers to ensure they sit side-by-side if possible */
.mphb-datepick {
    min-width: 140px;
}

/* 
 * Layout Logic:
 * On Desktop (> 768px), we want roughly 3-4 items per row to fit in 2 rows.
 * Flex-wrap handles this naturally if widths are correct.
 * Let's enforce a max-width for children to encourage wrapping into 2 rows.
 */
@media (min-width: 768px) {
    .mphb_sc_search-wrapper {
        flex-basis: calc(33.333% - 15px); /* 3 items per row approx */
        max-width: calc(33.333% - 15px);
    }
    
    /* Make the button fill the last slot or auto width */
    .mphb_sc_search-submit-button-wrapper {
        flex-basis: auto;
        margin-left: auto; /* Push to right if desired, or keep inline */
    }
}

/* Mobile: Stack everything */
@media (max-width: 767px) {
    .mphb_sc_search-form {
        flex-direction: column;
    }
    
    .mphb_sc_search-wrapper,
    .mphb_sc_search-submit-button-wrapper {
        width: 100%;
        max-width: 100%;
        flex: 1 1 100%;
    }
    
    .mphb_sc_search-submit-button-wrapper input[type="submit"] {
        width: 100%;
    }
}
