.category-box {
  color: #fff;
  position: relative;
  padding: 26px 36px;
  height: 270px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s;
  border: 1px solid #fcb33b00;

  &::before {
    position: absolute;
    content: '';
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0.12));
    transition: all 0.3s;
  }

  &__wrap {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding: 80px 4px 40px 4px;
  }

  &__img {
    position: absolute;
    height: 100%;
    width: 100%;
    top: 0;
    left: 0;
    object-fit: cover;
    z-index: -1;
    transition: all 0.5s;
  }

  &__h {
    z-index: 5;
    transition: all 0.5s;
  }

  &:hover {
    border: 1px solid $primary-color;

    &::before {
      // box-shadow: inset 0px -56px 2px -9px #f7f7f7;
    }

    .category-box__h {
      transform: translate3d(-30px, 20px, 5px);
      color: $primary-color;
      background-color: rgb(255 255 255 / 90%);
      padding: 4px 12px;
    }

    .category-box__img {
      transform: scale(1.05);
    }
  }
}

.news-box {
  &__img {
    height: auto;
    max-height: 410px;
    width: 100%;
    top: 0;
    left: 0;
    object-fit: cover;
    z-index: -1;
    transition: all 0.5s;
  }

  &__h {
    transition: all 0.5s;
  }
}

.product-box {
  // max-width: 330px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: 1;
  height: 100%;

  &__h {
    transition: all 0.3s;
  }

  &__img__wrap {
    width: 100%;
    height: 250px;
    position: relative;
    transition: all 0.3s;
    border: 1px solid #fcb33b4d;
  }

  &__img {
    width: 100%;
    height: 100%;
    // object-fit: cover;
    object-fit: contain;
    transition: all 0.3s;
  }

  &__badge {
    position: absolute;
    top: 0;

    &:nth-child(2) {
      left: 0px;
    }

    &:nth-child(3) {
      left: 50px;
    }
  }

  &__heart {
    position: absolute;
    top: 0;
    right: 0;
    height: 40px;
    width: 40px;
    border-radius: 50%;
    padding: 8px;
    background-color: rgba(229, 229, 229, 0.8);
    margin: 8px;
    cursor: pointer;

    path {
      fill: transparent;
      stroke: #969696;
      stroke-width: 1.5px;
      transition: all 0.2s;
    }

    &.selected {
      path {
        fill: $primary-color;
        stroke: $primary-color;
      }
    }

    &:hover {
      path {
        // fill: $primary-color;
        stroke: $primary-color;
      }
    }
  }

  &__energy {
    position: absolute;
    left: 0;
    bottom: 8px;
  }

  &__checkbox {
    position: absolute;
    right: 6px;
    bottom: 6px;
    background-color: #fff;
    border-radius: 50%;
    height: 40px;
    width: 40px;
    // display: flex;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0px 2px 5px #737373;
    margin: 0;
    padding: 0;
    z-index: 10;

    .checkmark {
      left: 11px;
    }
  }

  &__desc {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-grow: 1;
  }

  .btn {
    width: 100%;
    opacity: 0;
    transition: all 0.3s;
  }

  &:hover {
    .btn {
      opacity: 1;
    }

    .product-box__img {
      opacity: 0.9;
    }

    .product-box__img__wrap {
      border: 1px solid $primary-color;
    }

    .product-box__h {
      color: $primary-color;
    }
  }
}

.compareAllow {
  .product-box__checkbox {
    display: flex;
  }
}

.not-available {
  position: absolute;
  bottom: 0;
  left: 0;
  background-color: #fff;
  padding: 0 2px;
}

.special-offer {
  &__wrap {
    position: relative;
    background-color: #1c1c1c;

    &::before {
      position: absolute;
      content: '';
      height: 12%;
      width: 100%;
      top: 0;
      left: 0;
      background-color: #fff;
    }

    &::after {
      position: absolute;
      content: '';
      height: 31%;
      width: 100%;
      bottom: 0;
      left: 0;
      background-color: #fff;
    }
  }

  &__main {
    position: relative;
    background-color: #fff;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;

    &__img {
      width: 100%;
      max-height: 440px;
      object-fit: cover;
    }

    &__txt {
      max-width: 900px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
    }
  }

  &__products {
    z-index: 5;
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }

  &__product {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;

    &__img {
      height: 16vw;
      box-shadow: 0px 3px 5px rgb(0 0 0 / 5%), 0px 1px 18px rgb(0 0 0 / 3%),
        0px 6px 10px rgb(0 0 0 / 4%);
      width: 100%; 
      object-fit: contain;
      background-color: #ffffff;
      border: 1px solid #fcb33b00;
      transition: all 0.3s;
    }

    &__h {
      transition: all 0.3s;
      background-color: #fff;
      padding: 4px;
    }

    .btn {
      width: 100%;
      opacity: 0;
      transition: all 0.3s;
    }

    &:hover {
      .btn {
        opacity: 1;
      }

      .special-offer__product__h {
        color: $primary-color;
      }

      .special-offer__product__img {
        border: 1px solid $primary-color;
      }
    }
  }

  &__btn {
    &--desktop {}

    &--mob {
      display: none;
    }
  }
}

