.mf-hero-search {
    position: relative;
    padding: 110px 0 40px;
    background: linear-gradient(120deg,#0b1c2c 0%,#102f4a 55%,#123c62 100%);
    color: #fff;
    overflow: hidden;
}

.mf-hero-search__background {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 20% 20%, rgba(255,255,255,0.08), transparent 45%);
    pointer-events: none;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.25;
}

.mf-hero-search.has-image .mf-hero-search__background {
    opacity: 0.4;
}

.mf-hero-search .container {
    position: relative;
    z-index: 2;
}

.mf-hero-search__intro {
    max-width: 620px;
    margin-bottom: 32px;
    position: relative;
    z-index: 2;
}

.mf-hero-search__eyebrow {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin: 0 0 12px;
    color: rgba(255,255,255,0.72);
}

.mf-hero-search__intro h1 {
    font-size: 42px;
    font-weight: 700;
    margin: 0 0 12px;
}

.mf-hero-search__lead {
    font-size: 17px;
    margin: 0;
    color: rgba(255,255,255,0.85);
}

.mf-hero-search__card {
    background: #fff;
    border-radius: 20px;
    padding: 32px;
    box-shadow: 0 25px 80px rgba(0,0,0,0.25);
    color: #1d1d1f;
}

.mf-search-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.mf-search-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.mf-search-row.is-condensed {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.mf-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    color: #4f5866;
}

.mf-field input,
.mf-field select {
    height: 48px;
    border-radius: 12px;
    border: 1px solid #dfe3eb;
    padding: 0 14px;
    font-size: 15px;
    transition: border-color 0.2s ease;
    background: #fff;
}

.mf-field input:focus,
.mf-field select:focus {
    outline: none;
    border-color: #0065ff;
    box-shadow: 0 0 0 3px rgba(0,101,255,0.15);
}

.mf-field--submit {
    justify-content: flex-end;
    align-items: flex-start;
    gap: 10px;
}

