.yw-compare-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  width: auto;
  max-width: 100%;
  box-sizing: border-box;
}

.yw-compare-button-wrap {
  position: relative;
  display: inline-flex;
  --yw-compare-bubble-offset: 10px;
}

.yw-compare-button-wrap--listing {
  --yw-listing-btn-height: 52px;
  --yw-listing-btn-reveal-duration: 0.6s;
  --yw-listing-btn-overlap: calc(var(--yw-listing-btn-height) * 0.42);
  --yw-listing-btn-text-width: 0px;
  --yw-listing-btn-side-padding: 0.75em;
}

.yw-compare-button__inner {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  width: auto;
  max-width: 100%;
}

.yw-compare-button__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition:
    transform var(--yw-listing-btn-reveal-duration, 240ms) ease,
    background-color 0.6s ease,
    color 0.6s ease;
}

.yw-compare-button__icon svg {
  width: 1em;
  height: 1em;
  display: block;
}

.yw-compare-button__text {
  white-space: nowrap;
  line-height: 1.2;
}

.yw-compare-button__icon--remove {
  display: none !important;
}

.yw-compare-button.is-active .yw-compare-button__icon--add {
  transform: rotate(45deg);
}

.yw-compare-button:not(.is-active) .yw-compare-button__inner--add-after {
  flex-direction: row-reverse;
}

.yw-compare-button.is-active .yw-compare-button__inner--remove-after {
  flex-direction: row-reverse;
}

.yw-compare-button.is-active {
  opacity: 0.9;
}

.yw-compare-button--listing {
  display: inline-flex;
  align-items: stretch;
  justify-content: flex-start;
  width: max-content;
  max-width: none;
  min-height: var(--yw-listing-btn-height);
  padding: 0;
  overflow: visible;
  background: transparent;
}

.yw-compare-button--listing.is-collapsed {
  width: var(--yw-listing-btn-height);
}

.yw-compare-button-wrap--listing .yw-compare-button__inner {
  align-items: stretch;
  gap: 0;
  height: var(--yw-listing-btn-height);
  width: max-content;
  max-width: none;
  overflow: visible;
}

.yw-compare-button-wrap--listing .yw-compare-button__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 var(--yw-listing-btn-height);
  width: var(--yw-listing-btn-height);
  height: var(--yw-listing-btn-height);
  min-width: var(--yw-listing-btn-height);
  min-height: var(--yw-listing-btn-height);
  box-sizing: border-box;
  overflow: hidden;
  border-radius: 999px;
  position: relative;
  z-index: 1;
}

.yw-compare-button-wrap--listing .yw-compare-button:not(.is-active) .yw-compare-button__icon--remove,
.yw-compare-button-wrap--listing .yw-compare-button.is-active .yw-compare-button__icon--remove {
  display: none !important;
}

.yw-compare-button-wrap--listing .yw-compare-button.is-active .yw-compare-button__icon--add {
  transform: rotate(45deg);
}

.yw-compare-button-wrap--listing .yw-compare-button__text-mask {
  display: inline-flex;
  align-items: stretch;
  box-sizing: border-box;
  flex: 0 0 auto;
  width: var(--yw-listing-btn-text-width);
  min-width: 0;
  max-width: var(--yw-listing-btn-text-width);
  overflow: hidden;
  min-height: var(--yw-listing-btn-height);
  position: relative;
  z-index: 0;
  border-radius: 999px;
  transition:
    width var(--yw-listing-btn-reveal-duration) ease,
    max-width var(--yw-listing-btn-reveal-duration) ease;
}

.yw-compare-button-wrap--listing .yw-compare-button__text {
  display: inline-flex;
  align-items: center;
  box-sizing: border-box;
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
  max-width: none;
  white-space: nowrap;
  min-height: var(--yw-listing-btn-height);
  transform: translateX(0);
  transition:
    transform var(--yw-listing-btn-reveal-duration) ease,
    background-color 0.6s ease,
    color 0.6s ease,
    border-color 0.6s ease;
}

.yw-compare-button-wrap--listing .yw-compare-button:not(.is-active) .yw-compare-button__inner--add-before .yw-compare-button__text-mask,
.yw-compare-button-wrap--listing .yw-compare-button.is-active .yw-compare-button__inner--remove-before .yw-compare-button__text-mask {
  justify-content: flex-start;
  margin-left: calc(var(--yw-listing-btn-overlap) * -1);
  border-radius: 999px;
}

