/* Vehicle Stock Manager - Frontend Styles */

:root {
    --vsm-primary: #84c225;
    --vsm-secondary: #333;
    --vsm-text: #4a4a4a;
    --vsm-border: #e0e0e0;
    --vsm-bg-light: #f7f7f7;
    --vsm-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Container */
.vsm-listing-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Filters Section */
.vsm-filters-section {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: var(--vsm-shadow);
    margin-bottom: 30px;
    transition: all 0.3s ease;
}

.vsm-filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.vsm-filters-title {
    font-size: 22px;
    margin: 0;
    color: var(--vsm-secondary);
}

.vsm-filters-toggle {
    background: transparent;
    border: 2px solid #e0e0e0;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.vsm-filters-toggle:hover {
    background: #f5f5f5;
    border-color: #2271b1;
}

.vsm-filters-toggle .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    color: #666;
    transition: transform 0.3s ease;
}

.vsm-filters-toggle:hover .dashicons {
    color: #2271b1;
}

/* État collapsed */
.vsm-filters-section.collapsed .vsm-filters-content {
    display: none;
}

.vsm-filters-section.collapsed .vsm-filters-toggle .dashicons {
    transform: rotate(180deg);
}

.vsm-filters-section.collapsed {
    padding: 20px 30px;
}

.vsm-filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.vsm-filter-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--vsm-secondary);
    font-size: 14px;
}

.vsm-filter {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--vsm-border);
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.vsm-filter:focus {
    outline: none;
    border-color: var(--vsm-primary);
}

.vsm-price-range {
    display: flex;
    align-items: center;
    gap: 10px;
}

.vsm-price-range input {
    flex: 1;
}

.vsm-filter-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* Promo Section */
.vsm-promo-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--vsm-border);
}

.vsm-promo-section label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--vsm-secondary);
}

.vsm-promo-input-group {
    display: flex;
    gap: 10px;
    max-width: 400px;
}

#vsm-promo-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid var(--vsm-border);
    border-radius: 4px;
}

#vsm-promo-message {
    margin-top: 10px;
    padding: 10px;
    border-radius: 4px;
    display: none;
}

#vsm-promo-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

#vsm-promo-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

/* Buttons */
.vsm-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.vsm-btn-primary {
    background: var(--vsm-primary);
    color: #fff;
}

.vsm-btn-primary:hover {
    background: #72a820;
    transform: translateY(-1px);
}

.vsm-btn-secondary {
    background: #fff;
    color: var(--vsm-secondary);
    border: 1px solid var(--vsm-border);
}

.vsm-btn-secondary:hover {
    background: var(--vsm-bg-light);
}

.vsm-btn-promo {
    background: var(--vsm-primary);
    color: #fff;
    padding: 10px 20px;
}

.vsm-btn-large {
    padding: 15px 30px;
    font-size: 16px;
    width: 100%;
}

/* Results Section */
.vsm-results-section {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: var(--vsm-shadow);
}

.vsm-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.vsm-results-header h2 {
    margin: 0;
    font-size: 20px;
    color: var(--vsm-secondary);
}

#vsm-results-count {
    color: var(--vsm-primary);
    font-weight: bold;
}

.vsm-sort {
    display: flex;
    align-items: center;
    gap: 10px;
}

.vsm-sort label {
    font-weight: 600;
    color: var(--vsm-secondary);
    font-size: 14px;
}

#vsm-sort-select {
    padding: 8px 12px;
    border: 1px solid var(--vsm-border);
    border-radius: 4px;
    font-size: 14px;
}

/* Vehicles Grid */
.vsm-vehicles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

.vsm-vehicle-card {
    background: #fff;
    border: 1px solid var(--vsm-border);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s;
    cursor: pointer;
}

.vsm-vehicle-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateY(-3px);
}

.vsm-vehicle-photo {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: var(--vsm-bg-light);
}

