.models-section {
  background-color: var(--tertiary-color);
  color: var(--secondary-color);
  padding: 70px 0px;
}

.tipology-grid__title h2 {
  font-size: 36px;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--secondary-color);
  margin-bottom: 20px
}

.tipology-grid__title h3 p {
  font-size: 16px;
  line-height: 1;
  color: var(--secondary-color);
}

.tipology-grid__title {
  width: 50%;
  margin-bottom: 60px;
}

.typology-grid {
  max-width: 1240px;
  width: 100%;
  margin: auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 1fr;
}

.typology-grid__item {
  color: var(--secondary-color);
  font-weight: 300;
  letter-spacing: 0;
  line-height: 30px;
  padding: 25px 26px 10px 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: all 0.5s;
}

.typology-grid__item img {
  max-width: 100%;
  filter: grayscale(100%);
  mix-blend-mode: multiply;
}

.typology-grid__item:hover {
  background: rgba(0, 0, 0, 0.3)
}

.typology-grid .typology-link__text svg.image-link__icon {
  height: 16px;
  width: 36px;
  margin-left: 3px;
}

@media (min-width: 768px) {
  .typology-grid .typology-grid__item {
    border-right: 1px solid var(--secondary-color);
    border-bottom: 1px solid var(--secondary-color);
  }
  td, th{
  border: 0 !important;
  }
  .typology-grid .typology-grid__item svg.image-link__icon  *  {
    fill: var(--secondary-color)
  }

  .typology-grid .typology-grid__item:nth-child(4n) {
    border-right: 0
  }

  .typology-grid .typology-grid__item:nth-child(17n) {
    border-bottom: 0;

  }
}

.typology-link__text {
  display: flex;
  align-self: flex-start;
  margin-bottom: 16px;
  margin-top: 16px;
  font-weight: 800;
  align-items: center;
}

.typology-link__desc {
  line-height: 150%;
  font-size: 12px;
}

@media (max-width: 767px){
  .models-section {
    padding: 0px 0px 40px 0px;
  }

  .typology-grid {
    grid-template-columns: repeat(2,minmax(0, 1fr));
  }

  .typology-grid__item {
    padding: 18px 15px;
  }

  .tipology-grid__title {
    width: 100%;
    padding: 30px 20px;
    margin-bottom: 0px;
  }

  .typology-link__text {
    font-size: 17px;
    margin: 0 auto;
    padding-top: 10px;
    line-height: 20px;
  }

  .typology-grid .typology-link__text svg.image-link__icon {
    height: 7px;
    width: 4px;
    margin-left: 3px;
  }
  .typology-grid__item:not(:last-of-type){
    border-bottom: 1px solid var(--secondary-color);
  }

  .typology-grid__item:nth-child(odd){
    border-right: 1px solid var(--secondary-color);
  }


}

