@import "mobile";

.wp-block-yith-search-block {
  .ywcas-classic-search {
    &.ywcas-small {
      font-size: 16px;

      input {
        padding: 5px 0 5px 15px !important;
      }

      .ywcas-block-components-search-field {
        overflow: hidden;
      }

      button {
        margin-bottom: 0;

      }
    }

    &.ywcas-large {
      font-size: 18px;

      input {
        padding: 10px 20px !important;
      }

      button {
        margin-bottom: 0;
      }
    }

    .ywcas-input-field-wrapper {
      .ywcas-submit-wrapper {
        margin-right: 10px;

        .ywcas-submit-icon {
          cursor: pointer;
        }
      }
    }
  }
}

.ywcas-popover-results {
  margin-top: 10px;
  z-index: 9999;

  .popover-content {
    background: #fff;
    padding: 30px;
    border-radius: 13px;
    border: 1px solid #d8d8d8;
    max-height: 600px;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: 3px 0 15px rgba(0, 0, 0, 0.15);
    &::-webkit-scrollbar-track {
      border-radius: 13px !important;
    }
    &::-webkit-scrollbar-thumb {
      border-radius: 13px;
    }

    .ywcas-classic-related-content-wrapper {
      .ywcas-related-content {
        border-radius: 0 0 13px 13px;
        margin: 40px -30px -30px;
        padding-left: 10px;
        padding-bottom: 30px;
      }

      .ywcas-related-content__label {
        font-size: 0.87rem;
        text-transform: uppercase;
        padding: 30px 20px;
        color: var(--wp--preset--color--primary, #007565);
      }

      .ywcas-related-content__link {
        font-size: 0.94rem;
        padding: 0 30px 10px 20px;
        color: var(--wp--preset--color--primary, #1D1D1D);

        a {
          color: inherit;
        }
      }

      .ywcas-related-content__no_result {
        padding: 0 30px 10px 30px;
        color: var(--wp--preset--color--contrast, #1D1D1D)
      }
    }
    .ywcas-classic-related-categories-wrapper {
      margin-bottom: 25px;
    }
    .wp-block-yith-filled-block {
      hr {
        border-bottom: 0;
      }
      .ywcas-search-results {
        &.list {
          margin-top: 30px;
          margin-left:-10px;
          .ywcas-search-results-grid {
            gap: 25px;
          }
        }
        &.grid{
          margin-left:-10px;
        }

        .search-result-item {
          cursor: pointer;
          transition: all 0.3s linear;
          padding:10px;

          &.selected {
            background-color: #f6f6f6;
          }

          &:hover {
            cursor: pointer;
            background:#f6f6f6;
          }

          .search-result-item__summary {
            font-size: 0.8em;
          }

          &.grid {
            .search-result-item__content {
              height: 100%;
            }

            .search-result-item__name {
              margin-bottom: 7px;
            }

            .search-result-item__summary {
              margin-top: 15px;
            }

            .wp-block-button {
              align-self: center;
              width: 100%;

              button {
                width: 100%;
                line-height: initial;
                box-sizing: border-box;
              }
            }
          }

          &.list {

            .search-result-item__name {
              line-height: 1em;
              margin-bottom: 5px;
            }

            .wp-block-button {
              align-self: center;
              line-height: initial;
            }

            .search-result-item__summary {
              margin-top: 5px;
            }
          }

          .search-result-item__thumbnail {
            & {
              display: block;
              position: relative;

            }

            img {
              height: auto;
              border: 1px solid #C3C3C3;
            }

            .ywcas-badge {
              padding: 2px 10px;
              border-radius: 3px;
              display: inline-block;
              font-size: 0.7em;
              position: absolute;
              right: 5px;
            }
          }

          .search-result-item_name{
            width:100%;
          }

          .search-result-add-to-cart {
            padding: 0.5em 1em;
            font-size: 0.8em;
          }

          .search-result-item__inline_group {
            & > * {
              font-size: 0.8em;
              line-height: 1.7em;
              display: inline-block;
            }

            & span {
              width: 8px;
              display: inline-block;
              text-align: center;
            }

            .stock {
              &.out-of-stock {
                color: #D02A2B;
              }

              &.in-stock {
                color: #6D8A37;
              }
            }
          }
        }

        .ywcas-total-results {
          display: flex;
          gap: 10px;
          align-items: center;
          margin-top: 40px;
          font-size: 1rem;
          margin-left: 10px;
        }
      }
    }

  }
}

/**
ELEMENTOR
 */
.ywcas-elementor-input-field-wrapper {
  width: 100%;

  .ywcas-input-field {
    border: 1px solid #ccc;
    padding: 3px 10px;
    display: inline-flex;
    -webkit-box-align: center;
    align-items: center;
    box-sizing: border-box;
    position: relative;
    z-index: 1;
    border-radius: 8px;
    font-size: 14px;
    text-align: start;
    background: transparent;
    color: rgb(51, 51, 51);
    width: 100%;
    flex: 0 1 0%;
    padding-right: 14px;
  }

  input {
    flex: 1;
    border: 0;

    &:focus {
      outline: none;
      box-shadow: none;
    }
  }
}