.territoire-container {
    display: flex;
    gap: 2rem;
    padding: 2rem;
}

.territoire-communes {
    flex: 1;
    min-width: 600px;
}

.territoire-communes ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
}

.commune-item a {
    text-decoration: none;
    color: #333;
}

.commune-item:hover,
.commune-item.active {
    color: white;
	background-color: #2ABBDD;
}

.territoire-svg {
    flex: 2;
    position: relative;
    min-height: 500px;
}

.territoire-svg svg {
    width: 100%;
    height: 100%;
}

.territoire-popups {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.commune-item {
    position: relative;
    transition: background-color 0.3s ease;
	padding: 10px;
}

.commune-popup {
    display: none;
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    min-width: 250px;
	width: 100%;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.commune-popup[style*="display: block"] {
    opacity: 1;
}

.commune-item:hover {
    	background-color: #2ABBDD;

}

.commune-popup h3 {
    margin: 0 0 10px 0;
    color: #333;
}

.commune-popup p {
    margin: 8px 0;
    color: #666;
}

.commune-popup a {
    color: #007bff;
    text-decoration: none;
}

.commune-popup a:hover {
    text-decoration: underline;
}

[id^="detour-"] {
    fill: #e9ecef;
    stroke: #dee2e6;
    transition: fill 0.3s ease;
}

[id^="detour-"]:hover,
[id^="detour-"].active {
    fill: #007bff;
    cursor: pointer;
}
.commune-popup {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.commune-item.active .commune-popup {
    opacity: 1;
}

/* Styles des zones SVG */
[id^="detour-"] {
    fill: transparent;
    stroke: #333;
    stroke-width: 1;
    transition: fill 0.3s ease;
    cursor: pointer;
}

[id^="detour-"]:hover,
[id^="detour-"].active {
    fill: rgba(0, 123, 255, 0.2);
    stroke-width: 2;
}

/* Responsive Design */
@media screen and (max-width: 1200px) {
    .territoire-container {
        gap: 1rem;
        padding: 1rem;
    }

    .territoire-communes {
        min-width: 400px;
    }
}

@media screen and (max-width: 992px) {
    .territoire-container {
        display: grid !important;
        grid-template-columns: 1fr !important;
    }

    .territoire-communes {
        min-width: 100% !important;
        margin-bottom: 2rem !important;
    }

    .territoire-communes ul {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .territoire-svg {
        min-height: 400px !important;
    }

    .commune-popup {
        left: 50% !important;
        top: 100% !important;
        transform: translateX(-50%) !important;
        margin-top: 10px !important;
    }
}

@media screen and (max-width: 780px) {
    .territoire-svg {
        display: none !important;
    }
}

@media screen and (max-width: 680px) {
    .territoire-communes ul {
        grid-template-columns: 1fr !important;
		text-align: center;
    }

    .commune-popup {
        width: 90% !important;
        max-width: 300px !important;
    }
	.territoire-container, .territoire-communes{
		margin: 0px !important;
	}
}

@media screen and (max-width: 576px) {
    .territoire-container {
        padding: 0.2rem !important;
    }

    .commune-item {
        padding: 3px !important;
    }

    .commune-popup {
        padding: 10px !important;
    }
}
