/* =========================================================
   MVDE 2.0.29 — Bundled Custom Site CSS
   ---------------------------------------------------------
   本文件为用户提供的自定义 CSS（随 2.0.29 打包进插件）。
   以独立样式句柄 mvde-custom-fixes 在前端加载，
   不修改、不覆盖插件原有 CSS / JS / 模板 / 后台设置。
   注：按用户要求，menu-item-3873/3874/3875 的 padding 规则未包含。
   ========================================================= */

/* =========================================================
   Motors Listings - Hide duplicate Select2 dropdowns
   保留每个筛选器顶部的第一个下拉框
   隐藏下面由 Select2 生成的第二个重复下拉框
   ========================================================= */

.archive-listing-page [class*="stm-filter_"]
.form-group
span.select2.select2-container {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* 防止隐藏的 Select2 占用空间 */
.archive-listing-page [class*="stm-filter_"]
.form-group
span.select2.select2-container::before,
.archive-listing-page [class*="stm-filter_"]
.form-group
span.select2.select2-container::after {
    display: none !important;
    content: none !important;
}

/* 以上不要删除！！！！ */

/* =========================================================
   右侧顶部：Sort by + 排序下拉框 + Grid/List
   横向一排
   ========================================================= */

.stm-directory-listing-top__right {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 20px !important;
    width: auto !important;
    float: none !important;
    clear: none !important;
}

/* Sort by */
.stm-directory-listing-top__right .stm-sort-by-options {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 10px !important;
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
    width: auto !important;
}

/* Sort by 文字 */
.stm-directory-listing-top__right .stm-sort-by-options > span {
    display: inline-block !important;
    white-space: nowrap !important;
    margin: 0 !important;
}

/* 排序下拉框 */
.stm-directory-listing-top__right .stm-select-sorting {
    display: block !important;
    width: auto !important;
    margin: 0 !important;
}

/* select */
.stm-directory-listing-top__right .stm-select-sorting select {
    display: block !important;
    width: 175px !important;
    height: 50px !important;
    margin: 0 !important;
}

/* Grid / List */
.stm-directory-listing-top__right .stm-view-by {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 5px !important;
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
}

.stm-directory-listing-top__right .stm-view-by a {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 22px !important;
    height: 22px !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* =========================================================
   Vehicles per page
   让：
   Vehicles per page:  9  12  18  27
   横向排列
   ========================================================= */

.stm-inventory-items-per-page-wrap {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    flex-wrap: nowrap !important;

    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Vehicles per page 文字 */
.stm-inventory-items-per-page-wrap > .stm_label {
    display: inline-block !important;
    width: auto !important;
    margin: 0 15px 0 0 !important;
    padding: 0 !important;
    white-space: nowrap !important;
}

/* 9 12 18 27 的外层 */
.stm-inventory-items-per-page-wrap > .stm_per_page {
    display: block !important;
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* UL 横向 */
.stm-inventory-items-per-page-wrap > .stm_per_page > ul {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    flex-wrap: nowrap !important;

    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;

    list-style: none !important;
}

/* 9 / 12 / 18 / 27 */
.stm-inventory-items-per-page-wrap > .stm_per_page > ul > li {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    width: auto !important;
    margin: 0 12px 0 0 !important;
    padding: 0 !important;

    list-style: none !important;
}

/* 最后一个数字不要右边距 */
.stm-inventory-items-per-page-wrap > .stm_per_page > ul > li:last-child {
    margin-right: 0 !important;
}

/* 数字链接 */
.stm-inventory-items-per-page-wrap > .stm_per_page > ul > li > span {
    display: inline-block !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* 9 / 12 / 18 / 27 */
.stm-inventory-items-per-page-wrap > .stm_per_page > ul > li > span > a {
    display: inline-block !important;
    margin: 0 !important;
    padding: 0 !important;
    white-space: nowrap !important;
}

/* =========================================================
   防止主题原来的 clearfix / float 把元素重新变成上下排列
   ========================================================= */

.stm-directory-listing-top__right::before,
.stm-directory-listing-top__right::after,
.stm-sort-by-options::before,
.stm-sort-by-options::after,
.stm-inventory-items-per-page-wrap::before,
.stm-inventory-items-per-page-wrap::after {
    display: none !important;
    content: none !important;
}

/* =====================================================
   Motors 1.4.114 首页筛选器
   不改变原有宽度
   只处理：双箭头 + 文字垂直居中
   ===================================================== */

/* 1. 隐藏 Select2 自带箭头
   保留 Motors 原来的那个箭头 */
.stm-filter-tab-selects
.select2-container
.select2-selection__arrow {
    display: none !important;
}

/* 2. 禁止 stm-select-col 自己生成额外箭头 */
.stm-filter-tab-selects
.stm-select-col::before,
.stm-filter-tab-selects
.stm-select-col::after {
    display: none !important;
    content: none !important;
}

/* 3. 筛选框本身
   不设置 width / height，不改变原尺寸 */
.stm-filter-tab-selects
.select2-selection--single {
    position: relative !important;
    box-sizing: border-box !important;
}

/* 4. Brand / Type / Year / Body
   只处理文字垂直居中 */
.stm-filter-tab-selects
.select2-selection--single
.select2-selection__rendered {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;

    line-height: normal !important;

    display: flex !important;
    align-items: center !important;

    box-sizing: border-box !important;
}

/* 5. 保证文字不会因为 flex 导致宽度异常 */
.stm-filter-tab-selects
.select2-selection__rendered {
    min-width: 0 !important;
}

/* 6. 下拉列表文字
   不改变下拉框宽度 */
.stm-filter-tab-selects
.select2-results__option {
    box-sizing: border-box !important;
}

/* =========================================================
   CNEV Export - Listings Mobile Layout Only
   仅作用于 Listings 页面移动端
   ========================================================= */

@media (max-width: 767px) {

    /* =====================================================
       1. Listings 页面左右边距
       ===================================================== */

    body.post-type-archive-listings #content .archive-listing-page {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }

    /* =====================================================
       2. Cars for sale 上边距
       ===================================================== */

    body.post-type-archive-listings #content .stm-filter-top-wrap {
        padding-top: 20px !important;
    }

    body.post-type-archive-listings #content .stm-listing-directory-title {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }

    body.post-type-archive-listings #content .stm-listing-directory-title .title {
        margin-top: 0 !important;
    }

    /* =====================================================
       3. Sort by 整行靠左
       ===================================================== */

    body.post-type-archive-listings #content .stm-filter-top-wrap {
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        width: 100% !important;
    }

    body.post-type-archive-listings #content .stm-directory-listing-top__right {
        float: none !important;
        clear: both !important;

        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: flex-start !important;

        width: 100% !important;
        margin: 12px 0 0 0 !important;
        padding: 0 !important;
        text-align: left !important;
    }

    body.post-type-archive-listings #content .stm-sort-by-options {
        float: none !important;
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: flex-start !important;

        margin: 0 !important;
        padding: 0 !important;
    }

    body.post-type-archive-listings #content .stm-sort-by-options > span {
        margin: 0 10px 0 0 !important;
        padding: 0 !important;
        white-space: nowrap !important;
    }

    body.post-type-archive-listings #content .stm-select-sorting {
        float: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    body.post-type-archive-listings #content .stm-view-by {
        float: none !important;
        display: flex !important;
        align-items: center !important;
        margin: 0 0 0 15px !important;
        padding: 0 !important;
    }

    /* =====================================================
       4. Listings 内容区域
       ===================================================== */

    body.post-type-archive-listings #content .archive-listing-page_content {
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    /* =====================================================
       5. 车辆列表防止 Bootstrap 负边距
       ===================================================== */

    body.post-type-archive-listings #content .stm-isotope-sorting,
    body.post-type-archive-listings #content #listings-result,
    body.post-type-archive-listings #content .car-listing-row {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    /* =====================================================
       6. Listings 内容底部留白
       ===================================================== */

    body.post-type-archive-listings #content .archive-listing-page_content {
        padding-bottom: 40px !important;
    }

    body.post-type-archive-listings #content #listings-result {
        padding-bottom: 30px !important;
    }
}

