.ymm-advanced-search-container {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    padding: 40px;
    max-width: 1200px;
    margin: 40px auto;
}

.ymm-advanced-search-title {
    font-size: 32px;
    margin-bottom: 25px;
    color: #1a202c;
    font-weight: 600;
    text-align: left;
}

.ymm-search-mode-selector {
    display: flex;
    gap: 30px;
    margin-bottom: 35px;
    justify-content: flex-start;
}

.ymm-mode-option {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    color: #4a5568;
    padding: 0;
    appearance: none;
    background: transparent;
    border: 0;
    border-radius: 0;
    text-align: left;
}

.ymm-mode-option:hover {
    background: transparent;
    color: #1a202c;
}

.ymm-mode-option::before {
    width: 18px;
    height: 18px;
    border: 1px solid #718096;
    border-radius: 50%;
    content: '';
    flex: 0 0 18px;
}

.ymm-mode-option.is-active::before {
    border-color: #3b5bdb;
    box-shadow: inset 0 0 0 4px #ffffff;
    background-color: #3b5bdb;
}

.ymm-mode-option span {
    font-size: 16px;
}

.ymm-mode-option:focus-visible {
    outline: 3px solid rgba(59, 91, 219, 0.35);
    outline-offset: 4px;
}

.ymm-search-panel {
    display: none;
}

.ymm-search-panel.is-active {
    display: block;
}

