:root {
  font-size: 16px;
  --main-color: #00b54c;
  --text-bold-color: #333;
  --text-light-color: #666;
  --borders-color: #ddd;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: sans-serif;
}

/* scrollbar personalizada */
::-webkit-scrollbar {
  width: 7px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  border-radius: 2px;
  background-color: rgba(139, 195, 74, 0.6);
}

::-webkit-scrollbar-thumb:hover {
  background-color: rgba(139, 195, 74, 0.8);
}

#container {
  display: flex;
  width: 100vw;
  height: 100vh;
}

#map-column {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap:8px;
  width: inherit;
  height: 100vh;
}

#map {
  display: block;
  height: calc(100% - 3rem);
  width: 100%;
}

#legend {
  display: flex;
  flex-direction: column;
  top: 0;
  width: 25vw;
  height: 100vh;
  background: white;
  overflow: auto;
  font-size: 14px;
  align-items: center;
  min-width: 300px;
  max-width: 350px;
  padding: .5rem;
}

#cards {
  width: 30vw;
  min-width: 350px;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

#searchbox {
  position: sticky;
  top: 0;
  padding: 48px 8px 24px;
  z-index: 2001;
  background: white;
}

#search-controls,
#filters {
  display: flex;
}

#filters {
  margin-top: 7px;
  flex-direction: column;
  justify-content: space-between;
}

#filters select {
  font-size: 1.1em;
  color: var(--text-light-color);
  background-color: white;
}

#search-filter-container {
  width: 70%;
  border: 1px solid var(--borders-color);
  background-color: white;
  display: flex;
}

#search-filter {
  width: 85%;
  font-size: 1em;
  color: var(--text-light-color);
  background-color: Transparent;
  background-repeat: no-repeat;
  border: none;
  padding-left: 8px;
}

#search-filter:focus {
  outline: solid 2px var(--main-color);
}

#cancel-search-button {
  width: 15%;
  background-color: transparent;
  background-repeat: no-repeat;
  border: none;
  padding: 8px;
  margin: 0 .25rem;
  visibility: hidden;
}

#cancel-search-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

#search-button {
  width: 30%;
  border-radius: 0 0.7em 0.7em 0;
  border: 0;
  background-color: var(--main-color);
  color: white;
  font-weight: bold;
}

#search-button:after {
  content: "Buscar";
}

#logo {
  width: 100%;
  min-height: 20%;
  justify-content: center;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  padding: 20px;
  background: white;
  z-index: 2;
}

#logo {
  padding-bottom: 0;
}

#logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

#legend h2 {
  padding: 15px 0 9px;
  align-self: flex-start;
  font-size: 20px;
  text-transform: uppercase;
  color: var(--text-light-color);
}


#legend-secondary-taxonomy,
#legend-main-taxonomy {
  align-self: start;
}


#legend-main-taxonomy label,
#legend-secondary-taxonomy label {
  display: flex;
  margin-bottom: 10px;
  align-items: center;
  cursor: pointer;
  opacity: 1;
  margin: 10px;
  padding: 10px;
  border-radius: 20px;
  background-color: white;
  color: var(--text-bold-color);
  text-transform: uppercase;
}

.show-all > label,
#legend-main-taxonomy input:checked+label,
#legend-secondary-taxonomy input:checked+label,
input:checked + label {
  font-weight: bold;
}

#legend-main-taxonomy label img,
#legend-secondary-taxonomy label img {
  width: 32px;
  height: 32px;
  display: block;
  margin-right: 10px;
}

#legend-main-taxonomy input[type=checkbox],
#legend-secondary-taxonomy input[type=checkbox] {
  display: none;
}

div.card {
  position: relative;
  padding: 15px;
  margin: 10px;
  border: 1px solid var(--borders-color);
  border-radius: 1em;
  scrollbar-color: rgba(139, 195, 74, 0.6) rgba(139, 195, 74, 0.9);
}

div.card.selected {
  background: white;
  filter: drop-shadow(0px 4px 7px var(--main-color));
}

div.card > * {
  z-index: 100;
}

div.card h3 {
  font-size: 1.2em;
}