.yw-compare-button-wrap--listing .yw-compare-button:not(.is-active) .yw-compare-button__inner--add-before .yw-compare-button__text,
.yw-compare-button-wrap--listing .yw-compare-button.is-active .yw-compare-button__inner--remove-before .yw-compare-button__text {
  padding-left: calc(var(--yw-listing-btn-overlap) + var(--yw-listing-btn-side-padding));
  border-top-left-radius: 999px;
  border-bottom-left-radius: 999px;
}

.yw-compare-button-wrap--listing .yw-compare-button:not(.is-active) .yw-compare-button__inner--add-after .yw-compare-button__text-mask,
.yw-compare-button-wrap--listing .yw-compare-button.is-active .yw-compare-button__inner--remove-after .yw-compare-button__text-mask {
  justify-content: center;
  margin-right: calc(var(--yw-listing-btn-overlap) * -1);
  border-radius: 0;
}

.yw-compare-button-wrap--listing .yw-compare-button:not(.is-active) .yw-compare-button__inner--add-after .yw-compare-button__text,
.yw-compare-button-wrap--listing .yw-compare-button.is-active .yw-compare-button__inner--remove-after .yw-compare-button__text {
  padding-right: calc(var(--yw-listing-btn-overlap) + var(--yw-listing-btn-side-padding));
  border-top-right-radius: 999px;
  border-bottom-right-radius: 999px;
}

.yw-compare-button-wrap--listing .yw-compare-button.is-collapsed .yw-compare-button__text-mask,
.yw-compare-button-wrap--listing .yw-compare-button.is-collapsed .yw-compare-button__inner--add-before .yw-compare-button__text-mask,
.yw-compare-button-wrap--listing .yw-compare-button.is-collapsed .yw-compare-button__inner--add-after .yw-compare-button__text-mask,
.yw-compare-button-wrap--listing .yw-compare-button.is-collapsed .yw-compare-button__inner--remove-before .yw-compare-button__text-mask,
.yw-compare-button-wrap--listing .yw-compare-button.is-collapsed .yw-compare-button__inner--remove-after .yw-compare-button__text-mask {
  width: 0;
  max-width: 0;
  min-width: 0;
  margin-left: 0;
  margin-right: 0;
  overflow: hidden;
}

.yw-compare-button-wrap--listing .yw-compare-button.is-collapsed .yw-compare-button__text {
  min-width: 0;
}

.yw-compare-button-wrap--listing-full .yw-compare-button__text-mask {
  width: var(--yw-listing-btn-text-width);
  max-width: var(--yw-listing-btn-text-width);
}

.yw-compare-button-wrap--listing-full .yw-compare-button {
  padding: 0;
}

.yw-compare-button-wrap--listing-icon .yw-compare-button__text-mask {
  width: 0;
  min-width: 0;
  max-width: 0;
  margin-left: 0;
  margin-right: 0;
  overflow: hidden;
}

.yw-compare-button-wrap--listing-icon .yw-compare-button:hover .yw-compare-button__text-mask,
.yw-compare-button-wrap--listing-icon .yw-compare-button:focus-visible .yw-compare-button__text-mask {
  width: 0;
  max-width: 0;
}

.yw-compare-button-wrap--listing-animated .yw-compare-button__text-mask {
  width: 0;
  max-width: 0;
}

.yw-compare-button-wrap--listing-animated .yw-compare-button:not(.is-active) .yw-compare-button__inner--add-before .yw-compare-button__text,
.yw-compare-button-wrap--listing-animated .yw-compare-button.is-active .yw-compare-button__inner--remove-before .yw-compare-button__text {
  transform: translateX(-100%);
}

.yw-compare-button-wrap--listing-animated .yw-compare-button:not(.is-active) .yw-compare-button__inner--add-after .yw-compare-button__text,
.yw-compare-button-wrap--listing-animated .yw-compare-button.is-active .yw-compare-button__inner--remove-after .yw-compare-button__text {
  transform: translateX(100%);
}

.yw-compare-button-wrap--listing-animated:hover .yw-compare-button__text-mask {
  width: var(--yw-listing-btn-text-width);
  max-width: var(--yw-listing-btn-text-width);
}


