.section.catalogo {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-inline: var(--spacing-side);
  padding-top: 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);
    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;
      overflow-y: visible;
      padding-right: 20px;
      padding-left: 0px;
      background: #f9f9f9;
      border-radius: 8px;

      @media screen and (max-width: 48rem) {
        position: static;
        max-height: none;
        overflow-y: visible;
        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;

            &:first-child {
              margin-top: 0;
            }
          }

          .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);

                cursor: pointer;
                text-align: right;
                border-radius: 4px;
                transition: all 0.3s ease;

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

                svg {
                  transition: transform 0.3s ease;
                  flex-shrink: 0;
                  min-width: 24px;
                  height: 24px;
                  margin-left: 10px;
                }

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

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

            .filter-content {
              display: flex;
              flex-direction: column;
              max-height: 0;
              overflow: hidden;
              transition: max-height 0.4s ease-in-out;
              border-top: none;
              padding: 0;

              &.open {
                display: flex;
                max-height: 30rem;
                padding: var(--spacing-sm);
              }

              &[hidden] {
                display: none;
              }

              .filter-options {
                overflow-y: auto;
                padding: var(--spacing-xs);
                max-height: 300px;
                margin-bottom: 15px;

                .filter-option {
                  display: flex;
                  padding: var(--spacing-xs);
                  align-items: center;
                  gap: var(--spacing-xs);
                  cursor: pointer;
                  border-radius: 4px;
                  margin-bottom: 10px;

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

                  &:hover {
                    background-color: 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%;
                    font-size: 16px;
                  }

                  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;
                    }
                  }
                }
              }

              .filter-actions {
                display: flex;
                padding: var(--spacing-sm) 0 0;
                justify-content: center;
                align-items: center;
                gap: var(--spacing-sm);
                width: 100%;
                border-top: 1px solid var(--divider-light);
                margin-top: var(--spacing-sm);

                .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);
            }
          }
        }
      }
    }
  }

  /* Stili per il dropdown di ordinamento */
  .catalogo-sort-dropdown {
    position: relative;
    width: 100%;
    margin-bottom: 15px;
    margin-top: var(--spacing-sm);
  }

  .catalogo-sort-selected {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm);
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    text-align: left;
    font-size: inherit;
    line-height: inherit;
  }

  .catalogo-sort-options {
    display: none;
    position: absolute;
    top: calc(100% - 1px);
    left: 0;
    width: 100%;
    background-color: #fff;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 100;
  }

  .catalogo-sort-selected[aria-expanded="true"] + .catalogo-sort-options {
    display: block;
  }

  .catalogo-sort-selected[aria-expanded="true"] svg {
    transform: rotate(180deg);
    transition: transform 0.3s ease;
  }

  .catalogo-sort-selected svg {
    transition: transform 0.3s ease;
  }

  .sort-option {
    padding: 10px 15px;
    cursor: pointer;
  }

  .sort-option:hover {
    background-color: #f5f5f5;
  }

  .sort-option.active {
    font-weight: bold;
    background-color: #f0f0f0;
  }
}

