<template>
  <div
    class="loyalty-suite-challenge__card"
    :class="{
      [`loyalty-suite-challenge__card_${style}`]: true,
      'loyalty-suite-challenge__card_slide': inSlider,
      'loyalty-suite-challenge__card_no-rewards': !challenge.rewards || !challenge.rewards.length,
      'loyalty-suite-challenge__card_my': myChallenges,
      'loyalty-suite-challenge__card_no-click': isSharePage
    }"
  >
    <router-link
      :to="`/challenge/${challenge.id}`"
      class="loyalty-suite-challenge__card-content"
    >
      <div class="loyalty-suite-challenge__card-wrapper">
        <div
          v-if="(challenge.image_type === 'icon' && challenge.icon) || (challenge.image_type === 'image' && challenge.image)"
          class="loyalty-suite-challenge__card-header"
          :class="{ 'loyalty-suite-challenge__card-header_icon': challenge.image_type === 'icon' }"
        >
          <img
            v-if="challenge.image_type === 'icon' && challenge.icon"
            :src="challenge.icon"
            class="loyalty-suite-challenge__card-icon"
          >
          <img
            v-if="challenge.image_type === 'image' && challenge.image"
            :src="challenge.image"
            class="loyalty-suite-challenge__card-image"
          >
        </div>

        <div class="loyalty-suite-challenge__card-name">
          {{ challenge.name }}
        </div>

        <div
          v-if="challenge.start_date || challenge.end_date"
          class="loyalty-suite-challenge__card-date-wrapper"
        >
          <div class="loyalty-suite-challenge__card-date">
            <div
              v-if="challenge.start_date && isFuture(challenge.start_date_raw)"
              class="loyalty-suite-challenge__card-date-start"
            >
              {{ $t('startsOn') }}: {{ challenge.start_date }}
            </div>

            <div
              v-if="challenge.end_date"
              class="loyalty-suite-challenge__card-date-expired"
            >
              {{
                isPast(challenge.end_date_raw)
                  ? $t('challengeExpiredOn')
                  : $t('availableUntilChallenge')
              }}: {{ challenge.end_date }}
            </div>
          </div>
        </div>

        <div
          v-if="challenge.progress && challenge.progress > 0"
          class="loyalty-suite-challenge__card-progress"
        >
          <div class="loyalty-suite-challenge__card-progress-wrapper">
            <div
              class="loyalty-suite-challenge__card-progress-bar"
              :style="{ width: challenge.progress + '%' }"
            />
          </div>
          <div class="loyalty-suite-challenge__card-progress-value">
            {{ challenge.progress }}% {{ $t('complete') }}
          </div>
        </div>

        <div
          v-if="challenge.rewards && challenge.rewards.length"
          class="loyalty-suite-challenge__card-reward"
        >
          <span class="loyalty-suite-challenge__card-reward-title">
            {{ $t('rewards') }}:
          </span>

          <div class="loyalty-suite-challenge__card-reward-list">
            <div
              ref="rewardList"
              class="loyalty-suite-challenge__card-reward-list-wrapper"
              :class="{
                'loyalty-suite-challenge__card-reward-list-wrapper_fix':
                  Array.isArray(challenge.rewards) && challenge.rewards.length > 3
              }"
            >
              <div
                v-for="(reward, rewardIndex) in challenge.rewards"
                :key="rewardIndex"
                class="loyalty-suite-challenge__card-reward-item"
              >
                <span
                  v-if="myChallenges"
                  class="loyalty-suite-challenge__card-reward-item-status"
                />
                <span class="loyalty-suite-challenge__card-reward-item-name">
                  {{ formatRewardValue(reward) }} {{ $t(reward.label) }}
                </span>
                <span
                  v-if="shouldShowRewardDetails(reward)"
                  class="loyalty-suite-challenge__card-reward-item-details"
                  @click.prevent="openDetails(rewardIndex)"
                >
                  <span class="loyalty-suite-material-icons">notes</span>
                </span>
              </div>
            </div>

            <div
              v-if="showScrollButtons && canScrollUp"
              class="loyalty-suite-challenge__card-reward-scroll-up"
              @click.prevent="scrollRewards(-1)"
            >
              <span class="loyalty-suite-material-icons">chevron_right</span>
            </div>

            <div
              v-if="showScrollButtons && canScrollDown"
              class="loyalty-suite-challenge__card-reward-scroll-down"
              @click.prevent="scrollRewards(1)"
            >
              <span class="loyalty-suite-material-icons">chevron_right</span>
            </div>
          </div>
        </div>

        <div
          v-if="myChallenges"
          class="loyalty-suite-challenge__card-share"
          @click.stop.prevent="onShareClick"
        >
          {{ $t('share') }}
          <span class="loyalty-suite-material-icons">share</span>
        </div>
      </div>
    </router-link>
  </div>

  <RewardDetails
    v-model="statusDetails"
    :reward="currentReward"
    @close="closeDetails"
  />
