:root {
    --locator-width: 450px; /* panel width - 50px */
    --main-color: #546a2f;
    --main-darker-color: rgb(55, 69, 32);
    --light-color: #FFF8ED;
    --dark-color: #42392F;
    --secondary-mid-color: #C6945A;
}

html{
    height: 100vh;
}

body {
    background: #f7f7f7;
    font-family: 'Segoe UI', Arial, sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    height: 100vh;
}

header{
    box-sizing: border-box;
    width: 100%;
    height: 6vh;
    min-height: 6vh;
    background-color: var(--dark-color);
    padding: 3px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
header h1{
    text-align: left;
    color: white;
    font-weight: bold;
    font-size: 1.7em;
    margin: 0;
    line-height: 5vh;
    vertical-align: middle;
    width: 100px;
    /* padding-top: 0.5em;
    padding-bottom: 0.5em; */
}

#name-and-logo {
    display: flex;
    flex-direction: row;
    height: 100%;
    width: 100%;
    margin-left: 5px;
}

img#logo{
    margin: 0;
    border: 0px;
    padding-top: 1vh;
    padding-left: 0.5vh;
    padding-bottom: 2vh;
    padding-right: 1.5vh;
    vertical-align: middle;
    max-width: 50px;
}

#mapResultImg {
    max-width: 800px;
    width: 100%;
    height: auto;
    text-align: center;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
#mapResultImgContainer{
    margin: 2em;
}




.container {
    max-width: 900px;
    margin: 40px auto;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    padding: 32px 24px 24px 24px;
}
h1 {
    text-align: center;
    color: #2a7a2a;
    margin-bottom: 24px;
}
form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}
label {
    font-weight: 500;
    color: #333;
}
input[type="text"] {
    padding: 8px;
    border-radius: 5px;
    border: 1px solid #bbb;
    font-size: 1em;
}
button {
    padding: 10px 0;
    background: var(--main-color);
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 1em;
    cursor: pointer;
    transition: background 0.2s;
   

}
button:hover:not(.active) {
    background: var(--secondary-mid-color) ;
    color: #000 ;
}

#savePortfolio:disabled {
    background: #ccc;
    cursor: not-allowed;
    box-shadow: none;
    color:#000
}
#result {
    margin-top: 0;
    font-size: 1.1em;
    color: #333;
    flex: 1 1 auto;
}
#copas {
    margin-top: 10px;
    font-weight: bold;
    color: var(--main-color);
    font-size: 1.2em;
    text-align: center;
}
img {
    display: block;
    /* border: 2px solid #ccc; */
    border-radius: 8px;
    max-width: 100%;
}
main{
    display: flex;
    box-sizing: border-box;
    flex-direction: row;
    min-height: 94vh;
    height: 94vh;

}
#portfolio {
    background: var(--light-color);
    width: 100%;
    box-sizing: border-box;
    /* height: 94vh; */
    display: flex;
    align-items: start;
    padding-top: 1em;
    justify-content: space-around;
    position: relative; 
    flex-grow: 1;
}
#portfolio h2 {
    margin-top: 0;
}
#portfolioList{
    display: flex;
    flex-direction: column;
    margin: 0px;
    padding: 2em 2em 2em 3em;
    gap: 1.5em;
    flex-grow: 0.8;
}
#portfolioSummary{
    width: 30%;
    position: sticky;
    top: 4em; 
    align-self: flex-start;
}
#portfolioList li {
    margin-bottom: 0.5em;
}
#savePortfolio {
    width: 100%;
    margin-top: 1em;
    /* background: var(--main-color); */
    /* color: #fff;
    box-shadow: 1px 1px 5px rgba(0,0,0,0.1); */
    /* border-radius: 4px; */
    cursor: pointer;
    white-space: nowrap;
}

#portfolioSummary table{
    background-color: white;
}


#rightContainer{
    width: 100%;
    display: flex;
    flex-direction: column;
    overflow:auto;
    flex:1
}
nav {
    display: flex;
    box-sizing: border-box;
    flex-direction: column;
    align-items:start;
    width: 240px;
    min-height: 100%;
    padding-top: 1em;
    background-color: var(--dark-color);
}
.tab-btn {
    background: var(--dark-color);
    text-align: left;
    color: #fff;
    border: none;
    width: 100%;
    border-radius: 0;
    padding: 1em 1.5em;
    font-size: 1.1em;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
.tab-btn.active {
    background: var(--main-color);
    color: #fff;
}

#searchContainer{
    display: none;
    padding: 1em;
}