.mf-search-submit {
    width: 100%;
    height: 48px;
    border-radius: 14px;
    border: none;
    background: linear-gradient(120deg,#0070f3,#00a0ff);
    color: #fff;
    font-weight: 600;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mf-search-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(0,112,243,0.35);
}

.mf-search-reset {
    background: none;
    border: none;
    padding: 0;
    color: #5b6470;
    font-size: 14px;
    text-decoration: underline;
    cursor: pointer;
}

.mf-quick-links {
    margin-top: 24px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    font-size: 14px;
}

.mf-quick-links__list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.mf-quick-links__list a {
    background: #f1f3f7;
    color: #0f141c;
    padding: 6px 14px;
    border-radius: 999px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.2s ease;
}

.mf-quick-links__list a:hover {
    background: #d7deea;
}

@media (max-width: 1024px) {
    .mf-hero-search__intro h1 {
        font-size: 32px;
    }

    .mf-search-row,
    .mf-search-row.is-condensed {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .mf-hero-search {
        padding: 64px 0 24px;
    }

    .mf-hero-search__card {
        padding: 20px;
    }

    .mf-search-row,
    .mf-search-row.is-condensed {
        grid-template-columns: 1fr;
    }

    .mf-field--submit {
        align-items: stretch;
    }
}

/* ============================================
   SIDEBAR FILTERS - COMPLETE REDESIGN
   ============================================ */

.mf-search-sidebar {
    background: #fff;
    border-radius: 16px;
    padding: 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.mf-sidebar-search-form {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.mf-filter-panel {
    border-bottom: 1px solid #f0f0f0;
    background: #fff;
}

.mf-filter-panel:last-child {
    border-bottom: none;
}

.mf-filter-header {
    padding: 18px 24px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.mf-filter-header h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
    letter-spacing: -0.01em;
}

.mf-filter-body {
    padding: 20px 24px;
    background: #fff;
}

.mf-price-inputs,
.mf-year-inputs,
.mf-mileage-inputs {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 12px;
    align-items: center;
    width: 100%;
}

.mf-year-inputs select.form-control {
    width: 100%;
    min-width: 0;
    display: block;
}

.mf-price-separator {
    color: #6c757d;
    font-weight: 500;
    font-size: 14px;
    padding: 0 8px;
    white-space: nowrap;
    text-align: center;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mf-sidebar-search-form .form-control {
    width: 100%;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 14px;
    transition: all 0.2s ease;
    background: #fff;
    color: #1a1a1a;
    font-weight: 400;
}

.mf-sidebar-search-form .form-control::placeholder {
    color: #9ca3af;
    opacity: 1;
}

.mf-sidebar-search-form .form-control:hover:not(:focus) {
    border-color: #c0c0c0;
}

.mf-sidebar-search-form .form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
    outline: none;
}

.mf-sidebar-search-form select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath fill='%236c757d' d='M7 10L2 5h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    box-sizing: border-box;
}

.mf-year-inputs {
    display: flex !important;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.mf-year-inputs select.form-control {
    flex: 1;
    min-width: 0;
    width: auto;
    display: block;
    white-space: normal;
    word-wrap: break-word;
    overflow: visible;
}

.mf-year-inputs .mf-price-separator {
    flex-shrink: 0;
    margin: 0 4px;
}

.mf-filter-submit {
    padding: 20px 24px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mf-filter-btn {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

.mf-filter-btn:hover {
    background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.4);
    transform: translateY(-1px);
}

.mf-filter-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 123, 255, 0.3);
}

.mf-filter-reset {
    text-align: center;
    color: #6c757d;
    text-decoration: none;
    font-size: 14px;
    padding: 8px;
    transition: color 0.2s;
    border-radius: 6px;
}

.mf-filter-reset:hover {
    color: #007bff;
    background: rgba(0, 123, 255, 0.05);
    text-decoration: none;
}

/* Responsive */
@media (max-width: 768px) {
    .mf-search-sidebar {
        margin-top: 24px;
        border-radius: 12px;
    }

    .mf-filter-header {
        padding: 16px 20px;
    }

    .mf-filter-body {
        padding: 16px 20px;
    }

    .mf-filter-submit {
        padding: 16px 20px;
    }

    .mf-price-inputs,
    .mf-year-inputs,
    .mf-mileage-inputs {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .mf-year-inputs {
        flex-direction: column;
        align-items: stretch;
    }

    .mf-price-separator {
        display: none;
    }
    
    /* Ensure selects have proper width on mobile */
    .mf-year-inputs select.form-control {
        width: 100% !important;
        flex: none;
    }
}

/* Legacy sidebar styles - keep for compatibility but hide old widgets */
.mf-sidebar-filters .panel {
    display: none;
}

.mf-sidebar-filters .panel {
    border: none;
    border-radius: 8px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    background: #f8f9fa;
    overflow: hidden;
}

.mf-sidebar-filters .panel-heading {
    background: #fff;
    border: none;
    padding: 16px 20px;
    border-radius: 8px 8px 0 0;
    border-bottom: 1px solid #e9ecef;
}

.mf-sidebar-filters .panel-title {
    font-size: 15px;
    font-weight: 600;
    color: #212529;
    margin: 0;
}

.mf-sidebar-filters .panel-title a {
    color: inherit;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: color 0.2s;
}

.mf-sidebar-filters .panel-title a:hover,
.mf-sidebar-filters .panel-title a:focus {
    color: #007bff;
    text-decoration: none;
}

.mf-sidebar-filters .panel-title a .more-less {
    font-size: 12px;
    transition: transform 0.3s;
    color: #6c757d;
}

.mf-sidebar-filters .panel-title a[aria-expanded="true"] .more-less {
    transform: rotate(45deg);
}

.mf-sidebar-filters .panel-collapse {
    border-top: 1px solid #e9ecef;
}

.mf-sidebar-filters .panel-body {
    padding: 20px;
    background: #fff;
}

.mf-sidebar-filters .form-control,
.mf-sidebar-filters select.form-control {
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.mf-sidebar-filters .form-control:focus,
.mf-sidebar-filters select.form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.1);
    outline: none;
}

.mf-sidebar-filters .checkbox label,
.mf-sidebar-filters .radio label {
    font-size: 14px;
    color: #495057;
    cursor: pointer;
    padding-left: 8px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
}

.mf-sidebar-filters .checkbox input[type="checkbox"],
.mf-sidebar-filters .radio input[type="radio"] {
    margin-right: 8px;
    cursor: pointer;
}

.mf-sidebar-filters .btn {
    border-radius: 6px;
    padding: 10px 20px;
    font-weight: 500;
    transition: all 0.2s;
}

.mf-sidebar-filters .btn-primary {
    background: #007bff;
    border-color: #007bff;
}

.mf-sidebar-filters .btn-primary:hover {
    background: #0056b3;
    border-color: #0056b3;
}

.mf-sidebar-filters .list-group-item {
    border: none;
    border-bottom: 1px solid #e9ecef;
    padding: 12px 0;
    background: transparent;
}

.mf-sidebar-filters .list-group-item:last-child {
    border-bottom: none;
}

.mf-sidebar-filters .list-group-item a {
    color: #495057;
    text-decoration: none;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mf-sidebar-filters .list-group-item a:hover {
    color: #007bff;
}

/* Hide Archives and Categories widgets */
.mf-sidebar-filters .widget_archive,
.mf-sidebar-filters .widget_categories,
.mf-sidebar-filters .wp-block-archives,
.mf-sidebar-filters .wp-block-archives-list,
.mf-sidebar-filters [class*="wp-block-archives"],
.mf-sidebar-filters .wp-block-group {
    display: none !important;
}

/* Hide duplicate "Cena" panel - hide second panel with id="red-price" */
.mf-sidebar-filters .panel[id="red-price"]:nth-of-type(n+2),
.mf-sidebar-filters .panel[id="red-price"] ~ .panel[id="red-price"] {
    display: none !important;
}

/* Alternative: If there are multiple price panels, hide all except the first one */
.mf-sidebar-filters .panel[id="red-price"]:not(:first-of-type) {
    display: none !important;
}

/* Enhanced form field styling */
.mf-sidebar-filters input[type="text"],
.mf-sidebar-filters input[type="number"],
.mf-sidebar-filters input[type="email"],
.mf-sidebar-filters input[type="tel"],
.mf-sidebar-filters textarea {
    width: 100%;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 14px;
    transition: all 0.2s;
    background: #fff;
    color: #495057;
}

.mf-sidebar-filters input[type="text"]:focus,
.mf-sidebar-filters input[type="number"]:focus,
.mf-sidebar-filters input[type="email"]:focus,
.mf-sidebar-filters input[type="tel"]:focus,
.mf-sidebar-filters textarea:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.1);
    outline: none;
}

.mf-sidebar-filters select {
    width: 100%;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 14px;
    background: #fff;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.mf-sidebar-filters select:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.1);
    outline: none;
}

/* Checkbox and Radio styling */
.mf-sidebar-filters .checkbox,
.mf-sidebar-filters .radio {
    margin-bottom: 12px;
}

.mf-sidebar-filters .checkbox input[type="checkbox"],
.mf-sidebar-filters .radio input[type="radio"] {
    width: 18px;
    height: 18px;
    margin-right: 10px;
    cursor: pointer;
    accent-color: #007bff;
}

.mf-sidebar-filters .checkbox label,
.mf-sidebar-filters .radio label {
    font-size: 14px;
    color: #495057;
    cursor: pointer;
    padding-left: 0;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    font-weight: 400;
    transition: color 0.2s;
}

.mf-sidebar-filters .checkbox label:hover,
.mf-sidebar-filters .radio label:hover {
    color: #007bff;
}

/* Price range inputs */
.mf-sidebar-filters .input-group {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.mf-sidebar-filters .input-group .form-control {
    flex: 1;
}

.mf-sidebar-filters .input-group-addon {
    display: flex;
    align-items: center;
    padding: 0 8px;
    color: #6c757d;
    font-weight: 500;
}

/* Submit button styling */
.mf-sidebar-filters .btn-block {
    width: 100%;
    margin-top: 16px;
}

/* List items styling */
.mf-sidebar-filters ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mf-sidebar-filters ul li {
    padding: 10px 0;
    border-bottom: 1px solid #e9ecef;
}

.mf-sidebar-filters ul li:last-child {
    border-bottom: none;
}

.mf-sidebar-filters ul li a {
    color: #495057;
    text-decoration: none;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
}

.mf-sidebar-filters ul li a:hover {
    color: #007bff;
}

/* Label styling */
.mf-sidebar-filters label:not(.checkbox label):not(.radio label) {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #212529;
    font-size: 14px;
}

@media (max-width: 768px) {
    .mf-search-sidebar {
        margin-top: 24px;
        padding: 20px;
    }

    .mf-sidebar-filters .panel-heading {
        padding: 14px 16px;
    }

    .mf-sidebar-filters .panel-body {
        padding: 16px;
    }
}

/* Select2 styling fixes */
.mf-sidebar-filters .select2-container {
    width: 100% !important;
}

.mf-sidebar-filters .select2-container--default .select2-selection--single {
    height: auto;
    min-height: 42px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 8px 12px;
    background: #fff;
}

.mf-sidebar-filters .select2-container--default .select2-selection--single .select2-selection__rendered {
    padding: 0;
    padding-right: 20px;
    line-height: 26px;
    color: #495057;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    white-space: normal;
}

.mf-sidebar-filters .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 40px;
    right: 8px;
}

.mf-sidebar-filters .select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: #6c757d transparent transparent transparent;
    border-width: 6px 5px 0 5px;
    margin-top: -3px;
}

.mf-sidebar-filters .select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
    border-color: transparent transparent #6c757d transparent;
    border-width: 0 5px 6px 5px;
    margin-top: -3px;
}

