/* ================================================================
   SECTION NOS SITES — CONTENAIR
   Mise en page 2 lignes :
   1. Carte Google Maps pleine largeur et pleine hauteur (max 1200px)
   2. Liste des sites (3 par ligne, sur l'axe X, centrés, carrés sur mobile)
   Suppression de tous les hover/focus #FFD600
   Suppression de l'espace vide entre les cartes et le footer
================================================================ */

:root {
    --site-bg: #0d0d0d;
    --site-card-bg: rgba(255, 255, 255, 0.04);
    --site-border: rgba(255, 255, 255, 0.12);
    --site-border-active: rgba(255, 255, 255, 0.4);
    --site-transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.locations-section {
    padding: 30px 20px 50px;
    color: #ffffff;
    min-height: auto;
    background: var(--site-bg);
    width: 100%;
    box-sizing: border-box;
}

.locations-container {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    flex-direction: column;
}

/* ================================================================
   HEADER
================================================================ */

.locations-header {
    max-width: 1200px;
    margin-bottom: 18px;
    text-align: left;
}

.locations-kicker {
    color: #ffffff;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 3px;
    display: inline-block;
    opacity: 0.6;
    text-transform: uppercase;
}

.locations-header h2 {
    font-size: clamp(24px, 3.5vw, 32px);
    font-weight: 800;
    margin: 4px 0 6px;
    line-height: 1.2;
    color: #ffffff;
}

.locations-header p {
    color: rgba(255, 255, 255, 0.65);
    font-size: 14px;
    margin: 0;
    max-width: 600px;
}

/* ================================================================
   1ÈRE LIGNE : CARTE GOOGLE MAPS PLEINE LARGEUR & PLEINE HAUTEUR (MAX 1200PX)
================================================================ */

.map-container {
    width: 100%;
    height: 380px;
    margin-bottom: 20px;
    overflow: hidden;
    border-radius: 14px;
    border: 1px solid var(--site-border);
    background: #151515;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.map-container iframe,
.map-container iframe#companyMap {
    position: absolute;
    inset: 0;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    min-height: 100% !important;
    border: 0 !important;
    display: block;
}

.map-placeholder {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.4);
    font-size: 14px;
}

/* ================================================================
   2ÈME LIGNE : LISTE DES SITES (SUR LE MÊME AXE X / FLEX-DIRECTION: ROW)
================================================================ */

.locations-list {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: stretch;
    gap: 16px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.locations-list::-webkit-scrollbar {
    display: none;
}

/* CARTE DE SITE — DESKTOP */
.location-card {
    flex: 0 0 calc((100% - 32px) / 3);
    max-width: calc((100% - 32px) / 3);
    min-width: 0;
    background: var(--site-card-bg);
    border: 1px solid var(--site-border);
    border-radius: 12px;
    cursor: pointer;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform var(--site-transition), border-color var(--site-transition), background var(--site-transition), box-shadow var(--site-transition);
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

/* Hover sans #FFD600 */
.location-card:hover {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.07);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

/* Active */
.location-card.active {
    border: 1.5px solid var(--site-border-active);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

/* Focused pulse avec accent #FFD600 */
.location-card.location-card-focused {
    border-color: #FFD600 !important;
    animation: siteHighlightPulse 2s ease-in-out;
    box-shadow: 0 0 0 2px #FFD600, 0 8px 24px rgba(255, 214, 0, 0.25) !important;
}

@keyframes siteHighlightPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 214, 0, 0.6), 0 8px 24px rgba(255, 214, 0, 0.3);
        border-color: #FFD600;
    }
    50% {
        box-shadow: 0 0 0 6px rgba(255, 214, 0, 0.3), 0 12px 30px rgba(255, 214, 0, 0.4);
        border-color: #FFD600;
        transform: translateY(-4px);
    }
    100% {
        box-shadow: 0 0 0 2px rgba(255, 214, 0, 0.4), 0 8px 20px rgba(0, 0, 0, 0.4);
        border-color: rgba(255, 214, 0, 0.6);
        transform: translateY(0);
    }
}

.location-image {
    width: 100%;
    height: 130px;
    overflow: hidden;
    flex-shrink: 0;
    background: #1a1a1a;
}

.location-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.location-card:hover .location-image img {
    transform: scale(1.04);
}

