/* ========================================
   Product Section
======================================== */

.p-product-section--bg {
  background: #f3f8f8;
}

/* ========================================
   Commitment
======================================== */

.p-product-commitment {
  padding: var(--space-3xl) 0;
}

.p-product-commitment__title {
  display: block;
  margin: 0;
  font-size: 36px;
  font-weight: var(--fw-h2);
  line-height: 1.2;
  text-align: center;
}

.p-product-commitment__body {
  margin-top: var(--space-lg);
}

.p-product-commitment__grid {
  display: grid;
  grid-template-columns: 1fr 24px 1px 24px 1fr 24px 1px 24px 1fr;
  align-items: stretch;
}

.p-product-commitment__divider {
  background: #9ac4c7;
}

.p-product-commitment__col {
  text-align: center;
}

.p-product-commitment__tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto !important;
  padding: 16px;
  color: var(--color-white);
  font-family: var(--font-en);
  font-size: 14px;
  font-weight: var(--fw-en-bold);
  line-height: 1;
  background: #a1c2c5;
}

.p-product-commitment__h3 {
  margin-top: 24px;
  margin-bottom: 0;
  font-size: 22px;
  font-weight: var(--fw-h2);
  line-height: 1.5;
  text-align: center;
}

.p-product-commitment__img {
  margin: 24px 0 0;
}

.p-product-commitment__img img {
  display: block;
  width: 100%;
  height: auto;
}

.p-product-commitment__text {
  margin-top: 24px;
  margin-bottom: 0;
  font-size: 16px;
  text-align: justify;
}

/* ========================================
   Product Category
======================================== */

.p-product-products {
  margin-top: var(--section-gap);
}

.p-product-category {
  margin-top: var(--section-gap);
}

.p-product-category:first-child {
  margin-top: 0;
}

.p-product-category__head {
  display: grid;
  grid-template-columns: 240px 1fr;
  align-items: start;
  gap: 40px;
}

.p-product-category__ja {
  margin: 0;
  font-size: 32px;
  font-weight: var(--fw-h2);
}

.p-product-category__en {
  margin: 8px 0 0;
  font-size: 16px;
  font-weight: var(--fw-en-medium);
}

.p-product-category__item img,
.p-product-category__gallery img {
  display: block;
  width: 100%;
  height: auto;
}

.p-product-category__gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 40px;
}

.p-product-category__gallery figure {
  overflow: hidden;
  cursor: pointer;
}

.p-product-category__gallery figure img {
  transition:
    transform 0.5s ease,
    filter 0.5s ease;
}

.p-product-category__gallery figure:hover img {
  filter: brightness(1.03);
  transform: scale(1.05);
}

#cut-vegetables .p-product-category__gallery {
  row-gap: 50px;
}

/* ========================================
   Product Card
======================================== */

.p-product-card__imgwrap {
  overflow: hidden;
}

.p-product-card__imgwrap img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.5s ease;
  will-change: transform;
}

.p-product-category__gallery figure:hover .p-product-card__imgwrap img {
  transform: scale(1.05);
}

.p-product-card {
  position: relative;
  margin-top: 14px;
  margin-left: 18px;
  padding-left: 12px;
  text-spacing-trim: trim-start;
  font-feature-settings: "palt";
}

.p-product-card::before {
  content: "";
  position: absolute;
  top: -24px;
  left: 0;
  width: 2px;
  height: calc(100% + 24px);
  background: #9ac4c7;
}

.p-product-card__name {
  display: block;
  font-size: var(--font-size-base);
  font-weight: var(--fw-h2);
  line-height: 1.3;
}

.p-product-card__spec {
  display: block;
  margin-top: 2px;
  font-size: 14px;
  line-height: 1.5;
}

.p-product-category__note {
  margin-top: 30px;
  font-size: 12px;
}

/* ========================================
   Product Modal
======================================== */

.p-product-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.5s ease,
    visibility 0s linear 0.5s;
}

.p-product-modal.is-open {
  opacity: 1;
  visibility: visible;
  transition:
    opacity 0.5s ease,
    visibility 0s linear 0s;
}

.p-product-modal__overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(4, 0, 0, 0.3);
}

.p-product-modal__wrap {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  height: 100%;
  padding: 24px;
  pointer-events: none;
}

.p-product-modal__dialog {
  display: grid;
  grid-template-rows: auto 1fr;
  max-height: min(88vh, 760px);
  padding: 30px 40px 40px 40px;
  overflow: hidden;
  background: #fff;
  pointer-events: auto;
  transition: opacity 0.5s ease;
}

.p-product-modal.is-open .p-product-modal__dialog {
  opacity: 1;
}

.p-product-modal__header {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  column-gap: 16px;
}

.p-product-modal__close {
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
}

.p-product-modal__close img {
  width: 20px;
  height: 20px;
}

.p-product-modal__body {
  margin-top: 20px;
  overflow: auto;
}

.p-product-modal__img {
  display: block;
  width: 100%;
  max-width: 700px;
  max-height: 60vh;
  height: auto;
  margin-inline: auto;
  object-fit: contain;
}

.p-product-modal__title {
  font-size: 22px;
}

.p-product-modal__spec {
  font-size: 16px;
}

body.is-modal-open {
  position: fixed;
  right: 0;
  left: 0;
  width: 100%;
  overflow: hidden;
}

/* ========================================
   SP
======================================== */

@media (max-width: 767px) {
  .p-product-products {
    margin-top: 73px;
  }

  .p-product-commitment {
    padding: var(--space-xl) 0;
  }

  .p-product-commitment__title {
    font-size: 22px;
  }

  .p-product-commitment__grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .p-product-commitment__divider {
    display: block !important;
    width: 100%;
    height: 1px;
  }

  .p-product-commitment__grid > div:empty {
    display: none;
  }

  .p-product-commitment__h3 {
    font-size: 18px;
  }

  .p-product-category__head {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .p-product-category__ja {
    font-size: 28px;
  }

  .p-product-category__en {
    font-size: 14px;
  }

  .p-product-category__gallery {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px 10px;
    margin-top: 26px;
  }

  #cut-vegetables .p-product-category__gallery {
    row-gap: 20px;
  }

  .p-product-card {
    margin-top: 10px;
    margin-left: 8px;
    padding-left: 10px;
  }

  .p-product-card__name {
    font-size: var(--font-size-md);
  }

  .p-product-card__spec {
    font-size: 11px;
  }

  .p-product-modal__wrap {
    padding: 20px;
  }

  .p-product-modal__dialog {
    padding: 26px 20px 28px 20px;
  }

  .p-product-modal__title {
    font-size: 16px;
  }

  .p-product-modal__spec {
    font-size: 12px;
  }
}
