/**
 * Styles pour le widget archive des logements
 */

.logement-archive-container {
    width: 100%;
}

/* Grille */
.logement-archive-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    column-gap: 20px;
    row-gap: 30px;
}

/* Card */
.logement-card {
    display: flex;
    flex-direction: column;
    background-color: #ffffff;
    border-radius: 8px;
    overflow: hidden;
}


/* Slider d'images */
.card-image-slider {
    position: relative;
    width: 100%;
    overflow: hidden;
}

/* Filtre dégradé sur le slider */
.card-image-slider::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.10) 0%, rgba(0, 0, 0, 0.10) 100%);
    border-radius: 10px;
    pointer-events: none;
    z-index: 5;
}

.card-image-slider .logement-card-glide {
    position: relative;
}

.card-image-slider .glide__track {
    overflow: hidden;
}

.card-image-slider .glide__slides {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.card-image-slider .glide__slide {
    flex-shrink: 0;
    width: 100%;
    margin: 0;
    padding: 0;
}

.card-image-slider .glide__slide img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
}

.card-image-slider .glide__slide a {
    display: block;
}

/* Flèches de navigation */
.card-image-slider .glide__arrows {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

.card-image-slider .glide__arrow {
    position: absolute;
    top: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #FFFFFF40;
    color: #ffffff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    pointer-events: all;
    transition: all 0.3s ease;
    z-index: 11;
    padding: 0;
    opacity: 1;
}

.card-image-slider .glide__arrow svg {
    width: 5px;
    height: 8px;
}

.card-image-slider .glide__arrow:hover {
    background-color: #00000078;
}

.card-image-slider .glide__arrow--left {
    left: 10px;
}

.card-image-slider .glide__arrow--right {
    right: 10px;
}

.card-image-slider .glide__arrow:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Badge Coup de cœur */
.card-image-slider .coup-de-coeur-badge {
    position: absolute;
    bottom: 0px;
    left: 0;
    background: linear-gradient(0deg, rgba(1, 60, 68, 0.10) 0%, rgba(1, 60, 68, 0.10) 100%), #FFFFFF;
    color: #013C44;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 0 8px 0 0;
    z-index: 15;
    pointer-events: none;
}

/* Contenu de la card */
.card-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

/* Nom du logement */
.logement-name {
    margin: 0 0 10px 0;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
}

.logement-name a {
    color: inherit;
    text-decoration: none;
}

/* Localisation */
.logement-location {
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 10px;
    font-size: 14px;
    color: #666;
}

.logement-location svg {
    flex-shrink: 0;
    width: 11px;
    height: 13px;
}

/* Description (Titre ACF) */
.logement-description {
    margin-top: 7px;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    border-bottom: 1px dashed #00000033;
    padding-bottom: 10px;
}

/* Infos (Couchages et Prix) */
.logement-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #333;
    margin-top: auto;
}

.logement-info .separator {
    color: #999;
}

.logement-info .prix {
    font-weight: 600;
}

/* Image placeholder */
.card-image-slider .no-image img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
}

/* Message si aucun résultat */
.logement-archive-no-results {
    padding: 60px 20px;
    text-align: center;
    background-color: #f5f5f5;
    border-radius: 8px;
}

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

/* Pagination */
.logement-archive-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 40px;
    padding: 30px 0;
    background: #013C441A;
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
}

.pagination-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    border: none;
    color: #013C44;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pagination-btn:hover {
    opacity: 0.7;
}

.pagination-btn svg {
    width: 8px;
    height: 12px;
}

.pagination-btn svg path {
    stroke: #013C44;
}

.pagination-btn:disabled,
.pagination-btn.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.pagination-numbers {
    display: flex;
    align-items: center;
    gap: 5px;
}

.pagination-number {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    background-color: transparent;
    border: none;
    color: rgba(4, 6, 8, 0.40) !important;
    text-decoration: none;
    font-family: "Gabarito", sans-serif;
    font-size: 12px;
    font-style: normal;
    font-weight: 500;
    line-height: normal;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pagination-number:hover {
    color: #013C44;
}

.pagination-number.active {
    color: #013C44 !important;
    font-weight: 700;
    pointer-events: none;
}

.pagination-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    color: rgba(4, 6, 8, 0.40);
    font-family: "Gabarito", sans-serif;
    font-size: 12px;
}

/* État de chargement */
.logement-archive-container.loading {
    opacity: 1;
    pointer-events: none;
    position: relative;
}

/* Filtre gris 50% sur toute la page */
.logement-archive-container.loading::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(128, 128, 128, 0.5);
    z-index: 998;
}

.logement-archive-container.loading .logement-archive-grid {
    position: relative;
}

/* Loader GIF */
.logement-archive-container.loading .logement-archive-grid::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    background-image: url('loader.gif');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 999;
}

/* Ancien spinner CSS (à supprimer si vous utilisez le GIF) */
/* 
@keyframes spinner {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}
*/

/* Responsive */
@media (max-width: 1024px) {
    .logement-archive-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .logement-archive-grid {
        grid-template-columns: 1fr;
        row-gap: 20px;
    }

    .card-image-slider .glide__slide img {
        height: 200px;
    }

    .card-content {
        padding: 15px;
    }

    .logement-name {
        font-size: 16px;
    }

    .card-image-slider .glide__arrow {
        width: 25px;
        height: 25px;
    }
}

@media (max-width: 480px) {
    .card-image-slider .glide__slide img {
        height: 180px;
    }

    .logement-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .logement-info .separator {
        display: none;
    }
}