/* -------------------------------------------------- */
/* main de la galeria */
/* -------------------------------------------------- */

#main-content-gallery {
  width: 100%;
  margin: 0;
  padding: 10px;
}

/* -------------------------------------------------- */
/* boton de cargar mas */
/* -------------------------------------------------- */

#loading-more-box {
  margin-top: 10px;
  margin-bottom: 10px;
  padding: 10px;

  display: flex;
  align-items: center;
  justify-content: center;

  button {
    width: 25%;
    font-size: medium;
    border-radius: 10px;
    background-color: #ffd469;
  }
}

/* -------------------------------------------------- */
/* panel de la IA */
/* -------------------------------------------------- */

#info-box-ctrl {
  gap: 10px;
  display: flex;
  align-items: center;
  justify-content: end;
  margin-bottom: 15px;
}


#info-box {
  background-color: #ffffff;

  overflow-x: hidden;
  overflow-y: hidden;
  position: fixed;
  
  top: 80px;
  right: 0px;
  bottom: 0px;
  width: calc(30% - 75px);
  max-width: 100%;

  padding: 20px;
  transition: all 200ms linear; /* para transiciones suaves */
}

#info-box-body {
  width: 100%;
  height: calc(100% - 50px);
  overflow-x: hidden;
  overflow-y: scroll;
}

#product-main-photo {
  width: calc(100% - 20px);
  height: auto;

  aspect-ratio: 12/9;
  object-fit: contain;
  border-radius: 10px;
  overflow: hidden;
}

#product-price {
  color: #000000;
  text-decoration: none;
  background-color: #f4f6f8;

  padding: 10px;
  margin: 10px;
  border-radius: 1rem;
  gap: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;

  div {
    gap: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  * {
    font-size: x-large;
  }

}

#product-store {
  padding: 10px;
  max-width: calc(100% - 20px);
  max-height: calc(100% - 20px);
  object-fit: contain;
}

#product-title {

}

/* -------------------------------------------------- */
/* Enlace de afiliado */
/* -------------------------------------------------- */

#product-buttons {
  gap: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#product-link a, #product-reload {
  gap: 10px;
  padding: 1rem;
  border-radius: 10px;

  display: flex;
  align-items: center;
  justify-content: center;
}

#product-link a {
  color: #000000;
  font-size: medium;
  background-color: #ffd469;
}

#product-reload {
  color: #000000;
  font-size: medium;
  background-color: #e9e9ed;
}

/* -------------------------------------------------- */
/* galeria de resultados */
/* -------------------------------------------------- */

.search-info {
  gap: 10px;
  display: grid;
  align-items: center;
  justify-content: left;

  grid-template-columns: 130px 1fr;
  
  margin-top: 10px;
  margin-bottom: 10px;
  
  border-radius: 10px;
  background-color: #ffffff;
}

.search-store {
  padding: 10px;
  max-width: calc(100% - 20px);
  max-height: calc(100% - 20px);
  object-fit: contain;
}

.search-gallery {
  gap: 10px;
  display: grid;
  align-items: stretch;
  justify-content: center;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));

  .item-card {
    position: relative; /* para colocar items en las esquinas */
    
    display: grid;
    grid-template-columns: repeat(auto-fit, 1fr);

    overflow: hidden;
    border-radius: 10px;
    background-color: #ffffff;

    button:hover {
      background-color: #ffd469;
    }
  }

  .item-card-img {
    width: calc(100% - 2rem);
    height: calc(100% - 2rem);
    
    padding: 1rem;
    aspect-ratio: 4/3;
    object-fit: contain;
    
    border-top-left-radius: 1rem;
    border-top-right-radius: 1rem;
  }

  .item-price {
    gap: 10px;
    display: flex;
    align-items: center;
    justify-content: center;

    * {
      display: flex;
      align-items: center;
      justify-content: center;
    }

  }

  .item-title {
    /* Contenedor flexible en vertical */
    /* Límite de líneas */
    /* Oculta lo que sobrepasa y muestra los “…” */
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
  }

  .item-extra {
    gap: 10px;
    display: flex;
    align-items: center;
    justify-content: center;

    button, a {
      width: 100%;
      height: 50px;
      gap: 10px;
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 10px;
    }
  }
}

.item-offer {
  padding: 5px;
  border-radius: 10px;
  color: #ffffff;
  background-color: crimson;
}

.item-card-body {
  padding: 10px;
  display: grid;
  grid-gap: 20px;

  div {
    gap: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* -------------------------------------------------- */
/* indica al usuario cual item estamos viendo */
/* -------------------------------------------------- */
.checking-tag {
  display: none;
  padding: 5px;
  
  top: 0;
  left: 0;
  position: absolute;
  
  border-bottom-right-radius: 10px;
  background-color: #ffd469;
  box-shadow: 8px 8px 0px #000000;
}

.item-card.selected {
  .checking-tag {
    display: initial;
  }
}

/* -------------------------------------------------- */
/* best seller tag para las cartas */
/* -------------------------------------------------- */

.best-seller-tag {
  position:absolute;
  top: 10px;
  right: 0;
  padding: 5px;
  font-weight: bold;

  border-top-left-radius: 5px;
  border-bottom-left-radius: 5px;

  font-size: small;
  color: #ffffff;
  background-color: #258b80;
  box-shadow: rgba(17, 17, 26, 0.1) 0px 8px 24px, rgba(17, 17, 26, 0.1) 0px 16px 56px, rgba(17, 17, 26, 0.1) 0px 24px 80px;
}


/* -------------------------------------------------- */
/* Mobile Settings */
/* -------------------------------------------------- */

@media only screen and (max-width: 767px) {

  .search-gallery {
    padding: 5px;
    grid-template-columns: 1fr 1fr;
  }

  .item-price {
    display: grid !important;
  }

  #info-box.mobile-info-box {
    top: 0px;
    left: 0px;
    right: 0px;
    bottom: 0px;
    z-index: 1;

    width: calc(100vw - 40px);
  }

}