.vsm-vehicle-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.vsm-vehicle-card:hover .vsm-vehicle-photo img {
    transform: scale(1.05);
}

.vsm-vehicle-favorite {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255,255,255,0.9);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
}

.vsm-vehicle-favorite:hover {
    background: #fff;
    transform: scale(1.1);
}

.vsm-vehicle-body {
    padding: 20px;
}

.vsm-vehicle-brand {
    font-size: 12px;
    color: var(--vsm-primary);
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.vsm-vehicle-model {
    font-size: 18px;
    font-weight: bold;
    color: var(--vsm-secondary);
    margin-bottom: 10px;
}

.vsm-vehicle-engine {
    font-size: 13px;
    color: var(--vsm-text);
    margin-bottom: 15px;
}

.vsm-vehicle-specs {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 13px;
    color: var(--vsm-text);
}

.vsm-vehicle-price {
    font-size: 24px;
    font-weight: bold;
    color: var(--vsm-secondary);
}

.vsm-vehicle-price-label {
    font-size: 12px;
    color: var(--vsm-text);
    display: block;
    margin-bottom: 5px;
}

.vsm-vehicle-monthly {
    margin-top: 10px;
    padding: 10px;
    background: var(--vsm-bg-light);
    border-radius: 4px;
    display: none;
}

.vsm-vehicle-monthly.show {
    display: block;
}

.vsm-vehicle-monthly-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--vsm-primary);
}

/* Loading & Empty States */
.vsm-loading-state, .vsm-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--vsm-text);
}

.vsm-empty-state {
    font-size: 16px;
}

/* Detail Page */
.vsm-detail-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.vsm-detail-back {
    margin-bottom: 20px;
}

.vsm-back-link {
    color: var(--vsm-primary);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.vsm-back-link:hover {
    text-decoration: underline;
}

.vsm-detail-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

/* Gallery */
.vsm-detail-gallery {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: var(--vsm-shadow);
}

.vsm-main-photo {
    width: 100%;
    height: 400px;
    background: var(--vsm-bg-light);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 15px;
}

.vsm-main-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.vsm-photo-thumbnails {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
}

.vsm-thumbnail {
    height: 60px;
    border: 2px solid transparent;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s;
}

.vsm-thumbnail.active {
    border-color: var(--vsm-primary);
}

.vsm-thumbnail:hover {
    border-color: var(--vsm-primary);
    opacity: 0.8;
}

.vsm-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Detail Info */
.vsm-detail-info {
    background: #fff;
    border-radius: 8px;
    padding: 30px;
    box-shadow: var(--vsm-shadow);
}

.vsm-detail-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--vsm-border);
}

.vsm-brand {
    font-size: 14px;
    color: var(--vsm-primary);
    font-weight: 600;
    text-transform: uppercase;
    margin: 0 0 10px 0;
}

.vsm-model {
    font-size: 32px;
    font-weight: bold;
    color: var(--vsm-secondary);
    margin: 0 0 10px 0;
    line-height: 1.2;
}

.vsm-engine {
    font-size: 16px;
    color: var(--vsm-text);
    margin: 0;
}

.vsm-detail-specs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.vsm-spec-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.vsm-spec-label {
    font-size: 12px;
    color: var(--vsm-text);
    text-transform: uppercase;
    font-weight: 600;
}

.vsm-spec-value {
    font-size: 18px;
    color: var(--vsm-secondary);
    font-weight: 600;
}

.vsm-detail-options {
    margin-bottom: 30px;
    padding: 20px;
    background: var(--vsm-bg-light);
    border-radius: 8px;
}

.vsm-detail-options h3 {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: var(--vsm-secondary);
}

.vsm-detail-price-section {
    margin-bottom: 30px;
    padding: 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    color: #fff;
}

.vsm-price-box {
    margin-bottom: 15px;
}

.vsm-price-label {
    display: block;
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 5px;
}

.vsm-price-value {
    display: block;
    font-size: 36px;
    font-weight: bold;
    line-height: 1;
}

