/**
 * ********************************************************************************************
 * ********************************************** GOOGLE MAPS SETTINGS PAGE CONFIGURATION
 * ********************************************************************************************
 */

/* Variáveis utilizadas pelo módulo de mapas (em falta no :root principal do tema).
   Ajusta as cores aqui caso o teu design system precise de tons diferentes. */
:root {
  --brown: #5b4a3a;
  --grey: #4a4a4a;
  --padding-inline: 20px;
}

/* Animação da linha gradient no topo do mapa */
@keyframes flowGradient {
  0% {
    background-position: 100% 0%;
  }
  100% {
    background-position: -100% 0%;
  }
}

/*remove o overlay "Use Ctrl + ...*/
.gm-style-moc {
  display: none !important;
}
/* Ensure the map container also has a position context for absolute positioning */
.googleMapsWrapper {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#map {
  position: relative;
  height: 500px;
  width: 100%;
  border-radius: 5px;
  /* margin-inline: 20px; */
  /* margin-left: 170px; */
  /* padding-bottom: 100px; */
  /* margin-top: 30px; */
}

/* Map Wrapper */
.map-menu-wrapper {
  position: relative;
  top: 10px;
  left: 10px;
  background-color: #ffffffa8;
  padding: 10px;
  border-radius: 5px;
  z-index: 100;
  overflow: visible;
  max-width: 0px;
  border-radius: 10px;
  box-shadow: -1px 1px 15px 0px #232323;
}

.map-menu-wrapper::before {
  content: "";
  display: block;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
/* Map Filter Wrapper */
div#map-menu {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Styles for markers that do NOT start with 'adicional_' */
.googleMapsWrapper .default-marker-icon {
  width: 20px !important;
  height: 20px !important;

  /* Especifico para o THE FRAME */
  box-shadow: -1px 1px 15px 0px #232323;
  /* border-radius: 100%; */
}

/* Styles for markers whose ID DOES start with 'adicional_' */
.googleMapsWrapper .adicional-marker-icon {
  width: auto !important; /* Make them larger, use !important if necessary */
  height: 40px !important;
  /* transform: translate(50%, 50%); */
}
/* Menu Map Title */
.map-menu-title {
  font-size: 30px;
  line-height: 1.2;
  color: black;
  margin-bottom: 15px;
}
#map-menu button {
  display: flex;
  gap: 15px;
  outline: unset;
  padding: unset;
  border: unset;
  color: black;
  background-color: unset;
  cursor: pointer;
  align-items: center;
  font-family: "Open Sans", Sans-serif;
}
#map-menu button:active,
#map-menu button:focus,
#map-menu button:hover {
  background-color: transparent;
  color: inherit;
  color: black;
}
#map-menu button img {
  width: 25px;
  height: 25px;
}

/* POI side bar with information */
div#poi-sidebar {
  display: none;
  position: absolute;
  top: 0px;
  right: 0px;
  background-color: #000000c4;
  height: 100%;
  min-width: 200px;
  width: 400px;
  padding: 20px;
  transform: translate(120%, 0px);
  transition: all 300ms linear;
  -webkit-box-shadow: -7px 1px 16px 3px rgb(0 0 0 / 41%);
  color: white;
  z-index: 1001;
}
div#poi-sidebar.open {
  transform: translate(0%, 0px);
  transition: all 300ms linear;
}

.POIWrapper {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
#poi-sidebar h2,
#poi-sidebar p,
#poi-sidebar a,
#poi-sidebar span {
  color: white;
}
.marker-title {
  font-size: 14px;
  background-color: var(--green);
}
#poi-sidebar a {
  text-decoration: underline;
}
/* Side bar close button wrapper */
#poi-sidebarbutton {
  position: absolute;
  top: 5px;
  right: 5px;
  background: none;
  border: none;
  color: white;
  font-size: 1.2em;
  cursor: pointer;
  padding: 0px !important;
}
#sidebar-close-btn {
  padding: 0px !important;
  border: unset !important;
  width: 20px;
  height: 20px;
  position: relative;
  cursor: pointer;
  margin-left: auto;
}
#sidebar-close-btn span.line {
  height: 3px;
  display: block;
  position: absolute;
  top: 50%;
  left: 0px;
  width: 100%;
  background-color: white;
  transform: rotate(45deg);
}
#sidebar-close-btn span.line:nth-child(2) {
  top: 50%;
  left: 0px;
  transform: rotate(-45deg);
}

#sidebar-poi-category {
  margin-top: 10px;
  font-size: 14px;
  line-height: 1;
}
#sidebar-poi-title {
  font-size: 30px;
  margin-bottom: 10px;
}

#poi-sidebar p,
#poi-sidebar a,
#poi-sidebar span {
  font-size: 14px;
}

#sidebar-poi-img img {
  height: 170px !important;
  width: 100%;
  object-fit: cover;
  border-radius: 10px;
}

#map-menu button {
  gap: 8px;
}

