@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@100;400&family=Shippori+Mincho:wght@500&family=Zen+Old+Mincho:wght@400;500;600&display=swap");

/* ============================================================
   Variables
   ============================================================ */
:root {
  --color-base: #231815;
  --color-pink: #eb7083;
  --color-gold: #ac8746;
  --color-white: #ffffff;
  --color-lead-bg: #ffeced;
  --content-width: 1060px;
  --sp-margin: 28px;
  --bp: 768px;
}

/* ============================================================
   Base
   ============================================================ */
.pet-page {
  color: var(--color-base);
  line-height: 1.75;
  font-family: "Noto Sans JP", sans-serif;
}

/* SP改行制御 */
.pet-lead__br-sp {
  display: none;
}

.pet-products__heading-sp {
  display: none;
}

.pet-products__heading-pc {
  display: inline;
}

@media (max-width: 768px) {
  .pet-lead__br-sp {
    display: inline;
  }

  .pet-products__heading-sp {
    display: inline;
  }

  .pet-products__heading-pc {
    display: none;
  }
}

/* ============================================================
   MV
   ============================================================ */
.pet-mv {
  position: relative;
  width: 100%;
}

.pet-mv__bg {
  display: block;
  width: 100%;
  height: auto;
}

.pet-mv__title {
  position: absolute;
  top: 8%;
  left: 50%;
  width: 50%;
  margin: 0;
  transform: translateX(-50%);
  text-align: center;
}

.pet-mv__title img {
  display: block;
  width: 100%;
  height: auto;
}

@media (max-width: 768px) {
  .pet-mv__title {
    top: 9%;
    width: 56%;
  }
}

/* ============================================================
   Lead
   ============================================================ */
.pet-lead {
  position: relative;
  padding-block: 86px;
  padding-bottom: 176px;
  background: linear-gradient(
    to bottom,
    var(--color-lead-bg) 0%,
    var(--color-lead-bg) 25%,
    var(--color-white) 100%
  );
  overflow: hidden;
  text-align: center;
}

.pet-lead__sakura-left {
  position: absolute;
  top: -130px;
  left: -90px;
  width: 30%;
  pointer-events: none;
}

.pet-lead__sakura-right {
  position: absolute;
  top: -110px;
  right: -60px;
  width: 30%;
  pointer-events: none;
}

.pet-lead__inner {
  position: relative;
  width: min(var(--content-width), 100% - var(--sp-margin) * 2);
  margin-inline: auto;
}

.pet-lead__heading {
  margin: 0;
  font-family: "Shippori Mincho", serif;
  font-weight: 500;
  font-size: 24px;
  color: var(--color-base);
}

.pet-lead__body-wrap {
  position: relative;
  margin-top: 54px;
}

.pet-lead__text {
  font-family: "Noto Sans JP", sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 2;
  letter-spacing: 1.25px;
  text-align: center;
}

.pet-lead__illust {
  position: absolute;
  right: 0;
  bottom: 0;
  display: block;
  width: 130px;
}

@media (max-width: 1100px) {
  .pet-lead__illust {
    bottom: -100px;
    right: 0;
  }
}

@media (max-width: 768px) {
  .pet-lead {
    padding-block: 40px;
    padding-bottom: 170px;
  }

  .pet-lead__sakura-left {
    width: 45%;
    top: 120px;
    left: -32px;
  }

  .pet-lead__sakura-right {
    width: 45%;
    top: 50px;
    right: -35px;
  }

  .pet-lead__heading {
    font-size: 24px;
  }

  .pet-lead__body-wrap {
    flex-direction: column;
    align-items: center;
    margin-top: 36px;
    gap: 24px;
  }

  .pet-lead__text {
    font-size: 15px;
    letter-spacing: 0;
  }

  .pet-lead__illust {
    width: 130px;
    margin-right: calc(17% - 70px);
  }
}

/* ============================================================
   Products Section
   ============================================================ */
.pet-products {
  padding-bottom: 80px;
}

.pet-products__heading {
  margin: 0 auto 60px;
  font-family: "Zen Old Mincho", serif;
  font-weight: 400;
  font-size: 21px;
  color: var(--color-pink);
  text-align: center;
}