.vsm-price-vat {
    font-size: 14px;
    opacity: 0.9;
}

.vsm-monthly-payment {
    padding: 15px;
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
    margin-top: 15px;
}

.vsm-monthly-label {
    display: block;
    font-size: 13px;
    opacity: 0.9;
    margin-bottom: 5px;
}

.vsm-monthly-value {
    display: block;
    font-size: 24px;
    font-weight: bold;
}

.vsm-detail-promo {
    margin-top: 20px;
}

.vsm-detail-promo input {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 4px;
    margin-bottom: 10px;
}

#vsm-detail-promo-message {
    padding: 10px;
    border-radius: 4px;
    margin-top: 10px;
    display: none;
}

#vsm-detail-promo-message.success {
    background: rgba(255,255,255,0.3);
    display: block;
}

#vsm-detail-promo-message.error {
    background: rgba(255,0,0,0.2);
    display: block;
}

.vsm-detail-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.vsm-detail-actions .vsm-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.vsm-detail-actions .vsm-btn .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.vsm-detail-location, .vsm-detail-dealer {
    padding: 15px;
    background: var(--vsm-bg-light);
    border-radius: 4px;
    margin-bottom: 10px;
}

/* Technical Sheet */
.vsm-detail-technical {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: var(--vsm-shadow);
}

.vsm-detail-technical h2 {
    margin: 0 0 20px 0;
    font-size: 22px;
    color: var(--vsm-secondary);
}

.vsm-technical-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.vsm-technical-item {
    padding: 15px;
    border: 1px solid var(--vsm-border);
    border-radius: 4px;
}

.vsm-technical-label {
    display: block;
    font-size: 12px;
    color: var(--vsm-text);
    text-transform: uppercase;
    margin-bottom: 5px;
    font-weight: 600;
}

.vsm-technical-value {
    display: block;
    font-size: 16px;
    color: var(--vsm-secondary);
    font-weight: 600;
}

/* Responsive */
@media screen and (max-width: 1024px) {
    .vsm-detail-content {
        grid-template-columns: 1fr;
    }
    
    .vsm-detail-actions {
        grid-template-columns: 1fr;
    }
}

