/* MotorDesk Plugin CSS */

.motordesk-search-form {
    border: 1px solid #000;
    padding: 0.5em;
}

.motordesk-search-form > div {
    width: 96%;
    display: inline-block;
    padding: 0.5em;
}

@media (min-width: 600px) {
    .motordesk-search-form > div {
        width: 100%;
    }
}

@media (min-width: 1200px) {
    .motordesk-search-form > div {
        width: 100%;
    }
}

.motordesk-select-style .motordesk-select {
    width: 100%;
    padding: 0.25em;
}

.motordesk-select-style .motordesk-search-range .motordesk-select {
    width: 46%;
}

.motordesk-search-range {
    white-space: nowrap;
}

.motordesk-search-range > div {
    display: inline-block;
    width: 40%;
}

.motordesk-search-result {
    overflow: auto;
}

.motordesk-search-vehicle {
    cursor: pointer;
    width: 99.5%;
    border: 1px solid #000;
    padding: 0px;
    margin-top: 1em;
}

@media (min-width: 600px) {
    .motordesk-search-vehicle {
        width: 47%;
        float: left;
        clear: left;
    }
    .motordesk-search-vehicle:nth-of-type(even) {
        float: right;
        clear: right;
    }
}

.motordesk-search-vehicle > div {
    padding: 0.75em;
    padding-top: 0.5em;
}

