.product { width: min(1100px, 92%); margin: 48px auto; --v-align-adjust: 0px; --product-img-max-w: 640px; --product-img-max-h: clamp(300px, 60vh, 640px); }
.product__title { font-size: clamp(24px, 3.5vw, 36px); margin: 0 0 16px; }
.product__explanation { color:#444; line-height:1.9; margin-bottom: 24px; }

.product__content { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 1600px){
  .product__content { grid-template-columns: 1fr; }
}
@media (max-width: 1200px){
  .product__content { grid-template-columns: 1fr; }
}
@media (max-width: 900px){ .product__content { grid-template-columns: 1fr; } }

/* Prevent grid overflow when slider/contents are wider than their cell */
.product__gallery,
.product__features,
.product-slider { min-width: 0; }

.product__features { background:#fafafa; border:1px solid #eee; padding:16px 18px; border-radius:8px; margin-top: 0; position: relative; z-index: 2; overflow: visible; max-height: none; }
.product__features-title { font-size: 20px; margin: 0 0 10px; font-weight: 700; letter-spacing: .02em; color:#222; }
.product__feature-content { font-size: 15px; line-height: 1.8; overflow-wrap: anywhere; word-break: break-word; word-wrap: break-word; }
.product__feature-content p { margin: 0 0 12px; }
.product__feature-content p,
.product__feature-content li { overflow-wrap: anywhere; word-break: break-word; word-wrap: break-word; }
.product__feature-content b,
.product__feature-content strong { font-weight: 700; color: #111; }
.product__feature-content ul { margin: 0 0 14px 1.2em; padding: 0; }
.product__feature-content li { margin: 0 0 6px; }

.product__footer { margin-top: 24px; display: flex; gap: 10px; flex-wrap: wrap; }
.product__backlink { text-decoration:none; border:1px solid #ddd; padding:8px 12px; border-radius:6px; }

.product__downloadlink {
  text-decoration: none;
  border: 1px solid #0a7;
  background: #0a7;
  color: #fff;
  padding: 8px 12px;
  border-radius: 6px;
  font-weight: 600;
}
.product__downloadlink:hover { filter: brightness(0.95); }

/* Slider */
/* Slider */
.product-slider { position: relative; overflow-x: hidden; overflow-y: visible; border-radius: 10px; --media-h: clamp(300px, 60vh, 640px); z-index: 0; }
.product-slider__track {
  display: flex;
  transition: transform .35s ease;
  will-change: transform;
  touch-action: pan-y;
}
.product-slider,
.product-slider__track,
.product-slide { height: auto; }
.product-slide { min-width: 100%; margin: 0; padding: 0; position: relative; flex: 0 0 100%; box-sizing: border-box; }
.product-slide img { display:block; width:100%; height:auto; }
.product__gallery img { max-width: 100%; height: auto; }

/* Flexible image sizing: cap by max width/height and shrink if needed */
.product-slide__media { width: 100%; background: #fff; display: flex; align-items: center; justify-content: center; }
.product-slide__media img {
  width: auto;
  height: auto;
  max-width: min(100%, var(--product-img-max-w));
  max-height: var(--product-img-max-h);
  object-fit: contain;
}

/* Per-slide caption under image */
.product-slide__caption {
  margin: 10px 0 8px;
  padding: 8px 10px;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 6px;
  color: #333;
  font-size: 13px;
  line-height: 1.6;
  display: block;
  width: 100%;
  box-sizing: border-box;
  text-align: left;
  text-indent: 0;
  margin-left: 0;
  margin-right: 0;
}
.product-slide__caption-text { margin: 0; white-space: pre-line; text-align: left; }
.product-slide__yt { display: inline-block; margin-top: 6px; text-decoration: none; }

/* Two-column specs (e.g., 項目 / 仕様) */
.product-table--cols2 th:first-child,
.product-table--cols2 td:first-child { width: 34%; white-space: nowrap; }
.product-table--cols2 td:first-child { font-weight: 600; }
@media (max-width: 600px){
  .product-table--cols2 th:first-child,
  .product-table--cols2 td:first-child { width: 42%; }
}

.product-slider__nav {
  position:absolute; top: 50%; transform:translateY(-50%);
  border:none; background:rgba(0,0,0,.35); color:#fff;
  width:40px; height:40px; border-radius:20px; cursor:pointer;
  display:grid; place-items:center; font-size:22px; line-height:1; 
  z-index: 1;
}
.product-slider__nav--prev { left:8px; }
.product-slider__nav--next { right:8px; }

.product-slider__dots {
  position: static; /* place below the slider content to avoid overlap */
  left: auto; transform: none; bottom: auto;
  display:flex; gap:8px; justify-content: center; 
  margin-top: 10px;
}
.product-slider__dots button {
  width:8px; height:8px; border-radius:50%; border:none;
  background:rgba(255,255,255,.6); cursor:pointer;
}

.product-slider__dots button[aria-current="true"] { background:#fff; width:10px; height:10px; }

/* === Thumbnail gallery (above slider) === */
.product__thumbs { 
  display: flex; gap: 8px; margin: 0 0 10px; 
  overflow-x: auto; padding-bottom: 4px; 
  -webkit-overflow-scrolling: touch; 
}
.product-thumb { 
  flex: 0 0 auto; border: 1px solid #ddd; border-radius: 6px; 
  padding: 2px; background: #fff; cursor: pointer; 
}
.product-thumb img { display: block; width: 64px; height: 64px; object-fit: contain; background: #fff; }
.product-thumb[aria-current="true"] { outline: 2px solid #0a7; outline-offset: 1px; }
@media (max-width: 600px){ .product-thumb img { width: 56px; height: 56px; object-fit: contain; } }

/* === Comments === */
.product__comments { margin-top: 32px; padding-top: 16px; border-top: 1px solid #eee; }
.product__comments-title { font-size: 20px; margin: 0 0 12px; }

.product__comment-list { list-style: none; margin: 0; padding: 0; }
.product__comment-list .comment { border: 1px solid #eee; border-radius: 8px; padding: 12px; margin: 0 0 12px; background: #fff; }
.product__comment-list .comment-meta { font-size: 12px; color: #666; margin-bottom: 6px; }
.product__comment-list .comment-author { font-weight: 600; }
.product__comment-list .avatar { border-radius: 50%; }
.product__comment-list .comment-content p { margin: 0 0 10px; }
.product__comment-nav { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }

.product__no-comments,
.product__comments-closed { color: #666; }

.product__comment-form { margin-top: 16px; }
.product-comment-form input[type="text"],
.product-comment-form input[type="email"],
.product-comment-form textarea {
  width: 100%;
  border: 1px solid #ddd; border-radius: 6px; padding: 10px; box-sizing: border-box;
}
.product-comment-form p { margin-bottom: 12px; }
.product-comment-form input[type="submit"] {
  padding: 10px 16px; border-radius: 6px; border: 1px solid #ddd; background: #f5f5f5; cursor: pointer;
}

/* 外部キャプションを右カラム直下に固定 */
.product__caption {
  grid-column: 2;        /* 特徴（右カラム）の真下に置く */
  margin-top: 8px;
  color: #555;
  white-space: pre-wrap; /* 改行保持 */
  font-size: 13px;
  line-height: 1.6;
}
@media (max-width: 900px){
  .product__caption { grid-column: 1; }
}

/* === Product spec table === */
.product__table { margin-top: 16px; }
.product__table-title { font-size: 18px; margin: 0 0 8px; }
.product__table-wrap { overflow-x: auto; }
.product-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.product-table th, .product-table td { border: 1px solid #e5e5e5; padding: 8px 10px; text-align: left; word-break: break-word; }
.product-table thead th { background: #fafafa; }

/* === Per-slide spec table (follows each image) === */
.product-slide__table { margin-top: 12px; }
.product-slide__table-title { font-size: 16px; margin: 0 0 6px; }
.product-slide__table-wrap { overflow-x: auto; }
/* Reuse .product-table styles already defined */
.product, .product * { box-sizing: border-box; }
.product { isolation: isolate; }
.product__gallery { position: relative; z-index: 0; max-width: 100%; }
.product__features { position: relative; z-index: 2; max-width: 100%; overflow: visible; }
.product-slide__caption, .product-slide__table { position: relative; z-index: 1; }