@media screen and (max-width: 768px) {
    .vsm-filters-grid {
        grid-template-columns: 1fr;
    }
    
    .vsm-results-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .vsm-vehicles-grid {
        grid-template-columns: 1fr;
    }
    
    .vsm-detail-specs {
        grid-template-columns: 1fr;
    }
    
    .vsm-technical-grid {
        grid-template-columns: 1fr;
    }
    
    .vsm-detail-actions {
        grid-template-columns: 1fr;
    }
    
    .vsm-filter-actions {
        flex-direction: column;
    }
    

/* Layout avec filtres positionnables */
.vsm-filter-left, .vsm-filter-right {
    display: flex !important;
    gap: 30px !important;
    align-items: flex-start !important;
}

.vsm-filter-left .vsm-filters-section {
    flex: 0 0 300px !important;
    order: 1 !important;
}

.vsm-filter-left .vsm-content-wrapper {
    flex: 1 !important;
    order: 2 !important;
}

.vsm-filter-right .vsm-filters-section {
    flex: 0 0 300px !important;
    order: 2 !important;
}

.vsm-filter-right .vsm-content-wrapper {
    flex: 1 !important;
    order: 1 !important;
}

.vsm-filter-top .vsm-filters-section {
    margin-bottom: 30px;
}

/* Nombre de véhicules par ligne */
.vsm-vehicles-per-row-2 {
    grid-template-columns: repeat(2, 1fr) !important;
}

.vsm-vehicles-per-row-3 {
    grid-template-columns: repeat(3, 1fr) !important;
}

.vsm-vehicles-per-row-4 {
    grid-template-columns: repeat(4, 1fr) !important;
}

.vsm-vehicles-per-row-5 {
    grid-template-columns: repeat(5, 1fr) !important;
}

@media screen and (max-width: 1400px) {
    .vsm-vehicles-per-row-5 {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}

@media screen and (max-width: 1200px) {
    .vsm-vehicles-per-row-4,
    .vsm-vehicles-per-row-5 {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media screen and (max-width: 1024px) {
    .vsm-filter-left, .vsm-filter-right {
        flex-direction: column;
    }
    
    .vsm-filter-left .vsm-filters-section,
    .vsm-filter-right .vsm-filters-section {
        flex: 1 1 auto;
        width: 100%;
        order: 1 !important;
    }
    
    .vsm-filter-left .vsm-content-wrapper,
    .vsm-filter-right .vsm-content-wrapper {
        order: 2 !important;
    }
}

@media screen and (max-width: 900px) {
    .vsm-vehicles-per-row-2,
    .vsm-vehicles-per-row-3,
    .vsm-vehicles-per-row-4,
    .vsm-vehicles-per-row-5 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media screen and (max-width: 600px) {
    .vsm-vehicles-per-row-2,
    .vsm-vehicles-per-row-3,
    .vsm-vehicles-per-row-4,
    .vsm-vehicles-per-row-5 {
        grid-template-columns: repeat(1, 1fr) !important;
    }
}



/* Modal styles for promo popup - Centrage parfait */
.vsm-modal {
    position: fixed;
    z-index: 100000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    overflow-y: auto;
}

.vsm-modal.vsm-show {
    display: flex !important;
    opacity: 1 !important;
}

.vsm-modal-content {
    background-color: #fefefe;
    padding: 30px;
    border: 1px solid #888;
    border-radius: 8px;
    width: 90%;
    max-width: 450px;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin: 20px;
}

.vsm-close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    line-height: 20px;
    cursor: pointer;
}

.vsm-close:hover,
.vsm-close:focus {
    color: #000;
}

/* Popup promo code */
#vsm-promo-popup .vsm-modal-content {
    position: relative;
    text-align: center;
}
#vsm-promo-popup .vsm-modal-content {
    position: relative;
    text-align: center;
}
#vsm-promo-popup .vsm-modal-content {
    position: relative;
    text-align: center;
}

#vsm-promo-popup h2 {
    margin-top: 0;
    color: #333;
}

#vsm-promo-popup .vsm-promo-input {
    display: block;
    margin: 20px 0;
}

#vsm-promo-popup .vsm-promo-input input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    box-sizing: border-box;
    margin-bottom: 15px;
}

#vsm-promo-popup .vsm-promo-input button {
    width: 100%;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

#vsm-popup-promo-message {
    margin-top: 15px;
    padding: 10px;
    border-radius: 4px;
    display: none;
}

#vsm-popup-promo-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

#vsm-popup-promo-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Raccourcis dates limites */
.vsm-deadline-shortcuts {
    display: flex;
    gap: 5px;
    margin-top: 8px;
}

.vsm-btn-small {
    padding: 4px 10px;
    font-size: 12px;
    line-height: 1.4;
}

.vsm-deadline-shortcuts .vsm-btn {
    flex: 1;
}

.vsm-filter-group input[type="date"] {
    padding: 8px;
    font-size: 14px;
}

/* Proximity Filter Styles */
.vsm-proximity-filter {
    position: relative;
}

.vsm-proximity-search {
    position: relative;
    margin-bottom: 10px;
}

.vsm-proximity-input {
    width: 100%;
    padding: 10px 10px 10px 35px;
    border: 2px solid #ddd;
    border-radius: 25px;
    font-size: 14px;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"></path><circle cx="12" cy="10" r="3"></circle></svg>') no-repeat 10px center;
    background-size: 18px;
}

.vsm-proximity-input:focus {
    outline: none;
    border-color: var(--vsm-primary);
}

.vsm-proximity-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    margin-top: 5px;
}

