/**
 * Privacy & Cookie Features - Reference CSS
 * Use with your grid (e.g. Foundation row/columns) and base typography.
 */

/* ==========================================================================
   Switch (Foundation-style toggle for Analytics / Targeting)
   ========================================================================== */
.switch {
  padding: 0;
  border: none;
  position: relative;
  outline: 0;
  margin-bottom: 1rem;
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
}

.switch input {
  opacity: 0;
  position: absolute;
  top: 9px;
  left: 10px;
  padding: 0;
}

.switch input + label,
.switch input + label.switch-paddle {
  margin-left: 0;
  margin-right: 0;
}

.switch label,
.switch label.switch-paddle {
  display: block;
  margin-bottom: 1rem;
  position: relative;
  color: transparent;
  background: #dcdcdc;
  text-indent: 100%;
  width: 4rem;
  height: 2rem;
  cursor: pointer;
  -webkit-transition: left 0.15s ease-out;
  -moz-transition: left 0.15s ease-out;
  transition: left 0.15s ease-out;
  border-radius: 15px;
}

.switch label::after,
.switch label.switch-paddle::after {
  content: "";
  display: block;
  background: #fff;
  position: absolute;
  top: 0.27rem;
  left: 0.25rem;
  width: 1.4rem;
  height: 1.4rem;
  -webkit-transition: left 0.15s ease-out;
  -moz-transition: left 0.15s ease-out;
  transition: left 0.15s ease-out;
  -webkit-transform: translate3d(0, 0, 0);
  transform: translate3d(0, 0, 0);
  border-radius: 10px;
  border: 1px solid #333;
}

.switch input:checked + label,
.switch input:checked + label.switch-paddle {
  background: #38CCCB;
}

.switch input:checked + label::after,
.switch input:checked + label.switch-paddle::after {
  left: 2.25rem;
}

/* ==========================================================================
   Save Preferences button animation
   ========================================================================== */
#save-preferences {
  transition: opacity 0.5s ease-in-out;
}

#save-preferences.saving {
  animation: pulse-opacity 1s ease-in-out infinite;
}

#save-preferences.fading {
  opacity: 0;
}

@keyframes pulse-opacity {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

/* ==========================================================================
   Privacy popup (homepage)
   ========================================================================== */
.popup {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  width: 100%;
  max-width: calc(100% - 3rem);
  margin: 0 auto;
  background: #fff;
  box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.5);
}

@media (min-width: 40em) {
  .popup {
    left: 2rem;
    right: auto;
    width: 400px;
    max-width: 400px;
    margin: 0;
  }
}

@media (min-width: 64em) {
  .popup {
    width: 500px;
    max-width: 500px;
  }
}

.popup__button-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: none;
  border: none;
  padding: 0.5rem;
  color: #333;
  font-size: 1.5rem;
  font-weight: normal;
}

.popup__button-close:hover {
  background: none;
  border: none;
  color: #008CBA;
}

.popup-inner {
  padding: 2rem;
}

.popup__buttons {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-top: 2rem;
}

.popup__buttons button,
.popup__buttons .button {
  margin: 0;
  text-transform: uppercase;
}

.popup__buttons button:not(.hollow),
.popup__buttons .button:not(.hollow) {
  color: #fff;
}

/* Hollow button (Privacy Policy link in popup) */
.button.hollow {
  background: transparent;
  border-width: 2px;
  border-style: solid;
  border-color: #008CBA;
  color: #008CBA;
}

.button.hollow:hover,
.button.hollow:focus {
  border-color: #007095;
  color: #007095;
}

/* Primary / Save button (btn-all-loc used on privacy-choices page) */
.btn-all-loc {
  margin-bottom: 30px;
  color: #fff;
}

.btn-all-loc .fa {
  margin-left: 8px;
}

/* Screen reader only */
.show-for-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
