#box-recently-viewed-products .listing {
  grid-template-columns: repeat(auto-fill, minmax(48px, .5fr));
}

.listing {
  display: grid;
  grid-gap: var(--gutter-x);

  @media (min-width: @media-breakpoint-sm) {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }

  &.products {
    &.columns {
      grid-template-columns: repeat(auto-fill, minmax(125px, 1fr));
      @media (min-width: @media-breakpoint-sm) {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
      }
      @media (min-width: @media-breakpoint-md) {
        grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
      }
    }
    &.rows {
      grid-auto-flow: row;
      grid-template-columns: initial;
    }
  }

  &.categories {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }

  &.manufacturers {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    @media (min-width: @media-breakpoint-sm) {
      grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
  }

  h1, h2, h3 {
    padding-bottom: 0;
    border: none;
  }

  a {
    color: inherit;
    text-decoration: none;
  }

  .category, .manufacturer, .product {
    position: relative;
    overflow: hidden;

    background: var(--image-whitespace-color);
    border: 1px solid var(--default-border-color);
    border-radius: var(--border-radius);
    transform: scale(1);
    transition: all 100ms linear;

    color: inherit;
    text-decoration: none;

    @media (min-width: @media-breakpoint-sm) {
      &:hover {
        box-shadow: 0 .5rem 1rem 0 rgba(0, 0, 0, 0.15);
        transform: scale(1.01);
      }
    }
  }

  .category {
    position: relative;
    background: var(--whitespace-color);

    .caption {
      background: var(--whitespace-color);
      padding: ~"calc(var(--gutter-y)/2)" var(--gutter-x);
      color: var(--default-text-color);
      text-align: center;
      * {
        font-weight: normal;
        color: inherit;
        margin: 0;
      }
      .name {
        font-size: 1.15em;
      }
    }
  }

  .manufacturer {
    position: relative;
    background: var(--whitespace-color);

    img {
      width: 100%;
      height: auto;
      padding: 1rem;
    }

    .caption {
      margin: 0;
      padding: ~"calc(var(--gutter-y)/2)" var(--gutter-x);
      background: #f2f2f2;
      color: var(--default-text-color);
      text-align: center;
    }
  }

  .product {
    position: relative;
    background: var(--whitespace-color);

    .link {
      text-decoration: none;
    }

    .image-wrapper {
      background: var(--image-whitespace-color);

      .sticker {
        position: absolute;
        top: 20px;
        left: -32px;
        width: 125px;
        padding: .25rem 0;
        color: #fff;
        font-size: 12px;
        font-weight: bold;
        text-align: center;
        text-transform: uppercase;
        transform: rotate(-45deg);
        &.new {
          background: rgba(251, 184, 41, 0.9);
        }
        &.sale {
          background: rgba(237, 60, 50, 0.9);
        }
      }
    }

    .name {
      display: flex;
      justify-content: center;
      align-content: center;
      flex-direction: column;
      height: 40px;
      font-size: 1em;
      font-weight: 400;
      line-height: 115%;
      border-bottom: 0;
      margin: 0;
    }

    .manufacturer-name {
      color: var(--default-text-color);
      font-size: 0.9em;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
      line-height: 200%;
      opacity: .75;
    }

    .description {
      max-width: 640px;
      text-align: left;
    }

    .stock-available {
      .value {
        color: #009900;
      }
    }

    .stock-partly-available {
      .value {
        color: #ff9900;
      }
    }

    .stock-unavailable {
      .value {
        color: #cc0000;
      }
    }

    .price-wrapper {
      font-size: 1.25em;
      .price {
        font-weight: bold;
        white-space: nowrap;
      }
      .regular-price, .recommended-price {
        color: var(--default-text-color);
        font-size: 0.75em;
        font-weight: normal;
        white-space: nowrap;
      }
      .campaign-price {
        font-weight: bold;
        color: #c00;
        white-space: nowrap;
      }
    }

    .preview {
      margin: 0 -1px -1px -1px;
      display: none;
      position: absolute;
      top: 1em;
      right: 1em;
      padding: var(--input-padding-y);
      width: 3em;
      box-shadow: none;
    }

    @media (min-width: @media-breakpoint-sm) {
      &:hover .preview {
        display: inline-block;
      }
    }
  }

  &.columns .product {
    .image {
      width: 100%;
      height: auto;
    }

    .info {
      padding: .5rem 0;
      text-align: center;
    }

    .description {
      display: none;
    }

    .price-wrapper {
      position: initial;
    }
  }

  &.rows .product {

    .link {
      display: flex;
      gap: var(--gutter-x);
      padding: var(--gutter-y) var(--gutter-x);
    }

    .info {
      flex: 1 1 auto;
    }

    .image-wrapper {
      width: 175px;
      @media (min-width: @media-breakpoint-sm) {
        width: 160px;
      }
    }

    @media (min-width: @media-breakpoint-sm) {
      height: auto;
      .description {
        margin-bottom: 1em;
      }
    }
  }
}
