/* ===========================
  Layout: ヘッダー・フッター・グリッド
=========================== */

/* --------------------------------
  Site Header
-------------------------------- */
.site-header {
  position: sticky;
  top: var(--header-top);
  z-index: 200;
  padding: 0 16px;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--header-bg);
  border-radius: 90px;
  padding: 18px 51px;
  box-shadow: var(--shadow-header);
  max-width: 1100px;
  margin: 0 auto;
  height: var(--header-height);
  backdrop-filter: blur(8px);
}

.header-logo {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

/* PC ナビゲーション */
.header-nav {
  flex: 1;
  display: flex;
  justify-content: center;
}

.header-nav ul {
  display: flex;
  align-items: center;
  gap: 32px;
}

.header-nav a {
  display: block;
  white-space: nowrap;
  font-size: 16px;
  font-style: normal;
  font-weight: 400;
  line-height: 175%; 
}

/* ヘッダー右側ボタン群 */
.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* --------------------------------
  Support Button (お困りの方へ)
-------------------------------- */
.btn-support {
  position: relative;
  z-index: 0;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background-color: var(--color-purple);
  box-shadow: var(--shadow-header);
  color: var(--color-white);
  border-radius: 90px;
  font-size: 18px;
  font-weight: 700;
  white-space: nowrap;
  line-height: 1;
  height: var(--header-height);
  width: 197px;
}

.btn-support::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-color: var(--color-purple-hover);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

.btn-support:hover::before,
.btn-support:active::before {
  transform: scaleX(1);
}

.btn-support:hover {
  opacity: 1;
}

.btn-support svg {
  flex-shrink: 0;
}

/* PC 用は初期非表示 */
.btn-support--pc {
  display: none;
}

/* --------------------------------
  Hamburger Button
-------------------------------- */
.btn-hamburger {
  width: 22px;
  height: 22px;
}

.hamburger-icon {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
}

.hamburger-icon span {
  display: block;
  width: 22px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
}

.close-icon {
  display: none;
  align-items: center;
  justify-content: center;
}

.btn-hamburger[aria-expanded="true"] .hamburger-icon {
  display: none;
}

.btn-hamburger[aria-expanded="true"] .close-icon {
  display: flex;
}

/* --------------------------------
  Nav Overlay (Drawer)
-------------------------------- */
.nav-overlay {
  position: fixed;
  top: calc(var(--header-top) + var(--header-height) + 20px);
  left: max(16px, calc(50% - 640px));
  width: calc(100% - 249px);
  max-width: 1063px;
  z-index: 195;
  background: var(--color-white);
  border-radius: var(--radius-drawer);
  box-shadow: var(--shadow-drawer);
  max-height: calc(100vh - var(--header-top) - var(--header-height) - 32px);
  overflow-y: auto;
  /* 初期状態（非表示） */
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: opacity 0.25s, transform 0.25s;
}

.nav-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* ドロワー本体 */
.nav-overlay-body {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 50px;
  padding: 40px 80px 40px 40px;
}

/* --------------------------------
  Nav Cards（画像カードグリッド）
-------------------------------- */
.nav-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px 15px;
}

.nav-card {
  display: flex;
  flex-direction: column;
}

.nav-card-img {
  aspect-ratio: 240 / 179;
  overflow: hidden;
}

.nav-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nav-card-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 16px;
  font-weight: 700;
  gap: 6px;
  margin-top: 16px;
  padding: 0 8px;
}

.nav-card-label span:first-child {
  flex: 1;
  min-width: 0;
}

.nav-card-arrow {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}

/* --------------------------------
  Nav Supplement（アイコンリンク・テキストリンク・SNS）
-------------------------------- */
.nav-supplement {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

/* アイコンリンク */
.nav-icon-links {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-top: 16px;
}

.nav-icon-links a {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  letter-spacing: 0.28px;
}

.nav-icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
}

/* テキストリンク */
.nav-text-links {
  display: flex;
  flex-direction: column;
}

.nav-text-links a {
  display: block;
  font-size: 12px;
  line-height: 250%;
  letter-spacing: 0.24px;
}

/* 外部リンクアイコン */
.icon-external {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-left: 6px;
  vertical-align: -1px;
}

.nav-text-links .icon-external {
  width: 10px;
  height: 10px;
}