/* =========================================
   Footer Contact Info
   移动端所有页面标题居中
   ========================================= */
@media (max-width: 767px) {

    footer #block-22 .wp-block-heading {
        text-align: center !important;
    }
}


/* =========================================================
   MVDE 2.0.30
   Mobile single-vehicle title + MSRP range
   ---------------------------------------------------------
   Only the price area is changed. The title's existing
   Elementor styles are intentionally left untouched.
   ========================================================= */
@media (max-width: 767px) {

    /* Title + price are stacked vertically on the single listing. */
    .elementor-element-4a9c7bd7 > .elementor-container {
        display: flex;
        flex-direction: column;
    }

    /* Product title column: preserve its existing styling. */
    .elementor-element-4a9c7bd7
    .elementor-element-35ea0134 {
        width: 100%;
        max-width: 100%;
        flex: 0 0 100%;
    }

    /* Price column below the title, with space before following content. */
    .elementor-element-4a9c7bd7
    .elementor-element-7192b0d7 {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
        margin-top: 0 !important;
        margin-bottom: 20px !important;
        padding: 0 !important;
        box-sizing: border-box !important;
        overflow: visible !important;
    }

    .elementor-element-4a9c7bd7
    .elementor-element-7192b0d7
    .elementor-widget-wrap {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        box-sizing: border-box !important;
        overflow: visible !important;
    }

    .elementor-element-4a9c7bd7
    .elementor-element-7192b0d7
    .elementor-widget-container {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        box-sizing: border-box !important;
        overflow: visible !important;
    }

    .elementor-element-4a9c7bd7
    .stm-listing-single-price-title {
        display: flex !important;
        width: 100% !important;
        max-width: 100% !important;
        justify-content: flex-start !important;
        align-items: center !important;
        margin: 0 !important;
        padding: 0 !important;
        box-sizing: border-box !important;
        overflow: visible !important;
    }

    /* Full-width rectangular price background.
       The +20px / -20px pair fills the right-side gap without
       moving the left edge. */
    .elementor-element-4a9c7bd7
    .mvde-price-range {
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        width: calc(100% + 20px) !important;
        max-width: none !important;
        margin-top: 0 !important;
        margin-left: 0 !important;
        margin-bottom: 0 !important;
        margin-right: -20px !important;
        padding: 10px 12px !important;
        box-sizing: border-box !important;
        border-radius: 0 !important;
        clip-path: none !important;
        transform: none !important;
        overflow: visible !important;
        flex-wrap: nowrap !important;
        white-space: nowrap !important;
    }

    .elementor-element-4a9c7bd7
    .mvde-price-range .regular-price,
    .elementor-element-4a9c7bd7
    .mvde-price-range .sale-price {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        width: auto !important;
        max-width: none !important;
        flex: 0 0 auto !important;
        float: none !important;
        margin: 0 !important;
        padding: 0 !important;
        box-sizing: border-box !important;
        white-space: nowrap !important;
    }

    .elementor-element-4a9c7bd7
    .mvde-price-range .label-price {
        display: none !important;
    }

    .elementor-element-4a9c7bd7
    .mvde-price-range .regular-price::after {
        content: " - " !important;
        display: inline-block !important;
        margin-left: 6px !important;
        margin-right: 6px !important;
        white-space: pre !important;
    }

    .elementor-element-4a9c7bd7
    .mvde-price-range .value {
        display: inline-block !important;
        width: auto !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
        flex: 0 0 auto !important;
        font-size: 18px !important;
        font-weight: 600 !important;
        line-height: 1.3 !important;
        white-space: nowrap !important;
    }

    .elementor-element-4a9c7bd7
    .mvde-price-range .regular-price .value,
    .elementor-element-4a9c7bd7
    .mvde-price-range .sale-price .value {
        font-size: 18px !important;
        font-weight: 600 !important;
        line-height: 1.3 !important;
        white-space: nowrap !important;
    }

    .elementor-element-4a9c7bd7
    .mvde-price-range > * {
        box-sizing: border-box !important;
        flex-shrink: 0 !important;
    }
}