.location-details {
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    flex: 1;
    justify-content: center;
    background: transparent;
}

.location-city {
    color: rgba(255, 255, 255, 0.5);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.location-title {
    margin: 4px 0 2px;
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.3;
}

.location-address {
    margin: 0;
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    line-height: 1.35;
}

.no-locations {
    width: 100%;
    text-align: center;
    padding: 30px 20px;
    color: rgba(255, 255, 255, 0.4);
}

/* ================================================================
   TABLETTE (≤992px)
================================================================ */

@media (max-width: 992px) {
    .locations-section {
        padding: 24px 16px 40px;
    }

    .map-container {
        height: 280px;
        margin-bottom: 16px;
        border-radius: 12px;
    }

    .locations-list {
        gap: 10px;
    }

    .location-card {
        flex: 0 0 calc((100% - 20px) / 3);
        max-width: calc((100% - 20px) / 3);
    }

    .location-image {
        height: 100px;
    }

    .location-details {
        padding: 8px 10px;
    }

    .location-title {
        font-size: 14px;
    }

    .location-address {
        font-size: 12px;
    }
}

/* ================================================================
   MOBILE (≤768px)
   - 3 par ligne sur l'axe X (flex-direction: row)
   - Carré parfait (aspect-ratio: 1 / 1)
   - Image couvrant le carré + titre centré en bas
   - Espace aéré et équilibré avec le footer
================================================================ */

@media (max-width: 768px) {
    .locations-section {
        padding: 16px 12px 36px;
        min-height: auto;
    }

    .locations-header {
        margin-bottom: 10px;
    }

    .locations-kicker {
        font-size: 10px;
        letter-spacing: 2px;
    }

    .locations-header h2 {
        font-size: 18px;
        margin: 2px 0 2px;
    }

    .locations-header p {
        font-size: 11px;
    }

    /* Carte sur mobile : occupe 100% de sa boîte */
    .map-container {
        height: 230px;
        min-height: 200px;
        margin-bottom: 10px;
        border-radius: 10px;
    }

    /* Grille 3 par ligne sur le même axe X */
    .locations-list {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        justify-content: center;
        align-items: stretch;
        gap: 8px;
        width: 100%;
        margin-bottom: 0;
        padding-bottom: 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    /* Carré parfait */
    .location-card {
        flex: 0 0 calc((100% - 16px) / 3);
        max-width: calc((100% - 16px) / 3);
        aspect-ratio: 1 / 1;
        height: auto;
        position: relative;
        border-radius: 8px;
        border: 1px solid var(--site-border);
        overflow: hidden;
        display: flex;
        flex-direction: column;
        justify-content: flex-end;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    }

    .location-card:hover {
        transform: none;
        border-color: rgba(255, 255, 255, 0.3);
    }

    .location-card.active {
        border: 1.5px solid rgba(255, 255, 255, 0.6);
        box-shadow: 0 0 10px rgba(255, 255, 255, 0.15);
    }

    /* Image pleine carte */
    .location-image {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        z-index: 1;
    }

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

    /* Détails compacts en bas, centrés avec gradient sombre */
    .location-details {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 2;
        padding: 14px 4px 5px;
        background: linear-gradient(to top, rgba(0, 0, 0, 0.92) 0%, rgba(0, 0, 0, 0.6) 65%, transparent 100%);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
    }

    /* Masquer les détails superflus pour garder le carré épuré */
    .location-city,
    .location-address {
        display: none !important;
    }

    /* Titre centré compact */
    .location-title {
        font-size: 11px;
        font-weight: 700;
        color: #ffffff;
        margin: 0;
        line-height: 1.2;
        text-align: center;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        width: 100%;
        padding: 0 2px;
    }
}

/* ================================================================
   PETIT MOBILE (≤400px)
================================================================ */

@media (max-width: 400px) {
    .locations-section {
        padding: 14px 8px 30px;
    }

    .locations-list {
        gap: 6px;
    }

    .location-card {
        flex: 0 0 calc((100% - 12px) / 3);
        max-width: calc((100% - 12px) / 3);
        border-radius: 6px;
    }

    .map-container {
        height: 190px;
        margin-bottom: 8px;
    }

    .location-title {
        font-size: 10px;
    }
}