/* --------------------------------
  Nav Backdrop
-------------------------------- */
.nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 190;
  background: rgba(224, 237, 235, 0.70);
  backdrop-filter: blur(16px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

.nav-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

/* --------------------------------
  Responsive: PC (>= 1100px)
-------------------------------- */
@media (min-width: 1100px) {
  .site-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
  }

  .header-inner {
    flex: 1;
    max-width: 1063px;
    margin: 0;
  }

  .btn-support--pc {
    display: inline-flex;
    flex-shrink: 0;
  }

  .btn-support--sp {
    display: none;
  }
}

/* ================================
  Site Footer
================================ */

.site-footer {
  background: var(--color-background);
  margin-top: -72px;
}

/* ---- Footer Top ---- */
.footer-top {
  background: var(--color-background);
  padding: 164px 40px 60px;
  max-width: 1360px;
  margin: 0 auto;
}

/* ---- Catch Copy ---- */
.footer-catch {
  font-size: 48px;
  font-weight: 500;
  line-height: 130%;
  color: var(--color-green-dark);
  text-align: center;
  margin-bottom: 40px;
}

@media (max-width: 1200px) {
  .footer-catch {
    font-size: 26px;
    white-space: nowrap;
    margin-bottom: 27px;
  }
}

/* ---- App Download Section ---- */
.footer-app {
  width: 100%;
  background: linear-gradient(118deg, #7FC591 0%, #6DBDAE 42.66%, #5BB5D5 85.32%);
  border-radius: 24px;
  padding: 26px 0;
  margin-bottom: 30px;
}

.footer-app-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 179px;
}

.footer-app-content {
  color: var(--color-white);
  font-weight: 700;
}

.footer-app-lead {
  font-size: 32px;
  line-height: 130%;
  margin-bottom: 12px;
}

.footer-app-heading {
  font-size: 41px;
  line-height: 150%;
  margin-bottom: 34px;
}

.footer-app-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 23px;
  margin-bottom: 34px;
}

.footer-app-badge-link img {
  height: 72px;
  width: auto;
  display: block;
}

.footer-app-qr img {
  width: 138px;
  height: 138px;
  display: block;
  margin: 0 auto;
}

.footer-app-media {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-end;
  width: 265px;
}

.footer-app-phone {
  width: 380px;
  height: auto;
  display: block;
}

/* ---- Picoca+ Card Section ---- */
.footer-card-section {
  width: 100%;
  background: var(--color-bg-green);
  border-radius: 24px;
  padding: 60px 0;
  box-shadow: 0 1px 0 0 rgba(255, 255, 255, 0.30) inset, 0 8px 32px 0 rgba(0, 0, 0, 0.08);
  margin-bottom: 80px;
}

.footer-card-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 130px;
}

.footer-card-img {
  flex: 0 0 auto;
}

.footer-card-img img {
  width: 365px;
  height: auto;
}

.footer-card-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 40px;
}

.footer-card-heading {
  color: var(--color-green);
  font-size: 32px;
  font-weight: 700;
  line-height: 130%;
}

/* ---- Terms Button ---- */
.footer-terms {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-bottom: 80px;
}

.footer-terms-btn {
  width: 100%;
  max-width: 460px;
}

/* ---- Contact Section ---- */
.footer-contact {
  max-width: 1082px;
  background: rgba(255, 255, 255, 0.90);
  border-radius: 24px;
  padding: 50px 60px;
  box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.03), 0 1px 2px 0 rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(8px);
  position: relative;
  margin: 0 auto -270px;
  z-index: 2;
}

.footer-contact-heading {
  color: #054E3C;
  text-align: center;
  font-size: 32px;
  font-weight: 500;
  line-height: 130%;
  margin-bottom: 64px;
}

.footer-contact-grid {
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  align-items: center;
  gap: 0 70px;
}

.footer-contact-divider {
  background: #F3F3F3;
  height: 142px;
  width: 1px;
}

.footer-contact-item {
  text-align: center;
}

.footer-contact-label {
  font-size: 20px;
  font-weight: 500;
  line-height: 150%;
  margin-bottom: 32px;
}

.footer-contact-btn--purple {
  position: relative;
  z-index: 0;
  overflow: hidden;
  background-color: var(--color-purple);
  color: var(--color-white);
  border: var(--btn-border-width) solid var(--color-purple)!important;
}

.footer-contact-btn--purple::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-color: var(--color-purple-hover);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

.footer-contact-btn--purple:hover::before,
.footer-contact-btn--purple:active::before {
  transform: scaleX(1);
}

.footer-contact-btn--purple:hover {
  border: var(--btn-border-width) solid var(--color-purple-hover)!important;
  opacity: 1;
}

