@charset "UTF-8";

/**
 * HIGOYA Recently Viewed Products
 * Version 1.2.0
 */

/* =========================
   全体
   ========================= */
.higoya-recent {
  width: 100%;
  margin: 40px auto;
}

.higoya-recent[hidden] {
  display: none !important;
}

/* =========================
   見出し
   ========================= */
.higoya-recent__header {
  margin-bottom: 18px;
}

.higoya-recent__title {
  margin: 0 0 10px;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.5;
  color: #111;
}

/* 見出し下のライン */
.higoya-recent__header::after {
  content: "";
  display: block;
  width: 100%;
  height: 5px;
  background: linear-gradient(
    to right,
    #111 0%,
    #111 72%,
    #d84a4a 72%,
    #d84a4a 100%
  );
}

/* =========================
   一覧
   ========================= */
.higoya-recent__items {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px 20px;
}

/* =========================
   カード
   ========================= */
.higoya-recent__card {
  display: block;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.higoya-recent__card:hover {
  opacity: 0.85;
}

/* =========================
   画像
   ========================= */
.higoya-recent__image {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: #f7f7f7;
  margin-bottom: 12px;
}

/* =========================
   商品名
   ========================= */
.higoya-recent__name {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
  font-size: 13px;
  line-height: 1.6;
  color: #222;
  min-height: calc(1.6em * 4);
  margin-bottom: 6px;
  word-break: break-word;
}

/* =========================
   価格
   ========================= */
.higoya-recent__price {
  display: block;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
  color: #222;
}

/* =========================
   タブレット以下
   ========================= */
@media screen and (max-width: 1024px) {
  .higoya-recent__items {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px 18px;
  }
}

/* =========================
   スマホ
   元デザインに寄せる
   ========================= */
@media screen and (max-width: 767px) {
  .higoya-recent {
    margin: 28px auto 36px;
  }

  .higoya-recent__header {
    margin-bottom: 16px;
  }

  .higoya-recent__title {
    font-size: 18px;
    margin-bottom: 8px;
  }

  .higoya-recent__header::after {
    height: 5px;
  }

  .higoya-recent__items {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px 16px;
    overflow: visible;
  }

  .higoya-recent__card {
    display: block;
  }

  .higoya-recent__image {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    margin-bottom: 10px;
    background: #f7f7f7;
  }

  .higoya-recent__name {
    font-size: 12px;
    line-height: 1.55;
    min-height: calc(1.55em * 4);
    margin-bottom: 4px;
    -webkit-line-clamp: 4;
  }

  .higoya-recent__price {
    font-size: 12px;
    line-height: 1.5;
  }
}



/* スマホでは6商品まで表示 */
@media screen and (max-width: 767px) {
  .higoya-recent__card:nth-child(n+7) {
    display: none;
  }
}




/* スマホ：左右の余白調整 */
@media screen and (max-width: 767px) {

  .higoya-recent {
    box-sizing: border-box;
    width: 100%;
    padding-left: 16px;
    padding-right: 16px;
  }

  .higoya-recent__items {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 12px;
    row-gap: 20px;
  }

}



/* スマホ：商品写真の表示改善 */
@media screen and (max-width: 767px) {

  .higoya-recent__image {
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 4;
    object-fit: contain;
    background: transparent;
    margin-bottom: 10px;
  }

}
