/* ============================================================
   Styles spécifiques à la page disponibilites.php
   ============================================================ */

/* Hauteur réduite du carrousel sur cette page */
.hero-carousel {
    height: 500px;
    position: relative;
}

/* ---- Layout principal ---- */
.disponibilites-layout {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    margin-top: 30px;
}

.disponibilites-layout.multi-gites {
    grid-template-columns: 1fr 400px;
}

.disponibilites-layout.multi-gites .gites-list-column {
    padding-right: 15px;
}

.disponibilites-layout:not(.multi-gites) .gites-list-column {
    padding-right: 0;
}

.disponibilites-layout.small-gites .gites-list {
    grid-template-columns: 1fr;
}

.disponibilites-layout.medium-gites .gites-list {
    grid-template-columns: repeat(2, 1fr);
}

.disponibilites-layout:not(.multi-gites):not(.medium-gites):not(.small-gites) .gites-list {
    grid-template-columns: repeat(2, 1fr);
}

.disponibilites-layout.multi-gites .gites-list {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

/* ---- Colonne liste des gîtes ---- */
.gites-list-column {
    max-height: calc(100vh - 300px);
    overflow-y: auto;
    padding-right: 15px;
    min-width: 0;
}

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

/* ---- Carte gîte (liste) ---- */
.gite-list-card {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    max-width: none;
    width: 100%;
    margin: 0 auto;
    height: auto;
    display: flex;
    flex-direction: column;
    position: relative;
    cursor: pointer;
}

.gite-list-card:hover {
    box-shadow: var(--shadow-lg);
}

.gite-list-image {
    width: 100%;
    height: 100px;
    overflow: hidden;
    background: #f0f0f0;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gite-list-image .placeholder-image {
    font-size: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gite-list-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gite-list-content {
    padding: 15px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.gite-list-content h3 {
    color: var(--primary-color);
    margin: 0 0 10px 0;
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gite-list-content .gite-description {
    font-size: 0.85rem;
    color: var(--text-color);
    line-height: 1.5;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.gite-list-content .gite-localisation {
    color: #666;
    font-size: 0.85rem;
    margin-bottom: 10px;
}

.gite-list-content .gite-card-info {
    display: flex;
    gap: 10px;
    margin-bottom: auto;
    flex-wrap: wrap;
}

.gite-list-content .info-item {
    font-size: 0.8rem;
    color: #666;
}

.gite-list-content .btn {
    width: 40px;
    height: 40px;
    padding: 10px;
    text-align: center;
    font-size: 0;
    cursor: pointer;
    z-index: 10;
    position: absolute;
    top: 80px;
    right: 6px;
    background: #fff;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    transition: all 0.2s ease;
}

.gite-list-content .btn:hover {
    background: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    transform: scale(1.1);
}

.gite-list-content .btn svg {
    width: 20px;
    height: 20px;
    fill: #7d7d7d;
    flex-shrink: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform: translateZ(0);
}

/* ---- Popup carte Leaflet ---- */
.gite-popup-container .leaflet-popup-content-wrapper {
    border-radius: var(--radius);
    padding: 0;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3), 0 0 0 1px rgba(0,0,0,0.1);
    border: 6px solid #fff;
}

.gite-popup-container .leaflet-popup-tip {
    background: #fff;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.gite-popup-container .leaflet-popup-content {
    margin: 0;
    width: 230px !important;
    border-radius: var(--radius);
}

.gite-popup {
    overflow: hidden;
}

.gite-popup-image {
    width: 100%;
    height: 120px;
    overflow: hidden;
    background: #f0f0f0;
    border-top-left-radius: 5px;
}

.gite-popup-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gite-popup-content {
    padding: 12px;
}

.gite-popup-content h3 {
    margin: 0 0 8px 0;
    color: var(--primary-color);
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gite-popup-content .popup-location {
    margin: 0 0 10px 0;
    color: #666;
    font-size: 0.85rem;
}

.gite-popup-content .popup-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding: 8px;
    background: #f8f9fa;
    border-radius: var(--radius);
}

.gite-popup-content .popup-info span {
    font-size: 0.85rem;
    color: #666;
}

.gite-popup-content .popup-price {
    color: var(--primary-color);
    font-weight: bold;
}

.gite-popup-content .popup-btn {
    display: block;
    width: 100%;
    padding: 10px 15px;
    background: linear-gradient(to bottom, #6b8faa 0%, #5a7d9a 50%, #4a6b85 100%);
    color: white !important;
    text-align: center;
    text-decoration: none;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 700;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    letter-spacing: 0.5px;
    line-height: 1.4;
    border: none;
    cursor: pointer;
    transition: background 0.2s ease;
}

.gite-popup-content .popup-btn:hover {
    background: linear-gradient(to bottom, #7b9fba 0%, #6a8daa 50%, #5a7b95 100%);
}

.gite-popup-container .leaflet-popup-close-button {
    position: absolute !important;
    top: 1px !important;
    right: 1px !important;
    width: 30px !important;
    height: 30px !important;
    background: #fff !important;
    color: #324961 !important;
    border: 0 !important;
    border-radius: 50% !important;
    font-size: 17px !important;
    font-weight: bold !important;
    cursor: pointer !important;
    z-index: 10 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    line-height: 30px !important;
    text-align: center !important;
    transition: all 0.2s ease !important;
}

.gite-popup-container .leaflet-popup-close-button:hover {
    background: #fff !important;
    color: #dc3545 !important;
}

/* ---- Liste de sélection (multi-gîtes) ---- */
.gite-selection-list {
    max-height: 300px;
    overflow-y: auto;
}

.gite-selection-item {
    transition: background 0.2s ease !important;
}

.gite-selection-item:hover {
    background: #e9ecef !important;
}

/* ---- Colonne carte ---- */
.map-column {
    position: sticky;
    top: 20px;
    height: calc(100vh - 300px);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.map-container {
    width: 100%;
    height: 100%;
    background: #f0f0f0;
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
    .disponibilites-layout {
        grid-template-columns: 1fr;
    }

    .map-column {
        position: relative;
        top: 0;
        height: 400px;
        order: -1;
    }

    .gites-list-column {
        max-height: none;
        padding-right: 0;
    }
}
