/**
 * Styles pour l'affichage des résultats de vans
 * Charte graphique: Primary #1F374A, Secondary #F9B022, Text #1F374A
 */

.cvpm-resultat-vans-container {
    width: 100%;
    margin: 20px 0;
}

/* Info de recherche */
.cvpm-search-info {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.cvpm-search-info h2 {
    color: var(--e-global-color-primary);
    margin-bottom: 15px;
    font-size: 24px;
}

.cvpm-search-params {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.cvpm-search-params .cvpm-param {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 15px;
    background: #fff;
    border-radius: 6px;
    font-size: 14px;
}

.cvpm-search-params .cvpm-param strong {
    color: var(--e-global-color-primary);
}

/* Grille de vans - 2 blocs par ligne */
.cvpm-vans-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    margin-bottom: 30px;
}

/* Carte de van - Pas de border-radius ni shadow */
.cvpm-van-card {
    background: #fff;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Galerie slider - Ratio 1.34 paysage */
.cvpm-van-gallery {
    position: relative;
    width: 100%;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: #fce9c8;
}

.cvpm-gallery-slider {
    position: relative;
    width: 100%;
    height: 100%;
}

.cvpm-gallery-slides {
    position: relative;
    width: 100%;
    height: 100%;
}

.cvpm-gallery-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.cvpm-gallery-slide.active {
    opacity: 1;
}

.cvpm-gallery-slide img {
    width: 100%;
    height: 100%!important;
    object-fit: cover;
}

/* Flèches de navigation - #152A39 */
.cvpm-gallery-prev,
.cvpm-gallery-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: transparent!important;
    color: white!important;
    border: none!important;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
    padding: 0px!important;
}
.cvpm-gallery-prev svg,
.cvpm-gallery-next svg{
    height: 50px;
    width: 50px;
    object-fit: contain;
    object-position: center center;
}

.cvpm-gallery-prev:hover,
.cvpm-gallery-next:hover {
    opacity: 0.8;
}

.cvpm-gallery-prev {
    left: 15px;
}

.cvpm-gallery-next {
    right: 15px;
}

/* Bullet points - blancs avec border 1px solid #F9B022 */
.cvpm-gallery-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}

.cvpm-gallery-dot {
    width: 12px;
    height: 12px;
    background: #fff;
    border: 1px solid #F9B022;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.3s ease;
}

.cvpm-gallery-dot.active,
.cvpm-gallery-dot:hover {
    background: #F9B022;
}

/* Prix flottant - #F9B022 background, texte blanc */
.cvpm-van-price-tag {
    position: absolute;
    top: 0px;
    right: 0px;
    background: #F9B022;
    color: #fff;
    padding: 12px 20px;
    font-size: 20px;
    font-weight: 700;
    z-index: 10;
}

/* Bloc d'informations - #F2F3F5 background */
.cvpm-van-info {
    background: #F2F3F5;
    padding: 25px 25px 0;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

/* Titre - #152A39 */
.cvpm-van-title {
    color: #152A39;
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 20px 0;
    line-height: 1.3;
}

/* Caractéristiques sur 2 colonnes */
.cvpm-van-caracteristiques {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin: 0 0 25px 0;
}

.cvpm-caracteristique {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #152A39;
}

.cvpm-caracteristique-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #F9B022;
    font-weight: 700;
}

/* Style pour les images de caractéristiques */
img.cvpm-caracteristique-icon {
    width: 30px!important;
    height: 30px!important;
    object-fit: contain;
}

.cvpm-caracteristique-text {
    flex: 1;
    font-weight: 600;
}

.cvpm-van-separate{
    flex:1;
}

/* Boutons d'action - 2 boutons 50% chacun */
.cvpm-van-actions {
    margin: 0 -25px;
    display: flex;
}

.cvpm-van-actions .cvpm-btn {
    flex: 1;
    padding: 14px 20px!important;
    color: #fff;
    text-align: center;
    border: none;
    font-size: 15px!important;
    font-weight: 700;
    text-decoration: none;
    text-transform: initial!important;
    letter-spacing: 0.5px;
    transition: opacity 0.3s ease;
    cursor: pointer;
}

/* Bouton "Détails du Van" - #152A39 */
.cvpm-btn-details {
    background: #152A39!important;
}

/* Bouton "Je réserve" - #F9B022 */
.cvpm-van-actions .cvpm-btn-reserver, .cvpm-van-actions .cvpm-btn-reserver:hover {
    background: #F9B022!important;
    font-size: 18px!important;
}

.cvpm-van-actions .cvpm-btn:hover {
    opacity: 0.8;
}

/* État Indisponible / Dates non choisies */
.cvpm-van-unavailable,
.cvpm-van-no-dates {
    position: relative;
}

