﻿.recently-products {
  width: 1200px;
  max-width: 100vw;
  margin: 0px auto 120px;
  font-family: "Noto Sans JP", sans-serif;
}

.recently-products__title-wrapper {
  text-align: center;
}

.recently-products__title {
  display: inline-block;
  font-size: 36px;
  font-weight: 400;
  font-family: "Roboto", sans-serif;
  color: #4C4F51;
  border-bottom: 1px solid #4C4F51;
  line-height: 1;
  margin-bottom: 40px;
  letter-spacing: 0;
}

.recently-products__title-sub {
  display: block;
  font-size: 16px;
  font-weight: 400;
  padding: 8px 0 14px;
  line-height: 1;
  font-family: "Noto Sans JP", sans-serif;
}

.recently-products__list {
  display: flex;
  flex-wrap: wrap;
  gap: 48px;
}

.recently-products__link {
  display: block;
}

.recently-products__product {
  width: 264px;
  height: auto;
  padding: 8px 8px 16px;
  background-color: #fff;
  box-sizing: border-box;
  border: 1px solid transparent;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  overflow: hidden;
  border-radius: 4px;
  will-change: transform;
}

.recently-products__product:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 4px rgba(135, 162, 158, 0.25);
  border-color: #87A29E80;
}

.recently-products__head {
  margin-bottom: 16px;
}

.recently-products__picture {
  display: block;
  overflow: hidden;
  position: relative;
  width: 248px;
  height: 248px;
}

.recently-products__image {
  transition: transform 0.3s ease;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.recently-products__product:hover .recently-products__image {
  transform: scale(1.1);
}

.recently-products__body-content {
  display: flex;
  align-items: start;
  justify-content: space-between;
}

.recently-products__body-title {
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  row-gap: 4px;
}

.recently-products__body-category-area {
  width: 100%;
  height: 20px;
  display: inline-flex;
  gap: 10px;
  align-items: center;
}

.recently-products__status > .recently-products__icons .recently-products__icon img {
  height: 18px;
  border: 0.5px solid #4C4F51;
}

.recently-products__body-category-wrap {
  width: fit-content;
  height: fit-content;
  border: 0.5px solid #4c4f51;
}

/* カテゴリーがない場合は非表示 */
.recently-products__body-category-wrap:empty {
  border: none;
}

.recently-products__body-categoryName {
  padding: 2px 4px;
  color: #4C4F51;
  font-size: 12px;
  line-height: 1;
  font-weight: 400;
}

.recently-products__body-name {
  font-size: 16px;
  font-weight: 400;
  color: #4C4F51;
  line-height: 1;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  max-height: calc(1em * 2);
  min-height: calc(1em * 2);
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.recently-products__price-content {
  display: flex;
  flex-direction: column;
  row-gap: 4px;
}

.recently-products__price {
  display: flex;
  justify-content: start;
  align-items: center;
  gap: 8px;
  color: #4C4F51;
  line-height: 1.5;
}

.recently-products__price-label {
  font-size: 12px;
  font-weight: 400;
}

.recently-products__price-value {
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
}

.recently-products__price-tax {
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
}

.recently-products__empty {
  text-align: center;
  font-size: 16px;
  font-weight: 500;
  color: #4C4F51;
  line-height: 2;
}


/* 716pxから右側を見切れさせるための処理 */
@media screen and (max-width: 1280px) and (min-width: 717px) {
  .recently-products__list {
    width: 100%;
    padding: 0 clamp(12px, 2.5vw, 20px);
    gap: clamp(16px, 2vw, 48px);
  }

  .recently-products__product {
    width: clamp(154px, 22vw, 264px);
    padding: clamp(6px, 1vw, 8px) clamp(8px, 1.5vw, 8px) clamp(12px, 2vw, 16px) clamp(8px, 1.5vw, 8px);
  }

  .recently-products__picture {
    width: clamp(138px, 20vw, 248px);
    height: clamp(138px, 20vw, 248px);
  }

  .recently-products__body-name {
    font-size: clamp(13px, 1.8vw, 16px);
  }

  .recently-products__price {
    flex-wrap: nowrap;
    white-space: nowrap;
  }

  .recently-products__price-label {
    flex-shrink: 0;
    min-width: fit-content;
  }

  .recently-products__price-value {
    flex-shrink: 1;
    min-width: 0;
  }
}

@media screen and (max-width: 767px) {
  .recently-products {
    width: 100vw;
    margin: 0 auto 96px;
    padding: 0;
    font-family: "Noto Sans JP", sans-serif;
  }

  .recently-products__title {
    font-size: 20px;
    margin-bottom: 20px;
  }

  .recently-products__title-sub {
    font-size: 12px;
    padding: 4px 0 8px;
  }

  .recently-products__list {
    flex-wrap: nowrap;
    justify-content: start;
    gap: 20px;
    padding-bottom: 24px;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
  }

  .recently-products__item:first-child {
    padding-left: 20px;
  }

  .recently-products__item:last-child {
    padding-right: 12px;
  }

  .recently-products__list.has-scroll {
    overflow-x: auto;
    white-space: nowrap;
  }

  .recently-products__list.has-scroll::-webkit-scrollbar {
    height: 2px;
  }

  .recently-products__list.has-scroll::-webkit-scrollbar-track {
    background-color: #c4ccd1;
    margin: 0 20px;
  }

  .recently-products__list.has-scroll::-webkit-scrollbar-thumb {
    background-color: #4c4f51;
    border-radius: 0.5rem;
  }

  .recently-products__product {
    width: 154px;
    padding: 8px 8px 16px;
    box-shadow: 0 4px 4px #87A29E40;
  }

  .recently-products__product:hover {
    transform: none;
    border: none;
    padding: 8px 8px 16px;
  }

  .recently-products__head {
    margin-bottom: 16px;
  }

  .recently-products__picture {
    width: 138px;
    height: 138px;
  }

  .recently-products__product:hover .recently-products__image {
    transform: none;
  }

  .recently-products__body-categoryName {
    padding: 2px 4px;
    line-height: 1;
  }

  .recently-products__body-name {
    font-size: 13px;
    line-height: 1.5;
    max-height: calc(1.5em * 2);
    min-height: calc(1.5em * 2);
  }

  .recently-products__price {
    display: flex;
    flex-direction: column;
    align-items: start;
    row-gap: 4px;
    line-height: 1;
  }
  
  .recently-products__status>.recently-products__icons .recently-products__icon img {
    height: 16px;
  }

}
