* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Noto Serif JP", sans-serif;
    font-optical-sizing: auto;
    font-weight: 400;
    font-style: normal;
}
body {
    min-height: 100vh;
    background-color: #D7E0E8;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

h1 {
  margin: 0;
  box-sizing: border-box;
  padding: 0 150px;
  background-color: rgb(70, 88, 105);
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 110px;
  overflow: visible;
}
h1 a img {
  width: 120px;
  height: auto;
  display: block;
}
.sound-button {
  pointer-events: auto;
  flex-shrink: 0;
  background: none;
  border: none;
  padding: 0;
  line-height: 0;
  cursor: pointer;
}
.sound-button img {
  width: 80px;
  height: 80px;
  display: block;
}

/* ページレイアウト */
.medicine-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 30px;
}
.medicine-body {
  display: flex;
  gap: 80px;
  align-items: flex-start;
}
.medicine-left {
  margin-left: -50px;
  flex: 0 0 570px;
  align-items: center;
}
.medicine-left h2 {
  font-size: 38px;
  letter-spacing: 0.2em;
  padding-bottom: 20px;
  color: black;
  text-align: center;
}
.medicine-img {
  width: 320px;
  height: 320px;
  object-fit: contain;
  background-color: white;
  display: block;
  margin: 0 auto 20px;
}
.medicine-left h3 {
  text-align: center;
  font-size: 20px;
  letter-spacing: 0.1em;
  margin-bottom: 10px;
}
.medicine-left p {
  text-align: center;
  font-size: 16px;
  line-height: 1.9;
  letter-spacing: 0.03em;
}
.medicine-right {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  position: relative;
  margin-top: 50px;
  padding-bottom: 120px;
  padding-left: 40px;
}
.medicine-right-col {
  flex: 1 1 45%;
  min-width: 0;
}
.medicine-right h3 {
  font-size: 20px;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
  margin-top: 24px;
}
.medicine-right h3:first-child {
  margin-top: 0;
}
.medicine-right p {
  font-size: 17px;
  line-height: 1.9;
  letter-spacing: 0.03em;
  color: black;
  margin-left: 20px;
  white-space: nowrap;
}

/* 服用してみるボタンで、音声付きの動画再生を自動再生するようにすると、音声アリでも再生できる */
.hukuyou-btn {
  border: none;
  font-family: inherit;
  cursor: pointer;
  position: absolute;
  right: 10%;
  bottom: -30px;
  pointer-events: auto;
  display: inline-block;
  padding: 30px 120px;
  font-size: 32px;
  color: white;
  background-color: rgb(70, 88, 105);
  border-radius: 5px;
  text-decoration: none;
  transition: background-color 0.3s ease, opacity 0.3s ease;
}
.loading-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1s ease;
  z-index: 1000;
}
.loading-overlay.show {
  opacity: 1;
  pointer-events: auto;
}
.loading-gif {
  width: 400px;
  height: auto;
}

.video-overlay {
  position: fixed;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1s ease;
  z-index: 1001;
  background-color: #CDD3DC;
  overflow-y: auto; /* スクロールを許可 */
}
.video-overlay.show {
  opacity: 1;
  pointer-events: auto;
}
.video {
  width: 100%;
  height: auto;
  object-fit: cover;
  display: block;
  margin: 0 auto;
}
.video-head {
  position: sticky; /*stickyに変更し、スクロール中も上に残す */
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  height: 90px;
  padding: 0 150px;
  background-color: #627597;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transform: translateY(-100%);
  transition: transform 0.6s ease;
}
.video-overlay.show .video-head {
  transform: translateY(0);
}
.video-head a img {
  width: 100px;
  height: auto;
  display: block;
}
/* 付箋風の「製造者からひとこと」 */
.maker-note {
  position: relative; 
  margin-top: -100px;
  width: 780px;
  max-width: 80%;
  padding: 30px 35px;
  background-color: #e8e6df;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
  transform: translateX(420px) rotate(-4deg);
}
.maker-note h3 {
  text-align: center;
  font-size: 24px;
  letter-spacing: 0.1em;
  margin-bottom: 15px;
}
.maker-note p {
  text-align: center;
  font-size: 18px;
  line-height: 1.9;
  letter-spacing: 0.03em;
  color: #333;
}

.back-btn-wrap {
  text-align: center;
  margin-top: 220px;
}
.back-btn {
  border: none;
  font-family: inherit;
  cursor: pointer;
  display: inline-block;
  padding: 20px 70px;
  font-size: 30px;
  color: white;
  background-color: #627597;
  border-radius: 999px;
  transition: opacity 0.3s ease;
}
.back-btn:hover {
  opacity: 0.8;
}

