:root {
  --ep-black-rgb: 0, 0, 0;
  --ep-white-rgb: 255, 255, 255;
  --ep-bg-theme: var(--color-background, var(--ep-white-rgb));
  --ep-fg-theme: var(--color-foreground, var(--ep-primary-rgb));

  --ep-color-black: #272727;
  --ep-red: #E53E3E;

  --ep-spacing-sm: 1rem;
  --ep-spacing: 2rem;
  --ep-font-bold: 600;

  --ep-content-bg: rgb(var(--color-base-background-1, var(--ep-white-rgb)));

  --epw-font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  --epw-font-size-base: 16px;
  --epw-font-bold: 700;
  --epw-spacer: 1em;
  --epw-spacer--md: 1.5em;
  --epw-spacer--lg: 2em;
}

.epw-container {
  z-index: 9999;
  position: fixed;
  bottom: 0;
  overflow: hidden;
}

.epw-container:not(.epw-container--opened) {
  cursor: pointer;
}

@media screen and (max-width: 749px) {
  .epw-container--opened {
    right: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    width: 100%;
    margin-bottom: 0 !important;
  }
}

.epw-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--ep-spacing-sm);
  color: rgb(var(--ep-white-rgb));
}

.epw-header > .epw-button-close {
  display: flex;
}

.epw-logo {
  object-fit: contain;
  max-width: 36px;
  max-height: 36px;
}

.epw-logo > svg {
  max-width: inherit;
  max-height: inherit;
}

.epw-opened {
  display: flex;
  flex-direction: column;
}

.epw-opened__content {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 25rem;
  min-width: 30rem;
  padding: var(--ep-spacing);
  background-color: var(--ep-content-bg);
  color: rgb(var(--ep-black-rgb));
  overflow-y: scroll;
}

@media screen and (max-width: 749px) {
  .epw-opened__content {
    width: 100%;
    min-width: 100%;
  }
}

/* cart */
.epw-cart-empty {
  opacity: 0.4;
  text-align: center;
  margin-top: var(--ep-spacing);
}

.epw-cart-empty__icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  row-gap: var(--ep-spacing-sm);
}

.epw-cart-empty__icon > svg {
  opacity: 0.5;
  height: 5rem;
  width: 5rem;
}

.epw-cart-empty__icon > span {
  font-size: 60%;
  letter-spacing: 0.8px;
  padding: var(--ep-spacing-sm) var(--ep-spacing);
}

.ep-widget__content--cart {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: var(--ep-spacing);
}

/* customer card */
.epw-customer-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 100%;
  max-width: 25rem;
}

@keyframes epWave {
  0% { transform: rotateZ(0deg); }
  25% { transform: rotateZ(-15deg); }
  50% { transform: rotateZ(5deg); }
  100% { transform: rotateZ(0deg); }
}

.epw-customer-card__emoji {
  margin-right: var(--ep-spacing-sm);
  font-size: 2rem;
  animation: epWave .5s cubic-bezier(0.4, 0.0, 0.2, 1) 0.1s;
  animation-iteration-count: 2;
  transform-origin: bottom right;
  will-change: transform;
}

.epw-customer-card__sentence {
  margin: 0;
}

/* redemption form styles */
.epw-form__container {
  margin-top: var(--ep-spacing);
}

.epw-form__balance {
  font-size: 1.35rem;
  text-align: right;
  margin-bottom: var(--ep-spacing-sm);
}

.epw-form__inner {
  display: flex;
  flex-direction: column;
  row-gap: 1rem;
}

