/*
.ph-map__results {
  flex-basis: 100%;
  padding: 0 15px;
  margin: 0;
  @media (min-width: 1025px) {
      margin-left: unset;
      padding: 25px;
      flex-basis: 40%;
  }
  &.not-visible {
      display: none;

      @media (min-width: 1025px){
        display: block;
      }
  }
  ul {
      margin: unset;
  }
} */

/* -- INCLUDE NEW_PH_MAP() -- */
.ph-map {
  margin: 0 auto;
  display: inline;

  @media (min-width: 1025px) {
    display: block;
  }

  .info-window {
    .info-window__row {
      margin-bottom: 10px;

      &.ph__active .ph__active__text {
        background-color: var(--text);
        color: var(--text);
        font-size: 0.75rem;
        line-height: 1.25em;
        font-weight: 400;
        padding: 3px;
      }

      &.ph__fp .ph__fp__text {
        color: var(--text);
        font-size: 0.75rem;
        line-height: 1.25em;
        font-weight: 400;
        text-transform: uppercase;
      }

      &.ph__title .ph__title__text {
        font-size: 1rem;
        line-height: 1.125em;
        font-weight: 700;
        text-transform: uppercase;
      }

      &.ph__address .ph__address__text {
        font-size: 0.875rem;
        line-height: 1.28em;
        font-weight: 400;
        text-transform: capitalize;
      }

      &.ph__phone a {
        color: var(--text);
        font-size: 0.8125rem;
        line-height: 1.23em;
        font-weight: 400;
        text-decoration-line: underline;
      }
    }
  }

  .ph-map__locator {
    /* ---- top ---- */
    .ph-map__top {
      /* padding: 40px 20px 0; */
      margin: 0 auto;

      /* @media (min-width: 1025px) {
        padding: 80px 20px 0;
      } */

      .ph-map__header {
        margin-bottom: 22px;

        .ph-map__description ul {
          font-weight: 300;
          line-height: 1.57em;
          letter-spacing: 0.4px;
          color: var(--text);
          padding-bottom: 20px;

          @media (min-width: 1025px) {
            line-height: 1.52em;
          }

          li {
            font-size: 1rem;
            font-weight: 400;
            line-height: 1.5;

            @media (max-width: 769px) {
              font-size: 0.9rem;
            }
          }
        }
      }

      .ph-map__search-container {
        .ph-map__input__search-wrap {
          .ph-map__input__search__text {
            font-weight: 300;
            font-size: 16px;
            line-height: 0.8em;
            color: var(--text);

            @media (min-width: 1025px) {
              font-size: 18px;
            }
          }

          .ph-map__inputs-container {
            display: block;

            @media (min-width: 1025px) {
              display: flex;
              justify-content: space-between;
              align-items: center;
            }

            .ph-map__search-geo {
              --text: var(--BTN-PRIMARY-TEXT);
              flex-basis: 60%;
              position: relative;
              display: flex;
              align-items: center;
              border: 1px solid var(--border);
              border-radius: var(--base-radius);
              background-color: var(--BTN-PRIMARY-BG);
              color: var(--text);
              padding: 6px 6px 6px 16px;
              gap: 1rem;
              height: 50px;

              &:has(.ph-map__input__search:focus-visible) {
                outline: 1px solid var(--accent);
                outline-offset: 2px;
              }

              .ph-map__input__search {
                width: 100%;
                height: 50px;
                margin: 0;
                border: none;
                outline: none;
                padding: 0;
                color: var(--text);

                &::placeholder {
                  color: var(--border);
                  opacity: 1;
                }
              }

              .ph-map__search__submit svg {
                --btn-text: var(--BTN-SECONDARY-BG);
              }

              .ph-map__input__search-geolocation {
                width: fit-content;
                height: fit-content;
                padding: 0;

                .ph-map__search_icon {
                  display: block;
                  width: 24px;
                  height: 24px;
                  background: var(--text);
                  -webkit-mask: url('./icon-search-position.svg') center no-repeat;
                  mask: url('./icon-search-position.svg') center no-repeat;
                  cursor: pointer;
                }

                span {
                  font-weight: 300;
                  font-size: 12px;
                  line-height: 0.8em;
                  text-decoration-line: underline;
                  text-underline-offset: 2px;
                  color: var(--text-light);
                }
              }
            }

            .ph-map__pharmacy_type {
              display: flex;
              align-items: center;
              gap: 1rem;
              padding-top: 28px;

              @media (min-width: 1025px) {
                padding-top: 0;
              }

              .ph-map__type__input {
                cursor: pointer;
                accent-color: var(--text-light);
              }

              .ph-map__type__label {
                color: var(--COLOR-TITLE);
                max-width: 230px;

                @media (min-width: 1025px) {
                  max-width: unset;
                }
              }
            }
          }

          .ph-map__filters__title {
            margin-top: 35px;

            h5 {
              font-family: var(--FONT-STACK-BODY);
              font-size: 16px;
              line-height: 1.27em;
              font-weight: 600;
              color: var(--text);

              @media (min-width: 1025px) {
                font-size: 18px;
              }
            }
          }

          .ph-map__filters__container {
            border: 2px solid var(--border);
            border-radius: var(--base-radius);
            margin: var(--outer) 0;
            padding: 24px 15px;
            transition: 0.5s var(--theme-animation-1);

            @media (min-width: 1025px) {
              padding: 24px;
            }

            .ph-map__filters {
              padding-top: 20px;
              display: flex;
              flex-wrap: wrap;
              gap: 20px;
              flex-direction: column;

              @media (min-width: 1025px) {
                flex-direction: row;
              }

              .ph-map__filter {
                display: flex;
                align-items: center;
                padding: 12px 14px;
                cursor: pointer;
                background-color: var(--theme-color-beige);

                &.hidden {
                  display: none;
                  transition: inherit;
                }

                .ph-map__filter__input {
                  margin: 0 10px 0 0;
                }

                .ph-map__filter__input__label {
                  max-width: 230px;
                  flex-grow: 1;
                  cursor: inherit;

                  @media (min-width: 1025px) {
                    max-width: 237px;
                    width: 237px;
                  }

                  strong {
                    display: block;
                  }
                }
              }
            }

            .ph-map__filter__button__more--wrapper {
              margin-top: 25px;
              flex-basis: 100%;
              border-top: 1px solid #e2e2e2;

              @media (min-width: 1025px) {
                margin-top: 0;
              }
            }

            .ph-map__more-filters {
              cursor: pointer;
              width: fit-content;

              &:focus-visible {
                outline: none;

                .ph-map__filter__label {
                  outline: 2px solid var(--accent);
                  outline-offset: 2px;
                }
              }

              .ph-map__filter__title {
                font-family: var(--FONT-STACK-BODY);
                width: calc(100% - 25px);

                @media (min-width: 1025px) {
                  width: inherit;
                }

                &::after {
                  position: absolute;
                  left: unset;
                  right: -15px;
                  top: 50%;

                  @media (min-width: 1025px) {
                    position: relative;
                  }
                }
              }

              .ph-map__filter__label {
                cursor: pointer;
                text-decoration: underline;
                text-underline-offset: 5px;
                text-transform: lowercase;
              }
            }
          }
        }
      }
    }

    /* ---- interface ---- */
    .ph-map__interface {
      pointer-events: auto;
      padding: 0;
      position: relative;
      z-index: 2;
      display: flex;
      height: 100%;
      overflow: hidden;
      flex-direction: column;

      @media (min-width: 1025px) {
        padding: 25px;
        height: calc(90vh - 120px);
        border-top: unset;
        flex-direction: row;
      }
    }

    /* ---- results ---- */
    .ph-map__results {
      position: relative;
      flex-basis: 100%;
      margin: 0;

      @media (min-width: 1025px) {
        margin-left: unset;
        flex-basis: 40%;
        padding: 0 15px;
      }

      &.not-visible {
        display: none;

        @media (min-width: 1025px) {
          display: block;
        }
      }

      ul {
        margin: unset;
      }

      .ph-map__results__details {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        z-index: 2;
        transform: translateY(100%);
        transition: all 0.7s var(--theme-animation-1);
        overflow-y: auto;
        background: var(--bg);
        padding-left: 15px;
        padding-bottom: 70px;
        visibility: hidden;
        padding-top: 20px;

        @media (min-width: 1025px) {
          padding-top: 0;
          padding-left: 25px;
          padding-bottom: 40px;
        }

        &.open {
          transform: translateY(0);
          visibility: visible;
          padding-left: 0;
        }

        .ph-map__results__heading {
          height: 90px;
          border: unset;

          @media (min-width: 1025px) {
            height: 70px;
          }

          .ph-map__item__back-to-list {
            width: fit-content;
            svg {
              rotate: 180deg;
            }
          }
        }

        .ph-map__results__details-inner {
          .ph-map__results__details__content {
            max-height: 100%;
            padding: 25px 0;

            @media (min-width: 1025px) {
              padding: 20px 0;
            }

            &.ph-map__detail-active {
              padding-top: 0;
            }

            .ph-map__results__details__img {
              margin: unset;
              width: 75%;
              display: block;

              @media (max-width: 769px) {
                margin: 5px auto;
              }
            }

            .ph-map__item__row {
              &:not(:has(.ph-map__info__icon)) {
                display: block;
              }

              + & {
                margin-top: 15px;
              }

              &.ph__info {
                margin-top: 0;
                padding-top: 5px;
              }

              &.ph__map {
                align-items: center;

                .ph-map__item__btn {
                  padding-left: 0;
                }
              }

              &.row__ph__active--bottom {
                font-weight: 400;
                line-height: 1.2em;
                color: var(--text);
                display: flex;
                align-items: center;

                span {
                  color: var(--accent);
                }

                .ph-map__ph__text {
                  flex-basis: 80%;

                  @media (min-width: 1025px) {
                    flex-basis: 90%;
                  }
                }
              }

              &.row__ph__item--align {
                align-items: center;
              }

              &.row_ph_last {
                padding-bottom: 25px;
              }

              .ph-map__item__det {
                .ph-map__item__title {
                  color: var(--text);
                }

                .ragione_sociale {
                  margin-top: 10px;
                  margin-bottom: 10px;

                  .ph-map__results__details__subtitle {
                    font-size: 15px;
                    line-height: 1.26em;
                    text-transform: none;

                    span {
                      text-transform: capitalize;
                    }
                  }
                }

                address {
                  padding: 0;
                  margin: 0;
                }
              }

              .ph-map__item__link {
                @media (min-width: 1025px) {
                  display: none;
                }
              }
            }
          }
        }
      }
    }

    /* ---- ph found ---- */
    .ph-map__ph__found {
      padding: 35px 10px 10px;

      @media (min-width: 1025px) {
        padding: 0 0 25px;
      }
    }

    /* ---- ph list ---- */
    .ph-map__ph__list {
      list-style-type: none;
      position: relative;
      overflow-y: scroll;
      scroll-behavior: smooth;
      max-height: calc(90vh - 211px);

      @media (min-width: 1025px) {
        padding-right: 12px;
      }
    }

    .ph-map__ph__list-container {
      position: relative;
      transition-delay: 0.7s;

      &:has(+ .open) {
        visibility: hidden;
      }
    }

    /* ---- item ---- */
    .ph-map__item {
      background: var(--bg);
      padding: 15px;
      margin-bottom: 10px;
      border: 1px solid var(--border);
      border-radius: calc(var(--base-radius) / 2);

      @media (min-width: 1025px) {
        padding: 24px 22px;
      }

      &.active {
        --bg: var(--BTN-SECONDARY-BG);
        --text: var(--BTN-SECONDARY-TEXT);
      }

      &.active,
      &:focus-visible {
        outline: 2px solid var(--border);
        outline-offset: -2px;
      }

      .ph-map__info__icon svg {
        width: 18px;
        height: 18px;
      }
    }

    .ph-map__item[data-ph-style] {
      --bg: color-mix(in srgb, var(--COLOR-BADGE-BG) 20%, white);
      padding: 0 0 15px;

      @media (min-width: 1025px) {
        padding: 0 0 25px;
      }

      .ph-map__item__row {
        padding: 0 15px;

        @media (min-width: 1025px) {
          padding: 0 25px;
        }
      }

      .ph-map__info__icon svg {
        stroke: var(--text) !important;
      }
    }

    .ph-map__item__row {
      display: flex;
      flex-wrap: wrap;
      justify-content: flex-start;
      align-items: flex-start;
      margin-bottom: 5px;
      width: 100%;

      @media (min-width: 1025px) {
        align-items: center;
      }

      &.row__ph__item--align {
        align-items: center;
      }

      &:last-child {
        margin-bottom: 0;
      }
    }

    .ph-map__ph__active {
      padding: 6px 15px !important;
      flex-wrap: nowrap;
      justify-content: space-between;
      margin-bottom: 1rem;
    }

    .ph-map__item > .ph-map__ph__active {
      --radius: calc(var(--base-radius) / 2 - 3px);
      border-radius: var(--radius) var(--radius) 0 0;
    }

    .ph-map__ph__text {
      max-width: calc(100% - 30px);
      white-space: wrap;
    }

    .ph-map__item__margin {
      margin-right: 8px;

      @media (min-width: 1025px) {
        margin-right: 15px;
      }
    }

    .ph-map__item__btn {
      span {
        pointer-events: none;
      }
    }

    .ph-map__item__btn--details {
      width: fit-content;
    }

    .btn--text {
      --btn-text: var(--text);
    }

    .ph-map__item__map {
      font-size: 13px;
      text-decoration: underline;
      color: var(--text);
    }

    .ph-map__item__directions--desk {
      display: none;

      @media (min-width: 1025px) {
        display: block;
        padding: 0;
      }
    }

    .ph-map__item__link {
      font-size: 13px;
      text-decoration: underline;
      color: var(--text);

      &:hover,
      &:focus-visible {
        color: var(--text);
      }
    }

    .ph-map__item__km--mobile {
      float: left;

      @media (min-width: 1025px) {
        float: unset;
      }
    }

    .ph-map__item__km {
      --icon: url('./icon-distance-ph.svg');
      font-size: 14px;
      display: flex;
      align-items: center;
      justify-content: center;
      margin-bottom: 5px;

      @media (min-width: 1025px) {
        margin-bottom: unset;
      }
    }

    .ph-map__item__wrapper {
      display: flex;
      padding-bottom: 10px;

      &:last-child {
        padding-bottom: 0;

        @media (min-width: 1025px) {
          padding-bottom: 10px;
        }
      }

      &.ph-map__item__directions--mobile {
        @media (min-width: 1025px) {
          display: none;
        }

        .ph-map__item__link {
          padding: 2px 10px 0;
        }
      }

      svg {
        margin-right: 8px;
      }
    }

    .ph-map__item__block {
      display: block;

      @media (min-width: 1025px) {
        display: flex;
        align-items: center;
        gap: 1rem;
      }
    }

    .ph-map__item__details {
      justify-content: end;
      margin-top: 20px;

      .ph-map__item__btn {
        padding: 0;
      }
    }
  }

  /* ---- switches ---- */
  #ph-map-switches {
    display: flex;
    width: 100%;
    justify-content: space-around;
    align-items: center;
    text-transform: uppercase;
    margin-top: 10px;
    background: var(--BTN-SECONDARY-BG);
    border-radius: var(--base-radius);
    padding: 15px 25px;

    @media (min-width: 1025px) {
      display: none;
    }

    .ph-map-switches__switch {
      cursor: pointer;
      text-align: center;
      flex-basis: 50%;
      font-weight: var(--FONT-WEIGHT-HEADING);
      padding: 8px 24px;
      text-transform: uppercase;

      &.visible {
        background: var(--BTN-PRIMARY-BG);
        color: var(--BTN-PRIMARY-TEXT);
        border-radius: inherit;
      }
    }

    .ph-map-switches__switch-text {
      font-size: 14px;
    }

    .ph-map-switches__switch__map {
      &.visible {
        .ph-map__results {
          display: none !important;

          @media (min-width: 1025px) {
            display: block;
          }
        }
      }
    }
  }

  /* ---- ph list (secondo contesto, fuori da __locator) ---- */
  .ph-map__ph__list {
    flex: 1 1 400px;
    margin: 0;
    transition:
      max-height 0.3s,
      padding 0.3s;
    max-height: 70vh;

    @media (min-width: 1025px) {
      max-height: 100%;
    }

    &.not-visible {
      display: none;
    }

    .ph-map-switches__switch-text {
      font-family: var(--FONT-STACK-BODY);
      font-size: 20px;
      color: #707070;
    }
  }

  /* ---- map container ---- */
  .ph-map__map-container {
    position: relative;
    flex: 0 1 100%;
    height: 90vh;
    max-height: 0;
    margin-top: 30px;

    @media (min-width: 1025px) {
      margin-top: unset;
      flex-basis: 60%;
    }

    &.visible {
      max-height: 90vh;
      height: calc(90vh - 120px);

      .ph-map__map-canvas {
        height: calc(90vh - 120px);
      }
    }

    .ph-map__map-canvas {
      max-height: calc(90vh - 120px);
      border-radius: var(--base-radius);

      &.not-visible {
        display: none;
      }
    }

    .gm-style .gm-style-iw {
      max-width: 100vw !important;
      max-height: 100vh !important;
    }

    .gm-style-iw.gm-style-iw-c {
      button.gm-ui-hover-effect {
        right: 4px !important;

        span {
          width: 20px !important;
          height: 20px !important;
        }
      }
    }
  }
  /* ---- loader ---- */
  .loader-wrapper {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    opacity: 0;
    pointer-events: none;

    &.loading {
      pointer-events: auto;
      opacity: 1;
    }
  }
}