.vsm-proximity-suggestion-item {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.vsm-proximity-suggestion-item:hover {
    background: #f8f9fa;
}

.vsm-proximity-suggestion-item:last-child {
    border-bottom: none;
}

.vsm-proximity-suggestion-icon {
    width: 18px;
    height: 18px;
    opacity: 0.6;
}

.vsm-proximity-suggestion-text {
    flex: 1;
}

.vsm-proximity-suggestion-main {
    font-weight: 600;
    color: #333;
}

.vsm-proximity-suggestion-sub {
    font-size: 12px;
    color: #666;
    margin-top: 2px;
}

.vsm-proximity-selected {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-top: 10px;
}

.vsm-proximity-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--vsm-primary);
    color: white;
    border-radius: 20px;
    font-size: 14px;
    margin-bottom: 15px;
}

.vsm-proximity-remove {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.vsm-proximity-remove:hover {
    background: rgba(255,255,255,0.2);
}

.vsm-proximity-radius {
    margin-bottom: 15px;
}

.vsm-proximity-radius label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #333;
}

#vsm-radius-value {
    color: var(--vsm-primary);
    font-weight: 700;
}

.vsm-proximity-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
}

.vsm-proximity-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--vsm-primary);
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.vsm-proximity-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--vsm-primary);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.vsm-radius-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

.vsm-proximity-map {
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #ddd;
}

.vsm-proximity-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.vsm-proximity-actions .vsm-btn {
    flex: 1;
}

/* Responsive Proximity Filter */
@media screen and (max-width: 768px) {
    .vsm-proximity-map {
        height: 150px !important;
    }
    
    .vsm-proximity-input {
        font-size: 16px; /* Éviter zoom iOS */
    }
}

/* === Proximity Filter Styles === */
.vsm-proximity-filter {
    margin-bottom: 15px;
}

.vsm-proximity-input-wrapper {
    position: relative;
}

.vsm-proximity-input {
    width: 100%;
    padding: 12px 40px 12px 40px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.vsm-proximity-input::placeholder {
    color: #999;
}

.vsm-proximity-input:focus {
    outline: none;
    border-color: var(--vsm-primary);
}

.vsm-proximity-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: #666;
}

.vsm-proximity-clear-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    background: #ccc;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    line-height: 1;
}

.vsm-proximity-clear-icon:hover {
    background: #999;
}

.vsm-proximity-suggestions {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.vsm-proximity-suggestions.active {
    display: block;
}

.vsm-proximity-suggestion {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f5f5f5;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    transition: background 0.2s;
}

.vsm-proximity-suggestion:last-child {
    border-bottom: none;
}

.vsm-proximity-suggestion:hover {
    background: #f8f9fa;
}

.vsm-proximity-suggestion-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: #666;
    margin-top: 2px;
}

.vsm-proximity-suggestion-content {
    flex: 1;
    min-width: 0;
}

.vsm-proximity-suggestion-name {
    font-weight: 600;
    color: #333;
    font-size: 14px;
    margin-bottom: 2px;
}

.vsm-proximity-suggestion-detail {
    font-size: 12px;
    color: #666;
}

.vsm-proximity-selected-location {
    margin: 15px 0;
    padding: 12px 16px;
    background: #e3f2fd;
    border-radius: 8px;
    display: none;
    align-items: center;
    gap: 10px;
}

.vsm-proximity-selected-location.active {
    display: flex;
}

.vsm-proximity-selected-text {
    flex: 1;
    min-width: 0;
}

.vsm-proximity-selected-name {
    font-weight: 600;
    color: #1976d2;
    font-size: 14px;
}

.vsm-proximity-selected-remove {
    background: none;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1976d2;
    font-size: 18px;
    flex-shrink: 0;
    transition: background 0.2s;
}

.vsm-proximity-selected-remove:hover {
    background: rgba(25, 118, 210, 0.1);
}

.vsm-proximity-radius {
    margin-top: 15px;
}

.vsm-proximity-radius-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 14px;
    color: #333;
}