.cvpm-van-unavailable .cvpm-van-gallery,
.cvpm-van-no-dates .cvpm-van-gallery,
.cvpm-van-unavailable .cvpm-van-info,
.cvpm-van-no-dates .cvpm-van-info {
    filter: grayscale(1);
    opacity: 0.7;
}

/* Badge en haut à gauche */
.cvpm-van-unavailable-badge {
    position: absolute;
    top: 0;
    left: 0;
    background: #152A39;
    color: #fff;
    padding: 8px 15px;
    font-size: 13px;
    font-weight: 700;
    z-index: 20;
    text-transform: uppercase;
}

.cvpm-badge-no-dates {
    background: #666;
}

/* Overlay central */
.cvpm-van-unavailable-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 30;
    padding: 20px;
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    pointer-events: none;
}

.cvpm-overlay-no-dates {
    /* Un peu plus clair pour les dates manquantes */
}

.cvpm-overlay-msg {
    color: #152A39;
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 15px;
    background: rgba(255, 255, 255, 0.9);
    padding: 10px 15px;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.cvpm-van-unavailable-overlay .cvpm-btn {
    pointer-events: auto; /* Réactiver les clics sur le bouton de l'overlay */
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.cvpm-van-unavailable-overlay .cvpm-btn-see-dates {
    background: #F9B022!important;
    color: #fff!important;
    border: none!important;
    padding: 12px 25px!important;
    font-weight: 700!important;
    border-radius: 4px!important;
    cursor: pointer!important;
}

/* Compteur de résultats */
.cvpm-vans-count {
    text-align: center;
    padding: 20px;
    font-size: 16px;
    color: #666;
}

.cvpm-vans-count p {
    margin: 0;
    font-weight: 600;
}

/* Aucun résultat */
.cvpm-no-results {
    text-align: center;
    padding: 60px 20px;
    background: #f8f9fa;
    border-radius: 12px;
}

.cvpm-no-results p {
    font-size: 18px;
    color: #666;
    margin: 0 0 20px 0;
}

.cvpm-no-results .cvpm-btn {
    display: inline-block;
    padding: 12px 30px;
    background: var(--e-global-color-primary);
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: opacity 0.3s ease;
}

.cvpm-no-results .cvpm-btn:hover {
    opacity: 0.6;
}

/* Responsive */
@media (max-width: 768px) {
    .cvpm-vans-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .cvpm-search-params {
        flex-direction: column;
        gap: 10px;
    }

    .cvpm-search-params .cvpm-param {
        width: 100%;
    }

    .cvpm-van-gallery {
        aspect-ratio: 1.9;
    }

    .cvpm-van-title {
        font-size: 20px;
    }

    .cvpm-van-caracteristiques {
        grid-template-columns: 1fr;
    }

    .cvpm-van-actions {
        flex-direction: column;
    }

    .cvpm-gallery-prev,
    .cvpm-gallery-next {
        width: 40px;
        height: 40px;
    }

    .cvpm-gallery-prev {
        left: 10px;
    }

    .cvpm-gallery-next {
        right: 10px;
    }

    .cvpm-van-price-tag {
        padding: 10px 15px;
        font-size: 16px;
    }

    .cvpm-van-actions .cvpm-btn{
        margin:0!important;
    }

    /* Réduire la taille des bullets sur mobile */
    .cvpm-gallery-dots {
        bottom: 10px;
        gap: 6px;
    }

    .cvpm-gallery-dot {
        width: 8px;
        height: 8px;
    }
}

/* Modale */
.cvpm-van-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
}

.cvpm-van-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.cvpm-van-modal-content {
    position: relative;
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    margin: 5vh auto;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 1000000;
}

.cvpm-van-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 45px!important;
    height: 45px!important;
    background: rgba(255, 255, 255, 0.95);
    border: none!important;
    border-radius: 50%!important;
    cursor: pointer!important;
    z-index: 1000001;
    display: flex!important;
    padding: 0!important;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.cvpm-van-modal-close:hover {
    background: var(--e-global-color-primary);
    transform: rotate(90deg);
}

.cvpm-van-modal-close span {
    font-size: 32px;
    line-height: 1;
    color: #333;
    font-weight: 300;
}

.cvpm-van-modal-close:hover span {
    color: #fff;
}

.cvpm-van-modal-body {
    max-height: 90vh;
    overflow-y: auto;
    padding: 0;
    position: relative;
}

/* Empêcher le scroll du body quand la modale est ouverte */
body.cvpm-modal-open {
    overflow: hidden;
}

/* Styles du loader */
.cvpm-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    min-height: 40vh;
}

.cvpm-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--e-global-color-primary);
    border-radius: 50%;
    animation: cvpm-spin 1s linear infinite;
}

@keyframes cvpm-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.cvpm-loading p {
    margin-top: 20px;
    color: #666;
    font-size: 16px;
}

/* Message d'erreur */
.cvpm-error {
    padding: 40px 20px;
    text-align: center;
}

/* ===== NOUVEAUX STYLES MODALE DÉTAIL ===== */

