.charm-group, .chain-group  {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(2, auto);
  gap: 40px;
  row-gap: 20px;
}
.charms-accordion .accordion,
.product__variant-picker .accordion {
  .accordion__section.is-active .accordion__icon>svg:last-child {
    transform: rotate(180deg);
  }
  summary {
    font-family: var(--font-body-family);
    font-size: var(--font-size-static-md);
    font-weight: var(--font-weight-bold);
    cursor: pointer;
    padding: 0 10px;
    line-height: 1em;
    background: #F9F9F9;
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    height: 50px;
    .selection-checked {
      display: none;
    }
    span {
      display: block;
      padding: 15px 0;
    }
    .accordion__icon {
      margin-left: auto;
      position: relative;
      height: 16px;
      width: 16px;
    }
    .accordion__icon > svg {
      position: absolute;
    }

    .accordion__icon>svg:last-child {
      transform: rotate(90deg);
    }
  }

  details {
    position: relative;
    padding: 0;
    border: none;
    &:after {
      content: '';
      position: absolute;
      bottom: 0;
      left: 10px;
      height: 1px;
      background: rgba(27,27,27,.1);
      width: calc(100% - 20px);
    }
    &:has(.selected), &:has(:checked) {
      summary {
        .selection-unchecked {
          display: none;
        }
        .selection-checked {
          display: block;
        }
      }
    }
    &[open] {
      summary {
        .icon-plus {
          display: none;
        }
        .icon-minus {
          display: block;
        }
      }
    }
    .accordion__body-inner {
      padding-block-start: 15px;
    }
  }
}

.charms-list, .chains-list, .sizes-list {
  padding: 15px 20px 0;
  background: #F9F9F9;
  font-size: 10px;
  .charm, .chain {
    text-align: center;
    line-height: 120%;
    cursor: pointer;
    &.selected {
      .charm-img, .chain-img {
        border-color: #E394AB;
        modal-opener {
          display: block;
        }
      }
    }
  }
  .charm-img, .chain-img {
    border: 1px solid transparent;
    /* background: white; */
    margin-bottom: 4px;
    img {
      aspect-ratio: 1 / 1;
      object-fit: cover;
      object-position: center;
      display: block;
    }
  }
  .swiper-actions {
    text-align: center;
    display: flex;
    justify-content: center;
    gap: 20px;
    svg {
      width: 15px;
      height: 15px;
      color: black;
    }
  }
  button[class*=" swiper-button--prev"] {
    margin: 0;
  }
  .swiper-pagination {
    position: static;
    width: auto;
    display: flex;
    align-items: center;
    gap: 6px;
  }
  .swiper-pagination--dots .swiper-pagination-bullet {
    width: 6px;
    height: 6px;
  }
  .swiper-pagination--dots .swiper-pagination-bullet::before,
  .swiper-pagination--dots .swiper-pagination-bullet span {
    width: 6px;
    height: 6px;
  }
}

.sizes-list {
  padding-bottom: 15px;
}

.mixtape-wrapper {
  position: relative;
  > img {
    position: relative;
    z-index: 0;
  }
}