.vsm-proximity-radius-value {
    font-weight: 700;
    color: var(--vsm-primary);
}

.vsm-proximity-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(to right, var(--vsm-primary) 0%, #e0e0e0 0%);
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.vsm-proximity-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--vsm-primary);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    transition: transform 0.2s;
}

.vsm-proximity-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.vsm-proximity-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--vsm-primary);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.vsm-proximity-range-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #999;
    margin-top: 5px;
}

.vsm-proximity-map {
    width: 100%;
    height: 200px;
    border-radius: 8px;
    overflow: hidden;
    margin-top: 15px;
    border: 1px solid #e0e0e0;
    display: none;
}

.vsm-proximity-map.active {
    display: block;
}

.vsm-proximity-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.vsm-proximity-btn {
    flex: 1;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.vsm-proximity-btn-clear {
    background: #f5f5f5;
    color: #666;
}

.vsm-proximity-btn-clear:hover {
    background: #e0e0e0;
}

.vsm-proximity-btn-validate {
    background: var(--vsm-primary);
    color: white;
}

.vsm-proximity-btn-validate:hover {
    opacity: 0.9;
}

/* Mobile responsive */
@media screen and (max-width: 768px) {
    .vsm-proximity-map {
        height: 150px;
    }
    
    .vsm-proximity-input {
        font-size: 16px; /* Éviter zoom iOS */
    }
    
    .vsm-filters-header {
        margin-bottom: 15px;
    }
    
    .vsm-filters-title {
        font-size: 18px;
    }
    
    .vsm-filters-toggle {
        width: 32px;
        height: 32px;
    }
    
    .vsm-filters-toggle .dashicons {
        font-size: 18px;
        width: 18px;
        height: 18px;
    }
}

/* Concessionnaire dans carte véhicule */
.vsm-vehicle-dealership {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
    font-size: 13px;
    color: #666;
}

.vsm-vehicle-dealership .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    vertical-align: middle;
    margin-right: 4px;
}

.vsm-show-dealership-map {
    color: #2271b1;
    text-decoration: none;
    transition: color 0.2s;
}

.vsm-show-dealership-map:hover {
    color: #135e96;
    text-decoration: underline;
}

/* Modale carte */
.vsm-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100000;
}

.vsm-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
}

.vsm-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
}

.vsm-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #eee;
}

.vsm-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.vsm-modal-close {
    background: none;
    border: none;
    font-size: 32px;
    line-height: 1;
    color: #999;
    cursor: pointer;
    transition: color 0.2s;
    padding: 0;
    width: 32px;
    height: 32px;
}

.vsm-modal-close:hover {
    color: #333;
}

.vsm-modal-body {
    padding: 0;
}

#vsm-map-canvas {
    width: 100%;
    height: 400px;
}

/* Leaflet popup custom */
.leaflet-popup-content-wrapper {
    border-radius: 8px;
}

.leaflet-popup-content {
    margin: 15px;
    font-family: inherit;
}

.leaflet-popup-content b {
    display: block;
    margin-bottom: 8px;
    font-size: 15px;
}

.leaflet-popup-content a {
    display: inline-block;
    padding: 6px 12px;
    background: #2271b1;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 13px;
    transition: background 0.2s;
}

.leaflet-popup-content a:hover {
    background: #135e96;
}

/* Responsive modale */
@media (max-width: 768px) {
    .vsm-modal-content {
        width: 95%;
        max-height: 95vh;
    }
    
    #vsm-map-canvas {
        height: 300px;
    }
    
    .vsm-modal-header {
        padding: 15px 20px;
    }
    
    .vsm-modal-header h3 {
        font-size: 18px;
    }
}

/* ========== VUE GRILLE / CARTE ========== */

/* Contrôles de vue */
.vsm-view-controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

.vsm-view-switcher {
    display: flex;
    gap: 4px;
    background: #f5f5f5;
    padding: 4px;
    border-radius: 8px;
}