.map-bottom {
  display: flex;
  gap: 10px;
  background-color: white;
  border-radius: 0px 10px 00px 0px;
  position: absolute;
  bottom: 0px;
  left: 0px;
  padding: 5px 10px;
}
@media only screen and (max-width: 991px) {
  .filter-wrapper form .row {
    display: flex !important;
    width: 100%;
    flex-direction: column;
    gap: 12px;
    margin: 0px !important;
  }

  .filter-wrapper form .row > div {
    padding: 0px 10px !important;
    max-width: 100% !important;
    width: 100% !important;
  }

  .search-wrapper2 .search2 button.submit {
    width: 100% !important;
  }

  .search-wrapper2 .search2 .form-control {
    margin: 0px 0px;
  }
}
@media only screen and (max-width: 600px) {
  .map-menu-wrapper {
    max-width: 300px;
  }

  div#poi-sidebar {
    width: 300px;
  }

  #sidebar-poi-img img {
    height: 150px !important;
  }
  #sidebar-poi-category {
    font-size: 12px;
  }

  #sidebar-poi-title {
    font-size: 24px;
    line-height: 1;
  }

  #poi-sidebar p,
  #poi-sidebar a,
  #poi-sidebar span {
    font-size: 14px;
  }

  .map-bottom span {
    font-size: 12px;
  }
}
@media only screen and (max-width: 430px) {
  div#map-menu {
    gap: 10px;
  }
}

/* ===========================================================================
   ESTILO PORTADO DO HELLO-ELEMENTOR-CHILD-CLEAN
   Menu abaixo do mapa em grid de 4 colunas, linha gradient animada no topo,
   tooltip nos marcadores e marker "adicional" sempre por cima.
   =========================================================================== */

.googleMapsWrapper .map-menu-wrapper {
  background-color: transparent;
  padding: 0px;
  border-radius: 0px;
  z-index: 9;
  overflow: visible;
  border-radius: 0px;
  box-shadow: none;
  padding-block: 36px;
  padding-inline: var(--padding-inline);
  width: unset;
  max-width: unset;
}

.googleMapsWrapper .map-menu-title {
  font-size: 36px;
  font-weight: 500;
  font-family: "Open Sans";
  line-height: 1.2;
  color: var(--brown);
  margin-bottom: 52px;
  display: flex;
  flex-direction: column;
}

.googleMapsWrapper .map-menu-title span {
  font-size: 24px;
  font-weight: 300;
  font-family: "Open Sans";
  line-height: 29px;
  color: var(--grey);
  padding-top: 8px;
}

.googleMapsWrapper div#map-menu {
  display: grid;
  grid-template-columns: repeat(2, auto);
  grid-auto-flow: column;
  grid-template-rows: repeat(2, 1fr);
  gap: 20px;
  column-gap: 20px;
  width: fit-content;
  margin-inline: auto;
}

/* Linha gradient animada no topo do mapa */
/*#map::before {
  content: "";
  position: absolute;
  top: 0px;
  left: 0;
  width: 100vw;
  height: 2px;
  background: linear-gradient(to left, #000 0%, var(--green) 50%, #000 100%);
  background-size: 200% 100%;
  border-radius: 2px;
  animation: flowGradient 4s linear infinite;
  z-index: 12;
}*/

.googleMapsWrapper #map-menu button {
  color: var(--black);
  font-family: "Open Sans", Sans-serif;
  font-size: 16px;
  gap: 12px;
  white-space: nowrap;
  text-align: left;
}

.googleMapsWrapper #map-menu button img {
  width: 30px;
  height: 30px;
  max-width: unset;
}

.googleMapsWrapper #map-menu button[data-category="all"] {
  /* botão "Ver todos" agora inline no grid (sem position: absolute) */
}

.googleMapsWrapper #map-menu button[data-category="all"] img {
  width: 30px !important;
  height: 30px !important;
}

.googleMapsWrapper #map .default-marker-icon {
  box-shadow: none;
  width: 25px !important;
  height: 25px !important;
  transform: none !important;
}

.googleMapsWrapper div#poi-sidebar {
  width: fit-content;
  height: fit-content;
  background-color: #f1f1f1;
  box-shadow: none;
  top: 50%;
  right: 10px;
  transform: translateY(-50%) translateX(120%) !important;
  min-width: 300px;
}

.googleMapsWrapper div#poi-sidebar.open {
  transform: translateY(-50%) translateX(0%) !important;
}

.googleMapsWrapper #sidebar-close-btn span.line {
  background-color: var(--brown);
}

.googleMapsWrapper span#sidebar-poi-category {
  font-size: 12px;
  font-weight: 500;
  font-family: "Open Sans";
  text-transform: uppercase;
  letter-spacing: 1px;
  line-height: 1.2;
  color: var(--brown);
  margin-bottom: 50px;
}

.googleMapsWrapper #sidebar-poi-title {
  font-size: 20px;
  margin-bottom: 15px;
  margin-top: 0px;
  color: var(--grey);
  font-family: "Open Sans";
  line-height: 32px;
}

.googleMapsWrapper div#sidebar-poi-content img {
  width: 300px;
}