.cvpm-van-detail-content {
    padding: 40px;
    max-width: 100%;
}

/* Header */
.cvpm-detail-header {
    text-align: left;
    margin-bottom: 40px;
    border-left: 4px solid var(--e-global-color-secondary);
    padding-left: 20px;
}

.cvpm-detail-title {
    color: #1F374A;
    font-size: 36px;
    margin: 0 0 10px;
}

.cvpm-detail-subtitle {
    font-size: 18px;
    color: #555;
    margin-bottom: 10px;
}

.cvpm-detail-agence {
    display: inline-block;
    background: var(--e-global-color-primary);
    color: #fff;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Slider Galerie dans la modale */
.cvpm-detail-gallery-container {
    width: 100%;
    margin-bottom: 40px;
}

.cvpm-modal-slider {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 12px;
}

.cvpm-modal-slider-track {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

.cvpm-modal-slider-track::-webkit-scrollbar {
    display: none; /* Chrome, Safari and Opera */
}

.cvpm-modal-slider-item {
    flex: 0 0 50%; /* 2 images per view */
    scroll-snap-align: start;
    padding: 0 5px;
    height: 280px; /* Reduit à 280px comme demandé */
}

.cvpm-modal-slider-item img {
    width: 100%!important;
    height: 100%!important; /* Force la hauteur à 100% */
    object-fit: cover; /* Remplit tout en gardant le ratio */
    border-radius: 8px;
    display: block;
}

.cvpm-modal-slider-prev,
.cvpm-modal-slider-next {
    position: absolute!important;
    padding: 0!important;
    top: 50%!important;
    transform: translateY(-50%)!important;
    border: none!important;
    width: 40px!important;
    height: 40px!important;
    border-radius: 50%!important;
    cursor: pointer!important;
    font-size: 20px!important;
    display: flex!important;
    align-items: center!important;
    justify-content: center!important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2)!important;
    z-index: 10!important;
}

.cvpm-modal-slider-prev { left: 15px; }
.cvpm-modal-slider-next { right: 15px; }

/* Main Layout: Description */
.cvpm-detail-main-grid {
    display: block;
    margin-bottom: 50px;
}

.cvpm-detail-description {
    width: 100%;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    margin-bottom: 30px;
}

.cvpm-detail-description p {
    margin-bottom: 15px;
}

/* Specs Sections Full Width */
.cvpm-detail-specs {
    display: block;
}

.cvpm-spec-section {
    background: #fff;
    padding: 20px 0;
    border-radius: 0;
    margin-bottom: 30px;
    width: 100%;
}

.cvpm-spec-title {
    font-size: 24px;
    color: #1F374A;
    margin-bottom: 25px;
    border-bottom: 2px solid var(--e-global-color-secondary);
    padding-bottom: 10px;
    display: block;
    width: 100%;
}

.cvpm-spec-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.cvpm-spec-item {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
    padding: 10px 0;
    border-bottom: 1px dashed #eee;
}

.cvpm-spec-icon {
    width: 55px;
    height: 55px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9f9f9;
    border-radius: 50%; /* ROND comme demandé */
    border: 1px solid #eee;
    overflow: hidden;
}

.cvpm-spec-icon img {
    max-width: 70%;
    max-height: 70%;
    object-fit: contain;
}

.cvpm-spec-icon span.dashicons {
    color: var(--e-global-color-secondary);
    font-size: 24px;
}

.cvpm-spec-content {
    display: flex;
    flex-direction: column;
}

.cvpm-spec-label {
    font-size: 13px;
    color: #777;
    text-transform: uppercase;
    margin-bottom: 2px;
}

.cvpm-spec-value {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

/* Included Equipments */
.cvpm-detail-included {
    background: #F9FAFB;
    padding: 40px;
    border-radius: 12px;
    margin-bottom: 40px;
    text-align: center;
    clear: both;
}

.cvpm-included-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.cvpm-included-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.cvpm-included-item img {
    width: 100px; /* 100px comme demandé */
    height: auto;
}

.cvpm-included-item span {
    font-size: 14px;
    font-weight: 600;
    color: #1F374A;
}

/* Footer Actions */
.cvpm-detail-footer-actions {
    text-align: center;
    margin-top: 40px;
    padding-bottom: 40px;
}

.cvpm-detail-footer-actions .cvpm-btn {
    display: inline-block;
    padding: 15px 60px;
    font-size: 18px;
    border-radius: 30px;
}

/* Responsive */
@media (max-width: 768px) {
    .cvpm-van-detail-content {
        padding: 20px;
    }

    .cvpm-modal-slider-item {
        flex: 0 0 100%; /* 1 image per view on mobile */
        height: 250px;
    }

    .cvpm-modal-slider-item img {
        height: 100%;
    }

    .cvpm-spec-grid {
        grid-template-columns: 1fr;
    }

    .cvpm-included-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