.epw-form__inner .easy-points-form__discount {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* loading animation for redeem/reset buttons */
@keyframes ellipsis {
  to {
    width: 2rem;
  }
}

.easy-points--loading-ellipsis:after {
  position: relative;
  display: flex;
  align-items: center;
  animation: ellipsis steps(4, end) 1200ms infinite;
  overflow: hidden;
  content: '...';
  width: 0px;
}

/* tiers progress */
.epw-tiers {
  display: flex;
  flex-direction: column;
  margin-top: var(--ep-spacing);
}

.epw-tiers__sentence {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.25rem;
  font-size: 1.25rem;
}

.epw-tiers__rank-advancement {
  display: flex;
  align-items: baseline;
}

.epw-tiers__rank-advancement > span {
  /* comeback base font size */
  font-size: 0.85rem;
  margin-right: 2px;
  line-height: 2.5;
}

.epw-tiers__rank-maintenance-current {
  display: flex;
}

.epw-tiers__rank-maintenance-current > small {
  display: inline-block;
  font-size: 0.85rem;
  line-height: 2.5;
  margin-left: 0.25rem;
}

.epw-tiers__rank-maintenance {
  font-size: 0.85rem;
}

.epw-tiers__progress {
  position: relative;
  border-radius: 6px;
  height: 8px;
  width: 100%;
  overflow: hidden;
  background-color: rgba(var(--ep-fg-theme), 0.1);
}

.epw-tiers__progress--filled {
  display: block !important;
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  border-radius: 6px;
  background-color: rgb(var(--ep-fg-theme));
}


/* easyPoints theme */
.epw-container--theme-easypoints {
  font-family: var(--epw-font-family);
  font-size: var(--epw-font-size-base);
  font-weight: 400;
  letter-spacing: initial;
}

.epw-container--theme-easypoints p {
  color: rgb(var(--ep-black-rgb));
}

.epw-container--theme-easypoints .epw-header {
  font-size: 1em;
  padding: var(--epw-spacer);
}

.epw-container--theme-easypoints .epw-opened .epw-header {
  font-weight: var(--epw-font-bold);
}

.epw-container--theme-easypoints .epw-opened__content {
  min-height: 300px;
  max-height: 500px;
  width: 375px;
  min-width: 375px;
  padding: var(--epw-spacer--lg);
  background-color: rgba(var(--ep-white-rgb));
}

/* easyPoints theme: button */
.epw-container--theme-easypoints .epw-button {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 3em;
  padding: 0 var(--epw-spacer--md);
  border-radius: 4px;
  font-weight: var(--epw-font-bold);
  font-size: .875em;
  line-height: 1.25;
  font-family: inherit;
  color: rgb(var(--ep-white-rgb));
  background-color: rgba(var(--ep-primary-rgb), 0.9);
  border: none;
  outline: none;
  cursor: pointer;
}

.epw-container--theme-easypoints .epw-button:hover {
  background-color: rgba(var(--ep-primary-rgb, 1));
}

.epw-container--theme-easypoints .epw-button.easy-points--loading-ellipsis:after {
  display: inline-block;
}

/* easyPoints theme: form */
.epw-container--theme-easypoints  .epw-form__container {
  margin-top: var(--epw-spacer--lg);
}

.epw-container--theme-easypoints .epw-field {
  position: relative;
  width: 100%;
  display: flex;
  transition: box-shadow 0.1s ease;
}

.epw-container--theme-easypoints .epw-field::before {
  pointer-events: none;
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  border-radius: 1px;
  box-shadow: 0 0 1px rgba(var(--ep-black-rgb), 0.75);
  z-index: -1;
}

.epw-container--theme-easypoints .epw-field::after {
  pointer-events: none;
  content: "";
  position: absolute;
  top: 1px;
  right: 1px;
  bottom: 1px;
  left: 1px;
  border: 0.1em solid transparent;
  border-radius: 2px;
  box-shadow: 0 0 1px rgba(var(--ep-black-rgb), 0.75);
  transition: box-shadow .1s ease;
  z-index: 1;
}

.epw-container--theme-easypoints .epw-field__input {
  flex-grow: 1;
  min-height: 45px;
  padding: 0 16px;
  text-align: left;
  margin: 1px;
  transition: box-shadow 0.1s ease;
  appearance: none;
  background-color: rgba(var(--ep-black-rgb), 0.02);
  color: rgb(var(--ep-black-rgb));
  font-size: 1em;
  width: 100%;
  box-sizing: border-box;
  position: relative;
  border: 0;
  border-radius: 2px;
}

.epw-container--theme-easypoints .epw-field__input:disabled {
  background-color: rgba(var(--ep-black-rgb), 0.04);
}

.epw-container--theme-easypoints .epw-field__input::placeholder {
  opacity: 0;
}

.epw-container--theme-easypoints .epw-field__input:focus {
  padding-top: 1em;
  background-color: rgb(var(--ep-white-rgb));
  box-shadow: 0 0 0 2px rgba(var(--ep-primary-rgb));
  border-radius: 2px;
  outline: 0;
}

.epw-container--theme-easypoints .epw-field__input:not(:placeholder-shown) {
  padding-top: 1em;
  border-radius: 2px;
  outline: 0;
}

.epw-container--theme-easypoints .epw-field__input:not(:placeholder-shown):not(:disabled) {
  background-color: rgb(var(--ep-white-rgb));
}

.epw-container--theme-easypoints .epw-field__input:focus~.epw-field__label,
.epw-container--theme-easypoints .epw-field__input:not(:placeholder-shown)~.epw-field__label {
  font-size: 0.65em;
  left: calc(1px + 16px);
  top: calc(1px + 6px);
  letter-spacing: .02em;
  color: rgba(var(--ep-primary-rgb), 1);
}

.epw-container--theme-easypoints .epw-field__input:not(:placeholder-shown):not(:focus)~.epw-field__label {
  color: rgba(var(--ep-black-rgb), 1);
}

.epw-container--theme-easypoints .epw-field__label {
  font-size: 1em;
  left: calc(1px + 16px);
  top: calc(1px + 11px);
  margin-bottom: 0;
  pointer-events: none;
  position: absolute;
  transition: top .1s ease, font-size .1s ease;
  color: rgba(var(--ep-black-rgb), .75);
  letter-spacing: .04em;
  line-height: 1.5;
}

.epw-container--theme-easypoints .epw-form__balance {
  font-size: 1em;
  margin-bottom: 0.5em;
}

.epw-container--theme-easypoints .easy-points-form__discount {
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  flex-grow: 1;
  min-height: 45px;
  padding: 0 16px;
  border: 1px solid rgba(var(--ep-black-rgb), 0.08);
  background-color: rgba(var(--ep-black-rgb), 0.04);
  color: rgb(var(--ep-black-rgb));
  font-size: 0.75em;
  letter-spacing: 0.05em;
  width: 100%;
  box-sizing: border-box;
  border-radius: 2px;
}

.epw-container--theme-easypoints .easy-points-form__discount strong {
  font-size: 18px;
  margin-left: 4px;
  color: rgb(--ep-primary-rgb);
}

/* easyPoints theme: customer card */
.epw-container--theme-easypoints .epw-customer-card__emoji {
  font-size: 1.5em;
}

.epw-container--theme-easypoints .epw-customer-card__sentence {
  font-size: 1.25em;
}

/* easyPoints theme: tiers progress */
.epw-container--theme-easypoints .epw-tiers {
  margin-top: var(--epw-spacer--lg);
}

.epw-container--theme-easypoints .epw-tiers__sentence {
  font-size: 1em;
}

.epw-container--theme-easypoints .epw-tiers__rank-advancement span {
  font-size: 0.75em;
  margin-right: 0.25em;
  line-height: 1.75;
}

.epw-container--theme-easypoints .epw-tiers__progress {
  position: relative;
  border-radius: 6px;
  height: 8px;
  width: 100%;
  overflow: hidden;
  background-color: rgba(var(--ep-primary-rgb), 0.1);
}

.epw-container--theme-easypoints .epw-tiers__progress--filled {
  display: block !important;
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  border-radius: 6px;
  background-color: rgb(var(--ep-primary-rgb));
}


/* utils */
.easy-points-hide {
  display: none !important;
}

.epw-text--balance {
  font-weight: var(--ep-font-bold);
  letter-spacing: 1.2px;
}

.epw-button--plain {
  padding: 0;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
}

input.epw--invalid:not(:focus) {
  box-shadow: 0 0 0 2px #dc2626;
}
