.section.catalogo {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-inline: var(--spacing-side);
  padding-block: var(--spacing-md);
  max-width: var(--max-section-grid-width);
  margin: 0 auto;
  gap: var(--spacing-side);

  @media screen and (max-width: 48rem) {
    padding: var(--spacing-side-mobile);
  }

  .archive-news-breadcrumbs-container {
    .breadcrumbs {
      margin-inline-start: unset;

      .breadcrumb-item {
        color: var(--black);
      }
    }
  }

  .head {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    /* padding-block: var(--spacing-lg); */
    margin-top: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
  }

  .content {
    display: grid;
    grid-template-columns: 1fr 3fr;
    gap: var(--spacing-md);
    align-items: start;
    min-height: 0;

    @media screen and (max-width: 48rem) {
      grid-template-columns: 1fr;
    }

    &.news {
      grid-template-columns: 3fr 1fr;
      grid-template-areas: "grid sidebar";
      gap: var(--spacing-xl);

      @media screen and (max-width: 48rem) {
        grid-template-columns: 1fr;
        grid-template-areas: unset;
      }

      .catalogo-sidebar {
        grid-area: sidebar;
        padding-inline-end: unset;

        @media screen and (max-width: 48rem) {
          grid-area: unset;
        }
      }

      .catalogo-grid {
        grid-area: grid;

        @media screen and (max-width: 48rem) {
          grid-area: unset;
        }
      }
    }

    .catalogo-sidebar {
      position: sticky;

      height: auto;
      max-height: none;
      padding-right: var(--spacing-lg);
      align-self: start;

      @media screen and (max-width: 48rem) {
        position: static;
        max-height: none;
        overflow-y: visible;
        padding-right: 0;
        margin-bottom: var(--spacing-lg);
      }

      .catalogo-filters {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: var(--spacing-xl);

        .filter-group {
          display: flex;
          flex-direction: column;
          justify-content: space-between;
          align-items: flex-start;
          width: 100%;
          gap: var(--spacing-sm);

          &:has(.filter-toggle[aria-expanded="true"]) {
            .filter-group-title {
              font-weight: 700;
            }
          }

          .filter-group-title {
            transition: all 0.3s ease-in-out;
          }

          .filter-accordion {
            display: inline;
            width: 100%;

            .filter-header {
              display: flex;
              flex-direction: column;
              justify-content: space-between;
              align-items: flex-start;
              gap: var(--spacing-xs);
              cursor: pointer;
              width: 100%;

              .filter-title {
                transition: all 0.3s ease-in-out;
                margin: 0;
              }

              .filter-toggle {
                display: flex;
                align-items: center;
                justify-content: space-between;
                background: transparent;
                width: 100%;
                box-sizing: border-box;
                padding: var(--spacing-sm);
                border: 1px solid rgba(0, 0, 0, 0.14);
                cursor: pointer;
                text-align: right;

                .filter-selection {
                  white-space: nowrap;
                  overflow: hidden;
                  text-overflow: ellipsis;
                  max-width: 18ch;
                }

                svg {
                  transition: transform 0.3s ease;
                  flex-shrink: 0;
                }

                &[aria-expanded="true"] {
                  svg {
                    transform: rotate(180deg);
                  }
                }

                &:hover {
                  background: rgba(74, 85, 72, 0.07);
                }
              }
            }

            [class*="filter-content-"],
            .filter-content {
              display: flex;
              flex-direction: column;
              max-height: 0;
              overflow: hidden;
              transition: max-height 0.4s ease-in-out;

              &.open {
                max-height: 30rem;
              }

              &[hidden] {
                display: none;
              }

              .filter-options {
                overflow-y: auto;
                padding: var(--spacing-xs);

                .filter-option {
                  display: flex;
                  padding: var(--spacing-xs);
                  align-items: center;
                  gap: var(--spacing-xs);
                  cursor: pointer;

                  input[type="checkbox"],
                  input[type="radio"] {
                    position: absolute;
                    opacity: 0;
                    width: 0;
                    height: 0;
                  }

                  &:hover {
                    background: var(--divider-light);
                  }

                  label {
                    display: inline-flex;
                    align-items: center;
                    position: relative;
                    padding-inline-start: 2rem;
                    user-select: none;
                    min-height: 1.5rem;
                    cursor: pointer;
                    width: 100%;
                  }

                  label::before {
                    content: "";
                    position: absolute;
                    left: 0;
                    top: 0;
                    width: 1.5rem;
                    aspect-ratio: 1;
                    background-repeat: no-repeat;
                    background-position: center;
                    transition: background-image 0.2s ease, transform 0.2s ease;
                    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none'%3E%3Crect x='0.75' y='0.75' width='22.5' height='22.5' stroke='%23E0E0E0' stroke-width='1.5'/%3E%3C/svg%3E");
                  }

                  input:not(:checked) + label {
                    color: var(--Grey-Grey-4, #616161);
                  }

                  input:not(:checked):hover + label::before {
                    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none'%3E%3Crect x='0.75' y='0.75' width='22.5' height='22.5' stroke='%235F756F' stroke-width='1.5'/%3E%3C/svg%3E");
                  }

                  input:checked + label::before {
                    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none'%3E%3Crect width='24' height='24' fill='%235F756F'/%3E%3Cpath d='M6 11.5806L10.5073 16.0879L18.728 7.86719' stroke='white' stroke-width='1.5' stroke-linecap='square'/%3E%3C/svg%3E");
                  }

                  input:focus + label::before {
                    box-shadow: 0 0 0 1px rgba(95, 117, 111, 0.2);
                  }

                  input + label::before {
                    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
                  }

                  input:checked + label::before {
                    animation: checkbox-pop 0.3s
                      cubic-bezier(0.175, 0.885, 0.32, 1.275);
                  }

                  @keyframes checkbox-pop {
                    0% {
                      transform: scale(0.9);
                      opacity: 0.5;
                    }

                    50% {
                      transform: scale(1.1);
                    }

                    100% {
                      transform: scale(1);
                      opacity: 1;
                    }
                  }
                }
              }

              .divider {
                width: 100%;
                height: 0.0625rem;
                background-color: var(--divider-light);
                margin-block: var(--spacing-xs);
              }

              .filter-actions {
                display: flex;
                padding: var(--spacing-sm);
                justify-content: center;
                align-items: center;
                gap: var(--spacing-sm);
                width: 100%;

                .filter-reset {
                  display: flex;
                  cursor: pointer;
                  transition: all 0.2s ease;
                  padding: var(--spacing-xs) var(--spacing-sm);
                  justify-content: center;
                  align-items: center;
                  border-radius: 1.25rem;
                  border: 1px solid var(--black);
                  background-color: var(--white);
                  transform: scale(0.95);
                  width: 50%;

                  &:hover {
                    background-color: var(--black);
                    color: var(--white);
                    border-color: var(--white);
                    transform: scale(1);
                  }
                }

                .filter-apply {
                  display: flex;
                  cursor: pointer;
                  transition: all 0.2s ease;
                  padding: var(--spacing-xs) var(--spacing-sm);
                  justify-content: center;
                  align-items: center;
                  border-radius: 1.25rem;
                  background-color: #4a5548;
                  transform: scale(0.95);
                  width: 50%;

                  &:hover {
                    transform: scale(1);
                    filter: brightness(1.5);
                  }
                }
              }
            }
          }
        }
      }
    }

    .catalogo-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
      gap: var(--spacing-md);
      row-gap: var(--spacing-xxxxl);
      height: fit-content;
      min-height: 0;
      align-content: start;

      > * {
        min-height: 0;
      }

      &.news {
        grid-template-columns: 1fr;
        gap: unset;
      }
    }
  }

  .catalogo-pagination {
    width: 100%;

    .page-numbers {
      display: flex;
      flex-wrap: wrap;
      justify-content: center;
      gap: var(--spacing-sm);
      list-style: none;
      padding: 0;
      margin: 0;

      li {
        display: inline-flex;

        .page-numbers {
          display: flex;
          align-items: center;
          justify-content: center;
          min-width: 2.5rem;
          height: 2.5rem;
          padding: 0.25rem 0.75rem;
          border: 1px solid var(--divider-light);
          border-radius: 0.25rem;
          color: var(--black);
          text-decoration: none;
          transition: all 0.3s ease;

          &:hover {
            background-color: rgba(74, 85, 72, 0.07);
            border-color: #4a5548;
          }

          &.current {
            background-color: #4a5548;
            border-color: #4a5548;
            color: var(--white);
          }

          &.prev,
          &.next {
            padding: 0.25rem 1rem;

            .arrow-prev,
            .arrow-next {
              display: flex;
              align-items: center;
            }

            .arrow-prev:before {
              content: "←";
              margin-right: var(--spacing-xs);
            }

            .arrow-next:after {
              content: "→";
              margin-left: var(--spacing-xs);
            }
          }
        }
      }
    }
  }
}
