@import "mixins";

#orchard-map-wrapper, #orchard-map-nav {
	background: #e4e4e4;
	@include transition(0.3s ease opacity);
}

#orchard-map-wrapper {
  position: relative;
  min-height: 51vw;
  #orchard-retailers-modal-trigger {
    display: none;
    position: absolute;
    bottom: 5vw;
    left: 50%;
    text-transform: uppercase;


    border: solid 2px #ff893e;
    color: #ff893e;
    padding: 8px 13px 8px 13px;
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 0.08em;
    margin-right: 20px;
    text-decoration: none !important;

    @include transform(translate(-50%, 0));
    &:hover, &.active {
      background-color: #ff893e;
      color: #fff;
      @include transition(0.6s all linear);
    }
  }
  @include bp-768 {
    padding-bottom: 15vw;
    #orchard-retailers-modal-trigger {
      display: block;
    }
  }
}

#marker-info-window {
  display: none;
  position: absolute;
  z-index: 2;
  background: #fff;
  color: #363636;
  opacity: 0;
  padding: 20px;
  font-size: 14px;
  width: 280px;
  box-sizing: border-box;
  @include transition(0.4s ease opacity);
  @include transform(translate(-50%, calc(-100% - 5px)));
}
.mobile-only.orchard-offices {
  display: none;
  background: #fff;
  border-bottom: 2px solid #828282;
  .offices-title {
    text-align: center;
    padding: 25px 0;
  }
  .region-name {
    cursor: pointer;
    position: relative;
    padding-top: 16px !important;
    padding-bottom: 16px !important;
    h3 {
      color: #363636;
    }
    &:before {
      content: "";
      position: absolute;
      top: 0;
      background-color: #828282;
      left: 0px;
      width: 100vw;
      height: 2px;
    }
    &:after {
      font-family: FontAwesome;
      content: "\f107";
      position: absolute;
      right: 15px;
      color: #ff893e;
      top: 14px;
      display: inline-block;
      font-size: 32px;
    }
  }
  .region-name, .region-office {
    padding-top: 1rem;
    padding-bottom: 1rem;
  }
  .region-offices-wrapper {
    margin-top: -12px;
    display: none;
  }
  .region-wrapper {
    margin-top: -0.5vw;
  }
  .orchard-map-info-window-title {
    font-size: 20px;
    color: #363636;
    font-weight: 400;
  }
  .orchard-map-info-window-location {
    font-size: 15px;
    margin-left: 5px;
  }
  .region-wrapper.active {
    .region-name {
      &:before {
        background-color: #ff893e;
      }
      &:after {
        @include rotate(180deg);
      }
    }
    .region-offices-wrapper {
      display: block;
    }
  }
  .region-office {
    .orchard-map-info-window-subtitle, .orchard-map-info-window-territories-wrapper {
      margin-bottom: 1.5rem;
    }
    .orchard-map-info-window-territories-wrapper {
      padding-left: 0;
      li:first-of-type {
        list-style-type: none;
        margin-left: 0;
      }
    }
    .orchard-map-info-window-contact-wrapper {
      padding-bottom: 1.2rem;
    }
    .border {
      height: 1px;
      width: 100%;
      background: #a6a6a6;
    }
  }
  @include bp-768 {
    display: block;
  }
}
#marker-info-window, .region-office {
  a {
  	color: #ff893e;
  }
  .orchard-map-into-title-wrapper {
  	margin-bottom: 5px;
  }
  .orchard-map-info-window-title {
  	font-size: 22px;
  	font-weight: 600;
  }
  .orchard-map-info-window-location {
  	font-size: 17px;
  	margin-left: 5px;
  }
  .orchard-map-info-window-subtitle {
  	display: block;
  	margin-bottom: 13px;
  }
  .orchard-map-info-window-territories-wrapper {
  	margin-top: 5px;
  	padding-left: 3px;
    overflow: auto;
    margin-bottom: 0;
  	li {
	    float: left;
	    margin-left: 15px;
	    margin-right: 12px;
	  }
  }
  .orchard-map-info-window-contact-wrapper {
  	padding-left: 18px;
  	margin-bottom: 0;
  }
}

#orchard-map-nav {
	font-size: 16px;
	text-align: center;
  padding: 40px 0 35px;
  text-transform: uppercase;
  .orchard-map-main-title {
  	text-transform: none;
  	margin-bottom: 30px;
  }
  a {
    font-family: RopaSoftPTT-Regular;
    letter-spacing: 0.02em;
    font-size: 22px;
    color: #828282;
    margin-right: 20px;
    text-decoration: none;
    display: inline-block;
    vertical-align: middle;
    @include transform(translateZ(0));
    box-shadow: 0 0 1px rgba(0, 0, 0, 0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
    overflow: hidden;
    &:before {
      content: "";
      position: absolute;
      z-index: -1;
      left: 0;
      right: 100%;
      bottom: 0;
      background: #363636;
      height: 2px;
      -webkit-transition-property: right;
      transition-property: right;
      -webkit-transition-duration: 0.6s;
      transition-duration: 0.6s;
      -webkit-transition-timing-function: ease-out;
      transition-timing-function: ease-out;
    }
  	&.active, &:hover {
      color: #363636;
      -webkit-transition: color 0.3s linear;
      -moz-transition: color 0.3s linear;
      -o-transition: color 0.3s linear;
      transition: color 0.3s linear;
      &:before {
        right: 0;
      }
  	}
  }
  @include bp-768 {
    background: #fff;
    padding-bottom: 0;
    .orchard-map-nav-item-wrapper {
      display: flex;
      background: #e4e4e4;
      padding: 0.5vw 0 25px;
    }
    a {
      background: #fff;
      height: 50px;
      font-size: calc(12px + 1.5vw);
      line-height: 50px;
      vertical-align: middle;
      position: relative;
      flex-grow: 1;
      margin: 0 0 0 0.5vw;
      &:last-of-type {
        margin-right: 0.5vw;
      }
      &:before {
        height: 0.5vw;
      }
      &[data-toggle='offices'] {
        display: none;
      }
    }
  }
}

