/**
 * 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: 1.8;
    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: uppercase;
    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;
}


/* 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;
    }
}

/* 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;
}

/* Container pour l'iframe et le loader */
.cvpm-iframe-container {
    position: relative;
    min-height: 80vh;
}

/* Styles pour l'iframe */
#cvpm-van-iframe {
    width: 100%;
    min-height: 80vh;
    border: none;
    display: block;
    transition: opacity 0.4s ease;
}

/* 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;
}

/* Loader spécifique pour l'iframe */
.cvpm-iframe-loader {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    min-height: 80vh;
    z-index: 10;
    background: #fff;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
}

.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;
}

.cvpm-error p {
    color: #d32f2f;
    font-size: 16px;
    margin-bottom: 20px;
}

/* Styles pour le contenu du van dans la modale */
.cvpm-van-detail {
    padding: 20px 0;
}

.cvpm-van-detail-image {
    width: 100%;
    max-height: 500px;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 30px;
}

.cvpm-van-detail-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cvpm-van-detail-header h1 {
    color: var(--e-global-color-primary);
    font-size: 32px;
    margin: 0 0 10px 0;
    line-height: 1.2;
}

.cvpm-van-detail-subtitle {
    color: #666;
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 20px 0;
}

.cvpm-van-detail-intro {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.cvpm-van-detail-intro p {
    margin: 0;
    font-size: 16px;
    line-height: 1.6;
}

.cvpm-van-detail-description {
    margin-bottom: 30px;
}

.cvpm-van-detail-galerie {
    margin-top: 40px;
}

.cvpm-van-detail-galerie h3 {
    color: var(--e-global-color-primary);
    font-size: 24px;
    margin: 0 0 20px 0;
}

.cvpm-galerie-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.cvpm-galerie-item {
    width: 100%;
    height: 200px;
    overflow: hidden;
    border-radius: 8px;
}

.cvpm-galerie-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.cvpm-galerie-item:hover img {
    transform: scale(1.1);
}

/* Responsive modale */
@media (max-width: 768px) {
    .cvpm-van-modal-content {
        width: 95%;
        max-height: 95vh;
        margin: 2.5vh auto;
    }

    .cvpm-van-modal-body {
        padding: 15px;
    }

    .cvpm-van-modal-close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
    }

    .cvpm-van-modal-close span {
        font-size: 28px;
    }

    .cvpm-van-detail-header h1 {
        font-size: 24px;
    }

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