/* Stili per sezione con due immagini */
.sezione-con-due-immagini {
  background-color: var(--beige-section-background, #f5f0e8);
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

/* Layout in stile immagine di riferimento */
.sezione-con-due-immagini .content {
  display: flex;
  flex-direction: row;
  max-width: 1440px;
  margin: 0 auto;
  padding: 60px !important;
  gap: 60px;
  align-items: flex-start;
}

/* Immagine sinistra quadrata come nell'immagine di riferimento */
.sezione-con-due-immagini .left-content {
  display: block;
  width: 50%;
  aspect-ratio: 1/1;
  overflow: hidden;
}

.sezione-con-due-immagini .left-content img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* La colonna destra occupa l'altra metà */
.sezione-con-due-immagini .right-content {
  width: 50%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 500px;
  padding-top: 20px;
}

/* Tag superiore */
.sezione-con-due-immagini .tag {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  margin-bottom: 20px;
  letter-spacing: 1px;
  color: var(--black, #000);
}

/* Fix per il titolo nella sezione */
.sezione-con-due-immagini .heading-xl,
.sezione-con-due-immagini h2.heading-xl {
  font-size: 2.8rem !important;
  line-height: 1.1 !important;
  font-weight: 300 !important;
  margin-bottom: 30px !important;
  max-width: 90% !important;
  color: var(--black, #000) !important;
  font-family: var(--font-family-headline, serif) !important;
}

/* Fix per il bottom wrapper */
.sezione-con-due-immagini .bottom-wrapper {
  display: flex;
  position: relative;
  justify-content: space-between;
  margin-top: auto;
  margin-bottom: 0;
  min-height: auto;
  align-items: flex-end;
}

/* CTA "Leggi di più" */
.sezione-con-due-immagini .bottom-wrapper .cta {
  align-self: flex-end;
  font-size: 16px !important;
  font-weight: 400 !important;
  text-decoration: none !important;
  position: relative !important;
  padding-right: 25px !important;
}

/* Freccia al link come nell'immagine */
.sezione-con-due-immagini .bottom-wrapper .cta:after {
  content: "→";
  display: inline-block;
  margin-left: 5px;
  position: absolute;
  right: 0;
  top: 0;
}

/* Immagine di destra in basso */
.sezione-con-due-immagini .right-image,
.sezione-con-due-immagini img.right-image {
  max-width: 160px;
  width: 100%;
  height: auto;
  margin-bottom: 0;
}

/* Stili per filtri */
.filter-accordion {
  margin-bottom: 15px;
  border: 1px solid #ddd;
  border-radius: 4px;
  overflow: hidden;
  width: 100%;
}

.filter-header {
  margin-bottom: 0;
}

.filter-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 15px;
  border: none;
  cursor: pointer;
  text-align: left;
  font-weight: normal;
  transition: all 0.3s ease;
  font-size: 16px;
}

.filter-toggle:hover {
  background-color: #f9f9f9;
}

.filter-toggle svg {
  transition: transform 0.3s ease;
  min-width: 24px;
  min-height: 24px;
  color: #000;
  flex-shrink: 0;
  margin-left: 10px;
}

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

.filter-content {
  display: none;
  border-top: 1px solid #ddd;
  padding: 15px;
}

.filter-content.open {
  display: block !important;
}

.filter-options {
  max-height: none;
  overflow-y: visible;
  margin-bottom: 15px;
}

.filter-option {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  cursor: pointer;
  padding: 8px 5px;
  border-radius: 4px;
}

.filter-option:hover {
  background-color: #f5f5f5;
}

.filter-option.active {
  font-weight: bold;
}

.filter-option input {
  margin-right: 10px;
  min-width: 18px;
  min-height: 18px;
}

.filter-option label {
  cursor: pointer;
  flex-grow: 1;
  font-size: 16px;
  line-height: 1.2;
}

.filter-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 15px;
  border-top: 1px solid #eee;
  padding-top: 15px;
}

.filter-reset {
  background: none;
  border: none;
  cursor: pointer;
  color: #666;
  font-weight: 500;
  padding: 8px 12px;
}

.filter-apply {
  background-color: #000;
  color: #fff;
  border: none;
  padding: 8px 15px;
  cursor: pointer;
  border-radius: 4px;
  font-weight: 500;
}

/* Reset dei margini */
.catalogo-sidebar h3 {
  font-size: 20px;
}

/* Spazio tra i filtri */
.filter-group-title {
  margin-top: 30px;
  font-size: 1rem;

  font-weight: 400;
  color: var(--black);
  font-family: var(--font-family-base, sans-serif);
}

/* Prima sezione senza margine superiore */
.catalogo-sort-container .filter-group-title {
  margin-top: 0;
}

/* Nasconde il secondo titolo "Filtra per" se non ci sono filtri */
.empty-filters + .filter-group-title {
  display: none;
}

/* Stile specifico per l'icona freccia */
.filter-arrow-icon {
  min-width: 24px !important;
  height: 24px !important;
  display: block !important;
  margin-left: 10px !important;
  flex-shrink: 0 !important;
}

/* Container dei filtri */
.catalogo-sidebar {
  background: #f9f9f9;
  padding: 20px;
  border-radius: 8px;
}

/* Responsive per sezione con due immagini */
@media screen and (max-width: 991px) {
  .sezione-con-due-immagini .content {
    padding: 40px !important;
    gap: 40px;
  }

  .sezione-con-due-immagini .heading-xl,
  .sezione-con-due-immagini h2.heading-xl {
    font-size: 2.4rem !important;
    max-width: 100% !important;
  }

  .sezione-con-due-immagini .right-image,
  .sezione-con-due-immagini img.right-image {
    max-width: 120px;
  }

  .hero .heading-xxxxl {
    font-size: 28px !important;
    line-height: 140%;
    max-width: 90% !important;
  }
}

@media screen and (max-width: 768px) {
  .sezione-con-due-immagini .content {
    flex-direction: column;
    padding: 30px 20px !important;
    gap: 30px;
  }

  .sezione-con-due-immagini .left-content,
  .sezione-con-due-immagini .right-content {
    width: 100%;
  }

  .sezione-con-due-immagini .heading-xl,
  .sezione-con-due-immagini h2.heading-xl {
    font-size: 2rem !important;
  }

  .sezione-con-due-immagini .bottom-wrapper {
    margin-top: 30px;
  }

  .hero .heading-xxxxl {
    font-size: 24px !important;
    max-width: 100% !important;
  }
}