.mf-sidebar-filters .select2-container--default .select2-selection--single:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.1);
    outline: none;
}

.mf-sidebar-filters .select2-dropdown {
    border: 1px solid #dee2e6;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.mf-sidebar-filters .select2-results__option {
    padding: 10px 12px;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
}

.mf-sidebar-filters .select2-results__option--highlighted {
    background: #007bff;
    color: #fff;
}

/* Fix for select2 container text overflow */
.mf-sidebar-filters [id*="select2-"][id*="-container"] {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mf-sidebar-filters [id*="select2-"][id*="-container"] .select2-selection__rendered {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
}

/* Show Select2 placeholder */
.mf-sidebar-search-form .select2-selection__placeholder {
    color: #9ca3af !important;
    opacity: 1 !important;
    display: block !important;
}

.mf-sidebar-search-form .select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #1a1a1a;
}

.mf-sidebar-search-form .select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #9ca3af !important;
    opacity: 1 !important;
}

/* Ensure placeholder is visible when no value is selected */
.mf-sidebar-search-form .select2-container--default .select2-selection--single[aria-labelledby*="select2"] .select2-selection__rendered {
    color: #9ca3af;
}

.mf-sidebar-search-form .select2-container--default .select2-selection--single .select2-selection__rendered:empty::before {
    content: attr(data-placeholder);
    color: #9ca3af;
}