{# Rules For Modal #}

.model-modal {
  display: none; /* Hidden by default */
  position: fixed; /* Stay in place */
  z-index: 1; /* Sit on top */
  left: 0;
  top: 0;
  width: 100%; /* Full width */
  height: 100%; /* Full height */
  overflow: auto; /* Enable scroll if needed */
  background-color: rgb(0,0,0); /* Fallback color */
  background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
}



.tipology-modal .modal__container {
  max-width: 70%;
  max-height: calc(calc(var(--vh, 1vh) * 100) - 140px);
  box-sizing: border-box;
}

.tipology-modal .modal__inner-wrapper {
  padding: 10px;
  background: var(--secondary-color);
  border-radius: 3px;
}

.tipology-modal .modal__close {
  position: absolute;
  top: 16px;
  right: 19px;
  cursor: pointer;
}

.tipology-modal .modal__close svg {
  height: 50px;
  width: 55px;
}

.tipology-modal .modal__close svg *{
  stroke: var(--primary-color);
}

.model-modal__content--top img,
.model-modal__content--top__text {
  width: 50%!important;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
}

.model-modal__content--top__text {
  padding: 50px;
  color: var(--primary-color)
}

.model-modal__content--top {
  display: flex;
  width: 100%
}

.model-modal__content--top__title{
  color: var(--primary-color);
  font-size: 72px;
  font-weight: 800;
}

.model-modal__content--top__description {
  color: var(--primary-color);
  font-size: 18px;
  font-weight: 400;
  margin-top: 10px;
  line-height: 150%;
  padding-right: 65px;
}

.model-modal__content--middle {
  width: 80%;
  padding-top: 40px;
  margin: 0 auto;
  color: var(--primary-color);
  display:flex;
  gap:20px;

}
.table-2 {
  flex: 1; /* Occupa 1 parte su 4 */
    text-align:left !important;
}

.table-1 {
  flex: 3; /* Occupa 3 parti su 4 */
    text-align:left !important;
}

/* Media query per mobile */
@media (max-width: 768px) { /* Soglia per dispositivi mobili, puoi personalizzarla */
  .model-modal__content--middle {
    flex-direction: column; /* Cambia da layout orizzontale a verticale */
    gap: 8px; /* Riduci lo spazio tra i due elementi, se necessario */
  }

  .table-2,
  .table-1 {
    flex: unset; /* Disattiva le proporzioni flex */
    width: 100%; /* Ogni elemento occupa l'intera larghezza */
  }
}

.model-modal__content--middle table tbody tr:not(:first-of-type) {
  font-weight: 400;
  font-size: 16px;
}

.model-modal__content--middle table {
  width: 100%;
}



{# Modal Table Rules #}
.model-modal__content--middle table tbody tr:nth-child(1) td p{
  font-weight: 800;
  font-size: 20px;
  margin-bottom: 0;

}
.model-modal__content--middle table tbody tr:first-child{
    background-color: #f0f0e8 !important;
    color: #9d111c !important;

}

.model-modal__content--middle table tbody tr:nth-child(2) td:first-child,
.model-modal__content--middle table tbody tr:nth-child(4) td:first-child,
.model-modal__content--middle table tbody tr:nth-child(6) td:first-child,
.model-modal__content--middle table tbody tr:nth-child(8) td:first-child,
.model-modal__content--middle table tbody tr:nth-child(10) td:first-child,
.model-modal__content--middle table tbody tr:nth-child(12) td:first-child,
.model-modal__content--middle table tbody tr:nth-child(14) td:first-child,
.model-modal__content--middle table tbody tr:nth-child(16) td:first-child {
  border-left:1px solid #9d111c !important;
 
}



/* if needed to specify the big cell .typology-grid table tbody tr:nth-child(2) td:last-of-type {
background: var(--primary-color--05-opacity)
}*/

.model-modal__content--middle table tbody tr:nth-child(3) td:first-child,
.model-modal__content--middle table tbody tr:nth-child(5) td:first-child,
.model-modal__content--middle table tbody tr:nth-child(7) td:first-child,
.model-modal__content--middle table tbody tr:nth-child(9) td:first-child,
.model-modal__content--middle table tbody tr:nth-child(11) td:first-child,
.model-modal__content--middle table tbody tr:nth-child(13) td:first-child,
.model-modal__content--middle table tbody tr:nth-child(15) td:first-child,
.model-modal__content--middle table tbody tr:nth-child(17) td:first-child{
  background: #f8e8e0;
  border-left:1px solid #9d111c !important;

}
.model-modal__content--middle table tbody tr:nth-child(3) td:nth-child(2),
.model-modal__content--middle table tbody tr:nth-child(5) td:nth-child(2),
.model-modal__content--middle table tbody tr:nth-child(7) td:nth-child(2),
.model-modal__content--middle table tbody tr:nth-child(9) td:nth-child(2),
.model-modal__content--middle table tbody tr:nth-child(11) td:nth-child(2),
.model-modal__content--middle table tbody tr:nth-child(13) td:nth-child(2),
.model-modal__content--middle table tbody tr:nth-child(15) td:nth-child(2),
.model-modal__content--middle table tbody tr:nth-child(17) td:nth-child(2){
  background: #f8e8e0;
  border-left:1px solid #9d111c !important;

}
.model-modal__content--middle table tbody tr:nth-child(3) td:nth-child(3),
.model-modal__content--middle table tbody tr:nth-child(5) td:nth-child(3),
.model-modal__content--middle table tbody tr:nth-child(7) td:nth-child(3),
.model-modal__content--middle table tbody tr:nth-child(9) td:nth-child(3),
.model-modal__content--middle table tbody tr:nth-child(11) td:nth-child(3),
.model-modal__content--middle table tbody tr:nth-child(13) td:nth-child(3),
.model-modal__content--middle table tbody tr:nth-child(15) td:nth-child(3),
.model-modal__content--middle table tbody tr:nth-child(17) td:nth-child(3){
  background: #f8e8e0;

}
.model-modal__content--middle table tbody tr:nth-child(3) td:nth-child(4),
.model-modal__content--middle table tbody tr:nth-child(5) td:nth-child(4),
.model-modal__content--middle table tbody tr:nth-child(7) td:nth-child(4),
.model-modal__content--middle table tbody tr:nth-child(9) td:nth-child(4),
.model-modal__content--middle table tbody tr:nth-child(11) td:nth-child(4),
.model-modal__content--middle table tbody tr:nth-child(13) td:nth-child(4),
.model-modal__content--middle table tbody tr:nth-child(15) td:nth-child(4),
.model-modal__content--middle table tbody tr:nth-child(17) td:nth-child(4){
  background: #f8e8e0;
}
.model-modal__content--middle table tbody tr:nth-child(3) td:nth-child(5),
.model-modal__content--middle table tbody tr:nth-child(5) td:nth-child(5),
.model-modal__content--middle table tbody tr:nth-child(7) td:nth-child(5),
.model-modal__content--middle table tbody tr:nth-child(9) td:nth-child(5),
.model-modal__content--middle table tbody tr:nth-child(11) td:nth-child(5),
.model-modal__content--middle table tbody tr:nth-child(13) td:nth-child(5),
.model-modal__content--middle table tbody tr:nth-child(15) td:nth-child(5),
.model-modal__content--middle table tbody tr:nth-child(17) td:nth-child(5){
  background: #f8e8e0;
  
}

.model-modal__content--middle table tbody tr:nth-child(3) td:nth-child(6),
.model-modal__content--middle table tbody tr:nth-child(5) td:nth-child(6),
.model-modal__content--middle table tbody tr:nth-child(7) td:nth-child(6),
.model-modal__content--middle table tbody tr:nth-child(9) td:nth-child(6),
.model-modal__content--middle table tbody tr:nth-child(11) td:nth-child(6),
.model-modal__content--middle table tbody tr:nth-child(13) td:nth-child(6),
.model-modal__content--middle table tbody tr:nth-child(15) td:nth-child(6),
.model-modal__content--middle table tbody tr:nth-child(17) td:nth-child(6){
  background: #f8e8e0;
}
.model-modal__content--middle .table-2 table tbody tr:nth-child(2) td:first-child,
.model-modal__content--middle .table-2 table tbody tr:nth-child(4) td:first-child,
.model-modal__content--middle .table-2 table tbody tr:nth-child(6) td:first-child,
.model-modal__content--middle .table-2 table tbody tr:nth-child(8) td:first-child,
.model-modal__content--middle .table-2 table tbody tr:nth-child(10) td:first-child,
.model-modal__content--middle .table-2 table tbody tr:nth-child(12) td:first-child,
.model-modal__content--middle .table-2 table tbody tr:nth-child(14) td:first-child,
.model-modal__content--middle .table-2 table tbody tr:nth-child(16) td:first-child {
  background: #fff;
  color: #42778d;
}

.model-modal__content--middle .table-2 table tbody tr:nth-child(3) td:first-child,
.model-modal__content--middle .table-2 table tbody tr:nth-child(5) td:first-child,
.model-modal__content--middle .table-2 table tbody tr:nth-child(7) td:first-child,
.model-modal__content--middle .table-2 table tbody tr:nth-child(9) td:first-child,
.model-modal__content--middle .table-2 table tbody tr:nth-child(11) td:first-child,
.model-modal__content--middle .table-2 table tbody tr:nth-child(13) td:first-child,
.model-modal__content--middle .table-2 table tbody tr:nth-child(15) td:first-child,
.model-modal__content--middle .table-2 table tbody tr:nth-child(17) td:first-child{ 
  background: #f8e8e0;
  color: #42778d;
    font-weight: 800;
}

.model-modal__content--middle table tbody tr td strong {
  font-weight: 800;
}

/* Modal Bottom - Downloads + Form */

.model-modal__content--bottom__files {
  display: flex;
  flex-direction: row;
  width: 70%;
  margin: 0 auto;
}

.model-modal__content--bottom__files a {
    color: var(--tertiary-color);
    font-size: 24px;
    font-weight: 800;
    text-transform: uppercase;
    vertical-align: middle;
    display: flex;
    flex-direction: row;
    align-items: center;
}

.model-modal__content--bottom__files-icons {
    display: flex;
    align-items: center;
    flex-direction: row;
    width: 100%;
    justify-content: space-around;
}

.model-modal__content--bottom__files-icons svg {
  height: 33px;
  width: 40px;
  vertical-align: middle;
}

.model-modal__content--bottom__files-icons svg * {
  fill: var(--tertiary-color)
}

@media (max-width: 767px) {
  .model-modal__content--bottom__files-icons svg {
  margin-bottom: 10px
}
}

.model-modal__content--bottom {
  margin-top: 40px
}

{# Modal Form Section #}

.model-modal__content--bottom__form {
  margin-top: 40px;
  background: var(--primary-color);
  border-radius: 5px;
  display: flex;
  flex-direction: row;
  padding: 15px 25px;
}

.model-modal__content--bottom__form--title,
.modal-form__form {
  width: 50%;
}

.model-modal__content--bottom__form--title {
  font-size: 32px;
  font-weight: 800;
  color: var(--secondary-color);
  line-height: 150%;
}

.model-modal__content--bottom__form--form {
  width: 65%;
  color: var(--secondary-color);
}

.model-modal__content--bottom__form--form form label {
  color: var(--secondary-color);
}


@media all and (max-width: 767px) {

  .tipology-modal .modal__container {
    max-width: 100%;
    padding-top: 0;
  }

  .tipology-modal .model-modal__content--top {
    display: flex;
    width: 100%;
    flex-direction: column;
  }

  .tipology-modal .model-modal__content--top img, .model-modal__content--top__text {
    width: 100%!important;
  }

  .tipology-modal .model-modal__content--top__text {
    padding: 0px;
  }

  .tipology-modal .model-modal__content--top__title {
    line-height: 100%;
    font-size: 36px;
    margin-top: -20px
  }

  .tipology-modal .model-modal__content--top__description {
    padding-right: 0px;
    line-height: 150%;
    font-weight: 400
  }

  .model-modal__content--middle {
    width: 100%;
  }

  .model-modal__content--bottom__files {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    width: 100%;
  }

  .model-modal__content--bottom__files a {
    font-size: 14px;
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
  }

  .model-modal__content--bottom__form {
    display: flex;
    flex-direction: column;
  }

  .model-modal__content--bottom__form--title, 
  .model-modal__content--bottom__form--form{
    width: 100%;
  }

  .tipology-modal .modal__close {
    background: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    top: -60px;
    right: 10px;
  }
  

  .tipology-modal .modal__close svg {
    filter: unset;
  }

  .tipology-modal .modal__close svg * {
    stroke: var(--primary-color)
  }

}

.model-modal__content--middle table {
  width: 100%!important;
}

.model-modal__content--middle table td {
  text-align: center!important;
  vertical-align: middle!important;
  padding: 10px!important;
  border-right: 1px solid #9d111c !important;
    border-bottom: 1px solid #9d111c !important;
}

.model-modal__content--middle table td p {
  margin-bottom: 0!important;
}

/* Regole per prime 3 colonne no prima riga background: green; */

.model-modal__content--middle table tr:not(:first-of-type) td:nth-child(-n+3) {
  text-align: left!important;
}

/* Regole per quarta colonna no prima riga background: green; */

.model-modal__content--middle table tr:not(:first-of-type) td:nth-child(4) {
  text-align: left!important;

}


/* Regole per prima riga background: lightcoral!important;  */

.model-modal__content--middle table tr:first-of-type td {
  text-align: left!important;
  vertical-align: bottom!important;
  padding: 8px!important;
        border-left: 1px solid #9d111c !important;
  border-top: 1px solid #9d111c !important;

}

/* Regole per ultima colonna no prima riga */

.model-modal__content--middle table tr:not(:first-of-type) td:last-of-type {
  text-align: left!important;
}

.model-modal__content--middle table tr:not(:first-of-type) td:nth-child(4),
.model-modal__content--middle table tr:not(:first-of-type) td:nth-child(5) {
  text-align: left!important;
}

.model-modal__content--middle table tr:first-of-type td {
  text-align: left !important
}

.model-modal__content--middle table tr:first-of-type td:nth-child(6)  {
  text-align: left!important
}

/* Regole per mobile */

@media (max-width: 767px) {
  .model-modal__content--middle table tbody tr:nth-child(1) td p {
    font-size: 10px!important;
    font-weight: 800!important;
    text-align: center;
    vertical-align: middle
  } 
  .model-modal__content--middle table tbody tr:not(:first-of-type) td p {
    font-size: 9px!important;
    font-weight: 400!important;
    text-align: left;
    vertical-align: middle
  } 
}

/* Regole per Tablet */

@media (min-width: 768px) and (max-width: 1280px){
  .model-modal__content--top {
    display:flex;
    flex-direction: column;
  }
  
  .model-modal__content--top img, .model-modal__content--top__text {
    width: 100%!important;
  }
  
  .model-modal__content--top__title {
    font-size: 60px;
  }
  
  .model-modal__content--bottom__files {
    width: 100%;
  }
  
}