/*****************************************************
LESS compilation failed due a JavaScript error!

Input: /apps/onedomain/components/rebrand/rebrand-animated-slider/clientlibs/css/rebrand-animated-slider.less
Error: NameError: variable @brand-purple is undefined in /apps/onedomain/components/rebrand/rebrand-animated-slider/clientlibs/css/rebrand-animated-slider.less on line 14, column 24:
13   &:focus {
14     outline: 2px solid @brand-purple;
15     outline-offset: 4px;


(uncompiled LESS src is included below)
*****************************************************/
// Main styles applied to custom element only
rebrand-animated-slider {
  display: block;
  position: relative;
  width: 100%;
  padding: 80px 0;

  // Prevent browser back/forward swipe gestures
  overscroll-behavior-x: contain;
  -webkit-overscroll-behavior-x: contain;

  // Focus outline for keyboard navigation
  &:focus {
    outline: 2px solid @brand-purple;
    outline-offset: 4px;
  }

  &:focus:not(:focus-visible) {
    outline: none;
  }
}

// BEM class-based selectors for all child elements
.rebrand-animated-slider {
  &__container {
    position: relative;
    width: 100%;
    overflow: visible;
    margin-bottom: 48px; // 48px gap between cards and controls/indicators
  }

  &__track {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    min-height: 400px;

    // Prevent browser gestures
    overscroll-behavior-x: contain;
    -webkit-overscroll-behavior-x: contain;
    touch-action: pan-y pinch-zoom;

    // Mobile: Remove min-height, let content dictate height, ensure centering
    @media (max-width: @medium-breakpoint) {
      min-height: auto;
      height: auto;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
    }

    // Indicate draggable on desktop
    @media (hover: hover) and (pointer: fine) {
      cursor: grab;
      user-select: none;

      &:active {
        cursor: grabbing;
      }
    }
  }

  &__item {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.5);
    opacity: 0.4;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    z-index: 1;

    // Mobile: Stack vertically, show one at a time
    @media (max-width: @medium-breakpoint) {
      position: static;
      left: auto;
      top: auto;
      transform: none;
      opacity: 1;
      display: none;
      width: 100%;
      max-width: 100%;

      &--active {
        display: flex;
        flex-direction: column;
        align-items: center;
        pointer-events: auto;
      }

      &--prev,
      &--next,
      &--hidden {
        display: none;
      }
    }

    // Desktop: 3-card view with scaling
    @media (min-width: @medium-breakpoint) {
      // Hidden cards - completely invisible
      &--hidden {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
      }

      // Previous card - left side, 50% scale
      &--prev {
        transform: translate(-125%, -50%) scale(0.5);
        opacity: 0.4;
        z-index: 1;
      }

      // Active card - center, full scale
      &--active {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
        z-index: 3;
        pointer-events: auto;
      }

      // Next card - right side, 50% scale
      &--next {
        transform: translate(25%, -50%) scale(0.5);
        opacity: 0.4;
        z-index: 1;
      }
    }

    // Ensure child cards take full space
    > * {
      margin: 0;
      width: 100%;
    }
  }

  &__controls {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 48px; // 48px gap from indicators above
    position: relative;
    z-index: 10; // Ensure controls are always on top
  }

  &__button {
    all: unset;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    border: 1px solid @brand-purple;
    background-color: transparent;
    color: @brand-purple;
    cursor: pointer;
    transition: opacity 0.3s ease-in-out, border-color 0.3s ease-in-out;

    &:hover {
      opacity: 0.8;
    }

    &:focus {
      outline: 2px solid @brand-purple;
      outline-offset: 2px;
    }

    &:focus:not(:focus-visible) {
      outline: none;
    }

    &:active {
      transform: scale(0.95);
    }

    &:disabled {
      color: @color-grey-3;
      border-color: @color-grey-3;
      opacity: 0.5;
      cursor: not-allowed;
    }

    svg {
      width: 24px;
      height: 24px;
    }
  }

  &__indicators {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 0; // Container already has 48px margin-bottom
    position: relative;
    z-index: 10; // Ensure indicators are always on top
  }

  &__indicator {
    all: unset;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    background: @color-grey-1;
    cursor: pointer;
    transition: width 0.3s ease-in-out, background 0.3s ease-in-out;

    &:hover {
      opacity: 0.8;
    }

    &:focus {
      outline: 2px solid @brand-purple;
      outline-offset: 2px;
    }

    &:focus:not(:focus-visible) {
      outline: none;
    }

    &--active {
      width: 30px;
      background: @brand-red;
    }
  }

  &--empty {
    padding: 40px;
    text-align: center;
    color: @color-grey-3;
  }
}

// RTL support
.rtl .rebrand-animated-slider {
  &__button--prev,
  &__button--next {
    svg {
      transform: scaleX(-1);
    }
  }

  // Reverse the card positions for RTL
  &__item {
    @media (min-width: @medium-breakpoint) {
      &--prev {
        transform: translate(25%, -50%) scale(0.5);
      }

      &--next {
        transform: translate(-125%, -50%) scale(0.5);
      }
    }
  }
}
