:root {
    --map-green: #004F00;
    --map-hover-green: #007F00;
}

a path {
    transition: all 0.2s ease-in-out;
}

/* body {
    margin: 0;
    padding: 0;
    font-family: Arial, helvetica, sans-serif;
    background: white;
} */

.interactive-map {
    position: relative;
/*     width: calc(100vw - 2rem); */
    height: calc(100vh - 2rem);
    display: block;
/*     padding: 1rem; */
}
.interactive-map {
    position: relative;
    max-width:1372px;
    display: block;
}
.country-info h3{
  font-size:32px;
}
@media(max-width:600px){
  .country-info h3{
  font-size:24px;
}
}
@media(max-width:1400px){
  .interactive-map{
/*     padding:0px 20px; */
  }
}
.interactive-map svg {
    width: 100% !important;
    height: 100% !important;
    z-index: 3;
    display: block;
    transition: all 0.3s ease-in-out;
}

.interactive-map svg.active {
    filter: blur(32px);
    opacity: 0.5;
}

.interactive-map svg a {
    cursor: pointer;
}

.interactive-map svg a path {
    fill: var(--map-green);
    stroke: #fff;
    stroke-width: 1;
    stroke-miterlimit: 10;
}


/* Matches only data-country with non-empty value */
.interactive-map svg a[data-country]:not([data-country=""]):hover path {
    fill: var(--map-hover-green);
    cursor: pointer;
}

/* Disable interaction on data-country="" */
.interactive-map svg a[data-country=""] path {
    pointer-events: none;
    cursor: default;
}



/* COUNTRY POPUPS */
.interactive-map .country-popup {
    position: absolute;
    top: 1rem;
    left: 1rem;
    width: calc(100% - 2rem);
    height: calc(100% - 2rem);
    z-index: 5;
    /* We will control display with JS, and manage opacity/transform for smooth transition */
    display: none;
    /* Still hidden by default */
    opacity: 0;
    /* Start with 0 opacity for fade-in */
    transition: opacity 0.3s ease-in-out;
    /* Transition for the main popup container */
}

.interactive-map .country-popup.active {
    display: block;
    /* Show the container */
    opacity: 1;
    /* Fade in */
}

.interactive-map .country-popup>div {
    display: none;
    /* Hide all individual country popups initially */
    justify-content: space-between;
    height: 100%;
}

/* Show only the active country's details */
.interactive-map .country-popup>div.active {
    display: flex;
    /* Show the specific country popup when it's active */
    /* Add a small delay for child transitions to start after display:flex is applied */
    transition-delay: 0.05s;
}

.interactive-map .country-popup .country-map {
    max-width: 50%;
}

.interactive-map .country-popup .country-map img {
    width: auto;
    max-height: 100%;
    transform: scale(0.25);
    /* Initial smaller scale */
    transition: transform 0.3s ease-in-out;
    /* Apply transition directly to the image */
    max-width: 100%;
}

/* When the PARENT div has .active, scale the image to 1 */
.interactive-map .country-popup>div.active .country-map img {
    transform: scale(1);
}

.interactive-map .country-popup .country-info {
    background: #F7F8F0;
    border-radius: 2rem;
    padding: 2rem;
    max-width: 50%;
    flex-grow: 1;
    flex-basis: 0;
    align-self: end;
    transform: translateY(3rem);
    /* Initial lower position */
    transition: transform 0.3s ease-in-out;
    /* Apply transition directly to the info box */
}
@media(min-width:1100px){
  .interactive-map .country-popup>div.active .country-info {
   
  overflow:auto;
   
}
}

/* When the PARENT div has .active, move info box to its final position */
.interactive-map .country-popup>div.active .country-info {
    transform: translateY(0);
    max-height: 80%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.interactive-map .country-popup>div.active .country-info .country-info-overflow {
    display: flex;
    min-height: 0;
    position: relative;
}

.interactive-map .country-popup>div.active .country-info .country-info-overflow:before {
    content: '';
    position: absolute;
    top: -2px;
    left: 0;
    right: 0;
    height: 2rem;
    background: linear-gradient(to top, transparent, #F7F8F0);
    pointer-events: none;
}

.interactive-map .country-popup>div.active .country-info .country-info-overflow:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2rem;
    background: linear-gradient(to bottom, transparent, #F7F8F0);
    pointer-events: none;
}

.interactive-map .country-popup>div.active .country-info .country-info-overflow>div {
    overflow-y: auto;
    flex-grow: 1;
    min-height: 0;
}

.interactive-map .country-popup>div.active .country-info .cta-buttons {
    display: flex;
    flex-direction: row;
    gap: 1rem;
}

.interactive-map .country-popup>div.active .country-info .cta-buttons .btn {
    color: white;
    background: var(--map-hover-green);
    padding: 0.5rem 1rem;
    border-radius: 90px;
    text-decoration: none;
    font-weight: 400;
}

/* Styles for the close button within each country popup */
.interactive-map .country-popup button[role="button"] {
    position: absolute;
    top: 0;
    right: 0;
    border: none;
    cursor: pointer;
    z-index: 10;
    width: 40px;
    height: 40px;
    border-radius: 40px;
    text-align: center;
    background-color: #F7F8F0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    border: 1px solid var(--map-hover-green);
    font-size: 1rem;
}

.interactive-map .country-popup button[role="button"]:hover {
    background-color: var(--map-hover-green);
    color: #F7F8F0;
}

/* ---------------------- RESPONSIVE BREAKPOINT ---------------------- */
@media screen and (max-width: 1098px) {
    .interactive-map .country-popup>div.active {
        flex-direction: column;
        gap: 2rem;
    }

    .interactive-map .country-popup .country-map,
    .interactive-map .country-popup .country-info {
        max-width: 100%;
    }

    .interactive-map .country-popup>div.active .country-info {
        max-height: inherit;
    }
}

/* ---------------------- EXTRA FIXES - OVERWRITES 18 AUG ---------------------- */
.interactive-map {
    height: auto !important;
}

@media screen and (max-width: 1098px) {
    .interactive-map svg.active {
        filter: blur(32px);
        opacity: 0.5;
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
    }

    .interactive-map .country-popup.active {
        position: relative;
    }
}

/* ---------------------- HIDE WORLD MAP FOR MOBILE ---------------------- */

@media screen and (max-width: 600px) {
  .interactive-map svg {
    display: none;
    opacity: 0;
    visibility: hidden;
  }
  .interactive-map .country-popup button[role="button"] {
    display: none;
    opacity: 0;
    visibility: hidden;
  }
}