@media (max-width: 768px) {
  .pet-products__heading {
    margin-bottom: 40px;
    font-size: 21px;
    text-align: center;
  }
}

/* ============================================================
   Divider
   ============================================================ */
.pet-divider {
  display: block;
  width: min(var(--content-width), 100% - var(--sp-margin) * 2);
  height: 1px;
  margin: 126px auto;
  background: var(--color-pink);
  border: none;
}

@media (max-width: 768px) {
  .pet-divider {
    margin: 84px auto;
  }
}

/* ============================================================
   Product Item
   ============================================================ */
.pet-product {
}

/* --- Product Overview (image + info) --- */
.pet-product__overview {
  display: flex;
  align-items: center;
  gap: 42px;
}

.pet-product__photo-wrap {
  position: relative;
  flex-shrink: 0;
  width: calc(600 / 1280 * 100vw);
  max-width: calc(600 / 1280 * 1800px);
}

.pet-product__photo {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0 16px 16px 0;
}

.pet-product__info {
  flex: 1;
  min-width: 0;
  padding-right: max(0px, calc((100vw - var(--content-width)) / 2));
}

/* --- Product name --- */
.pet-product__category {
  display: block;
  margin-bottom: 6px;
  margin-left: 47px;
  font-family: "Zen Old Mincho", serif;
  font-weight: 600;
  font-size: 17px;
  color: var(--color-base);
}

.pet-product__badge {
  display: inline-block;
  margin-right: 10px;
  vertical-align: middle;
}

.pet-product__badge img {
  display: block;
  height: 36px;
  width: auto;
}

.pet-product__name {
  display: inline-block;
  vertical-align: middle;
}

.pet-product__name img {
  display: block;
  height: 33px;
  width: auto;
}

/* --- Price --- */
.pet-product__price-row {
  display: flex;
  align-items: flex-end;
  margin-top: 36px;
  gap: 16px;
}

.pet-product__label {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 86px;
  height: 42px;
  border: 1px solid var(--color-base);
  border-radius: 8px;
  font-family: "Noto Sans JP", sans-serif;
  font-weight: 400;
  font-size: 16px;
  white-space: nowrap;
}

.pet-product__price {
  display: flex;
  align-items: flex-end;
  line-height: 1;
}

.pet-product__price-num {
  font-family: "Zen Old Mincho", serif;
  font-weight: 400;
  font-size: 50px;
  color: var(--color-pink);
  line-height: 1;
}

.pet-product__price-unit {
  font-family: "Zen Old Mincho", serif;
  font-weight: 400;
  font-size: 22px;
  color: var(--color-base);
  line-height: 1;
  padding-bottom: 4px;
}

.pet-product__price-tax {
  margin-left: -9px;
  font-family: "Zen Old Mincho", serif;
  font-weight: 400;
  font-size: 19px;
  color: var(--color-base);
  line-height: 1;
  padding-bottom: 4px;
}

/* secondary price (桜墓誌彫刻費など) */
.pet-product__price-row--sub {
  margin-top: 36px;
}

.pet-product__label--sub {
  width: 98px;
  height: 30px;
  border-radius: 6px;
  font-size: 12px;
}

.pet-product__price-num--sub {
  font-size: 36px;
}

.pet-product__price-unit--sub {
  font-size: 16px;
}

.pet-product__price-tax--sub {
  font-size: 15px;
}

/* --- Notes --- */
.pet-product__notes {
  margin-top: 34px;
  font-family: "Noto Sans JP", sans-serif;
  font-weight: 400;
  font-size: 13px;
  line-height: 1.75;
}

/* ============================================================
   SP: Product Overview
   ============================================================ */
@media (max-width: 768px) {
  .pet-product__overview {
    flex-direction: column;
    gap: 0;
  }

  .pet-product__photo-wrap {
    width: 100%;
    max-width: 100%;
    margin-right: 56px;
  }

  .pet-product__photo {
    border-radius: 0 9px 9px 0;
  }

  .pet-product__info {
    width: min(100%, 100% - var(--sp-margin) * 2);
    margin-inline: auto;
    padding-right: 0;
    margin-top: 24px;
  }

  .pet-product__price-row {
    margin-top: 18px;
  }

  .pet-product__notes {
    margin-top: 16px;
  }

  .pet-product__price-num {
    font-size: 50px;
  }

  .pet-product__price-unit {
    font-size: 22px;
  }

  .pet-product__price-tax {
    font-size: 19px;
  }
}

