body#stores {
  #main {
    #content {
      margin: 0;
      width: 100%;
      .search_text {
        text-align: center;
        padding: 0 80px;
        h4 {
          font-size: clamp(1.5625rem, 1.3541666667rem + 0.5787037037vw, 1.875rem);
          font-family: "Manier", serif;
          font-weight: 500;
          margin: 0 0 30px 0;
          resize: none;
        }
        p {
          line-height: 1.4;
          font-size: clamp(0.8125rem, 0.6971153846rem + 0.3205128205vw, 0.9375rem);
          margin: 0 0 30px 0;
        }
      }
      .stores_layer {
        display: flex;
        align-items: flex-start;
        max-width: 604px; /* O un valor como 1100px si prefieres */
        margin: 0 auto; /* Para centrarlo si tiene max-width */
        box-sizing: border-box; /* Buena práctica */
        padding: 0 15px; /* Añade algo de padding lateral para móviles */
        min-width: 320px; /* Para evitar que se vuelva demasiado estrecho */
        .search_layer {
          flex: 1 1 50%;
          padding: 20px 60px;
          .search_block {
            padding: 45px;
            background: #E9E5DE;
            border: 1px solid #575757;
            .list {
              margin: 1rem 0;
              p {
                margin-bottom: 0;
                display: flex;
                position: relative;
                label {
                  display: inline-block;
                  vertical-align: top;
                  line-height: 120%;
                  color: #666439;
                  font-size: 0.875rem;
                  text-align: left;
                  font-family: 'Neue Haas Grotesk Display', serif;
                }
                .checkmark {
                  height: 18px;
                  width: 18px;
                  background-color: #fff;
                  border: 1px solid #666439;
                  border-radius: 22px;
                  margin-right: 6px;
                  flex: 0 0 18px;
                }
                .checkmark:has(+input:checked) {
                  border-color: #666439;
                  background-color: #666439;
                }
                input:checked+label {
                  font-weight: bold;
                }

                input[type=checkbox] {
                  cursor: pointer;
                  z-index: 10;
                  line-height: 100%;
                  opacity: 0;
                  position: absolute;
                  height: 18px;
                  min-width: 24px;
                  width: 100%;
                  top: 0;
                  left: 0;
                  margin: 0;
                  background: transparent;
                  border: none;
                  appearance: none;
                }
              }
            }
            h4.title {
              font-family: "Manier", serif;
              font-weight: bold;
              text-align: center;
              font-size: 25px;
              color: #666439;
            }

            .InputLabelling label {
              font-size: 15px;
              padding: 0;
              margin-bottom: 5px;
              font-family: 'Neue Haas Grotesk Display', serif;
            }
            #direccion {
              width: 100%;
              margin: 0;
              max-width: 100%;
              display: block;
              padding: 10px;
              border: 1px solid #575757;
              font-size: 15px;
            }
          }
          .Filtros,
          .FiltrosCategoria,
          .FiltrosCienNoches,
          .FiltrosProducto {
            position: relative;
            margin-top: 1.25rem;
            h4 {
              cursor: pointer;
            }
            h4.opened::after {
              content: "-";
            }
            h4::after {
              color: #000;
              content: "+";
              width: 24px;
              height: 24px;
              position: absolute;
              right: 0;
              line-height: 22px;
              text-align: center;
              border-radius: 100%;
              font-size: 24px;
              font-weight: 700;
              font-family: "Manier", serif;
            }
          }
          .Filtros {
            h4::after {
              background: #fff;
              border: 1px solid #222;
            }
            h4.title{
              font-weight: normal;
            }
          }
          .FiltrosCategoria,
          .FiltrosCienNoches,
          .FiltrosProducto {
            h4 {
              padding: 7px 0;
              border-bottom: 1px solid #575757;
              font-weight: normal;
              font-size: 16px;
              font-family: 'Neue Haas Grotesk Display', serif;
            }
          }
          .button_search {
            margin-top: 1.25rem;
            border-color: #666439;
            background: #666439;
            button {
              width: 100%;
              color: #FFF !important;
              font-size: 13px;
              font-weight: 400;
              padding-left: 10px;
              padding-right: 10px;
              border-radius: 0;
              height: 45px;
              text-transform: none;
              cursor: pointer;
              background: transparent;
              border: 0;
              font-family: 'Neue Haas Grotesk Display', serif;
            }
          }
        }
        .search_image {
          flex: 1 1 50%;
          text-align: center;
          margin-top: 80px;
          img {
            max-height: 440px;
          }
        }
      }
      #store {
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        max-width: 1080px;
        margin: 60px auto 60px;
        .title_tienda {
          background: #E9E5DE;
          padding: 23px;
          font-family: "Manier", serif;
          font-weight: 500;
          font-size: 20px;
          /*color: #666439;*/
          color: black;
        }
        .info_tienda {
          display: flex;
          .datos_tienda {
            /*flex: 1;*/
            display: flex;
            width: 24%;
            flex-direction: column;
            /*justify-content: space-between;*/
            border-right: 1px solid #E9E5DE;
            .direccion_tienda {
              display: flex;
              justify-content: space-between;
              padding: 15px 30px 0 30px;
              font-family: "Neue Haas Grotesk Display", serif;
              font-size: 14px;
              .direccion {
                p {
                  /*line-height: 140%;*/
                }
              }
              .cien_noches {
                width: 65px;
                img {

                  width: 100%;
                }
              }
            }
            .links_tienda {
              display: flex;
              justify-content: space-between;
              padding-left: 12px;
              align-items: center;
              .como_llegar a {
                text-decoration: underline;
                color: #666439;
                font-size: 0.9375rem;
              }
              .ver_tienda {
                margin-top: 0;
                border-color: #666439;
                background: #666439;
                a {
                  width: 100%;
                  color: #FFF !important;
                  font-weight: 400;
                  border-radius: 0;
                  text-decoration: none;
                  font-size: 15px;
                  height: 35px;
                  text-transform: uppercase;
                  min-width: 150px;
                  margin-top: -3px;
                  cursor: pointer;
                }
              }
            }
          }
          .productos_tienda {
            flex: 1;
            display: flex;
            flex-direction: column;
            .en_nuestra_tienda {
              padding: 23px;
              padding-bottom: 0;
              /*border-bottom: 1px solid #E9E5DE;*/
              color: #666439;
              font-weight: bold;
              font-size: 18.8px;
              font-family: "Neue Haas Grotesk Display", serif;
            }
            .productos {
              flex: 1 1 33.33%;
              display: flex;
              flex-wrap: wrap;
              padding-left: 15px;
              font-family: 'Neue Haas Grotesk Display', serif;
              .layer_categoria {
                display: flex;
                padding: 12px;
                width: 100%;
                min-width: 208px;
                .listado {
                  /*padding: 0 12px;*/
                  width: 100%;
                  p {
                    margin: 0;
                  }
                }
              }
            }
          }
        }
      }
    }
  }

  @media(max-width: 768px) {
    #main {
      #content {
        #store {
          margin: 60px 15px 60px !important;
        }
      }
    }

    .search_text {
      padding: 0 15px !important;
    }
    #search_form {
      margin-bottom: 20px;
      .stores_layer {
        align-items: center !important;
        flex-direction: column;
        width: 100%;

        .search_layer {
          flex: 1 1 100% !important;
          width: 100% !important;
          padding: unset !important;

          .search_block {
            padding: 30px !important;
          }
        }

        .search_image {
          display: none;
        }
      }
    }
    .info_tienda {
      flex-direction: column;
    }
    .datos_tienda {
      width: 100% !important;
    }
  }
}

