.intro-section {
  max-width: 1360px;
}

/* title */
.page-subtitle,
.product-main-section-title {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1;
  color: var(--color-accent);
}

.product-content-section-subtitle {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.5;
}

.categorize-section-title {
  margin-bottom: -1rem;
  font-size: clamp(2.5rem, 2.357rem + 0.71vw, 3rem);
  line-height: 1.2;

  :is(html[lang='ja'], html[lang='jp']) :is(&:not(.en-label)) {
    font-size: clamp(1.75rem, 1.536rem + 1.07vw, 2.5rem);
  }
}

.primary-markets-item-title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.5;
}

/* section */
.products-main-section {
  margin-top: 7.5rem;
  margin-bottom: 7.5rem;

  @media (width <= 767px) {
    margin-top: 2rem;
    margin-bottom: 3.75rem;
  }
}

.product-content-section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;

  & + & {
    margin-top: 5rem;

    @media (width <= 767px) {
      margin-top: 3.75rem;
    }
  }
}

/* container */
.has-product-guide-container {
  display: grid;
  grid-template-columns: auto 282px;
  gap: 1.5rem;

  @media (width <= 1000px) {
    grid-template-columns: 1fr;
  }

  .product-main-container {
    min-width: 0;
  }
}

.product-content-section-sub-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.product-content-section-wrapper {
  margin: 5rem 0;

  @media (width <= 767px) {
    margin: 3.75rem 0;
  }

  .product-main-section-title {
    margin-bottom: 1.5rem;
  }
}

.precision-roller-categorize-container {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;

  @media (width <= 767px) {
    gap: 1.5rem;
  }

  .categorize-section-title {
    margin-bottom: unset;
  }

  .precision-roller-categorize-sub-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
  }
}

/* layout */
.product-card-grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem 0.5rem;

  @media (width <= 767px) {
    grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  }
}

.primary-markets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;

  @media (width <= 767px) {
    display: flex;
    gap: 0.5rem;
    width: calc(100vw - (100vw - 100%) / 2);
    padding-right: calc((100vw - 100%) / 2);
    margin-right: calc((100% - 100vw) / 2);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
  }

  &.col-4 {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }

  &.precision-measurement {
    margin-top: 3.5rem;

    @media (width <= 767px) {
      margin-top: 2.25rem;
    }
  }

  .primary-markets-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;

    @media (width <= 767px) {
      flex: 0 0 200px;
      scroll-snap-align: start;
    }

    .primary-markets-image-container {
      width: 100%;
      overflow: hidden;
      border-radius: 12px;

      .primary-markets-image {
        width: 100%;
        height: 100%;
        aspect-ratio: 1;
        object-fit: cover;
      }

      &.precision-measurement {
        aspect-ratio: 4 / 3;
      }

      &.aspect-ratio-4-3 {
        aspect-ratio: 4 / 3;
      }

      &.aspect-ratio-2-1 {
        aspect-ratio: 2 / 1;

        @media (width <= 767px) {
          aspect-ratio: 4 / 3;
        }
      }
    }

    .primary-markets-text {
      font-size: 1rem;
      font-weight: 400;
      line-height: 1.5;
      color: var(--color-black);
    }
  }
}

.product-information-table-grid {
  --border-color: rgb(126 144 153 / 20%);

  display: grid;
  grid-template-columns: auto repeat(4, 1fr);
  width: 100%;
  border-left: 1px solid var(--border-color);

  @media (width <= 767px) {
    display: grid;
    grid-template-columns: 120px repeat(4, 140px);
    width: calc(100vw - (100vw - 100%) / 2);
    padding-right: calc((100vw - 100%) / 2);
    margin-right: calc((100% - 100vw) / 2);
    overflow-x: auto;
  }

  div {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    font-size: 0.875rem;
    line-height: 1.4;
    text-align: center;
    background-color: var(--color-white);
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);

    &.table-head {
      font-weight: 700;
      background-color: var(--color-gray-bg);
      border-top: 1px solid var(--border-color);
    }

    &.table-row-head {
      justify-content: flex-start;
      font-weight: 400;
      text-align: left;
      background-color: var(--color-gray-bg);
    }

    &.empty-cell {
      background-color: var(--color-gray-bg);
    }

    &.col-span-all {
      grid-column: span 4;
      justify-content: flex-start;
      text-align: left;
    }

    &.col-span-3 {
      grid-column: span 3;
      justify-content: flex-start;
      text-align: left;
    }

    &.text-left {
      text-align: left;
    }

    &.table-cell-image {
      padding: unset;
    }

    img {
      width: 100%;
      max-width: 100%;
      height: auto;
      object-fit: cover;
    }
  }
}

.product-spec-table-2-col {
  --border-color: rgb(126 144 153 / 20%);

  display: grid;
  grid-template-columns: 200px 1fr;
  width: 100%;
  overflow: hidden;
  border-top: 1px solid var(--border-color);
  border-left: 1px solid var(--border-color);
  border-radius: 4px;

  @media (width <= 767px) {
    grid-template-columns: 120px 1fr;
  }

  div {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    background-color: var(--color-white);
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);

    &.table-head {
      justify-content: flex-start;
      background-color: var(--color-gray-bg);
    }
  }
}

/* parts */
.product-card {
  .product-card-image-container {
    overflow: hidden;
    border-radius: 10px;
  }

  .product-card-image {
    width: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
  }

  .product-card-title {
    @media (width <= 1000px) {
      padding: 0.5rem;
      font-size: 1rem;
    }
  }

  &:hover {
    color: inherit;

    .product-card-image {
      transform: scale(1.03);
    }
  }
}