#orchard-map-retailers-modal {
	position: absolute;
  @include bp-768 {
    position: fixed;
    overflow: scroll;
  }
	opacity: 0;
	z-index: -1;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(6,27,47,0.95);
	@include transition(0.3s ease opacity);
  .map-type {
    display: none;
    &.active {
      display: block;
    }
  }
  .mobile-retailers {
    @include bp-768 {
      display: block;
    }
    display: none;
  }
  .mobile-map-modal-title {
    display: none;
    color: #fff;
    margin-bottom: 20px;
    font-size: 22px;
    text-transform: uppercase;
    line-height: 28px;
    max-width: calc(100% - 75px);
  }
	.map-modal-title {
		font-weight: 400;
		span:first-of-type {
			font-weight: 600;
		}
		margin-bottom: 70px;
	}
	.map-modal-title, .map-modal-footer {
		color: #fff;
		font-size: 22px;
	}
	.orchard-map-retailers-inner {
	  max-width: 90%;
	  width: 700px;
		max-height: 100%;
	  position: absolute;
	  margin: auto;
	  top: 50%;
	  left: 50%;
	  color: #fff;
	  @include transform(translate(-50%, -50%));
	}
	.map-modal-footer {
		font-weight: 600;
	}
	#orchard-map-close-modal, #orchard-map-mobile-close-modal {
    -webkit-appearance: none;
    background: none;
    border: none;
    outline: none;
    position: absolute;
    right: 40px;
    top: 35px;
    height: 35px;
    width: 35px;
    padding: 0;
    z-index: 10;
    img {
    	max-width: 100%;
    	height: auto;
    }
    @include bp-768 {
      display: none;
    }
	}
  #orchard-map-mobile-close-modal {
    @include bp-768 {
      display: block;
      position: absolute;
      top: 50%;
      transform: translateY(-50%);
      right: 16px;
    }
  }
	.retailers {
		display: none;
		font-size: 0;
		margin: 0 -15px;
		.img-wrapper {
			width: 25%;
			padding: 15px;
			display: none;
			img {
				width: 100%;
				height: auto;
			}
		}
	}
	&.showing {
		opacity: 1;
	}
	&[data-region='region-0'] .img-wrapper.region-0, &[data-region='region-1'] .img-wrapper.region-1, 
	&[data-region='region-2'] .img-wrapper.region-2, &[data-region='region-3'] .img-wrapper.region-3, 
	&[data-region='region-4'] .img-wrapper.region-4, &[data-region='region-5'] .img-wrapper.region-5 {
		display: inline-block;
	}

	&[data-type='digital'] .retailers.digital, &[data-type='physical'] .retailers.physical, &[data-type='performance'] .retailers.performance, {
		display: block;
	}
	.map-modal-footer {
		margin-top: 30px;
		font-size: 24px;
		text-align: center;
	}

  #mobile-map-title-wrapper {
    display: none;
    padding-top: 20px;
    position: fixed;
    z-index: 9;
    width: 100%;
    background-color: rgba(6,27,47,0.95);
    @include bp-768 {
      display: block;
    }
  }

  @include bp-768 {
    .map-modal-title {
      display: none;
    }
    .retailers, .map-modal-footer {
      display: none;
    }
    .mobile-map-modal-title, .mobile-retailers .map-modal-footer {
      display: block;
    }
    .orchard-map-retailers-inner {
      max-width: 100%;
      position: relative;
      top: 0;
      left: 0;
      @include transform(translate(0, 0));
      padding-top: 75px;
    }
    &[data-type='performance'] .orchard-map-retailers-inner {
      padding-top: 105px;
    }
    .mobile-retailers {
      display: none;
    }
    &[data-type='digital'] .mobile-digital-retailers, &[data-type='physical'] .mobile-physical-retailers, &[data-type='performance'] .mobile-performance-retailers, {
      display: block;
    }
    .mobile-retailers {
      h2 {
        font-size: 21px;
        color: #fff;
      }
      .map-modal-footer {
        font-size: 19.6px;
        padding-bottom: 30px;
        border-bottom: 1px solid #a6a6a6;
      }
      .row:last-of-type .map-modal-footer {
        border-bottom: 0;
      }
      .images-wrapper {
        margin: 0 -15px;
      }
      .img-wrapper {
        width: 25%;
        display: inline-block;
        padding: 15px;
        img {
          max-width: 100%;
          height: auto;
        }
      }
    }
  }
}