product-page-modals {
  margin-top: auto;
  margin-bottom: 0;
  display: block;
}

.product-form__modals-buttons {
  --_button_gap: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: var(--_button_gap);

  button {
    margin-right: var(--_button_gap);

    &:after {
      content: '';
      position: absolute;
      right: calc(var(--_button_gap) * -1);
      top: 50%;
      transform: translateY(-50%);
      width: 3px;
      height: 3px;
      background-color: var(--theme-color-black);
    }

    &:last-child {
      margin-right: 0;

      &:after {
        display: none;
      }
    }
  }
}

.product-page-modals__modal {
  &[aria-hidden] .modal__container {
    padding-top: 0;
    max-width: 33vw;
  }

  accessibility-tablist {
    display: flex;
    gap: 32px;
    padding-bottom: 17px;

    [aria-selected] {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 4px;
      transition: all 0.2s ease-in-out;
      margin-bottom: auto;

      &:after {
        content: '';
        display: block;
        width: 3px;
        height: 3px;
        border-radius: 50%;
        transition: all 0.2s ease-in-out;
      }
    }

    [aria-selected='true'],
    [aria-selected]:hover {
      color: var(--theme-color-primary);

      &:after {
        background-color: var(--theme-color-primary);
      }
    }
  }

  .modals_module__panel--content {
    display: flex;
    flex-direction: column;

    .modals_module__panel--metafield-item {
      display: flex;
      border-top: 1px solid var(--theme-color-grey-2);
      padding-block: 16px;
      gap: 4px;

      &:has(.modals_module__panel--value-content:empty) {
        display: none;
      }
    }

    .modals_module__panel--text-content {
      min-width: calc((100vw / 12) * 1);
      max-width: calc((100vw / 12) * 1);
      color: var(--theme-color-grey-4);
      word-wrap: break-word;
    }

    .modals_module__panel--value-content {
      color: var(--theme-color-black);
    }

    .modals_module__panel--value-content--list {
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      gap: 8px;

      .modals_module__panel--value-content {
        display: flex;
        gap: 8px;
        align-items: center;
      }
    }
  }
}

accordion-disclosure.accordion {
  display: none;
  border-top: 1px solid var(--theme-color-grey-2);
  padding: 16px 0;

  &.is-open .accordion__summary {
    color: var(--theme-color-primary);
  }

  .accordion__summary {
    padding: 0;
  }

  .product-page-modals__accordion--content {
    display: flex;
    flex-direction: column;

    .modals_module__panel--metafield-item {
      display: flex;
      flex-direction: column;
      padding-block: 8px;
      gap: 4px;

      &:first-of-type {
        padding-block-start: 16px;
      }

      &:has(.modals_module__panel--value-content:empty) {
        display: none;
      }
    }

    .modals_module__panel--text-content {
      color: var(--theme-color-grey-4);
    }

    .modals_module__panel--value-content {
      color: var(--theme-color-black);
    }

    .modals_module__panel--value-content--list {
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      gap: 8px;

      .modals_module__panel--value-content {
        display: flex;
        gap: 8px;
        align-items: center;
      }
    }
  }
}

@media screen and (max-width: 999px) {
  accordion-disclosure.accordion {
    display: block;
  }

  product-page-modals {
    display: none;
  }
}
