
/*  ヘッダー全体 ############################ */

header {
  width: 100%;
  background: url("../images/back_head_pc.png") no-repeat center top;
  height: 200px;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  margin: 0;
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0;
  height: 130px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative; 
}

/* ===== ヘッダー背景指定 ===== */
@media (min-width: 769px) and (max-width: 1024px) { 
header {background: url("../images/back_head_tb.png") no-repeat center top ; background-size: cover; } /*タブレット*/
}

@media (max-width: 768px) {
header { background: url("../images/back_head_sp.png") no-repeat center top; } /*スマホ*/
}



/*  ロゴ --------- */
.logo { flex-shrink: 0; }

.logo img { width: 200px;  height: auto; }


/*  ハンバーガーアイコン ----- */
.menu-toggle {
  display: none;
  width: 50px;
  height: 40px;
  position: absolute;
  top: 20%;
  right: 1em;
  transform: translateY(-30%);
  background: none;
  border: none;
  z-index: 2000;
}

.menu-toggle .bar {
  display: block;
  width: 30px;
  height: 3.5px;
  background-color: white;
  margin: 4px 0; 
  transition: 0.4s;
  transform-origin: center;
}

/* ハンバーガー開いたら×に */
.menu-toggle.active .bar:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px); 
}

.menu-toggle.active .bar:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active .bar:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px); 
}

/*  ナビゲーション ############################ */
.global-nav {
  display: flex;
  align-items: center;
  margin-top: -40px;
}

.menu {
  display: flex;
  flex-direction: row;
  align-items: center;
  list-style: none;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.menu > li {
  position: relative;
  margin-left: 30px;
}

.menu a {
  display: block;
  padding: 1em;
  color: white;
  text-decoration: none;
  font-size: 1em;
  cursor: pointer;
}

.menu a:hover { color: #007A0E; }

/* サブメニューの矢印 */
.has-children > a::after {
  content: " ▼";
  font-size: 0.7em;
}

/* サブメニュー */
.sub-menu {
  overflow: hidden;
  max-height: 0;
  transition: all 0.4s ease;
  background: #41715F;
  list-style: none;
  padding: 0;
  position: absolute;
  top: 100%;
  left: 0;
  width: 220px;
  z-index: 900;
  pointer-events: none;
}

.sub-menu li { font-size: 0.9em; }
.sub-menu li a { padding: 0.5em 1em; }
.sub-menu li a:hover { color: #F9FFAD; }

/* サブメニュー開いたら */
.has-children.open > .sub-menu {
  max-height: 500px;
  pointer-events: auto;
  font-size: 0.9em;
}

/* ===== PC時 hoverでサブメニュー開く ===== */
@media (min-width: 769px) {
  .menu li:hover > .sub-menu {
    max-height: 500px;
    opacity: 1;
    pointer-events: auto;
  }
}


/* ===== スマホ時（1024px以下） ===== */
@media (max-width: 1024px) {

header {
    height: 150px;
    background-size: cover;
    background-position: center top;
}

.header-inner {
    height: 100px;
    padding: 0 1em;
}

.logo img {
    width: 120px;
    height: auto;
}

.global-nav {
    width: 100%;
    justify-content: flex-end;
}

/*ハンバーガー*/


.menu {
    flex-direction: column;
    background: #333;
    width: 100%;
    position: absolute;
    top: 70px;
    left: 0;
    text-align: left;
    opacity: 0;
    transform: translateY(-30px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    pointer-events: none;
    visibility: hidden;
}

.menu > li {
    /*border-top: 1px solid #444;*/
    width: 100%;
}

/* メニュー開いたとき */
.menu.open {
    opacity: 0.95;
    transform: translateY(0);
    pointer-events: auto;
    visibility: visible;
}

.menu-toggle {
    display: block;
    right: 1em;
}

/* サブメニュー */
.sub-menu {
    position: static;
    width: 95%;
    background: #888;
}

/* 開いた時 */
.has-children.open > .sub-menu {
    max-height: 500px;
    opacity: 1;
    pointer-events: auto;
}

}

/* ===== タブレットサイズ時（769px〜1024px） ===== */
@media (min-width: 769px) and (max-width: 1024px) {
  .header-inner {
    max-width: 90%;
    padding: 0 1em;
  }

  .logo img {
    width: 180px;
    height: auto;
  }
}

