/* =========================================================================
   Vehicle Fleet Browser
   Loaded by inc/plr-fleet-browser.php with a filemtime() version, so it
   cache-busts on every edit — unlike custom.css, which is enqueued with no
   version and gets held by browser and page caches.
   Enqueued after custom.css so these rules win.
   ====================================================================== */

.plr-fleet,
.plr-fleet *,
.plr-fleet *:before,
.plr-fleet *:after {
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
}

/* Own wrapper instead of Bootstrap's .container, which is pinned to a fixed
   width (1170px at desktop). Nested inside a narrower WPBakery column it
   overflows, and .page-section { overflow: hidden } then crops the last card. */
.plr-fleet__inner {
    width: 100%;
    max-width: 1170px;
    margin: 0 auto;
    padding: 0 15px;
}

.plr-fleet__title {
    margin-bottom: 25px;
}

/* --- Controls ---------------------------------------------------------- */

.plr-fleet__controls {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    -webkit-box-align: end;
    -ms-flex-align: end;
    align-items: flex-end;
    gap: 15px;
    margin: 0 0 25px;
    padding: 20px;
    background: #f7f7f7;
    border-radius: 3px;
}

.plr-fleet__field {
    -webkit-box-flex: 1;
    -ms-flex: 1 1 200px;
    flex: 1 1 200px;
    min-width: 160px;
}

.plr-fleet__field--action {
    -ms-flex: 0 0 auto;
    flex: 0 0 auto;
}

.plr-fleet__label {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #14181c;
}

.plr-fleet__control {
    width: 100%;
    height: 40px;
    padding: 0 10px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 3px;
    color: #14181c;
}

.plr-fleet__control:focus {
    outline: 2px solid #14181c;
    outline-offset: 1px;
}

.plr-fleet__submit {
    height: 40px;
    line-height: 1;
}

/* The Apply button is the no-JS fallback; the script hides it once it boots. */
.plr-fleet--js .plr-fleet__field--action {
    display: none;
}

/* --- Results ----------------------------------------------------------- */

.plr-fleet__count {
    margin: 0 0 15px;
    font-size: 13px;
    color: #898989;
}

/* CSS Grid, not Bootstrap row/col: no negative margins to overflow, and
   minmax(0, 1fr) makes the columns incapable of exceeding their container
   however narrow the parent gets. */
.plr-fleet__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-gap: 30px;
    gap: 30px;
    -webkit-transition: opacity .2s ease;
    transition: opacity .2s ease;
}

@media (min-width: 600px) {
    .plr-fleet__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 992px) {
    /* 3 across is the desktop default, so the layout stays correct even if the
       markup and this file ever fall out of step and the modifier is missing. */
    .plr-fleet__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .plr-fleet__grid--2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .plr-fleet__grid--3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .plr-fleet__grid--4 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.plr-fleet.is-loading .plr-fleet__grid {
    opacity: .45;
    pointer-events: none;
}

.plr-fleet__col {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    min-width: 0;
}

.plr-fleet__card {
    width: 100%;
    height: 100%;
    margin: 0;
}

.plr-fleet__card .media img {
    width: 100%;
    height: auto;
}

/* .caption-title a is line-height:18px site-wide, which crowds two-line names. */
.plr-fleet__card-title {
    min-height: 42px;
    margin: 5px 5px 8px;
}

.plr-fleet__card-title a {
    display: inline-block;
    line-height: 24px;
}

/* .thumbnail-car-card .caption-text is hidden site-wide and re-enabled only for
   specific page IDs. The card keeps that class so every existing price rule
   applies unchanged; this forces it visible on whatever page the widget is on. */
.plr-fleet .caption-text {
    display: block !important;
}

.plr-fleet__card-price {
    margin-bottom: 12px;
}

/* --- Empty state ------------------------------------------------------- */

.plr-fleet__empty {
    grid-column: 1 / -1;
    padding: 50px 20px;
    text-align: center;
}

.plr-fleet__empty-title {
    margin-bottom: 6px;
    font-size: 18px;
    font-weight: 600;
    color: #14181c;
}

.plr-fleet__empty-text {
    margin-bottom: 20px;
    color: #898989;
}

/* --- Load more --------------------------------------------------------- */

.plr-fleet__more-wrap {
    margin-top: 30px;
    text-align: center;
}

.plr-fleet__load-more[hidden] {
    display: none;
}

.plr-fleet__load-more[disabled] {
    opacity: .6;
    cursor: default;
}

@media (max-width: 767px) {
    .plr-fleet__controls {
        display: block;
        padding: 15px;
    }

    .plr-fleet__field {
        margin-bottom: 12px;
    }

    .plr-fleet__field:last-child {
        margin-bottom: 0;
    }
}