.filter-table {
  width: 270px;

  &__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 4px;
    cursor: pointer;
  }

  &__h {
    font-weight: 700;
    border-bottom: 1px solid $gray-400;
    padding: 8px 0;
  }

  &__values-list {
    overflow-y: auto;
    max-height: 70vh;
  }
}

.control-box {
  border: 1px solid $gray-400;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 55px;
  min-width: 55px;
  font-size: 20px;
  cursor: pointer;
  font-family: $ff-sans;

  &__input {
    width: 80px;
    text-align: center;
    cursor: text;
    // padding-left: 14px;
    font-size: 14px;
  }

  &__plus {
    &:hover {
      color: $primary-color;
    }
  }

  &__wrap {
    display: flex;
  }
}

.control-box {
  &::selection {
    background: #fff;
  }
}

.control-box__wrap--sm {
  .control-box {
    height: 28px;
    min-width: 28px;
    font-size: 15px;

    &__input {
      width: 50px;
      padding-left: 8px;
      margin: 0 4px;
    }
  }
}

.max-available-amount {
  position: relative;

  &:before {
    position: absolute;
    content: 'Max. raspoloživo';
    font-size: 11px;
    background-color: $primary-color;
    // color: #fff;
    border-radius: 3px;
    bottom: 5px;
    left: 46px;
    padding: 2px 4px;
    z-index: 1;
  }

  &:after {
    content: '';
    position: absolute;
    width: 15px;
    height: 9px;
    bottom: 18px;
    left: 81px;
    transform: skew(-65deg) rotate(14deg);
    background-color: $primary-color;
  }

  .control-box__plus {
    // color: $gray-400;
    // pointer-events: none;
  }
}

.not-available-amount {
  position: relative;

  &:before {
    position: absolute;
    content: 'Na upit';
    font-size: 11px;
    background-color: $red-color;
    color: #fff;
    border-radius: 3px;
    bottom: 5px;
    left: 69px;
    padding: 2px 4px;
    z-index: 1;
  }

  &:after {
    content: '';
    position: absolute;
    width: 15px;
    height: 9px;
    bottom: 18px;
    left: 81px;
    transform: skew(-65deg) rotate(14deg);
    background-color: $red-color;
  }

  .control-box__input,
  .control-box__input-sm {
    color: $gray-400;
  }

  .control-box__plus {
    color: $gray-400;
    pointer-events: none;
  }
}

//media

@media (max-width: 1000px) {
  .category-box__wrap {
    grid-template-columns: repeat(3, 1fr);
    padding: 40px 4px;
  }

  .category-box {
    padding: 16px;
    height: 200px;
  }

  .category-box:hover .category-box__h {
    transform: translate3d(-16px, 16px, 5px); 
}
}

@media (max-width: 800px) {
  .product-box {
    .btn {
      opacity: 1;
    }
    &__h{
      word-break: break-word;
      padding: 4px 0;
    }
    &__badge { 
      height: 40px;
    }
  }
}

@media (max-width: 700px) {
  .category-box__wrap {
    grid-template-columns: repeat(2, 1fr);
  }

  .category-box {
    padding: 12px;
    height: 130px;

    &::before {
      background: linear-gradient(0deg,
          rgba(0, 0, 0, 0.5),
          rgba(0, 0, 0, 0.12));
    }
  }

  .compare-item {
    .product-box__img__wrap {
      height: 140px;
    }
  }

  .product-box__img__wrap {
    height: 180px;
  }

  .special-offer__products {
    gap: 8px;
  }

  .special-offer__product__img {
    height: 90px;
  }

  .special-offer__main__txt {
    padding-top: 0;
  }

  .category-box:hover .category-box__h {
    transform: translate3d(-10px, 10px, 5px);
  }
}

@media (max-width: 500px) {
  .product-box__img__wrap {
    height: 120px;
  }

  .product-box__heart {
    height: 30px;
    width: 30px;
    padding: 6px;
    margin: 6px;
  }

  .special-offer {
    &__main__img {
      max-height: 200px;
    }
    &__btn {
      &--desktop {
        display: none;
      }

      &--mob {
        display: block;
        text-align: center;
      }
    }
    &__products {
      gap: 4px;
    }
    &__product{
      &__h{
        font-size: 12px;
      }
      .btn {
        opacity: 1;
        font-size: 12px;
      }
    }
  }

  .category-box__wrap {
    padding: 12px 0px;
  }

  .special-offer__wrap::after { 
    height: 40%; 
  }

}