.yw-compare-button-wrap--listing-animated:hover .yw-compare-button:not(.is-active) .yw-compare-button__inner--add-before .yw-compare-button__text,
.yw-compare-button-wrap--listing-animated:hover .yw-compare-button.is-active .yw-compare-button__inner--remove-before .yw-compare-button__text,
.yw-compare-button-wrap--listing-animated:hover .yw-compare-button:not(.is-active) .yw-compare-button__inner--add-after .yw-compare-button__text,
.yw-compare-button-wrap--listing-animated:hover .yw-compare-button.is-active .yw-compare-button__inner--remove-after .yw-compare-button__text {
  transform: translateX(0);
}

.yw-compare-button-wrap--listing-icon .yw-compare-button,
.yw-compare-button-wrap--listing-animated .yw-compare-button {
  background: transparent !important;
  border-color: transparent;
}

.yw-compare-button__bubble {
  position: absolute;
  z-index: 20;
  min-width: 180px;
  max-width: min(320px, 90vw);
  width: max-content;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translate3d(0, 0, 0);
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
  background: #1f2a37;
  color: #fff;
  border-radius: 8px;
  padding: 10px 12px;
  line-height: 1.35;
  white-space: normal;
}

.yw-compare-button__bubble::after {
  content: none;
  position: absolute;
  width: 0;
  height: 0;
  border: 6px solid transparent;
}

.yw-compare-button-wrap[data-bubble-position="top"] .yw-compare-button__bubble {
  left: 50%;
  bottom: calc(100% + var(--yw-compare-bubble-offset));
  transform: translate3d(-50%, 6px, 0);
}

.yw-compare-button-wrap[data-bubble-position="top"] .yw-compare-button__bubble::after {
  left: 50%;
  top: 100%;
  transform: translateX(-50%);
  border-top-color: #1f2a37;
}

.yw-compare-button-wrap[data-bubble-position="bottom"] .yw-compare-button__bubble {
  left: 50%;
  top: calc(100% + var(--yw-compare-bubble-offset));
  transform: translate3d(-50%, -6px, 0);
}

.yw-compare-button-wrap[data-bubble-position="bottom"] .yw-compare-button__bubble::after {
  left: 50%;
  bottom: 100%;
  transform: translateX(-50%);
  border-bottom-color: #1f2a37;
}

.yw-compare-button-wrap[data-bubble-position="bottom-left"] .yw-compare-button__bubble {
  right: 0;
  top: calc(100% + var(--yw-compare-bubble-offset));
  transform: translate3d(0, -6px, 0);
}

.yw-compare-button-wrap[data-bubble-position="bottom-left"] .yw-compare-button__bubble::after {
  right: 18px;
  bottom: 100%;
  border-bottom-color: #1f2a37;
}

.yw-compare-button-wrap[data-bubble-position="left"] .yw-compare-button__bubble {
  right: calc(100% + var(--yw-compare-bubble-offset));
  top: 50%;
  transform: translate3d(6px, -50%, 0);
}

.yw-compare-button-wrap[data-bubble-position="left"] .yw-compare-button__bubble::after {
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  border-left-color: #1f2a37;
}

.yw-compare-button-wrap[data-bubble-position="right"] .yw-compare-button__bubble {
  left: calc(100% + var(--yw-compare-bubble-offset));
  top: 50%;
  transform: translate3d(-6px, -50%, 0);
}

.yw-compare-button-wrap[data-bubble-position="right"] .yw-compare-button__bubble::after {
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  border-right-color: #1f2a37;
}

.yw-compare-button-wrap.is-bubble-visible .yw-compare-button__bubble {
  opacity: 1;
  visibility: visible;
}

.yw-compare-button-wrap[data-bubble-position="top"].is-bubble-visible .yw-compare-button__bubble,
.yw-compare-button-wrap[data-bubble-position="bottom"].is-bubble-visible .yw-compare-button__bubble {
  transform: translate3d(-50%, 0, 0);
}

.yw-compare-button-wrap[data-bubble-position="left"].is-bubble-visible .yw-compare-button__bubble,
.yw-compare-button-wrap[data-bubble-position="right"].is-bubble-visible .yw-compare-button__bubble {
  transform: translate3d(0, -50%, 0);
}
