//
// Base styles
//

.accordion-button {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  padding: $accordion-button-padding-y 0.9em;
  @include font-size($font-size-base);
  color: $accordion-button-color;
  text-align: left; // Reset button style
  background-color: $accordion-button-bg;
  border: 0;
  @include border-radius(0);
  overflow-anchor: none;
  @include transition($accordion-transition);

  &:not(.collapsed) {
    color: $accordion-button-color;
    background-color: $gray-100;
    box-shadow: inset 0 ($accordion-border-width * -1) 0 $accordion-border-color;

    &::after {
      background-image: escape-svg($accordion-button-icon);
      transform: $accordion-icon-transform;
    }
  }

  // Accordion icon
  &::after {
    flex-shrink: 0;
    width: $accordion-icon-width;
    height: $accordion-icon-width;
    margin-left: auto;
    content: "";
    background-image: escape-svg($accordion-button-icon);
    background-repeat: no-repeat;
    background-size: $accordion-icon-width;
    @include transition($accordion-icon-transition);
  }

  &:hover {
    z-index: 2;
  }

  &:focus {
    z-index: 3;
    border-color: $accordion-button-focus-border-color;
    outline: 0;
    box-shadow: $accordion-button-focus-box-shadow;
  }
}

.accordion-header,
.accordion-heading {
  margin-bottom: 0;
}

.accordion-item {
  border-bottom: $accordion-border-width solid $gray-300;
  background-color: $accordion-bg;
}

.accordion-body {
  padding: $accordion-body-padding-y $accordion-body-padding-x;
}

// Secondary accordions

.secondary .accordion {
  .accordion-item {
    background-color: transparent;
    border: none;
    border-radius: 0.5rem;

    &:has(.accordion-button:disabled),
    .module-content {
      background-color: $gray-100;
    }

    &:first-of-type .accordion-button {
      border-radius: 0.5rem;
    }

    .module-content {
      padding: 1rem;
      border-radius: 0 0 .5rem .5rem;
    }
  }

  .accordion-button:not(.collapsed) {
    box-shadow: none;
    background-color: $primary;
    color: $white;

    .filter-svg {
      -webkit-text-stroke: 2px $white;
    }

    &::after {
      background-image: escape-svg($chevronActiveIcon);
    }
  }

  .accordion-button {
    background-color: $gray-100;

    &:disabled::after {
      background-image: none;
    }
  }

  .module-heading {
    border-radius: .5rem;
    font-weight: $font-weight-normal;
    display: flex;
    align-items: center;
    gap: 9px;
  }

  nav {
    padding: .5rem;
  }

  .accordion-collapse.show {
    background-color: $gray-100;
    border-radius: 0 0 .5rem .5rem;
  }
  
  .package-accordion .accordion-body {
    background-color: #fff;
    padding: 6px 0;
  }
}