/* ======================================= */
/*            CSS Variables                */
/* ======================================= */
:root {
  --white: #fff;
  --mainColor: #2bb673;      /* Formerly #2bb673 (example color) */
  --overlayDark: #202023;    /* Formerly #202023 */
  --secondaryAccent: #baaf99;/* Formerly #baaf99 */
}

/* ======================================= */
/*         Global / Helper Styles          */
/* ======================================= */

/* Remove default z-index for #slider and #wrapper when the sidepanel is open */
.sidepanel-open #slider,
.sidepanel-open #wrapper {
  z-index: unset;
}

/* Force left text alignment inside elements containing "align-" classes */
[class*="align-"] .sidepanel,
[class*="align-"] .sidepanel * {
  text-align: left !important;
}

/* ======================================= */
/*              Sidepanel Base             */
/* ======================================= */

.sidepanel {
  position: fixed;
  top: 0;
  right: -100%;
  width: 70%;
  max-width: 1500px;
  height: 100%;
  background-color: var(--white);
  overflow-x: hidden;
  z-index: 99901;
  transition: all 500ms cubic-bezier(0.77, 0, 0.175, 1);
  will-change: right;
}

/* Active (open) sidepanel variant */
.sidepanel.open {
  right: 0 !important;
}

/* Sidepanel media queries */
@media screen and (min-width: 1025px) {
  .sidepanel {
    min-width: 1000px;
  }
}

@media screen and (max-width: 1024px) {
  .sidepanel {
    width: 95%;
  }
}

/* ======================================= */
/*       Sidepanel Container & Content     */
/* ======================================= */

.sidepanel .sidepanel-container {
  padding: 30px;
  padding-top: 60px;
}

@media screen and (max-width: 1024px) {
  .sidepanel .sidepanel-container {
    padding-left: 20px;
    padding-right: 20px;
  }
}

/* Links in the content (sticky position) */
.sidepanel .sidepanel-container .sidepanel-body .links {
  position: sticky;
  right: 20px;
  bottom: 20px;
  z-index: 1;
  left: 0;
  margin-left: auto;
  width: max-content;
}

/* ======================================= */
/*                Overlay                  */
/* ======================================= */

#sidepanel-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  bottom: 0;
  right: 0;
  z-index: 99900;
  opacity: 0.8;
  visibility: hidden;
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* ======================================= */
/*              Close Button               */
/* ======================================= */

#sidepanel-close {
  color: var(--mainColor);
  position: fixed;
  top: 20px;
  right: -50%;
  z-index: 100003;
  cursor: pointer;
  font-size: 3rem;

  transform: rotate(45deg);
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);

  border-radius: 35px;
  background-color: var(--white);
  width: 35px;
  height: 35px;
  line-height: 33px;
  text-align: center;
}

#sidepanel-close:hover {
  opacity: 0.75;
}

/* ======================================= */
/*    HTML Tag State: .sidepanel-open      */
/* ======================================= */

html.sidepanel-open {
  overflow: hidden;
}

html body {
  left: 0;
}

html.sidepanel-open body {
  left: -200px;
  transition: all 500ms cubic-bezier(0.77, 0, 0.175, 1);
}

html.sidepanel-open #sidepanel-close {
  right: 30px;
}

html.sidepanel-open #sidepanel-overlay {
  visibility: visible;
  background-color: var(--overlayDark);
}

/* ======================================= */
/*             Loader Element              */
/* ======================================= */

.loader {
  width: 48px;
  height: 48px;
  border: 5px solid var(--white);
  border-bottom-color: var(--secondaryAccent);
  border-radius: 50%;
  display: inline-block;
  box-sizing: border-box;
  animation: rotation 1s linear infinite;
  margin-left: calc(50% - 24px);
}

/* Keyframes for loader rotation */
@keyframes rotation {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