/* 動画再生時にフェードインしてくるfooter */
.video-footer {
  position: relative;
  z-index: 1002;
  background-color: #627597;
  color: white;
  text-align: center;
  padding: 30px 0 20px;
  margin-top: 100px;
}
.video-footer.show {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.footer-title {
  font-size: 30px;
  letter-spacing: 0.1em;
  margin-bottom: 30px;
}
.footer-top {
  display: inline-block;
  color: white;
  text-decoration: none;
  font-size: 33px;
  letter-spacing: 0.1em;
  margin-bottom: 30px;
}
.footer-copy {
  font-size: 16px;
  opacity: 0.8;
}

/* =========================
   画面幅の狭い端末用の補正
   900pxを境にmedicine-bodyを縦積みにし、
   medicine-rightがmedicine-leftの下に来るようにする
========================= */

/* 900px以下：横並び→縦積みに切り替え */
@media (max-width: 900px) {
  h1 {
    padding: 0 5vw;
  }

  .medicine-wrap {
    padding: 20px 20px;
  }

  /* 横並びをやめて縦積みにする */
  .medicine-body {
    flex-direction: column;
    align-items: center;
    gap: 50px;
  }

  .medicine-left {
    margin-left: 0;
    flex: 0 0 auto;
    width: 100%;
    max-width: 480px;
  }

  .medicine-img {
    width: 260px;
    height: 260px;
  }

  .medicine-right {
    width: 100%;
    max-width: 600px;
    margin-top: 0;
    padding-left: 0;
    padding-bottom: 0; /* ボタンをabsoluteからstaticにするため不要に */
  }

  /* 2列だと狭い画面で文字が溢れるため1列に */
  .medicine-right-col {
    flex: 1 1 100%;
  }

  .medicine-right p {
    white-space: normal;
  }

  /* ボタンをabsolute配置から通常の流れに戻し、中央に表示 */
  .hukuyou-btn {
    position: static;
    flex: 1 0 100%;
    width: fit-content;
    margin: 30px auto 0;
    padding: 22px 70px;
    font-size: 26px;
  }

  .video-head {
    padding: 0 5vw;
  }

  .maker-note {
    width: 90%;
    max-width: 520px;
    transform: rotate(-2deg);
    margin: -60px auto 0;
  }
}

/* 760px以下：スマホ向けにさらに縮小 */
@media (max-width: 760px) {
  h1 {
    height: 80px;
  }

  h1 a img {
    width: 85px;
  }

  .sound-button img {
    width: 55px;
    height: 55px;
  }

  .medicine-wrap {
    padding: 16px 14px;
  }

  .medicine-left h2 {
    font-size: 24px;
  }

  .medicine-img {
    width: 200px;
    height: 200px;
  }

  .medicine-left h3 {
    font-size: 17px;
  }

  .medicine-left p {
    font-size: 14px;
    line-height: 1.8;
  }

  .medicine-right h3 {
    font-size: 17px;
  }

  .medicine-right p {
    font-size: 15px;
    margin-left: 0;
  }

  .hukuyou-btn {
    padding: 16px 44px;
    font-size: 20px;
  }

  .loading-gif {
    width: 220px;
  }

  .video-head {
    height: 70px;
  }

  .video-head a img {
    width: 70px;
  }

  .maker-note {
    transform: none;
    margin: -50px auto 0;
    padding: 20px;
  }

  .maker-note h3 {
    font-size: 18px;
  }

  .maker-note p {
    font-size: 14px;
  }

  .back-btn-wrap {
    margin-top: 100px;
  }

  .back-btn {
    padding: 14px 40px;
    font-size: 20px;
  }

  .footer-title {
    font-size: 20px;
    margin-bottom: 20px;
  }

  .footer-top {
    font-size: 20px;
    margin-bottom: 20px;
  }

  .footer-copy {
    font-size: 12px;
  }
}

/* 450px以下：さらに小さい端末向けに微調整 */
@media (max-width: 450px) {
  .medicine-img {
    width: 150px;
    height: 150px;
  }

  .medicine-left h2 {
    font-size: 20px;
  }

  .hukuyou-btn {
    padding: 12px 30px;
    font-size: 16px;
  }

  .maker-note {
    padding: 14px;
  }

  .maker-note h3 {
    font-size: 16px;
  }

  .maker-note p {
    font-size: 13px;
  }
}