/******************************/
/* Product共通 */
/******************************/
.p-product {
  display: flex;
  flex-direction: column;
  gap: 32px;
  max-width: 1280px;
  margin-inline: auto;
  padding: 0 max(16px, 2%);

  form {
    margin: 0;
  }

  select {
    box-sizing: border-box;
    padding: 6px;
    border: 1px solid #B3B2B2;
    border-radius: 5px;
    height: 44px;
    line-height: 1.2;
    max-width: 360px;
    font-size: 14px;

    @media screen and (min-width: 768px) {
      font-size: 16px;
    }
  }

  input[type=text] {
    box-sizing: border-box;
    padding: 6px;
    border: 1px solid #B3B2B2;
    border-radius: 5px;
    height: 44px;
    line-height: 1.2;
    font-size: 14px;

    @media screen and (min-width: 768px) {
      font-size: 16px;
    }
  }
}

/******************************/
/* 商品詳細ページのレイアウト */
/******************************/
.p-product-layout {
  display: grid;
  grid-template-areas: "image" "main" "detail";

  @media screen and (min-width: 768px) {
    grid-template-areas: "image main" "detail main";
    grid-template-columns: 1fr 40%;
    gap: 0 24px;
  }
}

.p-product-layout__main {
  grid-area: main;
  display: flex;
  flex-direction: column;
  gap: 32px;
  min-width: 0;
  margin-top: 24px;
}

.p-product-layout__image {
  grid-area: image;
  min-width: 0;
}

.p-product-layout__detail {
  grid-area: detail;
  min-width: 0;
}

