/* --- BASE LAYOUT --- */
.mmd-search-form {
    display: flex;
    width: 100%;
    align-items: stretch;
    position: relative;
    box-sizing: border-box;
}

.mmd-field-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    min-width: 150px;
}

/* Inputs & Selects */
.mmd-search-input,
.mmd-search-select {
    width: 100%;
    border: none;
    outline: none;
    transition: 0.2s;
    box-sizing: border-box;
    font-family: inherit;
    padding: 15px; 
    line-height: 1.3;
    display: block;
    /* FIX: Damit text-align (vom Widget) auch beim Select greift */
    text-align-last: inherit; 
}

.mmd-search-input::placeholder {
    opacity: 1;
    line-height: inherit;
}

.mmd-search-select {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    padding-right: 30px; 
}

.mmd-search-select option {
    text-align: inherit;
}

/* --- ICONS (FIXED) --- */
.mmd-field-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    pointer-events: none;
    color: #94a3b8; /* Fallback Farbe */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1; /* Wichtig für vertikale Zentrierung */
}

/* WICHTIG: Styles für das innere Icon-Element (SVG oder I) */
.mmd-field-icon i {
    font-size: inherit; /* Erbt vom Container */
    color: inherit;
}

.mmd-field-icon svg {
    width: 1em;   /* Skaliert mit font-size des Containers */
    height: 1em;
    fill: currentColor; /* Nimmt die Textfarbe an */
}

/* Default Padding wenn Icon da ist */
.has-icon .mmd-search-input,
.has-icon .mmd-search-select {
    padding-left: 45px;
}

/* Select Arrow */
.mmd-search-category::after,
.mmd-search-radius::after {
    content: '\f078';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    font-size: 0.7em;
    color: #cbd5e0;
}

/* Radius Field */
.mmd-search-radius {
    flex: 0 0 110px;
    min-width: auto;
}

/* Button Wrapper */
.mmd-search-btn-wrapper {
    display: flex;
    flex: 0 0 auto;
}

.mmd-search-submit {
    border: none;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 30px;
    height: 100%;
    font-weight: 600;
    white-space: nowrap;
}

/* =========================================
   SKIN: INTEGRATED (BOOKING STYLE)
   ========================================= */
.mmd-search-integrated {
    background-color: #fff; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    border-radius: 8px;
    padding: 6px; 
    border: 1px solid #e2e8f0;
}

.mmd-search-integrated .mmd-search-input,
.mmd-search-integrated .mmd-search-select {
    background-color: transparent;
    border: none;
    border-radius: 0;
}

/* Divider */
.mmd-search-integrated .mmd-field-wrapper:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 20%;
    height: 60%;
    width: 1px;
    background-color: #e2e8f0; 
    z-index: 5;
}

/* Hover-Effekt */
.mmd-search-integrated .mmd-field-wrapper:hover .mmd-search-input,
.mmd-search-integrated .mmd-field-wrapper:hover .mmd-search-select {
    background-color: #f8fafc;
    border-radius: 4px;
}

.mmd-search-integrated .mmd-search-submit {
    border-radius: 6px;
    height: 100%;
    min-height: 48px;
}

/* =========================================
   SKIN: SEPARATE (CLASSIC)
   ========================================= */
.mmd-search-separate {
    background: transparent;
    box-shadow: none;
    border: none;
}

.mmd-search-separate .mmd-search-input,
.mmd-search-separate .mmd-search-select {
    border: 1px solid #ddd;
    background-color: #fff;
    border-radius: 4px;
}

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 1024px) {
    .mmd-search-form {
        flex-wrap: wrap;
    }
}

@media (max-width: 767px) {
    .mmd-search-form {
        flex-direction: column; 
        gap: 10px;
        height: auto !important;
    }

    /* FIX: Radius Feld Höhe korrigieren */
    .mmd-search-radius {
        flex: 1 1 auto !important; 
        width: 100%;    
        min-height: 0;
        height: auto !important;
    }
    
    .mmd-search-integrated .mmd-field-wrapper,
    .mmd-search-submit {
        width: 100%; 
        background: #fff;
        border-radius: 8px;
        box-shadow: 0 4px 6px rgba(0,0,0,0.05);
        margin-bottom: 0;
        border: 1px solid #e2e8f0; 
        min-height: 45px; 
    }

    .mmd-search-integrated .mmd-field-wrapper::after {
        display: none;
    }
    
    .mmd-search-btn-wrapper { 
        width: 100%; 
        justify-content: center; 
    }
    
    .mmd-search-submit { 
        width: 100%;
        min-height: 50px; 
    }
    
    /* Wenn zentriert, nicht volle Breite erzwingen (optional) */
    .mmd-search-form[style*="align-items: center"] .mmd-field-wrapper,
    .mmd-search-form[style*="align-items: center"] .mmd-search-btn-wrapper {
         width: auto;
         min-width: 80%; 
    }
}