/* ===== Layout principal ===== */

#carnet-carte {
    display: flex;
    flex-direction: column;
}

.carnet-carte__filter {
    margin-bottom: 12px;
}

.carnet-carte__filter select {
    padding: 6px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    background: #fff;
}

.carnet-carte__body {
    display: flex;
    gap: 0;
    height: calc(100vh - 120px);
    min-height: 400px;
}

/* ===== Liste latérale (40%) ===== */

.carnet-carte__list {
    width: 40%;
    overflow-y: auto;
    border-right: 1px solid #eee;
    padding-right: 12px;
    box-sizing: border-box;
}

.carnet-carte__list-inner {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.carnet-carte__empty {
    color: #999;
    font-size: 14px;
    font-style: italic;
    padding: 16px 0;
    list-style: none;
}

/* ===== Items de la liste ===== */

.carnet-carte__item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 8px;
    border-radius: 6px;
    border: 1px solid #eee;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s;
}

.carnet-carte__item:hover {
    background: #f9f9f9;
}

.carnet-carte__item--active {
    background: #fff3f0;
    border-color: var(--e-global-color-primary);
}

.carnet-carte__item--no-coords {
    cursor: default;
}

.carnet-carte__item img {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.carnet-carte__item-type {
    font-size: 10px;
    text-transform: uppercase;
    color: var(--e-global-color-primary);
    font-weight: 700;
    margin: 0 0 2px;
    letter-spacing: 0.3px;
}

.carnet-carte__item-title {
    font-size: 13px;
    font-weight: 500;
    color: #333;
    margin: 0 0 2px;
    line-height: 1.3;
    text-transform: uppercase;
}

.carnet-carte__item-jour {
    font-size: 11px;
    color: #888;
    margin: 0;
}

/* ===== Carte (60%) ===== */

.carnet-carte__map {
    flex: 1;
    min-width: 0;
}

#carnet-carte-map {
    width: 100%;
    height: 100%;
}

/* ===== Popup OL ===== */

.carnet-carte__popup {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    width: 200px;
    position: relative;
}

.carnet-carte__popup-close {
    position: absolute;
    top: 6px;
    right: 8px;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #999;
    line-height: 1;
    padding: 0;
    z-index: 1;
}

.carnet-carte__popup-close:hover {
    color: #333;
}

.carnet-carte__popup-thumb {
    width: 100%;
    height: 80px;
    object-fit: cover;
    display: block;
}

.carnet-carte__popup-body {
    padding: 8px 10px 10px;
}

.carnet-carte__popup-type {
    font-size: 10px;
    text-transform: uppercase;
    color: var(--e-global-color-primary);
    font-weight: 700;
    margin: 0 0 2px;
    letter-spacing: 0.3px;
}

.carnet-carte__popup-title {
    font-size: 13px;
    font-weight: 500;
    color: #222;
    margin: 0 0 4px;
    line-height: 1.3;
    text-transform: uppercase;
}

.carnet-carte__popup-jour {
    font-size: 11px;
    color: #888;
    margin: 0 0 6px;
}

.carnet-carte__popup-link {
    display: block;
    text-align: center;
    background: var(--e-global-color-primary);
    color: #fff;
    border-radius: 4px;
    padding: 5px 8px;
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
    transition: opacity 0.15s;
}

.carnet-carte__popup-link:hover {
    opacity: 0.85;
    color: #fff;
}

/* ===== Contrôles OL (ol.css absent — styles manuels) ===== */

/* Le target OL peut placer les contrôles comme enfants directs du div#carnet-carte-map */
#carnet-carte-map {
    position: relative;
}

.ol-viewport {
    position: relative;
}

/* Ancrage commun à tous les contrôles OL */
#carnet-carte-map .ol-control,
.ol-viewport .ol-control {
    position: absolute;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 4px;
    padding: 2px;
    z-index: 10;
}

#carnet-carte-map .ol-zoom,
.ol-viewport .ol-zoom {
    top: 8px;
    left: 8px;
}

/* !important nécessaire pour passer au-dessus des styles bouton Elementor */
#carnet-carte-map .ol-zoom button,
.ol-viewport .ol-zoom button {
    display: block !important;
    width: 28px !important;
    height: 28px !important;
    background: #fff !important;
    border: 1px solid #ccc !important;
    border-radius: 3px !important;
    cursor: pointer !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    line-height: 28px !important;
    color: #333 !important;
    margin: 2px !important;
    padding: 0 !important;
    box-shadow: none !important;
    text-align: center !important;
}

#carnet-carte-map .ol-zoom button:hover,
.ol-viewport .ol-zoom button:hover {
    background: #f0f0f0 !important;
}

#carnet-carte-map .ol-attribution,
.ol-viewport .ol-attribution {
    bottom: 4px;
    right: 4px;
    max-width: 60%;
    font-size: 10px;
    background: rgba(255, 255, 255, 0.7);
    padding: 2px 6px;
}

#carnet-carte-map .ol-attribution ul,
.ol-viewport .ol-attribution ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

#carnet-carte-map .ol-attribution button,
.ol-viewport .ol-attribution button {
    display: none !important;
}

#carnet-carte-map .ol-attribution a,
.ol-viewport .ol-attribution a {
    color: #555;
}

.ol-rotate {
    display: none;
}

/* ===== Mobile (≤ 768px) ===== */

@media (max-width: 768px) {
    .carnet-carte__body {
        flex-direction: column;
        height: auto;
    }

    /* Carte en haut, liste en bas */
    .carnet-carte__map {
        order: -1;
        height: 50vh;
        min-height: 250px;
    }

    .carnet-carte__list {
        width: 100%;
        border-right: none;
        border-top: 1px solid #eee;
        padding-right: 0;
        padding-top: 12px;
        max-height: 40vh;
        overflow-y: auto;
    }
}