.loading-placeholder {
    width: 100%;
    max-width: 900px;
    aspect-ratio: 1 / 1;
    margin: 20px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(90deg, #f3f3f3 25%, #e0e0e0 50%, #f3f3f3 75%);
    background-size: 200% 100%;
    animation: loadingShimmer 2.5s ease-in-out infinite;
    border-radius: 8px;
    border: 2px solid #ccc;
    position: relative;
    filter: blur(0.2px);
}
.loading-text {
    position: absolute;
    color: var(--main-color);
    font-size: 2em;
    font-weight: bold;
    text-shadow: 0 2px 8px #fff, 0 0 2px #ccc;
    z-index: 2;
}
@keyframes loadingShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
#resultContainer {
    display: flex;
    flex-grow: 1;
    
    flex-direction: row;
    align-items: center;
    justify-content: space-around;
    gap: 1em;
    height: 94vh;
    /* background-color: var(--light-color); */
}
.portfolio-card {
    background: var(--light-color);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    margin: 0 auto;
    transition: box-shadow 0.2s;
    width: 100%;
    background-color: white;
    border: 1px solid black;
    box-sizing: border-box;
}
.portfolio-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.188);
}
.portfolio-row {
    display: flex;
    align-items: center;
    gap: 1em;
    flex-wrap: wrap;
    cursor: pointer;
    padding: 1.5em;
}

.expand-btn {
    background: none;
    color: #333;
    border: none;
    padding: 0 0.5em;
    font-size: 1.3em;
    /* align-self: flex-end; */
    cursor: pointer;
    transition: background 0.2s;
    margin-left: auto;
    float: right;
}
.expand-btn .arrow {
    display: inline-block;
    transition: transform 0.2s;
    font-size: 1.2em;
}

.remove-btn {
    background: #dc3545;
    color: #fff;
}
.remove-btn:hover {
    background: #a71d2a;
}
.trash-btn {
    background: #dc3545 !important;
    border: none;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    position: static;
    box-shadow: 0 2px 8px rgba(0,0,0,0.10);
    z-index: 2;
    padding: 5px 15px 5px 15px;
    transition: background 0.2s;
    margin-left: auto;
}
.portfolio-details {
    border-top: 1px solid black;
    border-radius: 0px;
    padding: 1.5em;
    gap: 0.7em;
    position: relative;
}
.portfolio-details-left {
    /* width: 70%; */
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    gap: 0.5em;
    flex-grow: 0.6;
}

.portfolio-details-row {
    display: flex;
    align-items: center;
    gap: 1.5em;
    margin-bottom: 0.2em;
}
.portfolio-details-label {
    min-width: 40%;
    text-align: left;
    font-weight: 500;
    color: #333;
}
.portfolio-details-row select,
.portfolio-details-row input,
.portfolio-details-row span {
    flex: 1 1 auto;
    min-width: 0;
}
.portfolio-details label {
    font-weight: 500;
    margin-right: 0.5em;
}
.portfolio-details input[type="number"] {
    width: 120px;
    padding: 0.3em;
    border-radius: 4px;
    border: 1px solid #bbb;
}
.portfolio-total {
    font-weight: bold;
    color: var(--main-color);
    margin-top: 0.5em;
}
.portfolio-total-summary {
    font-weight: bold;
    color: var(--main-color);
    margin-left: auto;
    margin-right: 0.5em;
    font-size: 1.1em;
    letter-spacing: 0.5px;
}
.portfolio-details-right {
    width: fit-content;
    height: 100%;
    max-width: 250px;
    flex-shrink: 0.2;
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.10);
    cursor: pointer;
    object-fit: cover;
    display: block;
}
.portfolio-thumb-wrapper {
    position: relative;
    display: inline-block;
}
.portfolio-thumb-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(108, 108, 108, 0.45);
    color: #fff;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    font-size: 1.1em;
    z-index: 1;
    cursor: pointer;
}
.portfolio-thumb-wrapper:hover .portfolio-thumb-overlay {
    opacity: 1;
    pointer-events: auto;
}
.portfolio-thumb-overlay img{
    color: white;
}

#portfolio-img-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
#portfolio-img-modal img {
    /* mantener asi */
    max-width: 90vw; 
    max-height: 90vh;
    border-radius: 10px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.25);
}
.portfolio-details-flex {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 0.7em;
    width: 100%;
    position: relative;
}
.growth-chart-container {
    width: 100%;
    margin: 1em auto 0 auto;
}
.toggle-chart-btn {
    background: var(--main-color);
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 0.5em 1em;
    cursor: pointer;
    font-size: 0.95em;
    transition: background 0.2s, color 0.2s;
    align-self: flex-start;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    margin-top: 0.5em;
}