/* Ensure Select2 works properly in sidebar */
.mf-sidebar-search-form .select2-container {
    width: 100% !important;
}

.mf-sidebar-search-form .select2-container--default .select2-selection--single {
    height: auto;
    min-height: 44px;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    padding: 0;
    background: #fff;
}

.mf-sidebar-search-form .select2-container--default .select2-selection--single .select2-selection__rendered {
    padding: 12px 40px 12px 16px;
    line-height: 20px;
    color: #1a1a1a;
}

.mf-sidebar-search-form .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 44px;
    right: 12px;
    width: 20px;
}

.mf-sidebar-search-form .select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: #6c757d transparent transparent transparent;
    border-width: 6px 5px 0 5px;
    margin-top: -3px;
}

.mf-sidebar-search-form .select2-container--default.select2-container--open .select2-selection--single {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.mf-sidebar-search-form .select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
    border-color: transparent transparent #007bff transparent;
    border-width: 0 5px 6px 5px;
    margin-top: -3px;
}

.mf-sidebar-search-form .select2-dropdown {
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    margin-top: 4px;
}

.mf-sidebar-search-form .select2-results__option {
    padding: 12px 16px;
    font-size: 14px;
    color: #374151;
}

.mf-sidebar-search-form .select2-results__option--highlighted {
    background: #007bff;
    color: #fff;
}

/* Hide placeholder for year selects */
.mf-year-inputs select[name="year_from"] + .select2-container .select2-selection__placeholder,
.mf-year-inputs select[name="year_to"] + .select2-container .select2-selection__placeholder {
    display: none !important;
}

.mf-year-inputs .select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #1a1a1a;
}

.mf-year-inputs .select2-container--default .select2-selection--single .select2-selection__rendered:empty {
    color: #1a1a1a;
}

/* Ensure year selects don't show placeholder text */
.mf-year-inputs .select2-selection__placeholder {
    display: none !important;
    opacity: 0 !important;
}