</template>

<script lang="ts">
import {
  defineComponent,
  ref,
  computed,
  onMounted,
  watch,
  nextTick,
} from 'vue';
import { DateTime } from 'luxon';
import RewardDetails from './RewardDetails.vue';
import {
  formatRewardValue,
  shouldShowRewardDetails,
} from '../utils/formatters';

export default defineComponent({
  components: {
    RewardDetails,
  },
  props: {
    challenge: {
      type: Object,
      required: true,
    },
    myChallenges: {
      type: Boolean,
      default: false,
    },
    inSlider: {
      type: Boolean,
      default: false,
    },
    style: {
      type: String,
      default: 'classic',
    },
  },
  emits: ['share'],
  setup(props, { emit }) {
    const statusDetails = ref(false);
    const currentReward = ref<any>('');
    const rewardList = ref<HTMLElement | null>(null);

    const timezone =
      window.loyalty_suite_account_data?.timezone || 'UTC';
    const wpFormat =
      window.loyalty_suite_account_data?.dateFormat || 'Y-m-d';

    const parseRawDate = (raw?: string | null): DateTime | null => {
      if (!raw) return null;

      let dt: DateTime;

      if (raw.includes('T')) {
        dt = DateTime.fromISO(raw, { zone: 'utc' });
      } else if (raw.includes(':')) {
        dt = DateTime.fromSQL(raw, { zone: 'utc' });
      } else {
        dt = DateTime.fromFormat(raw, 'yyyy-LL-dd', {
          zone: 'utc',
        });
      }

      if (!dt.isValid) {
        return null;
      }

      return dt.setZone(timezone).startOf('day');
    };

    const isPast = (raw: string): boolean => {
      const end = parseRawDate(raw);
      if (!end) return false;

      const now = DateTime.now()
        .setZone(timezone)
        .startOf('day');

      return now > end;
    };

    const isFuture = (raw: string): boolean => {
      const start = parseRawDate(raw);
      if (!start) return false;

      const now = DateTime.now()
        .setZone(timezone)
        .startOf('day');

      return start > now;
    };

    const showScrollButtons = computed(
      () =>
        Array.isArray(props.challenge.rewards) &&
        props.challenge.rewards.length > 3,
    );

    const scrollTop = ref(0);
    const scrollHeight = ref(0);
    const clientHeight = ref(0);

    const updateScroll = () => {
      if (!rewardList.value) return;

      scrollTop.value = rewardList.value.scrollTop;
      scrollHeight.value = rewardList.value.scrollHeight;
      clientHeight.value = rewardList.value.clientHeight;
    };

    const canScrollUp = computed(() => scrollTop.value > 0);

    const canScrollDown = computed(() => {
      return (
        Math.ceil(scrollTop.value + clientHeight.value) <
        scrollHeight.value
      );
    });

    const scrollRewards = (direction: number) => {
      const el = rewardList.value;
      if (
        !el ||
        !Array.isArray(props.challenge.rewards) ||
        props.challenge.rewards.length === 0
      ) {
        return;
      }

      const itemHeight =
        el.scrollHeight / props.challenge.rewards.length;
      el.scrollTop += direction * itemHeight;
      updateScroll();
    };

    const closeDetails = () => {
      statusDetails.value = false;
      currentReward.value = '';
    };

    const openDetails = (rewardIndex: number) => {
      if (!Array.isArray(props.challenge.rewards)) return;

      const reward = props.challenge.rewards[rewardIndex];
      if (!reward) return;

      currentReward.value = reward;
      statusDetails.value = true;
    };

    const isSharePage = !!window.loyalty_suite_account_data
      .isSharePage;

    const onShareClick = () => {
      const shareBase =
        window.loyalty_suite_account_data.shareBase;
      const userId = window.loyalty_suite_account_data.userId;
      const id = (props.challenge as any)?.id;

      if (!userId || !id) {
        return;
      }

      const url = new URL(shareBase);

      url.searchParams.set('user', String(userId));
      url.searchParams.set('type', 'challenge');
      url.searchParams.set('id', String(id));

      emit('share', url.toString());
    };

    onMounted(() => {
      if (rewardList.value) {
        rewardList.value.addEventListener('scroll', updateScroll);
        updateScroll();
      }
    });

    watch(
      () => props.challenge.rewards,
      () => {
        nextTick(updateScroll);
      },
    );

    return {
      statusDetails,
      currentReward,
      closeDetails,
      openDetails,
      rewardList,
      showScrollButtons,
      scrollRewards,
      canScrollUp,
      canScrollDown,
      isFuture,
      isPast,
      formatRewardValue,
      shouldShowRewardDetails,
      onShareClick,
      isSharePage,
    };
  },
});
</script>