/* -- CUSTOM BROADCAST 8.0.0 RESTYLE -- */
.ph-map__item__det {
  margin-bottom: 10px;

  h5 {
    font-family: var(--FONT-STACK-BODY);
    font-weight: var(--FONT-WEIGHT-HEADING);
    color: var(--text);
  }

  address {
    font-family: var(--FONT-STACK-BODY);
    font-weight: var(--FONT-WEIGHT-BODY);
    text-transform: capitalize;
  }
}

.ph-map__item__type {
  font-weight: var(--FONT-WEIGHT-BODY);
  font-family: var(--FONT-STACK-BODY);
  text-transform: uppercase;
  width: fit-content;
}

.ph-map__results__details__subtitle {
  display: block;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.ph-map__item__tel:before,
.ph-map__item__km:before,
.ph-map__results__details__text-icon::before {
  content: '';
  background-color: var(--icon-color, var(--BTN-PRIMARY-BG));
  -webkit-mask: var(--icon) center no-repeat;
  mask: var(--icon) center no-repeat;
  width: 24px;
  height: 24px;
  margin-right: 8px;
}

.ph-map__results__details__text-icon {
  font-weight: var(--FONT-WEIGHT-BODY) !important;
  text-decoration: underline;

  &::before {
    background-color: var(--icon-color, var(--BTN-PRIMARY-BG)) !important;
  }

  + & {
    margin-top: 15px;
  }
}

.ph-map__results__details__text-icon,
.ph-map__item__tel {
  --icon: url('./icon-call-us.svg');
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: fit-content;
}

.ph-map__item__mail {
  --icon: url('./icon-mail-circled.svg');
}

.ph-map__item__website {
  --icon: url('./icon-website.svg');
}

.ph-map__item__facebook {
  --icon: url('./icon-facebook-circled.svg');
}

.ph-map__item__instagram {
  --icon: url('./icon-instagram-circled.svg');
}

.ph-map__item__tiktok {
  --icon: url('./icon-tiktok-circled.svg');
}

.ph-map__item__shift {
  --icon: url('./icon-tick-circled.svg');
}

.hide_empty_anchor {
  display: none;
}

.ph-map__results__details__timetable {
  --spacing: 15px;
  table,
  th,
  td {
    border: none;
    border-collapse: collapse;
    padding: 0;
    margin: 0;
  }

  .tt-day {
    padding-right: var(--spacing);
  }

  tr {
    border-bottom: 1px solid var(--border);

    + & {
      margin-top: var(--spacing);
    }

    td {
      padding-top: var(--spacing);
      padding-bottom: calc(var(--spacing) / 2);
    }
  }
}

.ph-map__details__services-list {
  list-style: none;
  padding-left: 0;
  margin: 0;

  li::before {
    content: '';
    display: inline-block;
    background-color: var(--text);
    -webkit-mask: url('./icon-tick-circled.svg') no-repeat center;
    mask: url('./icon-tick-circled.svg') no-repeat center;
    width: 10px;
    height: 7px;
    margin-right: 8px;
  }
}