div.card h4 {
  font-size: .8em;
  color: var(--text-light-color);
}

div.card p {
  font-size: .9em;
}

/*Desactivo todos los eventos de card pq si no no escuchaba el Listener para hacer el setView*/
div.card>* {
  pointer-events: none;
  margin-bottom: 7px;
}

div.card p.website {
  text-align: right;
}

div.card p.website a {
  display: inline-block;
  padding: 4px 12px;
  border: 1px solid var(--borders-color);
  border-radius: 0.5em;
  background-color: #eee;
  color: var(--text-bold-color);
  text-align: center;
  text-decoration: none;
  font-size: 1.2em;
}

div.secondary-taxonomy-icon-row img {
  width: 30px;
  height: 30px;
}

div.card ul li {
  display: inline-block;
  background-image: url(img/punto_fuerte.png);
  background-repeat: no-repeat;
  background-position: left center;
  padding-left: 30px;
  line-height: 30px;
  background-size: 25px;
  margin-right: 3px;
}

/*solo para moviles */
#viewmap,
#viewlegend {
  display: none;
}

div.card .close-btn {
  pointer-events: all;
  width: 15px;
  height: 15px;
  position: absolute;
  right: 15px;
  top: 15px;
  visibility: hidden;
  background-color: transparent;
  border: none;
}

footer {
  display: flex;
  justify-content: center;
  padding: 0 8px;
  background-color: #fff;
  z-index: 999;
}

footer span {
  text-align: center;
}

@media (max-width: 1000px) {
  #container {
    overflow: hidden;
  }

  #container,
  #map-column,
  #cards,
  #legend {
    top: 0;
    left: 0;
    position: absolute;
    display: block;
    width: 100vw;
    height: 100vh;
  }

  #cards {
    display: flex;
    z-index: 2001;
    width: 100vw;
    height: 40vh;
    overflow-x: scroll;
    overflow-y: hidden;
    flex-direction: row;
    position: absolute;
  }

  #legend {
    background-color: white;
    max-width: none;
    z-index: 2002;
    display: flex;
    padding: 0px 10px 10px 10px;
    filter: drop-shadow(2px 0 6px #666);
  }

  #legend,
  #viewmap {
    transition-property: left;
    transition-duration: 1s;
    transition-delay: 0.4s;
  }

  #legend label {
    margin: 0;
    padding: 10px;
  }

  #logo {
    min-height: 20%;
  }

  #search-controls,
  #filters {
    left: 0;
    position: fixed;
    top: calc(100% - 3rem);
    height: 3rem;
  }

  #search-filter-container {
    width: 87%;
    border: 1px solid var(--borders-color);
    background-color: white;
    padding: 5px 5px 5px 15px;
    display: flex;
  }

  #viewmap,
  #viewlegend {
    display: block;
    position: absolute;
    bottom: 20%;
  }

  #viewlegend {
    z-index: 2000;
    left: 0px;
  }

  #viewmap {
    z-index: 2003;
    right: 0;
  }

  #viewmap-button,
  #viewlegend-button {
    padding: 13px;
    text-transform: uppercase;
    font-weight: bold;
    border: 0;
    background-color: var(--main-color);
    color: white;
    font-size: 20px;
  }

  #viewmap-button {
    border-radius: 0.5em 0 0 0.5em;
  }

  #viewlegend-button {
    border-radius: 0 0.5em 0.5em 0;
  }

  #cards.hidden {
    display: none;
  }

  #searchbox {
    position: fixed;
    right: 20px;
    top: 75vh;
    background: transparent;
  }

  #search-filter {
    width: 90%;
  }

  #cancel-search-button {
    width: 10%;
  }

  #search-button {
    position: relative;
    width: 13%;
    border-radius: 0;
    border: 0;
    background-color: var(--main-color);
    background-image: url("../img/search.png");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
  }

  #search-button:after {
    content: '';
  }

  div.card {
    min-width: 90vw;
    background-color: white;
    overflow-y: scroll;
    z-index: 1;
  }

  div.card .close-btn {
    visibility: visible;
    cursor: pointer; 
  }

  .close-btn img {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }
}