/* ============================================================
   Engraving (彫刻例)
   ============================================================ */
.pet-engraving {
  width: min(var(--content-width), 100% - var(--sp-margin) * 2);
  margin: 48px auto 0;
}

.pet-engraving__grid {
  display: grid;
  grid-template-columns: 18.302% repeat(3, 23.396%);
  -moz-column-gap: 3.836%;
  column-gap: 3.836%;
  width: 100%;
  align-items: stretch;
}

.pet-engraving__label {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-base);
  font-family: "Zen Old Mincho", serif;
  font-weight: 600;
  font-size: 17px;
  text-align: center;
}

/* display:contents でグリッド直下の子として扱う */
.pet-engraving__photos {
  display: contents;
}

/* 2枚の場合 */
.pet-engraving__grid--2col {
  grid-template-columns: 194px repeat(2, 248px);
}

.pet-engraving__photo {
  flex-shrink: 0;
  /* width: calc(248 / 1060 * 100%); */
}

.pet-engraving__photo img {
  display: block;
  width: 100%;
  aspect-ratio: 248 / 194;
  -o-object-fit: cover;
  object-fit: cover;
}

@media (max-width: 768px) {
  .pet-engraving__grid {
    display: block;
  }

  .pet-engraving__label {
    border: none;
    justify-content: flex-start;
    font-size: 20px;
    margin-bottom: 14px;
  }

  /* display:contents を解除して通常のgridとして機能させる */
  .pet-engraving__photos {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: calc(14 / 375 * 100%);
    width: 100%;
  }

  .pet-engraving__photo {
    width: 100%;
  }

  .pet-engraving__grid--2col .pet-engraving__photos {
    grid-template-columns: 1fr 1fr;
  }
}

/* PC時：SP用インラインタイトルを非表示 */
.pet-flow__title--sp-inline {
  display: none;
}

@media (max-width: 768px) {
  /* SP時：PC用タイトルエリアを非表示、SP用インラインタイトルを表示 */
  .pet-flow__title-wrap {
    display: none;
  }

  .pet-flow__title--sp-inline {
    display: inline;
  }
}

/* ============================================================
   Flow (ご供養の流れ)
   ============================================================ */
.pet-flow {
  width: min(var(--content-width), 100% - var(--sp-margin) * 2);
  margin: 72px auto 0;
}

.pet-flow__heading {
  margin: 0 0 28px;
  font-family: "Zen Old Mincho", serif;
  font-weight: 500;
  font-size: 21px;
  color: var(--color-gold);
  text-align: center;
}

.pet-flow__sub {
  display: block;
  margin-top: -28px;
  margin-bottom: 24px;
  font-family: "Zen Old Mincho", serif;
  font-weight: 500;
  font-size: 17px;
  color: var(--color-gold);
  text-align: center;
}

.pet-flow__list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.pet-flow__item {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--color-gold);
  border-radius: 10px;
  overflow: hidden;
}

.pet-flow__num {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 108px;
  background: var(--color-gold);
  color: var(--color-white);
  text-align: center;
}

.pet-flow__num-label {
  font-family: "Zen Old Mincho", serif;
  font-weight: 500;
  font-size: 15px;
  line-height: 1;
}

.pet-flow__num-digit {
  font-family: "Zen Old Mincho", serif;
  font-weight: 500;
  font-size: 23px;
  line-height: 1;
  margin-top: 4px;
}

.pet-flow__title-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: calc(230 / 1060 * 100%);
  padding: 26px 16px;
  border-right: none; /* ★ 削除 */
  position: relative; /* ★ 追加 */
}

.pet-flow__title-wrap::after {
  content: "";
  position: absolute;
  right: 0;
  top: 12px; /* 上の余白 */
  bottom: 12px; /* 下の余白 */
  width: 1px;
  background: var(--color-gold);
}

.pet-flow__title {
  font-family: "Zen Old Mincho", serif;
  font-weight: 500;
  font-size: 21px;
  color: var(--color-gold);
  text-align: center;
}