/******************************/
/* 商品情報 */
/******************************/
.p-product-info {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* 先行予約販売 */
.p-pre-order {
  display: flex;
  padding: 16px 12px;
  flex-direction: column;
  gap: 4px;
  border-radius: 8px;
  background: #E9EDE8;
}

.p-pre-order__icon {
  color: #505748;
  font-size: 12px;
  font-weight: bold;
}

.p-pre-order__date {
  font-size: 12px;
}

/* 基本情報 */
.p-product-base {
  box-sizing: border-box;
  overflow-wrap: anywhere;
  word-break: normal;
  line-break: strict;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.p-product-base__title {
  margin: 0;
  line-height: 1.4;
  font-family: "ヒラギノ明朝 ProN", "Hiragino Mincho ProN", "游明朝", "Yu Mincho", "YuMincho", "MS P明朝", "MS PMincho", serif;
  font-size: 24px;

  @media screen and (min-width: 768px) {
    font-size: 28px;
  }

  img {
    vertical-align: middle;
  }
}

.p-product-base__id {
  font-size: 12px;
}

.p-product-base__explain {
  margin: 0;
  font-size: 14px;
}

.p-product-base__tag {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* 価格・定価 */
.p-product-price {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
}

.p-product-price__unit {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 21px;
  font-weight: bold;
}

.p-product-price__sell {
  font-family: "ヒラギノ明朝 ProN", "Hiragino Mincho ProN", "游明朝", "Yu Mincho", "YuMincho", "MS P明朝", "MS PMincho", serif;
}

.p-product-price__text {
  line-height: 1.2;
  font-size: 14px;
  color: #7D7D7D;
}

.p-product-price__normal.forOptions {
  display: none;
}

.p-product-price__off.forOptions {
  display: none;
  margin-right: 10px;
}

/******************************/
/* 名入れ設定 */
/******************************/
.p-product-name {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.p-product-name__title {
  line-height: 1;
  font-size: 14px;
}

.p-product-name__body {
  input {
    width: 100%;
    max-width: 360px;
  }
}

/******************************/
/* パスワード入力 */
/******************************/
.p-product-form-password {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.p-product-form-password__title {
  display: flex;
  flex-direction: column;
  gap: 4px;
  line-height: 1;
  font-size: 14px;

  span {
    font-size: 12px;
    color: #7D7D7D;
  }
}

.p-product-form-password__body {
  input {
    width: 100%;
    max-width: 360px;
  }
}

/******************************/
/* オプション情報 */
/******************************/
.p-product-option {
  overflow-x: auto;
}

/* オプション table */
.p-product-option-tbl {
  display: none;

  @media screen and (min-width: 768px) {
    display: block;
  }

  table {
    margin-bottom: 0px;
    border-top: 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 1px solid #B3B2B2;
    border-radius: 0;
    width: 100%;
    font-family: "ヒラギノ角ゴシック", "Hiragino Sans", "ヒラギノ角ゴ Pro W3", "Hiragino Kaku Gothic Pro", "ヒラギノ角ゴ ProN W3", "Hiragino Kaku Gothic ProN", "メイリオ", "Meiryo", "Lucida Grande", sans-serif;
    overflow-x: auto;
    white-space: nowrap;
    margin-left: auto;
    margin-right: auto;
    max-width: 1330px;

    &::-webkit-scrollbar {
      height: 10px;
    }

    &::-webkit-scrollbar-track {
      background: transparent;
    }

    &::-webkit-scrollbar-thumb {
      background: #c6c6c6;
      border-radius: 5px;
    }

    div {
      display: inline-block !important;
    }
  }

  th,
  td {
    padding: 15px 30px;
    border-top: 1px solid #B3B2B2 !important;
    border-left: 0;
    border-radius: 0 !important;
    text-align: center;
  }

  th {
    font-weight: bold;
  }

  th:nth-child(2n),
  td:nth-child(2n) {
    background-color: #F5F5F5;
  }

  label {
    margin-top: 10px;
    margin-bottom: 0;
    line-height: 1.4;
  }

  input {
    margin-top: 0;
  }

  .stock_head th,
  .stock_head td {
    border-bottom: 2px solid #B3B2B2;
    font-size: 16px;
    font-weight: bold;
  }
}

/* オプション select */
.p-product-option-select {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.p-product-option-select__box {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.p-product-option-select__title {
  line-height: 1;
  font-size: 14px;
}

/******************************/
/* オプションの詳細情報 */
/******************************/
.p-product-option-detail {
  margin-top: 8px;

  a {
    text-decoration: underline;

    &:hover {
      opacity: 0.7;
    }
  }
}

.p-product-option-detail__btn {
  box-sizing: border-box;
  display: inline-block;
  margin-top: 0;
  margin-bottom: 20px;
  padding: 18px;
  width: 250px;
  border: none;
  border-radius: 25px;
  font-size: 14px;
  line-height: 1.4;
  background: #5c5c5c;
  color: #ffffff;
  text-align: center;

  @media screen and (min-width: 768px) {
    margin-top: 20px;
    padding: 15px;
  }

  &:hover {
    background: rgba(92, 92, 92, 0.8);
    color: #ffffff;
    text-decoration: none;
  }

  &:focus,
  &:active {
    background: rgba(92, 92, 92, 0.8);
    color: #ffffff;
    text-decoration: none;
  }
}

.mfp-container {
  padding-top: 6px;
  padding-bottom: 6px;

  @media screen and (min-width: 768px) {
    padding-top: 0;
    padding-bottom: 0;
  }
}

.js-option-detail-wrap {
  box-sizing: border-box;
  position: relative;
  margin: 25px 20px;
  padding: 70px 20px 0 20px;
  width: auto;
  background: #fafafa;
  max-height: calc(100vh - 60px);

  @media screen and (min-width: 768px) {
    margin: 60px auto;
    padding: 90px 60px 0 70px;
    max-height: calc(100vh - 120px);
  }

  @media screen and (min-width: 1024px) {
    max-width: 1280px;
  }
}

.js-option-detail-wrap {
  & > .mfp-close {
    top: 20px !important;
    left: 20px;
    right: auto;
    width: 30px;
    height: 30px;
    opacity: 1;

    @media screen and (min-width: 768px) {
      top: 30px !important;
      left: 30px;
    }

    img {
      padding: 0;
      width: 30px;
      height: 30px;
      opacity: 1;
    }
  }
}

.p-price-table {
  box-sizing: border-box;
  overflow-y: auto;
  padding: 0 0 45px 0;
  max-height: calc(100vh - 210px);
  line-height: 1.4;
  word-break: break-all;

  @media screen and (min-width: 768px) {
    padding-right: 15px;
    padding-bottom: 90px;
    padding-left: 0;
  }
}

.p-price-table__heading-wrap {
  display: flex;
  flex-wrap: wrap;
}

.p-price-table__heading {
  box-sizing: border-box;
  padding: 15px 5px 15px 10px;
  width: 30%;
  font-size: 16px;
  font-weight: bold;
  background: #F5F5F5;
  color: #212121;

  @media screen and (min-width: 768px) {
    padding: 15px 25px;
    font-size: 18px;
  }

  &:nth-child(2) {
    padding-left: 0px;
    width: 70%;

    @media screen and (min-width: 768px) {
      padding-left: 10px;
    }
  }
}

.p-price-table__dl {
  display: flex;
  flex-wrap: wrap;
}

.p-price-table__dt {
  box-sizing: border-box;
  padding: 15px 15px 15px 0;
  border-bottom: 2px solid #B3B2B2;
  width: 30%;
  font-weight: bold;

  @media screen and (min-width: 768px) {
    padding: 15px 25px;
  }
}

.p-price-table__dd {
  box-sizing: border-box;
  margin: 0;
  padding-top: 15px;
  border-bottom: 2px solid #B3B2B2;
  width: 70%;
}

.p-price-table-list__item {
  margin-bottom: 15px;
  padding-bottom: 15px;
  padding-left: 0;
  border-bottom: 1px solid #B3B2B2;

  @media screen and (min-width: 768px) {
    padding-left: 25px;
  }

  &:last-child {
    margin-bottom: 0;
    border-bottom: 0;
  }
}

.p-price-table-list__name {
  font-weight: bold;
}

.p-price-table-list__price {
  margin-top: 5px;
}

.p-price-table-list__soldout {
  color: #B94646;
  font-weight: bold;
}

.p-price-table__body {
  &::after {
    display: block;
    clear: both;
    content: "";
  }

  dt {
    float: left;
    box-sizing: border-box;
    width: 50%;
    padding: 0.7em 0.5em;
    border-top: 1px solid #eaeaea;
  }

  dd {
    overflow: hidden;
    padding: 0;
    border-top: 1px solid #eaeaea;
  }

  span {
    display: block;
    text-align: right;
  }

  ul {
    margin: 0;
    padding: 0;
    list-style-type: none;
  }

  li {
    padding: 0.7em 0.5em;
    border-bottom: 1px solid #eaeaea;

    &:last-child {
      border-bottom: 0;
    }
  }
}

.p-price-table__name {
  font-weight: bold;
}

/******************************/
/* 購入数 */
/******************************/
.p-product-form-stock-layout {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.p-product-form-stock {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;

  @media screen and (min-width: 768px) {
    justify-content: flex-start;
  }
}

.p-product-form-stock__title {
  margin-right: 20px;
  font-size: 14px;

  @media screen and (min-width: 768px) {
    font-size: 16px;
  }
}

.p-product-form-stock__box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  font-size: 13px;

  @media screen and (min-width: 768px) {
    font-size: 16px;
  }
}

.p-product-form-stock__input {
  display: flex;
  justify-content: center;
  align-items: center;
  border: 1px solid #B3B2B2;

  input[type=text] {
    border-top: 0;
    border-bottom: 0;
    border-radius: 0;
    width: 50px;
    height: 50px;
    font-size: 18px;
    text-align: center;
  }
}

.p-product-form-stock__add {
  overflow: hidden;
  display: block;
  position: relative;
  white-space: nowrap;
  text-indent: -9999px;
  width: 50px;
  height: 50px;

  &:hover {
    background: #E9EDE8;
  }

  &::before, &::after {
    content: "";
    position: absolute;
  }

  &.is-down {
    &::before {
      top: 50%;
      left: 50%;
      width: 14px;
      height: 2px;
      background: #212121;
      transform: translate(-50%, -50%);
    }
  }

  &.is-up {
    &::before {
      top: 50%;
      left: 50%;
      width: 14px;
      height: 2px;
      background: #212121;
      transform: translate(-50%, -50%);
    }

    &::after {
      top: 50%;
      left: 50%;
      width: 2px;
      height: 14px;
      background: #212121;
      transform: translate(-50%, -50%);
    }
  }
}

.p-product-form-stock__unit {
  margin-left: 10px;
}

.p-product-form-stock__stock {
  font-size: 14px;
  color: #7D7D7D;
}

/******************************/
/* 購入ボタン */
/******************************/
.p-product-form-button {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 360px;
  margin-inline: auto;

  @media screen and (min-width: 768px) {
    max-width: 100%;
  }
}

.p-product-form-button__cart {
  display: flex;
  flex-direction: column;
  gap: 8px;

  .disable_cartin {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
}

/* 会員限定 */
.p-product-members-only {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 12px;
  border-radius: 4px;
  background: #E9EDE8;
  padding: 24px;
  font-size: 14px;
}

.p-product-members-only__link {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  width: 100%;

  & > * {
    flex: 1 1 auto;
  }
}

/* お気に入りボタン */
.p-product-form-button__favorite {
  display: flex;
  flex-direction: column;
  gap: 8px;
  span {
    &::after {
      content: "する";
    }
  }

  .is-added {
    span {
      &::after {
        content: "済み";
      }
    }
  }
}

/* エラーメッセージ */
.p-product-error-message {
  margin: 0;
  color: #B94646;
  text-align: center;
}

.stock_error:empty {
  display: none;
}

/******************************/
/* 商品画像 */
/******************************/
.p-product-img {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 600px;
  margin-inline: auto;

  img {
    display: block;
  }

  .splide__arrow {
    background: #E9EDE8;

    svg {
      fill: #728270;
    }
  }
}

.p-product-img__main {
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 12px;
  background: #F5F5F5;
  width: 100%;
  max-width: 600px;
  max-height: 600px;
  aspect-ratio: 1 / 1;
}

.p-product-img__thumb {
  width: 100%;

  .splide__track--nav > .splide__list > .splide__slide.is-active {
    border: 2px solid #728270;
  }
}

/******************************/
/* 商品シェア用ソーシャルボタン */
/******************************/
.p-product-sns {
  z-index: 10;
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  justify-content: center;

  @media screen and (min-width: 768px) {
    top: 16px;
    right: 16px;
  }
}

.p-product-sns__trigger {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border: 1px solid #D8D8D8;
  border-radius: 20px;
  background: #FFF;
  color: #333333;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);

  &:hover {
    background: #F5F5F5;
    border-color: #C0C0C0;
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
  }

  &[aria-expanded="true"] {
    background: #F0F0F0;
    border-color: #A0A0A0;
  }
}

.p-product-sns__icon {
  width: 18px;
  height: 18px;
  transition: transform 0.3s ease;
}

.p-product-sns__text {
  font-weight: 500;
  letter-spacing: 0.5px;
}

.p-product-sns-list {
  z-index: 100;
  position: absolute;
  top: 100%;
  left: 45%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
  padding: 8px;
  background: #FFF;
  border: 1px solid #D8D8D8;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%) translateY(-10px);
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);

  @media screen and (min-width: 768px) {
    left: 50%;
    padding: 12px 16px;
  }

  &.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
  }

  /* 三角形の矢印 */
  &::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid #D8D8D8;
  }

  &::after {
    content: '';
    position: absolute;
    top: -7px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-bottom: 7px solid #FFF;
  }
}

.p-product-sns-list__item {
  margin: 0;
  display: flex;

  /* SNSボタンのサイズを調整 */
  a, span {
    display: block;
    transition: transform 0.2s ease;

    &:hover {
      transform: scale(1.1);
    }
  }
}

/******************************/
/* 商品説明 */
/******************************/
.p-product-explain {
  overflow-wrap: anywhere;
  word-break: normal;
  line-break: strict;
  line-height: 2;
}

/******************************/
/* レビュー */
/******************************/
.p-product-review {
  width: 100%;

  .splide {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    width: 100%;
    overflow: hidden;
  }

  .splide__arrows {
    align-self: flex-end;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;

    .splide__arrow {
      position: static;
      transform: translateY(0);
      background: transparent;
      width: 24px;
      height: 24px;
      transition: 0.3s ease;

      svg {
        width: 14px;
        height: 14px;
        fill: #728270;
      }
    }
  }

  .splide__arrow:hover:not(:disabled) {
    opacity: 1;
    background: #CBDBD3;
  }
}

.p-product-review__message {
  border-radius: 4px;
  background: #E9EDE8;
  box-sizing: border-box;
  width: 100%;
  padding: 24px;
}

.p-product-review__empty {
  border-radius: 4px;
  background: #E9EDE8;
  margin: 0;
  padding: 24px;
  text-align: center;
}

.p-product-review-item {
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-wrap: anywhere;
  word-break: normal;
  line-break: strict;
}

.p-product-review-item__header {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* レビュー投稿者情報 */
.p-product-reviewer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.p-product-reviewer__name {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: bold;
}

.p-product-reviewer__data {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* レビュー投稿情報 */
.p-product-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.p-product-meta__rate {
  display: flex;
  flex-wrap: wrap;
}

.p-product-meta__rate-icon {
  width: 18px;
  height: 18px;
  vertical-align: -0.3em;
  fill: currentColor;
  fill: #D5D5D5;

  &.is-color {
    fill: #EACD3E;
  }
}

/* レビュー内容 */
.p-product-review-message {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.p-product-review-message__title {
  line-height: 1.4;
  font-size: 16px;
  font-weight: bold;
}

.p-product-review-message__comment {
  line-height: 1.75;
}

.p-product-review-message__image {
  width: 140px;
}

/* ショップからの返信コメント */
.p-product-review-reply {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 16px 0 0;
  font-size: 12px;
}

.p-product-review-reply__title {
  line-height: 1.2;
  font-size: 14px;
}

.p-product-action {
  box-sizing: border-box;
  margin-top: 30px;
  padding-left: 0;
  width: auto;

  @media screen and (min-width: 768px) {
    margin-top: 0;
    padding-left: 12px;
  }

  @media screen and (min-width: 1024px) {
    padding-left: 40px;
    width: 50%;
  }
}

/* 数量 */
.p-product-form {
  text-align: center;
}

.p-product-contact__link {
  display: block;
  margin-top: 25px;
  margin-bottom: 25px;
  font-size: 14px;
  font-weight: bold;
  text-align: center;

  @media screen and (min-width: 768px) {
    font-size: 18px;
  }
}

/***** 商品詳細 *****/
.p-product__ttl {
  position: relative;
  margin-top: 0;
  margin-bottom: 25px;
  line-height: 1.4;
  font-size: 24px;
  font-weight: bold;
  text-align: center;
  letter-spacing: 0.1em;

  @media screen and (min-width: 768px) {
    margin-bottom: 40px;
    font-size: 28px;
  }
}

.p-product-detail {
  padding-top: 60px;

  @media screen and (min-width: 768px) {
    padding-top: 90px;
  }
}

/******************************/
/* ショッピングガイドのリンク */
/******************************/
.p-product-link-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-top: 1px solid #CBDBD3;
  padding-top: 24px;
}

.p-product-link-list__item {
  list-style: disc;
  margin-left: 2em;

  a {
    text-decoration: underline;

    &:hover {
      opacity: 0.7;
    }
  }
}

/******************************/
/* 組合せ購入 */
/******************************/
.p-product-recommend {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  justify-content: center;
  gap: 32px 24px;

  @media screen and (min-width: 600px) {
    grid-template-columns: repeat(3, 1fr);
  }

  @media screen and (min-width: 768px) {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  @media screen and (min-width: 1100px) {
    grid-template-columns: repeat(3, 1fr);
  }
}