.toggle-chart-btn:hover {
    background: var(--secondary-mid-color);
    color: #000;
}

.toggle-chart-btn:disabled,
.toggle-chart-btn--disabled {
    opacity: 0.55;
    cursor: not-allowed;
    background: #ccc;
    color: #555;
    box-shadow: none;
}

.growth-chart-container.is-hidden {
    display: none;
}
#map{
    width: 100%;
    height: 100%;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-left: 0;
    margin-right: 0;
}

.custom-modal-box {
    background: #fff;
    padding: 2em;
    border-radius: 10px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.18);
    min-width: 320px;
    max-width: 90vw;
    position: absolute;
}
.custom-modal-refcat {
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 0.5em;
}
.custom-modal-ldt {
    margin-bottom: 1em;
}
.custom-modal-btnrow {
    display: flex;
    justify-content: flex-end;
    gap: 1em;
}
.custom-modal-procesar {
    background: var(--main-color);
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 0.5em 1.2em;
    cursor: pointer;
}
.custom-modal-procesar:hover {
    background: var(--main-color);
}

/* #errorBadge {
    background: #dc3545;
    color: #fff;
    padding: 0.5em 1em;
    border-radius: 5px;
    text-align: center;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
} */

table.result-table{
    width: 100%;
    text-align: left;
}
.result-table td, .result-table th {
    padding: 0.5em 1em;
    border-bottom: 1px solid #ddd;
}
.result-table th {
    background-color: var(--dark-color);
    color: white;
    width: 35%;
}
.result-table tr:hover {
    background-color: #ddd;
}

.info{
    background-color: var(--light-color);
    border-left: 6px solid var(--secondary-mid-color);
    margin-top: 2em;
    padding: 1em;
}

.emptyPageText{
    margin: 2em 2em 2em 2em;
    align-self: flex-start;
    flex-grow: 1;
    height: fit-content;
    background-color: var(--light-color);
    font-size: 1.7em;
    padding: 10px 50px 30px 50px;
    box-shadow: 0 2px 8px var(--dark-color);
    border-radius: 10px;
    border: 1px solid var(--dark-color);
    
}

.emptyPageText li{
    margin-bottom: 0.8em;
}

#goToSearchTab{
    padding: 0.5em 1em;
    background-color: var(--main-color);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 0.8em;
    cursor: pointer;
    border: 3px solid var(--dark-color);
}


.resultNotFoundText ol li{
    margin-bottom: 0.5em;
}

.hovered{
    background-color: var(--secondary-mid-color);
    color: black;
}

#resultData{
    width: 40%;
    margin-left: 2em;
    margin-right: 2em;
}

.btn-animated{
    background-color: var(--main-color);
    box-shadow: 0 9px var(--main-darker-color);
    border-radius: 10px;
    font-size: 1.2em;
    padding: 1.5em;

}

.btn-animated:active{
 background-color: var(--main-darker-color);
  box-shadow: 0 5px black;
  transform: translateY(4px);
  color: white
}


.btn-animated:hover:not(:disabled){
 background-color: var(--main-darker-color);
  color: white

}

.icon {
  color: white;
  font-size: 100px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  -ms-transform: translate(-50%, -50%);
  text-align: center;
}
.zoom-icon {
    color: #ffffff
}

a#menuIcon{
    width: 2em;
    padding: 0.5em;
    color: white;
    display: none;
}

footer{
    display: none;
    box-sizing: border-box;
    background-color: var(--dark-color);
    padding: 2em;
    align-items:flex-start;
    justify-content: space-evenly;
    /* height: 130px; */
    font-size: small;
    color: white;
    gap: 2em;
}
footer a{
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items:center;
    width: fit-content;
}
footer a:hover{
    text-decoration: underline;

}

footer .footerColumn {
    font-weight:600;
    margin: 0;
    display: flex;
    flex-direction: column;
}
footer .footerColumn h3{
    margin-top: 0;
    margin-bottom: 0.8em;
}

footer .footerColumn ul{
    padding: 0;
    margin: 0;
    gap: 0.5em;
    display: flex;
    flex-direction:  column;
}
.footerColumn ul li {
    list-style-type: none;

}

footer svg{
    vertical-align:baseline;
    padding-right: 1em;
}