<style lang="scss" scoped>
.loyalty-suite-challenge__card {
  display: flex;
  padding: 10px;

  &.loyalty-suite-challenge__card_slide {
    width: 100%;
    height: 100%;
    padding: 0;
  }

  &.loyalty-suite-challenge__card_classic {
    &.loyalty-suite-challenge__card_my {
      .loyalty-suite-challenge__card {
        &-wrapper {
          justify-content: center;
        }

        &-share {
          display: flex;
          border: 1px solid var(--loyalty-suite-borders-60);
          border-radius: 4px;
          justify-content: center;
          align-items: center;
          order: 3;
          margin-bottom: 30px;
          padding: 5px 10px;
          font-size: 14px;
          color: var(--loyalty-suite-dark);
          transition: 0.3s;
          cursor: pointer;

          span {
            color: var(--loyalty-suite-primary);
            font-size: 16px;
            margin-left: 6px;
            transition: 0.3s;
          }

          &:hover {
            background: var(--loyalty-suite-primary);
            color: var(--loyalty-suite-light);

            span {
              color: var(--loyalty-suite-light);
            }
          }
        }

        &-name {
          padding: 20px 30px;
        }
      }
    }

    &.loyalty-suite-challenge__card_no-click {
      pointer-events: none;
    }

    a.loyalty-suite-challenge__card-content {
      display: flex;
      width: 100%;
      flex-direction: column;
      align-items: center;
      text-decoration: none;
      border-radius: 8px;

      &:hover {
        color: var(--loyalty-suite-dark);
      }
    }

    .loyalty-suite-challenge__card {
      &-wrapper {
        display: flex;
        width: 100%;
        height: 100%;
        flex-direction: column;
        align-items: center;
        background: var(--loyalty-suite-light);
        box-shadow: 0 3px 10px 0 rgba(0, 0, 0, 0.2);
        border-radius: 8px;
        padding: 0;
      }

      &-date {
        display: flex;
        flex-direction: column;
        justify-content: center;

        &-wrapper {
          display: flex;
          justify-content: center;
          width: 100%;
          padding: 0 20px 20px 20px;
        }

        &-start {
          display: flex;
          justify-content: center;
          text-align: center;
          color: var(--loyalty-suite-primary);
          font-weight: 700;
          width: 100%;
          margin-bottom: 5px;
        }

        &-expired {
          display: flex;
          justify-content: center;
          text-align: center;
          color: var(--loyalty-suite-primary);
          font-weight: 700;
          width: 100%;
        }
      }

      &-progress {
        display: flex;
        flex-direction: column;
        width: 70%;
        padding: 5px 0 20px 0;

        &-value {
          display: flex;
          font-size: 12px;
          color: var(--loyalty-suite-dark);
          justify-content: center;
          text-transform: lowercase;
        }

        &-wrapper {
          display: flex;
          width: 100%;
          height: 5px;
          border-radius: 8px;
          background: var(--loyalty-suite-borders-40);
          position: relative;
          margin: 0 0 5px 0;
        }

        &-bar {
          display: flex;
          position: absolute;
          left: 0;
          top: 0;
          height: 5px;
          border-radius: 8px;
          background: var(--loyalty-suite-positive);
        }
      }

      &-name {
        display: flex;
        width: 100%;
        justify-content: center;
        font-size: 16px;
        color: var(--loyalty-suite-dark);
        line-height: normal;
        text-align: center;
        padding: 20px;
      }

      &-header {
        display: flex;
        width: 100%;
        justify-content: center;
        align-items: center;
        border-radius: 8px;
        border-bottom-right-radius: 0;
        border-bottom-left-radius: 0;

        &.loyalty-suite-challenge__card-header_icon {
          height: 95px;
        }
      }

      &-icon {
        display: flex;
        flex-shrink: 0;
        width: 70px;
        height: 70px;
        object-fit: cover;
        margin-top: 25px;
      }

      &-image {
        display: flex;
        flex-shrink: 0;
        width: 100%;
        aspect-ratio: 16 / 9;
        object-fit: cover;
        border-radius: 8px;
        border-bottom-right-radius: 0;
        border-bottom-left-radius: 0;
      }

      &-reward {
        display: flex;
        width: 100%;
        flex-direction: column;
        padding: 0 20px 20px 20px;

        &-title {
          display: flex;
          width: 100%;
          justify-content: center;
          font-size: 14px;
          color: var(--loyalty-suite-dark);
          line-height: normal;
          margin-bottom: 10px;
        }

        &-list {
          display: flex;
          width: 100%;
          flex-direction: column;
          position: relative;

          &-wrapper {
            display: flex;
            width: 100%;
            flex-direction: column;

            &.loyalty-suite-challenge__card-reward-list-wrapper_fix {
              height: 123px;
              overflow-y: auto;
              scroll-behavior: smooth;
              scrollbar-width: none;

              &::-webkit-scrollbar {
                width: 0;
                height: 0;
              }
            }
          }
        }

        &-item {
          display: flex;
          width: 100%;
          height: 36px;
          flex-shrink: 0;
          align-items: center;
          background: var(--loyalty-suite-light);
          padding: 5px 6px 5px 8px;
          border-radius: 7px;
          margin-bottom: 5px;
          border: 1px dashed var(--loyalty-suite-borders);

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

          &-name {
            font-size: 13px;
            color: var(--loyalty-suite-dark);
            line-height: 15px;
            margin-right: 5px;
          }

          &-status {
            display: flex;
            flex-shrink: 0;
            width: 20px;
            height: 20px;
            margin-right: 7px;
            background: var(--loyalty-suite-positive);
            border-radius: 50%;
            padding-bottom: 1px;

            &::after {
              display: flex;
              justify-content: center;
              align-items: center;
              content: '\2714';
              width: 100%;
              height: 100%;
              color: var(--loyalty-suite-light);
              font-size: 10px;
              font-weight: 700;
              line-height: normal;
            }
          }

          &-details {
            display: flex;
            flex-shrink: 0;
            margin-left: auto;
            padding: 5px 6px;
            background: var(--loyalty-suite-primary);
            border-radius: 5px;
            transition: 0.3s;

            .loyalty-suite-material-icons {
              font-size: 14px;
              color: var(--loyalty-suite-light);
            }

            &:hover {
              cursor: pointer;
              background: var(--loyalty-suite-primary-90);
            }
          }

          &-empty {
            display: flex;
            width: 100%;
            height: 36px;
            flex-shrink: 0;
            text-align: center;
            justify-content: center;
            align-items: center;
            background: var(--loyalty-suite-light);
            border: 1px dashed
              var(--loyalty-suite-borders-60);
            padding: 5px 8px;
            border-radius: 5px;
            font-size: 13px;
            line-height: 15px;
          }
        }

        &-scroll-up {
          display: flex;
          flex-shrink: 0;
          width: 22px;
          height: 22px;
          justify-content: center;
          align-items: center;
          position: absolute;
          top: -10px;
          left: 50%;
          transform: translateX(-50%);
          z-index: 2;
          border-radius: 50%;
          background: var(
            --loyalty-suite-primary-80
          );
          transition: 0.3s;

          &:hover {
            cursor: pointer;
            background: var(
              --loyalty-suite-primary-90
            );
          }

          .loyalty-suite-material-icons {
            font-size: 20px;
            color: var(--loyalty-suite-light);
            transform: rotate(-90deg);
          }
        }

        &-scroll-down {
          display: flex;
          flex-shrink: 0;
          width: 22px;
          height: 22px;
          justify-content: center;
          align-items: center;
          position: absolute;
          bottom: -10px;
          left: 50%;
          transform: translateX(-50%);
          z-index: 2;
          border-radius: 50%;
          background: var(
            --loyalty-suite-primary-80
          );
          transition: 0.3s;

          &:hover {
            cursor: pointer;
            background: var(
              --loyalty-suite-primary-90
            );
          }

          .loyalty-suite-material-icons {
            font-size: 20px;
            color: var(--loyalty-suite-light);
            transform: rotate(90deg);
          }
        }
      }
    }
  }

  &.loyalty-suite-challenge__card_modern {
    &.loyalty-suite-challenge__card_no-rewards {
      .loyalty-suite-challenge__card {
        &-wrapper {
          padding-bottom: 30px;
        }

        &-share {
          display: flex;
          border: 1px solid var(--loyalty-suite-borders-60);
          border-radius: 4px;
          justify-content: center;
          align-items: center;
          order: 3;
          margin-top: 30px;
          padding: 5px 10px;
          font-size: 14px;
          color: var(--loyalty-suite-dark);
          transition: 0.3s;
          cursor: pointer;

          span {
            color: var(--loyalty-suite-primary);
            font-size: 16px;
            margin-left: 6px;
            transition: 0.3s;
          }

          &:hover {
            background: var(--loyalty-suite-primary);
            color: var(--loyalty-suite-light);

            span {
              color: var(--loyalty-suite-light);
            }
          }
        }
      }
    }

    &.loyalty-suite-challenge__card_my {
      .loyalty-suite-challenge__card {
        &-wrapper {
          justify-content: center;
        }

        &-name {
          padding: 20px 30px;
        }
      }
    }

    &.loyalty-suite-challenge__card_no-click {
      pointer-events: none;
    }

    a.loyalty-suite-challenge__card-content {
      display: flex;
      width: 100%;
      flex-direction: column;
      align-items: center;
      text-decoration: none;
      border-radius: 8px;

      &:hover {
        color: var(--loyalty-suite-dark);
      }
    }

    .loyalty-suite-challenge__card {
      &-wrapper {
        display: flex;
        width: 100%;
        height: 100%;
        flex-direction: column;
        align-items: center;
        background: var(--loyalty-suite-light);
        box-shadow: 0 3px 10px 0 rgba(0, 0, 0, 0.2);
        border-radius: 8px;
        padding: 0;
      }

      &-date {
        display: flex;
        flex-direction: column;
        justify-content: center;

        &-wrapper {
          display: flex;
          justify-content: center;
          width: 100%;
          padding: 20px 0 0 0;
          order: 3;
        }

        &-start {
          display: flex;
          justify-content: center;
          text-align: center;
          color: var(--loyalty-suite-primary);
          font-weight: 700;
          width: 100%;
          margin-bottom: 5px;
        }

        &-expired {
          display: flex;
          justify-content: center;
          text-align: center;
          color: var(--loyalty-suite-primary);
          font-weight: 700;
          width: 100%;
        }
      }

      &-progress {
        display: flex;
        flex-direction: column;
        width: 70%;
        padding: 20px 0 0 0;
        order: 4;

        &-value {
          display: flex;
          font-size: 12px;
          color: var(--loyalty-suite-dark);
          justify-content: center;
          text-transform: lowercase;
        }

        &-wrapper {
          display: flex;
          width: 100%;
          height: 5px;
          border-radius: 8px;
          background: var(--loyalty-suite-borders-40);
          position: relative;
          margin: 0 0 5px 0;
        }

        &-bar {
          display: flex;
          position: absolute;
          left: 0;
          top: 0;
          height: 5px;
          border-radius: 8px;
          background: var(--loyalty-suite-positive);
        }
      }

      &-name {
        display: flex;
        width: 100%;
        justify-content: center;
        font-size: 16px;
        color: var(--loyalty-suite-dark);
        line-height: normal;
        text-align: center;
        padding: 15px 20px;
        order: 1;
      }

      &-header {
        display: flex;
        width: 100%;
        justify-content: center;
        align-items: center;
        border-radius: 0;
        order: 2;

        &.loyalty-suite-challenge__card-header_icon {
          height: 95px;
        }
      }

      &-icon {
        display: flex;
        flex-shrink: 0;
        width: 70px;
        height: 70px;
        object-fit: cover;
      }

      &-image {
        display: flex;
        flex-shrink: 0;
        width: 100%;
        aspect-ratio: 16 / 9;
        object-fit: cover;
        border-radius: 0;
      }

      &-reward {
        display: flex;
        width: 100%;
        flex-direction: column;
        padding: 15px 20px 20px 20px;
        order: 5;

        &-title {
          display: flex;
          width: 100%;
          justify-content: center;
          font-size: 14px;
          color: var(--loyalty-suite-dark);
          line-height: normal;
          margin-bottom: 10px;
        }

        &-list {
          display: flex;
          width: 100%;
          flex-direction: column;
          position: relative;

          &-wrapper {
            display: flex;
            width: 100%;
            flex-direction: column;

            &.loyalty-suite-challenge__card-reward-list-wrapper_fix {
              height: 123px;
              overflow-y: auto;
              scroll-behavior: smooth;
              scrollbar-width: none;

              &::-webkit-scrollbar {
                width: 0;
                height: 0;
              }
            }
          }
        }

        &-item {
          display: flex;
          width: 100%;
          height: 36px;
          flex-shrink: 0;
          align-items: center;
          background: var(--loyalty-suite-light);
          padding: 5px 6px 5px 8px;
          border-radius: 7px;
          margin-bottom: 5px;
          border: 1px dashed var(--loyalty-suite-borders);

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

          &-name {
            font-size: 13px;
            color: var(--loyalty-suite-dark);
            line-height: 15px;
            margin-right: 5px;
          }

          &-status {
            display: flex;
            flex-shrink: 0;
            width: 20px;
            height: 20px;
            margin-right: 7px;
            background: var(--loyalty-suite-positive);
            border-radius: 50%;
            padding-bottom: 1px;

            &::after {
              display: flex;
              justify-content: center;
              align-items: center;
              content: '\2714';
              width: 100%;
              height: 100%;
              color: var(--loyalty-suite-light);
              font-size: 10px;
              font-weight: 700;
              line-height: normal;
            }
          }

          &-details {
            display: flex;
            flex-shrink: 0;
            margin-left: auto;
            padding: 5px 6px;
            background: var(--loyalty-suite-primary);
            border-radius: 5px;
            transition: 0.3s;

            .loyalty-suite-material-icons {
              font-size: 14px;
              color: var(--loyalty-suite-light);
            }

            &:hover {
              cursor: pointer;
              background: var(--loyalty-suite-primary-90);
            }
          }

          &-empty {
            display: flex;
            width: 100%;
            height: 36px;
            flex-shrink: 0;
            text-align: center;
            justify-content: center;
            align-items: center;
            background: var(--loyalty-suite-light);
            border: 1px dashed
              var(--loyalty-suite-borders-60);
            padding: 5px 8px;
            border-radius: 5px;
            font-size: 13px;
            line-height: 15px;
          }
        }

        &-scroll-up {
          display: flex;
          flex-shrink: 0;
          width: 22px;
          height: 22px;
          justify-content: center;
          align-items: center;
          position: absolute;
          top: -10px;
          left: 50%;
          transform: translateX(-50%);
          z-index: 2;
          border-radius: 50%;
          background: var(
            --loyalty-suite-primary-80
          );
          transition: 0.3s;

          &:hover {
            cursor: pointer;
            background: var(
              --loyalty-suite-primary-90
            );
          }

          .loyalty-suite-material-icons {
            font-size: 20px;
            color: var(--loyalty-suite-light);
            transform: rotate(-90deg);
          }
        }

        &-scroll-down {
          display: flex;
          flex-shrink: 0;
          width: 22px;
          height: 22px;
          justify-content: center;
          align-items: center;
          position: absolute;
          bottom: -10px;
          left: 50%;
          transform: translateX(-50%);
          z-index: 2;
          border-radius: 50%;
          background: var(
            --loyalty-suite-primary-80
          );
          transition: 0.3s;

          &:hover {
            cursor: pointer;
            background: var(
              --loyalty-suite-primary-90
            );
          }

          .loyalty-suite-material-icons {
            font-size: 20px;
            color: var(--loyalty-suite-light);
            transform: rotate(90deg);
          }
        }
      }
    }
  }
}
</style>
