#relation_pd {
  clear: both;
  margin: 60px 0 0;
  background-color: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

#relation_pd > .panel-heading {
  padding: 0;
  background-color: transparent;
  border: 0;
}

#relation_pd .panel-title {
  display: flex;
  align-items: center;
  margin: 0;
  color: #333333;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

#relation_pd .panel-title::before,
#relation_pd .panel-title::after {
  width: 100%;
  height: 1px;
  background-color: #bfbfbf;
  content: "";
}

#relation_pd .panel-title::before {
  margin-right: 20px;
}

#relation_pd .panel-title::after {
  margin-left: 20px;
}

#relation_pd > .panel-body {
  padding: 30px 0 0;
}

#relation_pd .panel-body > .col-sm-12 {
  float: none;
  padding-right: 0;
  padding-left: 0;
}

#relation_pd .thumbnail-list {
  display: flex;
  flex-wrap: wrap;
  margin: 0 -12px;
  padding: 0;
  list-style: none;
}

#relation_pd .thumbnail-list > li {
  display: flex;
  float: none;
  width: 50%;
  margin: 0;
  padding: 0 12px 24px;
}

#relation_pd .li-item {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #f5f5f5;
  border-radius: 30px;
  box-shadow: 0 8px 24px rgba(9, 56, 28, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#relation_pd .li-item:hover,
#relation_pd .li-item:focus-within {
  background-color: #f5f5f5;
  box-shadow: 0 16px 36px rgba(9, 56, 28, 0.16);
  transform: translateY(-5px);
}

#relation_pd figure {
  position: relative;
  margin: 0;
  overflow: hidden;
  background-color: #ffffff;
}

#relation_pd figure > a:first-child {
  display: block;
  overflow: hidden;
}

#relation_pd figure > a:first-child img {
  display: block;
  width: 100%;
  height: auto;
  transform: scale(1);
  transition: transform 0.45s ease;
}

#relation_pd .li-item:hover figure > a:first-child img,
#relation_pd .li-item:focus-within figure > a:first-child img {
  transform: scale(1.05);
}

#relation_pd figcaption {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  gap: 20px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 28px !important;
  color: #ffffff;
  text-align: center;
  background-color: rgba(9, 56, 28, 0.92);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

#relation_pd figure:hover figcaption,
#relation_pd figure:focus-within figcaption {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

#relation_pd figcaption span {
  display: block;
  max-width: 440px;
  font-size: 15px;
  line-height: 1.8;
  letter-spacing: 0.06em;
  text-align: center;
}

#relation_pd figcaption a {
  display: inline-block;
  color: #ffffff;
  text-decoration: none;
}

#relation_pd figcaption .btn-primary {
  display: inline-flex;
  flex-flow: row nowrap;
  align-items: center;
  justify-content: center;
  padding: 9px 28px;
  color: #ffffff;
  background-color: #bf9e5b;
  border-color: #bf9e5b;
  border-radius: 22px;
  font-weight: 600;
  letter-spacing: 0.06em;
  white-space: nowrap;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

#relation_pd figcaption .btn-primary .fa {
  display: inline-block;
  margin-right: 6px;
}

#relation_pd figcaption .btn-primary:hover,
#relation_pd figcaption .btn-primary:focus {
  background-color: #8a6928;
  border-color: #8a6928;
}

#relation_pd .li-item > h4 {
  margin: 0;
  padding: 22px 24px 26px;
  color: #09381c;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
  letter-spacing: 0.06em;
}

/* 關聯商品目前不顯示價格及購買按鈕 */
#relation_pd .product-price,
#relation_pd .li-item > .btn-danger {
  display: none !important;
}

@media (max-width: 600px) {
  #relation_pd {
    margin-top: 40px;
  }

  #relation_pd .panel-title {
    font-size: 24px;
  }

  #relation_pd .panel-title::before {
    margin-right: 14px;
  }

  #relation_pd .panel-title::after {
    margin-left: 14px;
  }

  #relation_pd > .panel-body {
    padding-top: 22px;
  }

  #relation_pd .thumbnail-list {
    margin-right: 0;
    margin-left: 0;
  }

  #relation_pd .thumbnail-list > li {
    width: 100%;
    padding-right: 0;
    padding-bottom: 20px;
    padding-left: 0;
  }

  #relation_pd figcaption {
    padding: 22px !important;
  }

  #relation_pd figcaption span {
    font-size: 14px;
    line-height: 1.7;
  }

  #relation_pd .li-item > h4 {
    padding: 18px 20px 22px;
    font-size: 21px;
  }
}
