/* ===== PRODUCT DETAIL PAGE ===== */

/* --- 3-column Layout (matches index products section) --- */
.pd-layout {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 8vh 0;
  min-height: 100vh;
  min-height: 100dvh;
  box-sizing: border-box;
}

body:not(.home) .pd-layout {
  align-items: center;
}

.pd-center {
  flex: 0 0 65%;
  padding-top: 2vh;
}

/* --- Main (Gallery + Info) --- */
.pd-main {
  display: flex;
  gap: 5%;
}

/* --- Gallery --- */
.pd-gallery {
  flex: 0 0 48%;
  display: flex;
  flex-direction: column;
  gap: 1.2vh;
}

.pd-gallery-main {
  width: 100%;
  overflow: hidden;
  border-radius: 4px;
}

.pd-gallery-main img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  display: block;
  transition: opacity 0.4s ease;
}

/* 1行あたり最大5枠。5枚未満は右に空き、6枚目からは下段へ */
.pd-gallery-thumbs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  width: 100%;
}

.pd-thumb {
  width: 100%;
  min-width: 0;
  background: none;
  border: none;
  padding: 0;
  cursor: none;
  overflow: hidden;
  border-radius: 2px;
  opacity: 0.5;
  transition: opacity 0.3s ease;
}

.pd-thumb.is-active,
.pd-thumb:hover {
  opacity: 1;
}

.pd-thumb img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}

/* --- Product Info --- */
.pd-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.pd-breadcrumb {
  font-size: 0.7rem;
  font-weight: 300;
  color: #000;
  letter-spacing: 0.08em;
  margin-bottom: 3vh;
}

.pd-breadcrumb a {
  color: #000;
  text-decoration: none;
  transition: opacity 0.3s ease;
}

.pd-breadcrumb a:hover {
  opacity: 0.6;
}

.pd-title {
  font-family: 'Roboto', 'Noto Sans JP', sans-serif;
  font-size: 1.3rem;
  font-weight: 500;
  color: #000;
  letter-spacing: 0.06em;
  line-height: 1.5;
  margin-bottom: 2vh;
}

.pd-price {
  font-family: 'Roboto', 'Noto Sans JP', sans-serif;
  font-size: 1.1rem;
  font-weight: 400;
  color: #000;
  letter-spacing: 0.04em;
  margin-bottom: 4vh;
}

.pd-price-tax {
  font-size: 0.7rem;
  font-weight: 300;
}

/* --- Variants --- */
.pd-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 400;
  color: #000;
  letter-spacing: 0.14em;
  margin-bottom: 1vh;
}

.pd-variant {
  margin-bottom: 3vh;
}

.pd-variant-options {
  display: flex;
  gap: 8px;
}

.pd-variant-btn {
  font-family: 'Roboto', 'Noto Sans JP', sans-serif;
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  color: #000;
  background: transparent;
  border: 1px solid #000;
  padding: 0.6em 1.8em;
  cursor: none;
  transition: background 0.3s ease, color 0.3s ease;
}

.pd-variant-btn.is-selected {
  background: #000;
  color: #C48265;
}

.pd-variant-btn:hover {
  background: rgba(0, 0, 0, 0.1);
}

.pd-variant-btn.is-selected:hover {
  background: #000;
}

/* --- Quantity --- */
.pd-quantity {
  margin-bottom: 4vh;
}

.pd-quantity-ctrl {
  display: inline-flex;
  align-items: center;
  border: 1px solid #000;
}