.vsm-view-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
    color: #666;
}

.vsm-view-btn .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.vsm-view-btn:hover {
    background: #e0e0e0;
    color: #333;
}

.vsm-view-btn.active {
    background: #2271b1;
    color: white;
}

.vsm-view-btn.active:hover {
    background: #135e96;
}

/* Conteneur carte */
.vsm-vehicles-map {
    width: 100%;
    height: 600px !important;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

#vsm-map-container {
    width: 100%;
    height: 100%;
}

/* Marqueurs personnalisés */
/* Marqueurs wrapper */
.vsm-map-marker-wrapper {
    background: transparent !important;
    border: none !important;
}

/* Marqueurs personnalisés (fallback si inline ne marche pas) */
.vsm-map-marker,
.vsm-map-marker-wrapper > div {
    background: #2271b1 !important;
    border: 3px solid white !important;
    border-radius: 50% !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 40px !important;
    height: 40px !important;
    color: white !important;
    font-weight: bold !important;
    font-size: 16px !important;
    line-height: 1 !important;
    cursor: pointer !important;
}

.vsm-marker-inner {
    color: white !important;
    font-weight: bold !important;
    font-size: 16px !important;
    text-align: center !important;
    line-height: 1 !important;
    pointer-events: none;
}

/* Clusters de marqueurs */
.marker-cluster-small {
    background-color: rgba(34, 113, 177, 0.6);
}

.marker-cluster-small div {
    background-color: rgba(34, 113, 177, 0.8);
}

.marker-cluster-medium {
    background-color: rgba(34, 113, 177, 0.6);
}

.marker-cluster-medium div {
    background-color: rgba(34, 113, 177, 0.8);
}

.marker-cluster-large {
    background-color: rgba(34, 113, 177, 0.6);
}

.marker-cluster-large div {
    background-color: rgba(34, 113, 177, 0.8);
}

.marker-cluster {
    border-radius: 50% !important;
}

.marker-cluster div {
    border-radius: 50% !important;
    color: white;
    font-weight: bold;
    text-align: center;
    font-size: 14px;
}

/* Popup carte */
.vsm-map-popup {
    padding: 0;
    min-width: 280px;
}

.vsm-map-popup h4 {
    margin: 0 0 12px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #2271b1;
    font-size: 16px;
    color: #333;
}

.vsm-map-vehicles {
    max-height: 400px;
    overflow-y: auto;
}

.vsm-map-vehicle {
    display: flex;
    gap: 12px;
    padding: 10px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background 0.2s;
}

.vsm-map-vehicle:last-child {
    border-bottom: none;
}

.vsm-map-vehicle:hover {
    background: #f8f9fa;
}

.vsm-map-vehicle img {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.vsm-map-vehicle-info {
    flex: 1;
    min-width: 0;
}

.vsm-map-vehicle-info strong {
    display: block;
    margin-bottom: 4px;
    font-size: 14px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vsm-map-vehicle-info span {
    font-size: 12px;
    color: #666;
}

.vsm-map-vehicle-price {
    display: block;
    margin-top: 4px;
    font-size: 14px;
    font-weight: bold;
    color: #2271b1;
}

/* Personnalisation popups Leaflet */
.leaflet-popup-content-wrapper {
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.leaflet-popup-content {
    margin: 15px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.5;
}

.leaflet-popup-tip {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Responsive */
@media (max-width: 768px) {
    .vsm-results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .vsm-view-controls {
        width: 100%;
        justify-content: space-between;
    }
    
    .vsm-vehicles-map {
        height: 500px !important;
    }
    
    .vsm-map-popup {
        min-width: 250px;
    }
    
    .vsm-map-vehicle img {
        width: 60px;
        height: 45px;
    }
    
    .vsm-view-btn {
        width: 36px;
        height: 36px;
    }
}

/* Fix pour les résultats */
.vsm-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.vsm-results-header h2 {
    margin: 0;
}