.productos-colchones .listado {
  column-count: 3;
  column-gap: 40px;
}

.productos-colchones .listado p {
  break-inside: avoid;
  margin-bottom: 8px;
}


.productos-colchones .listado:has(p:nth-child(6)) {
  column-count: 3;
}

.productos-colchones .listado:not(:has(p:nth-child(6))) {
  column-count: 1;
}


.productos-bases .listado {
  column-count: 3;
  column-gap: 40px;
}

.productos-bases .listado p {
  break-inside: avoid;
  margin-bottom: 8px;
}

/* Si la lista tiene 5 párrafos o menos, fuerza una columna */
.productos-bases .listado:has(p:nth-child(6)) {
  column-count: 3;
}

.productos-bases .listado:not(:has(p:nth-child(6))) {
  column-count: 1;
}
/* Mobile first: Default to 1 column */
.productos-colchones .listado,
.productos-bases .listado {
  column-count: 1;
  column-gap: 0; /* No gap needed for 1 column */
}

/* Small Tablets / Large Mobiles (Optional breakpoint) - 2 columns if enough items */
@media (min-width: 576px) {
  /* Only apply 2 columns if there are enough items (your :has logic) */
  .productos-colchones .listado:has(p:nth-child(4)), /* Ajusta el nº si prefieres */
  .productos-bases .listado:has(p:nth-child(4)) {    /* Ajusta el nº si prefieres */
    column-count: 2;
    column-gap: 20px; /* Gap más pequeño para 2 columnas */
  }
  /* Ensure single column if few items */
  .productos-colchones .listado:not(:has(p:nth-child(4))),
  .productos-bases .listado:not(:has(p:nth-child(4))) {
    column-count: 1;
    column-gap: 0;
  }
}

/* Tablets and Desktops - 3 columns if enough items */
@media (min-width: 768px) {
  .stores_layer{
    width: 55vw;
  }
  /* Only apply 3 columns if there are enough items (your :has logic) */
  .productos-colchones .listado:has(p:nth-child(6)),
  .productos-bases .listado:has(p:nth-child(6)) {
    column-count: 3;
    column-gap: 40px; /* Tu gap original */
  }
  /* Fallback to 2 columns if medium amount of items */
  .productos-colchones .listado:not(:has(p:nth-child(6))):has(p:nth-child(4)),
  .productos-bases .listado:not(:has(p:nth-child(6))):has(p:nth-child(4)) {
    column-count: 2;
    column-gap: 20px;
  }
  /* Fallback to 1 column if few items */
  .productos-colchones .listado:not(:has(p:nth-child(4))),
  .productos-bases .listado:not(:has(p:nth-child(4))) {
    column-count: 1;
    column-gap: 0;
  }
}
.nuestratienda {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: bold;
  color: #666439;
  font-size: 18.8px;
  font-family: "Neue Haas Grotesk Display", serif;
  padding: 0!important;
}

.flecha-final {
  transition: transform 0.3s ease;
  color: #666439;
  cursor: pointer;
}

.separador_hr {
  border: none;
  width: 100%;
  border-top: 1px solid #ccc;
  margin-top: 1rem;
  margin-bottom: 1rem;
}

.container-bases {
  padding: 23px 23px 23px 23px;
}

.productos-bases {
  padding-bottom: 20px!important;
}

body#cms.cms-id-16 {
  & #main {
      & #content {
          & .stores_layer {
              & .search_layer {
                  & .search_block {
                      .Filtros h4.title {
                          font-weight: normal;
                      }
                  }
              }
          }
      }
  }
}
