@use '../../_global/styles/mixins' as *;
@use '../../_global/styles/vars' as *;
@use '../../atoms/slider-tabs/slider-tabs';

.card-slider {
  margin: var(--section-margin) 0 var(--section-margin) 0;
  .magazine-article & {
    margin-left: -30px;
    margin-right: -30px;
  }

  &-inner {
    background: var(--color-background);
    padding: 33px 30px 0 30px;
    @media(max-width: 645px) {
      padding-left: 20px;
      padding-right: 20px;
    }
  }

  .like-h2 {
    padding: 0 0 32px 0;
    max-width: 870px;
    margin: 0 auto;
  }

  .card-slider-container {
    position: relative;
    padding-bottom: 4rem;
    max-width: 870px;
    margin: 0 auto;
    display: flex;
    @media(max-width: 590px) {
      display: block;
    }
    .card {
      position: relative;
      margin: 0 12px;
      @media(max-width: 590px) {
        margin: 12px 0;
      }
      &:first-child {
        margin-left: 0;
      }
    }
  }

  .slide-overflow {
    overflow: hidden;
    margin-left: -12px;

    .slide-wrapper {
      position: relative;
      display: flex;
      align-items: flex-start;
      width: 37400px;
      contain: layout;
      @media(max-width: 645px) {
        width: 25400px;
      }
    }

    .card {
      &:first-child {
        margin-left: 12px;
      }
      @media(max-width: 590px) {
        margin: 0 12px;
      }
    }

    .prev-clone,
    .next-clone {
      position: absolute;
      display: flex;
      width: 100%;
    }

    .prev-clone {
      position: absolute;
      right: 100%;
      justify-content: flex-end;
    }
  }

  &.fullwidth {
    .card-slider-inner {
      padding-left: var(--container-padding);
      padding-right: var(--container-padding);
    }
    .card-slider-container {
      max-width: 1340px;
    }
    .like-h2 {
      max-width: 1340px;
    }
  }
}
