/**
 * Copyright since 2007 PrestaShop SA and Contributors
 * PrestaShop is an International Registered Trademark & Property of PrestaShop SA
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Academic Free License version 3.0
 * that is bundled with this package in the file LICENSE.md.
 * It is also available through the world-wide-web at this URL:
 * https://opensource.org/licenses/AFL-3.0
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@prestashop.com so we can send you a copy immediately.
 *
 * @author    PrestaShop SA and Contributors <contact@prestashop.com>
 * @copyright Since 2007 PrestaShop SA and Contributors
 * @license   https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0
 */

#itrimageslider {
  --title-color: var(--neutral-white);
  --subtitle-color: var(--neutral-white);
  --text-color: var(--neutral-white);
  --dots-color: var(--neutral-transparent);
  --dots-color-active: var(--neutral-white);
  --dots-opacity: 1;
  --arrow-background-color: var(--neutral-transparent);
  --arrow-color: var(--bs-white);
  --arrow-color-active: var(--bs-primary);

  min-height: 300px;
  margin-bottom: 0;
  aspect-ratio: 1;

  .carousel {
    .carousel-inner {
      margin-bottom: 0;

      .carousel-item {

        img {
          width: 100%;
          -o-object-fit: cover;
          object-fit: cover;
          height: 100%;
        }

        .carousel-content {
          margin-bottom: 0;
          height: 100%;

          .carousel-caption {
            top: 50%;
            left: 50%;
            bottom: inherit;
            text-align: left;
            transform: translate(-50%, -50%);
            padding: 1rem 0;
            max-width: calc(100dvw - (1rem + 2rem + 1rem) * 2);

            .title {
              color: var(--title-color);
              font-family: var(--font-family-secondary);
              font-size: 1.5rem;
              line-height: 1.5rem;
              font-weight: 400;
              margin-bottom: 0;
            }

            .caption-description {
              color: var(--text-color);
              max-width: 25rem;

              :where(h2, h3, h4, h5, h6) {
                color: var(--subtitle-color);
                margin: 0 0 2rem 0;
                font-weight: 400;
                font-size: 1rem;
                line-height: 1rem;
              }

              p {
                color: var(--text-color);
                font-size: 1rem;
                line-height: 1.25rem;
              }
            }
          }
        }
      }
    }

    .carousel-indicators {
      margin-bottom: 0;

      button {
        position: relative;
        background-color: transparent;
        display: inline-flex;
        justify-items: center;
        align-items: center;
        min-height: 3rem;
        min-width: 3rem;
        margin: 0;

        &:before {
          position: absolute;
          content: '';
          width: 1rem;
          height: 1rem;
          top: 50%;
          left: 50%;
          transform: translate(-50%, -50%);
          background-color: var(--dots-color);
          outline: 1px solid var(--dots-color-active);
          opacity: var(--dots-opacity);
          border-radius: 99px;
          padding: 0;
          margin: 0;
          outline-offset: -1px;
        }

        &.active {
          &:before {
            outline-color: var(--dots-color);
            background-color: var(--dots-color-active);
          }
        }
      }
    }

    .carousel-control-prev, .carousel-control-next {
      z-index: 10;
      top: 50%;
      display: inline-flex;
      justify-content: center;
      align-items: center;
      width: fit-content;
      height: fit-content;
      padding: 0.5rem;
      background-color: transparent;
      border-radius: 999px;
      transform: translateY(-50%);
      opacity: 1;

      &:hover :where(.carousel-control-next-icon, .carousel-control-prev-icon) {
        color: var(--arrow-color-active);
        opacity: 1;
      }

      :where(.carousel-control-next-icon, .carousel-control-prev-icon) {
        display: inline-block;
        width: 2rem;
        height: 2rem;
        font-size: 2rem;
        background-repeat: no-repeat;
        background-position: 50%;
        background-size: 100% 100%;
        opacity: 1;
        background-image: none;
        color: var(--arrow-color);
      }
    }

    .carousel-control-prev {
      left: 0.5rem;
    }

    .carousel-control-next {
      right: 0.5rem;
    }
  }

  @media (min-width: 576px) {
    aspect-ratio: 30 / 7;

    .carousel {
      .carousel-inner {
        .carousel-item {
          .carousel-content {
            .carousel-caption {
              max-width: calc(100dvw - (1rem + 3rem + 1rem) * 2)
            }
          }
        }
      }
    }
  }

  @media (min-width: 768px) {
    min-height: 420px;

    .carousel {
      .carousel-inner {
        .carousel-item {
          .carousel-content {
            .carousel-caption {
              .title {
                font-size: 3rem;
                line-height: 3rem;
              }

              .caption-description {
                :where(h2, h3, h4, h5, h6) {
                  font-size: 2rem;
                  line-height: 2rem;
                }

                p {
                  font-size: 1.5rem;
                  line-height: 1.75rem;
                }
              }
            }
          }
        }
      }

      .carousel-control-prev, .carousel-control-next {
        padding: 0;

        :where(.carousel-control-next-icon, .carousel-control-prev-icon) {
          width: 3rem;
          height: 3rem;
          font-size: 3rem;
        }
      }

      .carousel-control-prev {
        left: 1rem;
      }

      .carousel-control-next {
        right: 1rem;
      }
    }
  }
}