.pd-qty-btn {
  font-family: 'Roboto', sans-serif;
  font-size: 0.85rem;
  width: 2.5em;
  height: 2.5em;
  background: transparent;
  border: none;
  color: #000;
  cursor: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.pd-qty-btn:hover {
  background: rgba(0, 0, 0, 0.06);
}

.pd-qty-value {
  font-family: 'Roboto', sans-serif;
  font-size: 0.85rem;
  font-weight: 400;
  min-width: 2.5em;
  text-align: center;
  color: #000;
  border-left: 1px solid #000;
  border-right: 1px solid #000;
  padding: 0.5em 0;
}

/* --- Add to Cart --- */
.pd-cart-form {
  width: 100%;
  box-sizing: border-box;
}

.pd-add-cart {
  font-family: 'Roboto', 'Noto Sans JP', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  color: #C48265;
  background: #000;
  border: 1px solid #000;
  padding: 1.2em 0;
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  cursor: none;
  transition: background 0.3s ease, color 0.3s ease;
  margin-bottom: 5vh;
}

.pd-add-cart:hover {
  background: transparent;
  color: #000;
}

/* --- Description --- */
.pd-description {
  margin-bottom: 4vh;
}

.pd-desc-text {
  font-size: 0.8rem;
  font-weight: 300;
  color: #000;
  line-height: 2;
  letter-spacing: 0.04em;
  margin-bottom: 3vh;
}

.pd-specs {
  display: flex;
  flex-direction: column;
}

.pd-spec-row {
  display: flex;
  font-size: 0.75rem;
  font-weight: 300;
  color: #000;
  line-height: 1.6;
  padding: 0.6em 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.pd-spec-row dt {
  flex: 0 0 30%;
  font-weight: 400;
  letter-spacing: 0.04em;
}

.pd-spec-row dd {
  flex: 1;
}

/* --- Accordion --- */
.pd-accordion {
  border-top: 1px solid rgba(0, 0, 0, 0.15);
}

.pd-accordion:last-of-type {
  border-bottom: 1px solid rgba(0, 0, 0, 0.15);
}

.pd-accordion summary {
  font-family: 'Roboto', 'Noto Sans JP', sans-serif;
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  color: #000;
  padding: 1.6em 0;
  cursor: none;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: opacity 0.3s ease;
}

.pd-accordion summary::-webkit-details-marker {
  display: none;
}

.pd-accordion summary::after {
  content: '+';
  font-size: 1rem;
  font-weight: 300;
  transition: transform 0.3s ease;
}

.pd-accordion[open] summary::after {
  content: '−';
}

.pd-accordion summary:hover {
  opacity: 0.6;
}

.pd-accordion p {
  font-size: 0.75rem;
  font-weight: 300;
  color: #000;
  line-height: 1.8;
  padding: 0 0 1.6em;
  letter-spacing: 0.03em;
}

/* --- Related Products --- */
.pd-related {
  padding: 10vh 0 0;
}

.pd-related-title {
  font-family: 'Roboto', 'Noto Sans JP', sans-serif;
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  color: #000;
  margin-bottom: 4vh;
}

.pd-related-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
}

/* 商品一覧と同じ：ホバーでオーバーレイに名・価格 */
.pd-related-item {
  display: block;
  position: relative;
  overflow: hidden;
  text-decoration: none;
}

.pd-related-item img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.pd-related-item:hover img {
  transform: scale(1.03);
}

.pd-related-item .products-spec {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(196, 130, 101, 0.75);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 8%;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.pd-related-item:hover .products-spec {
  opacity: 1;
}

/* --- Footer --- */
.pd-footer {
  padding: 6vh 4vw 4vh;
  text-align: center;
}

.pd-footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.4vh;
}

.pd-footer-copy {
  font-size: 9pt;
  color: #000;
  letter-spacing: 0.08em;
  font-weight: 300;
}

/* --- Entry Animation --- */
.pd-main,
.pd-related {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.9s ease, transform 0.9s ease;
}

.pd-main.animate-in,
.pd-related.animate-in {
  opacity: 1;
  transform: translateY(0);
}

/* ===== MOBILE ===== */
@media screen and (max-width: 768px) {
  .pd-layout {
    flex-direction: column;
    align-items: center;
    padding: 4vh 5vw;
    gap: 3vh;
  }

  .pd-center {
    flex: none;
    width: 100%;
  }

  .pd-main {
    flex-direction: column;
    gap: 4vh;
  }

  .pd-gallery {
    flex: none;
    width: 100%;
  }

  .pd-info {
    padding: 0;
  }

  .pd-title {
    font-size: 1.1rem;
  }

  .pd-price {
    font-size: 1rem;
  }

  .pd-related-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 4vw 3vw;
  }

  .pd-add-cart,
  .pd-variant-btn,
  .pd-qty-btn,
  .pd-thumb,
  .pd-accordion summary {
    cursor: auto;
  }
}