/* Back to Top */
.footer-back-top {
  position: absolute;
  top: 78px;
  right: -124px;
}

.footer-back-top img {
  width: 100px;
  height: auto;
}

@media (max-width: 1340px) {
  .footer-back-top {
    top: auto;
    right: 0;
    bottom: -40px;
  }
}

/* ---- Footer Nav (Dark Green) ---- */
.footer-nav-wrap {
  background: var(--color-green);
  padding: 256px 40px 70px;
}

.footer-nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.footer-nav-logo {
  flex-shrink: 0;
  width: 171px;
}

.footer-nav-logo img {
  width: 100%;
  height: auto;
}

.footer-nav-links {
  display: flex;
  gap: 64px;
}

@media (max-width: 1024px) {
  .footer-nav-links {
    gap: 40px;
  }
}

.footer-nav-col-heading {
  font-size: 15px;
  font-weight: 600;
  line-height: 200%;
  color: var(--color-white);
  margin-bottom: 7px;
}

.footer-nav-col ul {
  display: flex;
  flex-direction: column;
}

.footer-nav-col a {
  font-size: 15px;
  color: var(--color-white);
  line-height: 200%;
  transition: all 0.3s ease;
}

.footer-nav-col a:hover {
  color: var(--color-white);
}

/* ---- ALPICO GROUP Bar ---- */
.footer-alpico {
  background: var(--color-white);
  padding: 23px 0 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 23px;
}

.footer-alpico-copyright {
  width: 100%;
  border-top: 1px solid #D9D9D9;
  padding-top: 23px;
  text-align: center;
  font-size: 13px;
  color: #B6B6B6;
}

@media (max-width: 1024px) {
  .footer-app-inner {
    gap: 50px;
  }

  .footer-card-inner {
    gap: 50px;
  }
}

/* ================================
  Footer Responsive: Mobile (< 821px)
================================ */
@media (max-width: 820px) {

  .site-footer {
    margin-top: -36px;
    overflow: hidden;
  }

  .footer-top {
    padding: 118px 15px 60px;
  }

  /* App */
  .footer-app {
    padding: 45px 0;
    border-radius: 12px;
    margin-bottom: 25px;
  }

  .footer-app-inner {
    flex-direction: column;
    gap: 20px;
    text-align: center;
  }

  .footer-app-lead {
    font-size: 18px;
    font-weight: 700;
    line-height: 130%;
    margin-bottom: 7px;
  }

  .footer-app-heading {
    font-size: 23px;
    margin-bottom: 18px;
  }

  .footer-app-badges {
    gap: 15px;
    margin-bottom: 0;
  }

  .footer-app-badge-link img {
    height: 45px;
  }

  .footer-app-qr {
    display: none;
  }

  .footer-app-media {
    justify-content: center;
  }

  .footer-app-phone {
    width: 143px;
  }

  /* Card */
  .footer-card-section {
    padding: 30px 0;
    border-radius: 12px;
    margin-bottom: 40px;
  }

  .footer-card-inner {
    flex-direction: column;
    gap: 20px;
    align-items: center;
    text-align: center;
  }

  .footer-card-img img {
    width: 200px;
  }

  .footer-card-content {
    align-items: center;
    gap: 20px;
  }

  .footer-card-heading {
    font-size: 24px;
  }

  .footer-card-btn {
    padding: 9px 18px;
  }

  /* Terms */
  .btn.footer-terms-btn {
    width: auto;
    padding: 12px 26px;
  }

  /* Contact */
  .footer-contact {
    padding: 50px 0;
    border-radius: 12px;
    margin-bottom: -220px;
  }

  .footer-contact-heading {
    font-size: 29px;
    margin-bottom: 32px;
  }

  .footer-contact-grid {
    grid-template-columns: 1fr;
    gap: 40px 0;
  }

  .footer-contact-label {
    font-size: 18px;
    margin-bottom: 18px;
  }

  .footer-contact-divider {
    display: none;
  }

  .footer-contact-btn,
  .footer-contact-btn--purple {
    width: 250px;
    height: 50px;
  }

  .footer-back-top {
    right: 10px;
    bottom: -35px;
  }

  .footer-back-top img {
    width: 72px;
  }

  /* Nav */
  .footer-nav-wrap {
    padding: 225px 32px 50px;
  }

  .footer-nav-inner {
    flex-direction: column;
    gap: 50px;
  }

  .footer-nav-logo {
    width: 130px;
  }

  .footer-nav-links {
    gap: 20px;
    flex-wrap: wrap;
    margin: 0 auto;
  }

  .footer-nav-col {
    width: calc(50% - 10px);
  }

  .footer-nav-col-heading {
    font-size: 13px;
    margin-bottom: 0;
  }

  .footer-nav-col a {
    font-size: 13px;
  }

  /* ALPICO */
  .footer-alpico {
    padding: 13px 0;
    gap: 8px;
  }

  .footer-alpico-logo {
    width: 195px;
  }

  .footer-alpico-copyright {
    padding-top: 8px;
    font-size: 12px;
  }
}