/* =========================================================
   MVDE 2.0.31
   Mobile Motors Listings card MSRP range
   ---------------------------------------------------------
   IMPORTANT:
   - Listings mobile: keep price on the RIGHT of the title.
   - Keep both title and price on the same horizontal row.
   - Show the range as: 25,151$ - 33,644$
   - Do NOT move the Listings price below the title.
   - Do NOT change desktop Listings layout.
   - Do NOT change the Single Listing/detail-page layout.
   - Preserve Motors' existing price background/visual styling.
   ========================================================= */
@media (max-width: 767px) {

    /* -----------------------------------------------------
       Listings card meta row
       Price stays on the right of the title and is vertically
       centered with the title.
       ----------------------------------------------------- */
    body.post-type-archive-listings .car-meta-top,
    body.archive-listing-page .car-meta-top {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* -----------------------------------------------------
       Vehicle title
       Keep existing typography. Only make it the flexible
       left-side item of the same row.
       ----------------------------------------------------- */
    body.post-type-archive-listings .car-meta-top .car-title,
    body.archive-listing-page .car-meta-top .car-title {
        order: 1 !important;
        flex: 1 1 auto !important;
        min-width: 0 !important;
        width: auto !important;
        max-width: none !important;
        float: none !important;
        margin-top: 0 !important;
        margin-bottom: 0 !important;
        margin-left: 0 !important;
        margin-right: 8px !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        box-sizing: border-box !important;
    }

    /* -----------------------------------------------------
       Listings price
       Price remains on the RIGHT of the title.
       No full-width rule here: this is intentionally auto-width
       so it stays beside the title.
       ----------------------------------------------------- */
    body.post-type-archive-listings .car-meta-top .price.discounted-price,
    body.archive-listing-page .car-meta-top .price.discounted-price {
        order: 2 !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: flex-end !important;
        flex: 0 0 auto !important;
        width: auto !important;
        max-width: none !important;
        min-width: 0 !important;
        float: none !important;
        clear: none !important;
        margin: 0 !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        box-sizing: border-box !important;
        white-space: nowrap !important;
        text-align: right !important;
    }

    /* -----------------------------------------------------
       Price values
       Keep the two original Motors values on one line.
       ----------------------------------------------------- */
    body.post-type-archive-listings .car-meta-top .price.discounted-price .regular-price,
    body.post-type-archive-listings .car-meta-top .price.discounted-price .sale-price,
    body.archive-listing-page .car-meta-top .price.discounted-price .regular-price,
    body.archive-listing-page .car-meta-top .price.discounted-price .sale-price {
        display: inline-flex !important;
        align-items: center !important;
        width: auto !important;
        max-width: none !important;
        flex: 0 0 auto !important;
        float: none !important;
        clear: none !important;
        margin: 0 !important;
        padding: 0 !important;
        box-sizing: border-box !important;
        white-space: nowrap !important;
        text-align: right !important;
    }

    /* Hide labels if a Listings template outputs them. */
    body.post-type-archive-listings .car-meta-top .price.discounted-price .label-price,
    body.archive-listing-page .car-meta-top .price.discounted-price .label-price {
        display: none !important;
    }

    /* -----------------------------------------------------
       Range separator
       Result: 25,151$ - 33,644$
       ----------------------------------------------------- */
    body.post-type-archive-listings .car-meta-top .price.discounted-price .regular-price::after,
    body.archive-listing-page .car-meta-top .price.discounted-price .regular-price::after {
        content: " - " !important;
        display: inline-block !important;
        margin-left: 5px !important;
        margin-right: 5px !important;
        white-space: pre !important;
    }

    /* Keep the original Motors price typography on Listings.
       No font-size/weight override is added here. */
}