#envelopeIcon{
    width: 50px;
}




/* RESPONSIVE */

@media (max-width: 1000px) {
  nav {
    width: 100%;
    min-height: unset;
    height: unset;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    padding-top: 0;
    position: static;
    margin-top: 0;
    margin-bottom: 0;
    background-color: var(--dark-color);
    border-radius: 0;
    box-shadow: none;
    z-index: 10;
    gap: 0px;
  }

  .tab-btn {
    width: auto;
    min-width: 120px;
    padding: 10px 16px;
    font-size: 1em;
    border-radius: 0 0 5px 5px;
    margin: 0 4px;
  }
  main {
    flex-direction: column;
    /* height: 100vh;   en vez de 100% */
  }
  
  

}
@media (max-width: 1200px) {
    .locator-text{
      display: none;

    }

  #div-contenedor-locator > :last-child {
    position: relative !important;   /* se integra en el flujo normal */
    left: 0 !important;              /* pegado al borde izquierdo */
    width: 100% !important;          /* ocupa todo el ancho disponible */
    max-width: 100% !important; 
    box-sizing: border-box !important;
  }

  #m-ignsearch-panel input.m-input-search {
    width: 100% !important;          /* input se adapta al ancho del panel */
  }
    #resultContainer{
        flex-direction: column;
    }
  #mapResultImg{
    max-width: 600px;
  }
  #resultData{
    width: unset;
    margin-bottom: 3em;
  }
  #resultContainer{
    height: unset;
  }
  .resultNotFoundText{
    align-self: flex-start;
  }
  .emptyPageText{
    margin: 0;
    padding: 1em;
}
.emptyPageText ol{
    padding: 0 0 0 0.8em;
    font-size: 0.8em;
  }
    .portfolio-details-flex{
    flex-direction: column;
    /* align-items: stretch; */
}
.portfolio-details-right{
    justify-content: center;
    margin-top: 1em;
}
}
@media (max-width: 600px){
    nav{
        flex-direction: column;
        gap: 0;
        display: none;
    }

    .tab-btn{
        width: 100%;
        text-align: center;
    }

    #mapResultImgContainer{
        margin: 1em 1em 0 1em;
    }
    #resultData{
        margin: 0 1em 1em 1em;
    }

    .portfolio-details-right{
        max-width: unset;
    }
    a#menuIcon{
        display: block;
    }
    #m-baselayerselector-unique-btn{
        font-size: 0 !important;               /* oculta el texto */
        width: 40px !important;              /* ancho fijo para el icono */
        height: 40px !important;              /* alto fijo para el icono */
        padding: 0 !important;                /* quita padding extra */
        background: url('/img/icons/layer-icon.svg') no-repeat center center !important;
        background-size: 60% !important;    
        background-color: white !important;
    }
    footer{
        flex-direction: column;
        justify-content: center;
        text-align: center;
        align-items: center;
    }
    footer a{
        display: inline-flex
    }


} 
@media (max-width: 1400px){
    #rightContainer {
    height: 100%;  
  }

  #portfolio {
    flex-direction: column-reverse;
    height: auto;
  }
  #portfolioSummary {
    width: 100%;
    margin-bottom: 2em;
    padding: 1em;
    box-sizing: border-box;
    align-self: flex-start;
    position:static;
  }
  #portfolioList {
    width: 100%;
    padding: 1em;
    box-sizing: border-box;
  }


    .portfolio-thumb{
        width: 100%;
    }
    .portfolio-details-left,
    .portfolio-details-right {
        width: 100%;
    }


}

.m-content .custom-modal-btnrow {
    justify-content: center;
    gap: 1em;
}
.m-content .custom-modal-procesar{
    width: 50%;
}
.m-content .custom-modal-box{
    width: 100%;
}

/* DROPDOWN */
#changeLanguage{
    color: white;
}
.customDropdown {
  position: relative;
  display: inline-block;
}
/* Dropdown Content (Hidden by Default) */
.dropdown-content {
  display: none;
  position: absolute;
  background-color: #f1f1f1;
  min-width: 160px;
  box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
  z-index: 1;
}

/* Links inside the dropdown */
.dropdown-content a {
  color: black;
  padding: 12px 16px;
  text-decoration: none;
  display: block;
}

/* Change color of dropdown links on hover */
.dropdown-content a:hover {background-color: #ddd;}

/* Show the dropdown menu (use JS to add this class to the .dropdown-content container when the user clicks on the dropdown button) */
.show {display:block;}