.product-mv {
  display: grid;
  grid-template-areas: 'stack';

  @media (width <= 767px) {
    grid-template-areas: none;
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .product-mv-image-container {
    position: relative;
    grid-area: stack;

    @media (width <= 767px) {
      grid-area: auto;
    }
  }

  .product-mv-image {
    width: 100%;
    height: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
  }

  .page-title {
    z-index: 1;
    display: block;
    grid-area: stack;
    gap: unset;
    place-self: end start;
    margin-left: calc(50vw - 680px);
    line-height: 1;
    color: var(--color-white);

    @media (width <= 767px) {
      grid-area: unset;
      margin-bottom: unset;
      margin-left: 4.3%;
      color: var(--color-black);
    }

    @media (width <= 1439px) {
      margin-left: 2.1%;
    }
  }
}

.accent-button {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 1.5rem 1rem;
  color: var(--color-white);
  text-decoration: none;
  background-color: var(--color-accent);
  border-radius: 10px;
  transition: filter 0.3s ease;

  &:hover {
    color: var(--color-white);
    filter: brightness(0.9);
  }

  .accent-button-main {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;

    .accent-button-icon {
      width: 0.8em;
      height: 0.8em;
      stroke-width: 2;
    }
  }

  .accent-button-sub {
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    text-align: center;

    @media (width <= 767px) {
      font-size: 0.75rem;
    }
  }
}

.primary-markets-item-note-list {
  display: flex;
  flex-direction: column;
  list-style-type: disc;

  .primary-markets-item-note-item {
    margin-left: 1em;
    font-size: clamp(0.875rem, 0.839rem + 0.18vw, 1rem);
    font-weight: 400;
    line-height: 1.5;
  }
}

.video-container {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  overflow: hidden;

  iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
  }
}

.link {
  color: var(--color-link);
  text-decoration: underline;

  &:hover {
    color: var(--color-link);
    text-decoration: none;
  }
}

/* product guide */
.product-guide {
  --border-color: rgb(126 144 153 / 20%);

  z-index: 98;
  background-color: var(--color-white);

  @media (width <= 1000px) {
    width: 100%;
  }

  .product-guide-grid {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;

    @media (width <= 1000px) {
      grid-template-columns: repeat(2, 1fr);
    }

    .product-guide-item {
      border-bottom: 1px solid var(--border-color);

      &:nth-of-type(odd) {
        @media (width <= 1000px) {
          border-right: 1px solid var(--border-color);
        }
      }

      .product-guide-link {
        display: flex;
        gap: 1rem;
        justify-content: space-between;
        width: 100%;
        height: 100%;
        padding: 1rem;
        font-size: 1rem;
        line-height: 1.5;
        color: var(--color-black);
        transition: all 0.3s ease;

        .product-guide-item-icon {
          color: var(--color-white);

          @media (width <= 1000px) {
            color: var(--color-accent);
          }
        }

        &:hover {
          color: var(--color-white);
          background-color: var(--color-accent);

          .product-guide-item-icon {
            color: var(--color-white);
          }
        }
      }
    }
  }
}

/* control product guide location */
.product-guide-pc {
  @media (width <= 1000px) {
    display: none;
  }
}

.product-guide-mobile {
  display: none;

  @media (width <= 1000px) {
    display: block;
    margin: 0 2rem;
  }
}

.product-guide-head-button {
  display: flex;
  gap: 10px;
  justify-content: start;
  width: 100%;
  padding-bottom: 0.5rem;
  font-size: var(--text-24);
  font-weight: 700;
  line-height: 1.5;
  color: var(--color-black);
  background-color: var(--color-white);
  border: none;

  @media (width <= 1000px) {
    justify-content: center;
  }

  .product-guide-icon {
    display: none;
    color: var(--color-accent);

    @media (width <= 1000px) {
      display: inline-block;
    }

    .chevron-double-right-icon {
      transform: rotate(90deg);
      transition: transform 0.3s ease;

      @media (width <= 1000px) {
        display: inline-block;
        margin-bottom: 20%;
      }
    }
  }

  &[aria-expanded='true'] .chevron-double-right-icon {
    transform: rotate(-90deg);
  }
}

.steel-ball-product-information-table-grid {
  --border-color: rgb(126 144 153 / 20%);

  display: grid;
  grid-template-columns: auto repeat(3, 1fr);
  width: 100%;
  border-left: 1px solid var(--border-color);

  @media (width <= 767px) {
    display: grid;
    grid-template-columns: 120px repeat(3, 140px);
    width: calc(100vw - (100vw - 100%) / 2);
    padding-right: calc((100vw - 100%) / 2);
    margin-right: calc((100% - 100vw) / 2);
    overflow-x: auto;
  }

  div {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    font-size: 0.875rem;
    line-height: 1.4;
    text-align: center;
    background-color: var(--color-white);
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);

    &.table-head {
      font-weight: 700;
      background-color: var(--color-gray-bg);
      border-top: 1px solid var(--border-color);
    }

    &.table-row-head {
      justify-content: flex-start;
      font-weight: 400;
      text-align: left;
      background-color: var(--color-gray-bg);
    }

    &.empty-cell {
      background-color: var(--color-gray-bg);
    }

    &.col-span-all {
      grid-column: span 4;
      justify-content: flex-start;
      text-align: left;
    }

    &.text-left {
      text-align: left;
    }

    &.table-cell-image {
      padding: unset;
      object-fit: cover;
    }

    img {
      width: 100%;
      max-width: 100%;
      height: 100%;
      object-fit: cover;
    }
  }
}
.primary-markets-item .primary-markets-image-container {
  .primary-markets-image.object-fit {
    object-fit: contain;
  }
}