/* --------------------------------
  Responsive: Mobile (< 1100px)
-------------------------------- */
@media (max-width: 1099px) {
  /* ヘッダーのPC用ナビを非表示 */
  .header-nav {
    display: none;
  }

  .header-inner {
    justify-content: space-between;
    height: 75px;
    padding: 16px 20px 16px 25px;
  }

  .header-logo img {
    width: 94px;
    height: auto;
  }

  .header-actions {
    gap: 20px;
  }

  .btn-support {
    width: 107px;
    height: 43px;
    font-size: 10px;
  }

  .btn-support img {
    width: 13px;
    height: auto;
  }

  /* ドロワーをフルスクリーンオーバーレイに */
  .nav-overlay {
    top: calc(var(--header-top) + var(--header-height) + 12px);
    left: 15px;
    width: calc(100% - 30px);
    max-width: 100%;
    border-radius: 16px;
    max-height: 82vh;
    z-index: 250;
    transform: translateY(-8px);
  }

  .nav-overlay.is-open {
    transform: translateY(0);
    opacity: 1;
  }

  /* ドロワー本体：縦並び */
  .nav-overlay-body {
    grid-template-columns: 1fr;
    padding: 20px 20px 35px;
    gap: 23px;
  }

  /* 2列カードグリッド */
  .nav-cards {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px 15px;
  }

  .nav-card-label {
    font-size: 14px;
    padding: 0 2px;
    margin-top: 10px;
  }

  .nav-card-arrow {
    width: 16px;
    height: 16px;
  }

  .nav-card-arrow img {
    width: 100%;
    height: auto;
  }

  /* サプリメント：アイコンリンクとテキストリンクを横並び */
  .nav-supplement {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 0 16px;
  }

  .nav-icon-links {
    grid-column: 1;
    grid-row: 1;
    padding-top: 5px;
  }

  .nav-text-links {
    grid-column: 2;
    grid-row: 1;
    border-top: none;
    padding-top: 0;
  }
}

/* ================================
  Two Column Layout（メイン左・サイドバー右）
================================ */

.two-col-layout {
  display: grid;
  grid-template-columns: 1fr 305px;
  gap: 10%;
  align-items: start;
  max-width: 1350px;
  margin: 0 auto;
  padding: 0 35px;
}

/* grid内でのテキスト・コンテンツのoverflow防止 */
.two-col-layout__main {
  min-width: 0;
}

/* PC時にサイドバーをスクロールに追従させる */
.two-col-layout__side {
  position: sticky;
  top: calc(var(--header-top) + var(--header-height) + 10px);
}


/* --------------------------------
  サイドバーナビ
-------------------------------- */
.side-nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.side-nav__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px 16px 30px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  font-size: 16px;
  font-weight: 500;
  color: var(--color-text);
  background: var(--color-white);
  text-decoration: none;
  transition: border-color 0.3s, color 0.3s;
  cursor: pointer;
  width: 100%;
  text-align: left;
}

.side-nav__item:hover {
  opacity: 1;
  border-color: var(--color-text);
}

.side-nav__arrow {
  flex-shrink: 0;
  width: 13px;
  height: 13px;
  /* 下向きSVGを初期状態として表示 */
  background-image: url('../img/icons/arrow-down.svg');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  transition: transform 0.4s ease;
}

.side-nav__item:hover .side-nav__arrow {
  /* 下向き（0deg）→ 右向き（-90deg）へ回転 */
  transform: rotate(-90deg);
}

/* --------------------------------
  Responsive: <= 820px）
-------------------------------- */
@media (max-width: 820px) {
  .two-col-layout {
    grid-template-columns: 1fr;
    gap: 75px;
    padding: 50px 15px 0;
  }

  /* サイドバーをコンテンツの上に移動 */
  .two-col-layout__side {
    order: -1;
    position: static;
  }

  .side-nav {
    gap: 12px;
    padding: 0 20px;
  }

  .side-nav__item {
    padding: 12px 25px;
    font-size: 16px;
  }
}