.charms {
  .charm {
    position: absolute;
    width: 22.06%;
    padding-bottom: 22.06%;
    cursor: pointer;
    z-index: 1;
    .mixtape-charm-earrings & {
      width: 19.6%;
      padding-bottom: 19.6%;
      img {
        height: 163.28%;
        max-width: none;
        max-height: none;
        &.zodiac {
          height: 163.28%;
        }
      }
    }
    &.selected {
      .select-chain {
        display: none;
      }
      .edit {
        display: block;
      }
    }
    img {
      height: 100%;
      width: auto;
      left: 50%;
      transform: translateX(-50%);
      top: 0;
      position: absolute;
      + .select-charm {
        display: none;
      }
      ~ .edit {
        display: flex;
        justify-content: center;
        align-items: center;
      }
      &.zodiac {
        height: 125%
      }
      &.zodiac-new {
        height: 109%;
        .mixtape-charm-earrings & {
          height: 160%;
        }
      }
    }
    &.charm-1 {
      top: 55%;
      left: 13%;
      img {
        transform: rotate(30deg);
        margin-left: -37%;
      }
      .mixtape-charm-earrings & {
        top: 47.5%;
        left: 25%;
        img {
          transform: rotate(0deg) translateX(-50.5%);
          margin-left: 0;
        }
      }
    }
    &.charm-2 {
      left: 40%;
      top: 60%;
      img {
        transform: rotate(-15deg);
        margin-left: -36%;
        &.zodiac {
          margin-left: -22%;
        }
      }
      .mixtape-charm-earrings & {
        left: 56.05%;
        top: 47%;
        img {
          transform: rotate(0deg) translateX(-52%);
          margin-left: 0;
        }
      }
    }
    &.charm-3 {
      right: 17%;
      top: 45%;
      img {
        transform: rotate(-34deg);
        margin-left: -33%;
        &.zodiac {
          margin-left: -21%;
        }
      }
    }
    &.chain {
      right: 4%;
      top: 12%;
      .edit {
        bottom: 10px;
      }
    }
    .edit {
      position: absolute;
      bottom: -21px;
      left: 0;
      width: 100%;
      text-align: center;
      font-size: 12px;
      color: #aeaeae;
      cursor: pointer;
      display: none;
      .mixtape-charm-earrings & {
        bottom: -94px;
        @media (max-width: 480px) {
          bottom: -60px;
        }
      }
      span {
        border-bottom: 1px solid #aeaeae;
        display: flex;
        flex-direction: column;
        align-items: center;
      }
      svg {
        width: 10px;
        polygon, path {
          fill: #aeaeae;
        }
      }
      @media (max-width: 768px) {
        font-size: 2.5vw;
      }
    }
    .select-charm, .select-chain {
      position: absolute;
      width: 100%;
      height: 100%;
      background: transparent;
      display: flex;
      align-items: center;
      justify-content: center;
      color: #000000;
      font-size: 14px;
      padding: 0 10%;
      line-height: 1em;
      border-radius: 50%;
      border: 1px dashed #E394AB;
      text-align: center;
      @media (max-width: 768px) {
        font-size: 3vw;
      }
    }
  }
}

.mixtape-modal {
  background-color: rgba(0, 0, 0, 0.2);
  display: none;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  position: fixed;
  inset-block-start: 0;
  inset-inline-start: 0;
  z-index: var(--z-modals);
}

.mixtape-modal__dialog {
  background-color: rgb(var(--color-background));
  width: 500px;
  padding: 30px;
  border-radius: var(--card-corner-radius);
}

.mixtape-modal[open] {
  display: flex;
}

.mixtape-modal__close {
  background: none;
  padding: 0;
  border: none;
  border-radius: 0;
  margin: 0;
  position: absolute;
  inset-block-start: 0;
  inset-inline-end: 0;
  z-index: 1;
  cursor: pointer;
}

.mixtape-modal__content {
  margin: 0 auto;
}

.mixtape-modal__content .container {
  position: relative;
}

.mixtape-modal-opener {
  appearance: none;
  border: none;
  padding: 0;
  background: none;
  outline: none;
}

.modal-letters {
  display: flex;
  flex-wrap: wrap;
  .charm {
    width: calc(20% - 10px);
    text-align: center;
    margin: 5px;
    display: block;
    cursor: pointer;
    font-size: 12px;
    .charm-img {
      width: 100%;
      padding-bottom: 100%;
      border: 0px solid #d8d8d8;
      font-size: 12px;
      position: relative;
      img {
        max-height: 75%;
        min-height: 75%;
        margin-bottom: 5px;
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        transition: none;
      }
    }
  }
}

.product__variant-picker .accordion {
  details {
    &:after {
      display: none;
    }
  }
}
