/* =========================================================
   💙 共通ヘッダー（S.I.Mエレック）
   スマホメニュー＋SDGsアイコン＋反転エフェクト対応
========================================================= */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  z-index: 999;
  transition: background 0.3s ease, color 0.3s ease;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  box-sizing: border-box;
}

/* --- ロゴ --- */
.logo h1 {
  font-size: 1.2rem;
  color: #182578;
  font-weight: 700;
  letter-spacing: 0.03em;
  margin: 0;
  transition: opacity 0.3s;
}

.logo h1:hover {
  opacity: 0.7;
}

/* --- ナビゲーション --- */
#g-nav {
  flex: 1;
  margin-left: 3rem;
}

#g-nav .nav-list {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

#g-nav .nav-list li a {
  color: #182578;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
}

#g-nav .nav-list li a:hover {
  color: #243fb5;
}

#g-nav .nav-list li.current a {
  font-weight: 700;
}

/* --- 右側アイコン群 --- */
.header-icons {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-icons a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.header-sdgs img {
  width: 55px;
  height: 55px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.header-icons .sns-icon img {
  width: 40px;
  height: 40px;
  margin-top: 2px;
  margin-left: -10px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.header-sdgs:hover img,
.header-icons .sns-icon:hover img {
  transform: scale(1.1);
  opacity: 0.85;
}

/* --- お問い合わせボタン --- */
.btn-header {
  background: #182578;
  color: #fff;
  text-decoration: none;
  padding: 0.6rem 1.4rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.3s ease;
}

.btn-header:hover {
  background: #243fb5;
  transform: translateY(-2px);
}

/* --- ハンバーガー --- */
.openbtn {
  display: none;
  position: relative;
  width: 36px;
  height: 28px;
  cursor: pointer;
  z-index: 1001;
}

.openbtn span {
  position: absolute;
  width: 100%;
  height: 3px;
  background: #182578;
  border-radius: 2px;
  left: 0;
  transition: all 0.4s;
}

.openbtn span:nth-child(1) {
  top: 0;
}

.openbtn span:nth-child(2) {
  top: 12px;
}

.openbtn span:nth-child(3) {
  bottom: 0;
}

.openbtn.active span:nth-child(1) {
  transform: rotate(45deg);
  top: 12px;
}

.openbtn.active span:nth-child(2) {
  opacity: 0;
}

.openbtn.active span:nth-child(3) {
  transform: rotate(-45deg);
  bottom: 12px;
}

/* --- スマホ展開メニュー（ぼかし＋フェード） --- */
#g-nav.panelactive {
  position: fixed;
  top: -100vh;
  left: 0;
  width: 100%;
  height: 100vh;
  background: rgba(24, 37, 120, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: all 0.6s ease;
}

#g-nav.panelactive.show {
  top: 0;
  opacity: 1;
  pointer-events: auto;
}

#g-nav.panelactive .nav-list {
  flex-direction: column;
  gap: 2rem;
  text-align: center;
}

#g-nav.panelactive .nav-list li a {
  color: #fff;
  font-size: 1.4rem;
  letter-spacing: 0.05em;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

#g-nav.panelactive.show .nav-list li a {
  opacity: 1;
  transform: translateY(0);
}

/* --- メニュー開時の反転 --- */
body.menu-open header {
  background: transparent;
  box-shadow: none;
}

body.menu-open .logo h1 {
  color: #fff;
}

body.menu-open .openbtn span {
  background: #fff;
}

body.menu-open .btn-header {
  background: #fff;
  color: #182578;
}

body.menu-open .header-icons img {
  filter: invert(1);
}

/* =========================================================
   💻 タブレット（769〜1024px）
========================================================= */
@media screen and (min-width: 769px) and (max-width: 1024px) {
  .header-inner {
    height: 72px;
    padding: 0 1.2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .header-icons {
    display: flex !important;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    /* ✅ 右寄せ */
    gap: 0.6rem;
    /* 間隔を少し狭める */
    margin-left: auto;
    /* 左側要素と距離をとる */
  }

  .btn-header {
    font-size: 0.9rem;
    padding: 0.45rem 1rem;
    border-radius: 999px;
    white-space: nowrap;
  }

  .openbtn {
    display: block;
    width: 32px;
    height: 24px;
    margin-left: 0.6rem;
  }

  #g-nav {
    display: none;
  }

}

