/* Stacking Order */
#sticky-slideout          { z-index: 999; }
#sticky-tab-wrapper       { z-index: 998; }
#sticky-slideout-overlay  { z-index: 997; }

@keyframes animateTab {
  from {
    height: 100vh;
  }
  to {
    height: 25vh;
  }
}

/* Sticky Tab */
#sticky-tab-wrapper {
  position: fixed;
  right: 0;
  top: 50%;
  display: flex;
  align-items: center;
  transform: translateY(-50%);
  height: 25vh;
  background-color: var(--primary-color);

  #sticky-tab {
      box-shadow: -4px 0 24px rgba(0, 0, 0, 0.35);
      color: #fff;
      padding: 25px 17px;
      cursor: pointer;
      writing-mode: vertical-rl;
      text-orientation: mixed;
      transform: rotate(180deg);
      font-size: 20px;
      font-weight: 700;
      letter-spacing: 0.05em;
      text-transform: uppercase;
      user-select: none;
      transition: all 0.2s ease;
      white-space: nowrap;
      height: 100%;
      text-align: center;
  }

  #sticky-tab:hover {
      background-color: #000000;;
  }
}

#sticky-tab-wrapper.animate-in {
  animation: animateTab 1.25s cubic-bezier(1,0,0,1) 0.5s both;
}

/* Sticky Slideout */
#sticky-slideout {
    position: fixed;
    right: -100%;
    top: 50%;
    transform: translateY(-50%);
    width: 90vw;
    max-width: 600px;
    max-height: 80vh;
    color: #ffffff;
    background: var(--primary-color);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.25);
    overflow-y: auto;
    transition: right 0.5s cubic-bezier(1,0,0,1);
    padding: 35px;

  &.is-open { right: 0; }

  #sticky-slideout-close {
    background-color: #000000;
    border: 1px solid #000000;
    border-radius: 0;
    font-size: 22px;
    line-height: 1;
    height: 35px;
    width: 35px;
    cursor: pointer;
    color: #ffffff;
    padding: 4px 8px;
    transition: background-color 0.15s ease;

    &:hover {
      color: #000000;
      background-color: transparent;
      border: 1px solid #000000;
    }
  }

  #sticky-slideout-top-bar {
    display: flex;
    justify-content: space-between;
    margin-bottom: 25px;

    #sticky-slideout-title {
      font-weight: 600;
      font-size: 30px;
    }
  }

  #sticky-slideout-content {
    color: #ffffff;
    margin-top: 8px;
    text-align: center;

    img {
      width: 100%;
      height: auto;
    }
  }

  #sticky-slideout-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;

    .slideout-btn {
      text-decoration: none;
      text-align: center;
      padding: 8px 25px;

      &.white {
        color: var(--primary-color);
        background: #ffffff;
        border: 1px solid #ffffff;

        &:hover {
          color: #ffffff;
          background: var(--primary-color);
          border: 1px solid #ffffff;
        }
      }

      &.whiteOutline {
        color: #ffffff;
        background: transparent;
        border: 1px solid #ffffff;

        &:hover {
          color: #000000;
          background: #ffffff;
          border: 1px solid #ffffff;
        }
      }

      &.black {
        color: #ffffff;
        background: #000000;
        border: 1px solid #000000;

        &:hover {
          color: #ffffff;
          background: var(--primary-color);
          border: 1px solid #000000;
        }
      }

      &.blackOutline {
        color: #000000;
        background: transparent;
        border: 1px solid #000000;

        &:hover {
          color: #ffffff;
          background: #000000;
          border: 1px solid #000000;
        }
      }
    }
  }
}

/* Sticky Overlay */
#sticky-slideout-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

#sticky-slideout-overlay.is-open {
    display: block;
}