/* Carte du Patrimoine */

.cdp-wrapper {
    position: relative;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    font-family: 'Barlow', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

.cdp-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    margin: 16px 24px;
    background: rgba(124, 183, 128, 0.2);
    border-radius: 24px;
}

.cdp-filter-input {
    flex: 1 1 200px;
    min-width: 200px;
    padding: 9px 12px;
    background: #FFFFFF;
    border: 1px solid #7cb780 !important;
    border-radius: 6px !important;
    font-family: 'Barlow', sans-serif;
    font-size: 14px;
    color: #7cb780;
    line-height: 1.2;
    outline: none;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
}

.cdp-filter-input::placeholder {
    color: #7cb780;
    opacity: 1;
}

.cdp-filter-input option {
    color: #000;
}

.cdp-filter-input:focus {
    border-color: #5a9e60;
    box-shadow: 0 0 0 2px rgba(124, 183, 128, 0.25);
}

select.cdp-filter-input {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='%237cb780' d='M0 0l5 6 5-6z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

.cdp-filter-autocomplete {
    position: relative;
    flex: 1 1 200px;
    min-width: 200px;
    display: flex;
}

.cdp-filter-autocomplete .cdp-filter-input {
    flex: 1 1 auto;
    min-width: 0;
}

.cdp-autocomplete-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 1000;
    margin: 0;
    padding: 4px 0;
    list-style: none;
    background: #FFFFFF;
    border: 1px solid #7cb780;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    max-height: 240px;
    overflow-y: auto;
}

.cdp-autocomplete-menu[hidden] {
    display: none;
}

.cdp-autocomplete-item {
    padding: 8px 12px;
    font-family: 'Barlow', sans-serif;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    line-height: 1.2;
}

.cdp-autocomplete-item:hover,
.cdp-autocomplete-item.is-active {
    background: rgba(124, 183, 128, 0.2);
    color: #5a9e60;
}

.cdp-map-container {
    width: 100%;
}

.cdp-map {
    width: 100%;
    height: 600px;
}

/* Pins SVG via divIcon */
.cdp-pin {
    background: transparent;
    border: none;
}

.cdp-pin svg {
    display: block;
    width: 100%;
    height: 100%;
}

/* Légende */
.cdp-legend {
    display: flex;
    align-items: center;
    gap: 18px;
    background: #FFFFFF;
    padding: 10px 16px;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    font-family: 'Barlow', sans-serif;
    font-weight: 700;
    font-size: 12px;
    line-height: 1;
    white-space: nowrap;
    color: #000;
}

.cdp-legend .cdp-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.cdp-legend .cdp-legend-pin {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 20px;
}

.cdp-legend .cdp-legend-pin svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* Popup (fenêtre flottante) */
.cdp-popup .leaflet-popup-content-wrapper {
    background: #FFFFFF;
    border-radius: 20px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.18);
    padding: 4px;
}

.cdp-popup .leaflet-popup-tip {
    background: #FFFFFF;
}

.cdp-popup .leaflet-popup-content {
    margin: 16px 20px;
    font-family: 'Barlow', sans-serif;
    line-height: 1.35;
    width: 280px !important;
    text-align: center;
}

.cdp-popup .cdp-ville,
.cdp-card .cdp-ville {
    font-family: 'Barlow', sans-serif;
    font-weight: 400;
    font-size: 18px;
    color: #a51916;
    line-height: 1.1;
    margin-bottom: 2px;
    text-align: center;
}

.cdp-popup .cdp-title,
.cdp-card .cdp-title {
    margin: 0 0 12px;
    font-family: 'Barlow', sans-serif;
    font-weight: 700;
    font-size: 26px;
    line-height: 1.05;
    color: #a51916;
    text-align: center;
}

.cdp-popup .cdp-photo,
.cdp-card .cdp-photo {
    display: block;
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 12px;
}

.cdp-popup .cdp-meta,
.cdp-card .cdp-meta {
    list-style: none;
    padding: 0;
    margin: 0 0 14px;
}

.cdp-popup .cdp-meta li,
.cdp-card .cdp-meta li {
    padding: 2px 0;
    font-family: 'Barlow', sans-serif;
    font-size: 13px;
    color: #000000;
    line-height: 1.4;
}

.cdp-popup .cdp-meta-key,
.cdp-card .cdp-meta-key {
    font-weight: 700;
    color: #000000;
}

.cdp-popup .cdp-meta-value,
.cdp-card .cdp-meta-value {
    font-weight: 400;
    color: #000000;
}

.cdp-popup .cdp-cta-wrap,
.cdp-card .cdp-cta-wrap {
    text-align: center;
}

.cdp-popup .cdp-cta,
.cdp-card .cdp-cta {
    display: inline-block;
    padding: 8px 16px;
    background: #990a2c;
    color: #FFFFFF !important;
    text-decoration: none;
    border-radius: 10px;
    font-family: 'Barlow', sans-serif;
    font-weight: 500;
    font-size: 15px;
    line-height: 1.1;
}

.cdp-popup .cdp-cta:hover,
.cdp-card .cdp-cta:hover {
    background: #7d0723;
}

/* Layout split (carte + liste) */
.cdp-wrapper-split .cdp-split {
    display: flex;
    align-items: stretch;
    gap: 24px;
    padding: 16px 24px;
    height: 700px;
}

.cdp-wrapper-split .cdp-map-side {
    flex: 1 1 50%;
    min-width: 0;
}

.cdp-wrapper-split .cdp-map-side .cdp-map {
    width: 100%;
    height: 100%;
    border-radius: 16px;
    overflow: hidden;
}

.cdp-wrapper-split .cdp-list-side {
    flex: 1 1 50%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow: hidden;
}

.cdp-cards {
    flex: 1 1 auto;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    padding: 8px 12px 12px 8px;
}

.cdp-card {
    background: #FFFFFF;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 16px 20px;
    font-family: 'Barlow', sans-serif;
    line-height: 1.35;
    text-align: center;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.cdp-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.cdp-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    padding: 8px 0 4px;
}

.cdp-page-btn {
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    background: #FFFFFF;
    color: #000000;
    border: 1px solid #d0d0d0;
    border-radius: 8px;
    font-family: 'Barlow', sans-serif;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
}

.cdp-page-btn:hover:not(:disabled) {
    background: #f5f5f5;
}

.cdp-page-btn.cdp-page-active {
    background: #990a2c;
    color: #FFFFFF;
    border-color: #990a2c;
    font-weight: 700;
}

.cdp-page-btn.cdp-page-disabled {
    opacity: 0.4;
    cursor: default;
}

@media (max-width: 900px) {
    .cdp-wrapper-split .cdp-split {
        height: auto;
        padding: 12px 16px;
    }
    .cdp-wrapper-split .cdp-map-side {
        display: none;
    }
    .cdp-wrapper-split .cdp-list-side {
        flex: 1 1 100%;
        overflow: visible;
    }
    .cdp-cards {
        overflow: visible;
        padding: 8px 4px;
        grid-template-columns: 1fr;
    }
}