/* =========================================================
   📱 スマホ（768px以下）
========================================================= */
@media screen and (max-width: 768px) {
  .header-inner {
    height: 68px;
    padding: 0 1rem;
    justify-content: space-between;
  }

  .logo h1 {
    font-size: 0.8rem;
  }

  .header-icons {
    display: flex !important;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    /* ✅ 右寄せ */
    gap: 0.5rem;
    /* 間隔を少し狭める */
    margin-left: auto;
    /* 左側要素と距離をとる */
  }

  .header-sdgs img{
    width: 35px;
    height: 35px;
  }
  .header-icons .sns-icon img {
    width: 26px;
    height: 26px;
    margin-left: -2px;
  }

  .btn-header {
    font-size: 0.6rem;
    padding: 0.2rem 0.3rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #4a60ff 0%, #2e3ea8 100%);
    white-space: nowrap;
    margin-right: 10px;
  }

  .openbtn {
    display: block;
    width: 32px;
    height: 24px;
    margin-left: 0.6rem;
  }

  #g-nav {
    display: none;
  }
}

/* =========================================================
   🩵 フッター共通（整理済み・完全レスポンシブ）
========================================================= */
#footer {
  background: #182578;
  color: #fff;
  padding: 3rem 1rem 2rem;
  font-family: "Noto Sans JP", sans-serif;
}

/* --- 内部レイアウト --- */
.footer-inner {
  max-width: 1000px;
  /* PC時の中央寄せ幅 */
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 3rem;
  flex-wrap: wrap;
}

/* --- 左側（会社情報） --- */
.footer-left h1 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
}

.footer-left p {
  font-size: 0.9rem;
  line-height: 1.7;
}

.footer-left a {
  color: #fff;
  text-decoration: none;
}

.footer-left a:hover {
  text-decoration: underline;
}

/* --- 右側（SNS + ボタン） --- */
.footer-right {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.footer-right .sns-icon img {
  width: 32px;
  height: 32px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.footer-right .sns-icon:hover img {
  transform: scale(1.1);
  opacity: 0.85;
}

/* --- お問い合わせボタン --- */
.btn-footer {
  background: #fff;
  color: #182578;
  padding: 0.6rem 1.4rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn-footer:hover {
  background: #f1f4ff;
  transform: translateY(-2px);
}

/* --- 下部コピーライト --- */
.footer-bottom {
  text-align: center;
  font-size: 0.85rem;
  margin-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  padding-top: 1.2rem;
  color: #ddd;
  position: relative;
}

.footer-bottom a.pagetop {
  position: absolute;
  right: 1rem;
  top: 0.8rem;
  text-decoration: none;
  color: #fff;
  font-weight: 600;
  font-size: 1.1rem;
  transition: color 0.3s;
}

.footer-bottom a.pagetop:hover {
  color: #a0b4ff;
}

/* =========================================================
   💻 タブレット（769〜1024px）
========================================================= */
@media screen and (max-width: 1024px) and (min-width: 769px) {
  .footer-inner {
    justify-content: space-around;
    gap: 2rem;
    max-width: 900px;
  }

  .footer-left h1 {
    font-size: 1.05rem;
  }

  .btn-footer {
    font-size: 0.9rem;
  }
}

/* =========================================================
   📱 スマホ（768px以下）
========================================================= */
@media screen and (max-width: 768px) {
  #footer {
    padding: 2.5rem 1rem 1.5rem;
    text-align: center;
  }

  .footer-inner {
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
  }

  .footer-left h1 {
    font-size: 1rem;
    margin-bottom: 0.3rem;
  }

  .footer-left p {
    font-size: 0.85rem;
    line-height: 1.6;
  }

  .footer-right {
    flex-direction: column;
    gap: 0.8rem;
  }

  .footer-right .sns-icon img {
    width: 28px;
    height: 28px;
  }

  .btn-footer {
    background: linear-gradient(135deg, #4a60ff 0%, #2e3ea8 100%);
    color: #fff;
    display: inline-block;
    font-size: 0.95rem;
    font-weight: 700;
    text-decoration: none;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
  }

  .btn-footer:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
  }

  .footer-bottom {
    font-size: 0.75rem;
    margin-top: 1.8rem;
    padding-top: 1.5rem;
  }

  .footer-bottom a.pagetop {
    position: relative;
    top: 0;
    right: 0;
    display: inline-block;
    margin-top: 0.8rem;
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.15);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
  }
}