.pet-flow__desc-wrap {
  display: flex;
  align-items: center;
  padding: 10px calc(42 / 1060 * 100%);
}

.pet-flow__desc {
  font-family: "Noto Sans JP", sans-serif;
  font-weight: 100;
  font-size: 17px;
  font-weight: 400;
  line-height: 1.75;
}

/* --- Branch items (とこしえの碑) --- */
.pet-flow__branch {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 18px;
  margin-left: 54px;
  padding-left: 24px;
  border-left: none; /* border-leftを削除 */
  position: relative;
  overflow: visible;
}

.pet-flow__branch::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  /* 2つ目のボックスの中央で止まるよう調整 */
  bottom: 20%;
  width: 1px;
  background: var(--color-gold);
}

.pet-flow__branch-item {
  position: relative;
  display: flex;
  align-items: stretch;
  border: 1px solid var(--color-gold);
  border-radius: 10px;
  overflow: visible; /* overflowをvisibleに */
}

.pet-flow__branch-item::before {
  content: "→";
  position: absolute;
  left: -26px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-gold);
  font-size: 16px;
}

.pet-flow__branch-title-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: calc(230 / 1060 * 100%);
  padding: 10px 16px;
  border-right: 1px solid var(--color-gold);
}

.pet-flow__branch-title {
  font-family: "Zen Old Mincho", serif;
  font-weight: 500;
  font-size: 21px;
  color: var(--color-gold);
  text-align: center;
}

.pet-flow__branch-desc-wrap {
  display: flex;
  align-items: center;
  padding: 10px calc(42 / 1060 * 100%);
}

.pet-flow__branch-desc {
  font-family: "Noto Sans JP", sans-serif;
  font-weight: 400;
  font-size: 17px;
  line-height: 1.75;
}

/* --- Flow note --- */
.pet-flow__note {
  margin-top: 16px;
  font-family: "Noto Sans JP", sans-serif;
  font-weight: 400;
  font-size: 13px;
  line-height: 1.75;
  text-align: left;
}

/* ============================================================
   SP: Flow
   ============================================================ */
@media (max-width: 768px) {
  .pet-flow__heading {
    font-size: 20px;
    text-align: left;
  }

  .pet-flow__sub {
    font-size: 15px;
    text-align: left;
  }

  .pet-flow__list {
    gap: 10px;
  }

  .pet-flow__item {
    flex-direction: column;
    border-radius: 4px;
  }

  .pet-flow__num {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: start;
    width: 100%;
    min-height: unset;
    padding: 0;
    background: transparent; /* ゴールド背景をリセット */
  }

  .pet-flow__num-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 70px;
    height: 70px;
    background: var(--color-gold); /* ゴールドはnum-boxのみ */
    color: var(--color-white);
  }

  .pet-flow__num-label {
    font-size: 8px;
  }

  .pet-flow__num-digit {
    font-size: 14px;
    margin-top: 2px;
  }

  .pet-flow__title-wrap {
    display: none;
  }

  .pet-flow__title--sp-inline {
    display: inline;
    padding-left: 16px;
    font-family: "Zen Old Mincho", serif;
    font-weight: 500;
    font-size: 18px;
    color: var(--color-gold);
  }

  .pet-flow__desc-wrap {
    padding: 12px 24px;
  }

  .pet-flow__desc {
    font-size: 15px;
  }

  /* SP branch */
  .pet-flow__branch {
    margin-left: 16px;
    padding-left: 18px;
    border-left: none;
  }

  .pet-flow__branch::before {
    /* 2つ目のボックスの中央で止まるよう調整 */
    bottom: 22%;
  }

  .pet-flow__branch-item {
    flex-direction: column;
    border-radius: 4px;
  }

  .pet-flow__branch-item::before {
    left: -19px;
  }

  .pet-flow__branch-title-wrap {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--color-gold);
    padding: 10px 16px;
    justify-content: flex-start;
  }

  .pet-flow__branch-title {
    font-size: 18px;
    text-align: left;
  }

  .pet-flow__branch-desc-wrap {
    padding: 12px 24px;
  }

  .pet-flow__branch-desc {
    font-size: 15px;
  }
}