.ymm-search-row {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

/* Custom Dropdown Styling */
.ymm-custom-dropdown {
    position: relative;
    flex: 1;
}

.ymm-dropdown-selection {
    position: relative;
    display: flex;
    align-items: center;
}

.ymm-dropdown-search {
    width: 100%;
    padding: 14px 18px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s, box-shadow 0.2s;
    background-color: #ffffff; /* Use white to avoid confusion */
}

.ymm-dropdown-list-wrapper {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-top: none;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    margin-top: -1px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    z-index: 1000;
    max-height: 250px;
    overflow: hidden;
    display: none;
    flex-direction: column;
}

.ymm-dropdown-search:focus {
    outline: none;
    border-color: #3b5bdb;
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(59, 91, 219, 0.1);
}

.ymm-dropdown-arrow {
    position: absolute;
    right: 18px;
    width: 10px;
    height: 10px;
    border-right: 2px solid #94a3b8;
    border-bottom: 2px solid #94a3b8;
    transform: rotate(45deg);
    pointer-events: none;
    margin-top: -6px;
}

.ymm-dropdown-list-wrapper {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-top: 5px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    max-height: 300px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.ymm-dropdown-list {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow-y: auto;
    flex: 1;
    background: #fff !important;
}

.ymm-dropdown-list li {
    padding: 12px 18px !important;
    cursor: pointer;
    font-size: 15px;
    border: none !important;
    border-bottom: 1px solid #f1f5f9 !important;
    color: #4a5568 !important;
    background: #fff !important;
    margin: 0 !important;
    text-align: left !important;
    list-style-type: none !important;
}

.ymm-dropdown-list li:last-child {
    border-bottom: none !important;
}

.ymm-dropdown-list li:hover {
    background: #f8fafc !important;
    color: #3b5bdb !important;
}

.ymm-dropdown-loading {
    padding: 12px;
    text-align: center;
    font-size: 14px;
    color: #94a3b8;
    background: #f8fafc;
}

/* YMM Panel styling within advanced search */
.ymm-search-panel[data-panel="vehicle"] .ymm-filter-dropdowns {
    display: flex;
    flex: 1;
    gap: 12px;
}

.ymm-search-panel[data-panel="vehicle"] .ymm-column {
    flex: 1;
}

.ymm-search-panel[data-panel="vehicle"] .ymm-select {
    padding: 14px 18px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    background-color: #f8fafc;
}

.ymm-search-panel[data-panel="vehicle"] .ymm-select:focus {
    border-color: #3b5bdb;
    background-color: #fff;
}

.ymm-advanced-search-btn {
    background-color: #3b5bdb;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0;
    width: 60px;
    height: 54px;
    font-size: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s, transform 0.1s;
    flex-shrink: 0;
}

.ymm-advanced-search-btn svg {
    width: 24px;
    height: 24px;
}

.ymm-advanced-search-btn:hover:not(:disabled) {
    background-color: #2b45a2;
}

.ymm-advanced-search-btn:active:not(:disabled) {
    transform: scale(0.96);
}

.ymm-advanced-search-btn:disabled {
    background-color: #cbd5e0;
    cursor: not-allowed;
}

@media (max-width: 1024px) {
    .ymm-search-panel[data-panel="vehicle"] .ymm-filter-dropdowns {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 640px) {
    .ymm-advanced-search-container {
        max-width: none;
        margin: 0 auto 32px;
        padding: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }

    .ymm-advanced-search-title {
        margin-bottom: 18px;
        color: #ffffff;
        font-size: clamp(28px, 5vw, 36px);
        line-height: 1.2;
    }

    .ymm-search-mode-selector {
        flex-direction: column;
        gap: 12px;
        margin-bottom: 12px;
        align-items: stretch;
    }

    .ymm-mode-option {
        position: relative;
        justify-content: center;
        height: 64px;
        min-height: 64px;
        width: 100%;
        padding: 12px 16px;
        border-radius: 8px;
        background: #ffffff;
        border: 1px solid #e2e8f0;
        color: #1a202c;
        font-size: 18px;
        font-weight: 700;
        line-height: 1.2;
        text-align: center;
        box-shadow: 0 2px 0 rgba(26, 32, 44, 0.12);
    }

    .ymm-mode-option::before {
        display: none;
    }

    .ymm-mode-option span {
        font-size: inherit;
    }

    .ymm-search-panel {
        display: none;
        margin: 0;
        opacity: 0;
        overflow: visible;
    }

    .ymm-search-panel.is-active {
        display: block;
        margin: 0;
        opacity: 1;
        overflow: visible;
    }

    .ymm-mobile-panel-heading {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        margin: 0 0 16px;
    }

    .ymm-mobile-panel-heading h3 {
        margin: 0;
        color: #ffffff;
        font-size: 20px;
        font-weight: 700;
        text-align: right;
    }

    .ymm-advanced-search-back {
        min-height: 48px;
        padding: 10px 16px;
        border: 1px solid #3b5bdb;
        border-radius: 6px;
        background: #ffffff;
        color: #2b45a2;
        cursor: pointer;
        font-size: 16px;
        font-weight: 700;
    }

    .ymm-advanced-search-back::before {
        margin-right: 8px;
        content: '←';
    }

    .ymm-advanced-search-back:focus-visible {
        outline: 3px solid rgba(59, 91, 219, 0.35);
        outline-offset: 3px;
    }

    .ymm-mobile-panel-open .ymm-search-mode-selector {
        display: none;
    }

    .ymm-search-row {
        flex-direction: column;
        gap: 12px;
        padding: 0;
        border-radius: 0;
        background: transparent;
    }

    .ymm-custom-dropdown,
    .ymm-search-panel[data-panel="vehicle"] .ymm-filter-dropdowns {
        width: 100%;
    }

    .ymm-dropdown-search,
    .ymm-search-panel[data-panel="vehicle"] .ymm-select {
        min-width: 0;
        min-height: 54px;
        padding: 14px 46px 14px 16px;
        font-size: 16px;
    }

    .ymm-dropdown-list-wrapper {
        max-height: 240px;
    }

    .ymm-advanced-search-btn {
        width: 100%;
        min-height: 54px;
        height: 54px;
        background-color: #3b5bdb;
        color: #ffffff;
    }

    .ymm-advanced-search-btn:hover:not(:disabled) {
        background-color: #2b45a2;
    }

    .ymm-advanced-search-btn:disabled {
        background-color: #cbd5e0;
        color: #ffffff;
    }

    .ymm-search-panel[data-panel="vehicle"] .ymm-filter-dropdowns {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 360px) {
    .ymm-advanced-search-container {
        padding: 0;
    }

    .ymm-mode-option {
        height: 60px;
        min-height: 60px;
        padding: 10px 14px;
        font-size: 17px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ymm-advanced-search-btn {
        transition: none;
    }
}

@media (min-width: 641px) {
    .ymm-mobile-panel-heading {
        display: none;
    }
}