.googleMapsWrapper div#sidebar-poi-content p {
  max-width: 300px;
  line-height: 18px;
  color: var(--grey);
  margin: 0px;
}

/* Tooltip do nome no marker (aparece em hover/focus) */
.marker-title {
  text-align: center;
  position: absolute;
  width: 100px;
  font-family: "Open Sans";

  text-align: center;
  transform: translateX(-50%);
  left: 50%;
  opacity: 0;
  transition: all 300ms linear;
  font-weight: 500;
}
.custom-marker:focus .marker-title,
.custom-marker:hover .marker-title {
  opacity: 1;
  transition: all 300ms linear;
}

/* Garante que o marker "adicional" (NEXTO) fica por cima dos outros */
gmp-advanced-marker:has(.adicional-marker-icon) {
  position: relative;
  z-index: 10 !important;
}
gmp-advanced-marker:has(.default-marker-icon) {
  position: relative;
  z-index: 5 !important;
}

/* ----------- BREAKPOINT: ≤1550px (portátil) ----------- */
@media only screen and (max-width: 1550px) {
  .googleMapsWrapper #map-menu button {
    font-size: 14px !important;
    gap: 12px !important;
  }
  .googleMapsWrapper .map-menu-wrapper #map-menu button img,
  .googleMapsWrapper
    .map-menu-wrapper
    #map-menu
    button[data-category="all"]
    img {
    width: 25px !important;
    height: 25px !important;
  }

  #map {
    height: 370px;
  }
  .googleMapsWrapper div#map-menu {
    gap: 10px;
    column-gap: 50px !important;
  }
  .googleMapsWrapper .map-menu-wrapper {
    padding-block: 25px;
  }
}

/* ----------- BREAKPOINT: ≤1280px ----------- */
@media only screen and (max-width: 1280px) {
  .googleMapsWrapper .map-menu-title {
    font-size: 30px;
    margin-bottom: 30px;
  }

  .googleMapsWrapper .map-menu-title span {
    font-size: 20px;
    padding-top: 0;
  }
  .googleMapsWrapper #map-menu button[data-category="all"] img,
  .googleMapsWrapper #map-menu button img {
    width: 28px !important;
    height: 28px !important;
  }

  .googleMapsWrapper #map-menu button {
    gap: 8px !important;
  }

  .all-apartments .filtros-ordenacao {
    position: relative;
  }
}

/* ----------- BREAKPOINT: ≤991px (tablet) ----------- */
@media only screen and (max-width: 991px) {
  .googleMapsWrapper {
    display: flex;
    flex-direction: column;
    background-color: #fff;
  }

  .googleMapsWrapper .map-menu-wrapper {
    position: relative;
    top: unset;
    right: unset;
    transform: none;
    max-width: 100%;
    box-shadow: none;
    width: 100%;
    padding-inline: var(--padding-inline);
    padding-block: 0px;
    background-color: transparent;
    margin-block: 30px;
  }

  .googleMapsWrapper div#map-menu {
    display: grid;
    grid-template-columns: repeat(3, auto);
    grid-auto-flow: unset;
    grid-template-rows: unset;
    gap: 20px !important;
    column-gap: 20px !important;
    width: fit-content;
    margin-inline: auto;
  }
  .googleMapsWrapper div#poi-sidebar {
    width: calc(100% - 60px);
    top: unset;
    bottom: 30px;
    right: 30px;
    transform: translateY(120%) translateX(0%) !important;
    display: none;
  }

  .googleMapsWrapper div#poi-sidebar.open {
    transform: translateY(0%) translateX(0%) !important;
    width: fit-content;
  }

  #sidebar-close-btn {
    width: 15px;
    height: 15px;
  }
  .googleMapsWrapper #map-menu button {
    font-size: 16px !important;
    gap: 12px !important;
    white-space: normal;
  }
}

/* ----------- BREAKPOINT: ≤600px (mobile) ----------- */
@media only screen and (max-width: 600px) {
  #map {
    position: relative;
    height: 400px;
  }

  .googleMapsWrapper div#map-menu {
    display: grid;
    grid-template-columns: repeat(2, auto);
    gap: 10px !important;
  }

  .googleMapsWrapper #map-menu button {
    text-align: left;
  }

  .googleMapsWrapper .map-menu-title {
    font-size: 25px;
  }

  .googleMapsWrapper .map-menu-title span {
    font-size: 16px;
  }

  .googleMapsWrapper div#sidebar-poi-content img {
    width: 100%;
  }

  .googleMapsWrapper div#sidebar-poi-content p {
    max-width: 100%;
  }

  .googleMapsWrapper div#poi-sidebar.open {
    width: calc(100% - 60px);
  }

  .googleMapsWrapper #map-menu button[data-category="all"] img,
  .googleMapsWrapper #map-menu button img {
    width: 20px !important;
    height: 20px !important;
  }

  .googleMapsWrapper #map-menu button {
    font-size: 14px !important;
    gap: 10px !important;
  }
}