.motordesk-search-vehicle > div > a {
    display: block;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.motordesk-search nav {
    margin-top: 1em;
    clear: both;
}

.motordesk-search nav a {
    border: 1px solid #000;
    padding: 0.35em;
    text-decoration: none;
    margin-right: 0.15em;
}

.motordesk-vehicle-feature {
    border: 1px solid #000;
    padding: 0.75em;
}

.motordesk-hide {
    display: none;
}

.motordesk-vehicle{
    padding: 1rem;
}

/* =================== */

/* MotorDesk Enhanced Search Layout */
.motordesk-search-container {
    display: flex;
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Mobile (≤ 767px) → stack in column */
@media (max-width: 767px) {
    .motordesk-search-container {
        flex-direction: column;
    }
}

/* Search Sidebar */
.motordesk-search-sidebar {
    flex: 0 0 300px;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    height: fit-content;
    position: sticky;
    top: 20px;
}

.motordesk-search-sidebar {
    flex: 0 0 300px;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    height: fit-content;
    position: sticky;
    top: 20px;
}

/* Tablet (≤ 1024px) → reduce width */
@media (max-width: 1024px) {
    .motordesk-search-sidebar {
        flex: 0 0 auto;   
        width: 240px;     
    }
}

/* Mobile (≤ 767px) → full width + no sticky */
@media (max-width: 767px) {
    .motordesk-search-sidebar {
        flex: 0 0 auto;   
        width: 100%;      
        position: static; 
        margin-bottom: 20px;
    }
}

.motordesk-search-form-wrapper h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
    font-size: 1.5em;
}

.motordesk-search-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.motordesk-search-form > div {
    display: flex;
    flex-direction: column;
}

.motordesk-search-form label {
    font-weight: 600;
    margin-bottom: 5px;
    color: #555;
    font-size: 0.9em;
}

.motordesk-search-form select,
.motordesk-search-form input[type="text"],
.motordesk-search-form input[type="number"] {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: white;
}

.motordesk-search-range {
    display: flex;
    align-items: center;
    gap: 10px;
}

.motordesk-search-range input {
    flex: 1;
}

.motordesk-search-form input[type="submit"] {
    background: #C73D25;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    transition: background-color 0.3s;
}

.motordesk-search-form input[type="submit"]:hover {
    background: #1e293b;
}

/* Main Results Area */
.motordesk-search-main {
    flex: 1;
}

.motordesk-search-result-grid {
    display: grid;
    grid-template-columns: 1fr; /* Default: mobile - 1 column */
    gap: 20px;
    margin-bottom: 30px;
}

/* Tablet (≥ 768px) */
@media (min-width: 768px) {
    .motordesk-search-result-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Desktop/Laptop (≥ 1024px) */
@media (min-width: 1024px) {
    .motordesk-search-result-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Vehicle Grid Cards */
.motordesk-search-vehicle-grid {
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.motordesk-search-vehicle-grid:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.motordesk-vehicle-image {
    position: relative;
    width: 100%;
    height: auto;
    overflow: hidden;
}

@media (max-width: 767px) {
    .motordesk-vehicle-image {
        height: auto !important;
    } 
}

@media (max-width: 1024px) {
    .motordesk-vehicle-image {
        height: auto !important;
    } 
}


.motordesk-vehicle-image img {
    width: 100%;
    height: auto;
    object-fit: cover;
    transition: transform 0.3s;
}

.motordesk-search-vehicle-grid:hover .motordesk-vehicle-image img {
    transform: scale(1.05);
}

.motordesk-no-image {
    width: 100%;
    height: 100%;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 0.9em;
}

.motordesk-vehicle-info {
    padding: 15px;
}

.motordesk-vehicle-title h4 {
    margin: 0 0 10px 0;
    font-size: 1.1em;
}

.motordesk-vehicle-title a {
    color: #1e293b;
    text-decoration: none;
}

.motordesk-vehicle-title a:hover {
    color: #C73D25;
}

.motordesk-vehicle-price {
    margin-bottom: 10px;
}

.motordesk-vehicle-price .price {
    font-size: 1.3em;
    font-weight: bold;
    color: #C73D25;
}

.motordesk-vehicle-details {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 10px;
}

.motordesk-vehicle-details .separator {
    margin: 0 8px;
}

.motordesk-vehicle-specs {
    display: flex;
    gap: 10px;
}

.motordesk-vehicle-specs .spec-item {
    background: #f8f9fa;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    color: #555;
}

.motordesk-vehicle-specs .spec-item span {
    margin-right: 8px;
}

/* No Results */
.motordesk-no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: #666;
}

/* Pagination */
.motordesk-search-main nav {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
}

.motordesk-search-main nav a {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    transition: all 0.2s;
}

.motordesk-search-main nav a:hover {
    background: #007cba;
    color: white;
    border-color: #007cba;
}

.motordesk-search-main nav a b {
    color: #007cba;
}

/* Search  Form */
.motordesk-search-form {
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    font-family: Arial, sans-serif;
}

.motordesk-search-form > div {
    margin-bottom: 15px;
}

.motordesk-search-form label {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
    color: #333;
}

.motordesk-search-form select,
.motordesk-search-form input[type="text"],
.motordesk-search-form input[type="number"] {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.motordesk-search-range {
    display: flex;
    align-items: center;
    gap: 10px;
}

.motordesk-search-range input {
    flex: 1;
}

.motordesk-search-range span {
    font-weight: normal;
    color: #666;
}

.motordesk-additional-options {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    opacity: 0;
}

.motordesk-additional-options.expanded {
    max-height: 2000px;
    opacity: 1;
    transition: max-height 0.5s ease-in, opacity 0.3s ease-in;
}

.motordesk-view-more-btn {
    background: transparent;
    color: #2568b0;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin: 0;
}

.motordesk-view-more-btn .arrow {
    transition: transform 0.3s ease;
}

.motordesk-view-more-btn.expanded .arrow {
    transform: rotate(180deg);
}

input[type="submit"] {
    background: #28a745;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    width: 100%;
    transition: background-color 0.3s ease;
}

input[type="submit"]:hover {
    background: #218838;
}

.motordesk-main-fields,
.motordesk-additional-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.motordesk-range-field {
    grid-column: span 2;
}

@media (max-width: 600px) {
    .motordesk-range-field {
        grid-column: span 1;
    }
    
    .motordesk-search-range {
        flex-direction: column;
        align-items: stretch;
    }
}

.motordesk-vehicle img{
    margin: 5px;
}

.motordesk-latest {
    display: grid;
    grid-template-columns: 1fr; /* Default: mobile - 1 column */
    gap: 20px;
    margin-bottom: 30px;
}

/* Tablet (≥ 768px) */
@media (min-width: 768px) {
    .motordesk-latest {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Desktop/Laptop (≥ 1024px) */
@media (min-width: 1024px) {
    .motordesk-latest {
        grid-template-columns: repeat(4, 1fr);
    }
}

.view-button {
    display: inline-block;
    padding: 5px 14px;
    background-color: #C73D25;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    margin-top: 10px;
}
.view-button:hover {
    background-color: #1e293b;
    color: #fff;
}


/* Light Box CSS */

 .motordesk-image-resize {
        position: relative;
    }
    
    .gallery-image {
        cursor: pointer;
        transition: transform 0.3s ease, opacity 0.3s ease;
    }
    
    /* Lightbox Styles */
    .lightbox-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.9);
        z-index: 9999;
        justify-content: center;
        align-items: center;
    }
    
    .lightbox-container {
        position: relative;
        max-width: 90%;
        max-height: 90%;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    
    .lightbox-image {
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
        border-radius: 8px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    }
    
    .lightbox-nav {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        background: rgba(255, 255, 255, 0.1);
        border: 2px solid rgba(255, 255, 255, 0.3);
        color: white;
        font-size: 24px;
        width: 50px;
        height: 50px;
        border-radius: 50%;
        cursor: pointer;
        display: flex;
        justify-content: center;
        align-items: center;
        transition: all 0.3s ease;
        backdrop-filter: blur(10px);
        line-height: 1;
        padding: 0;
        box-sizing: border-box;
    }
    
    .lightbox-nav:hover {
        background: rgba(255, 255, 255, 0.2);
        border-color: rgba(255, 255, 255, 0.5);
        transform: translateY(-50%) scale(1.1);
    }
    
    .lightbox-prev {
        left: 20px;
    }
    
    .lightbox-next {
        right: 20px;
    }
    
    .lightbox-close {
        position: absolute;
        top: 20px;
        right: 20px;
        background: rgba(255, 255, 255, 0.1);
        border: 2px solid rgba(255, 255, 255, 0.3);
        color: white;
        font-size: 24px;
        width: 50px;
        height: 50px;
        border-radius: 50%;
        cursor: pointer;
        display: flex;
        justify-content: center;
        align-items: center;
        transition: all 0.3s ease;
        backdrop-filter: blur(10px);
        line-height: 1;
        padding: 0;
        box-sizing: border-box;
    }
    
    .lightbox-close:hover {
        background: rgba(255, 255, 255, 0.2);
        border-color: rgba(255, 255, 255, 0.5);
        transform: scale(1.1);
    }
    
    .lightbox-counter {
        position: absolute;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        color: white;
        background: rgba(0, 0, 0, 0.5);
        padding: 8px 16px;
        border-radius: 20px;
        font-size: 14px;
        backdrop-filter: blur(10px);
    }
    
    .lightbox-loading {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        color: white;
        font-size: 18px;
    }
    
    /* Mobile responsiveness */
    @media (max-width: 768px) {
        .lightbox-nav, .lightbox-close {
            width: 40px;
            height: 40px;
            font-size: 18px;
        }
        
        .lightbox-prev {
            left: 10px;
        }
        
        .lightbox-next {
            right: 10px;
        }
        
        .lightbox-close {
            top: 10px;
            right: 10px;
        }
        
        .lightbox-counter {
            bottom: 10px;
            font-size: 12px;
            padding: 6px 12px;
        }
    }