/* ヘッダー全体のスタイル */
  .header {
    background-color: #ffffff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    /* padding-bottom: 3%; */
    padding-bottom: 1%;
  }
  .header__top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding: 10px 20px;
  }

  /* 左ブロック */
  .header__left {
    display: flex;
    flex-direction: column;
    width:70%;
  }
  
  .header__title {
    font-size: 14px;
    margin-bottom: 0px;
    padding-top: 14px;
    line-height: 1;
    font-weight:bold;
    @media (max-width: 1160px) {
      padding-bottom: 10px;
    }
  }
  .header__title {
    position: relative;
  }
  
  @media (max-width: 768px) {
    .header__title {
      position: absolute;
      left: 120px;
      top: 0;
      font-size: 12px;
    }
  }
  
  .header__logo-container {
    display: flex;
    align-items: center;
    /* container-name: header__logo-container;
    container-type: inline-size; */
  }
  
  .header__logo {
    margin-right: 10px;
  }
  .header__logo-text {
    display: flex;
    align-items: center;
    padding-left: 1%;
  }
    @media (max-width: 1200px) {
    .header__logo-text {
      display: none;
    }
  }


  .header__logo-main {
    /* width: 267px; */
    flex-shrink: 0;
    display: flex;
    align-items: center;
    width: 20vw;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    max-width: 350px;
    min-width: 230px;
  }
  .header__logo-main a{
    display: block;
    width: 100%;
  }
  /* @media (max-width: 1200px) {
    .header__logo-main {
      width: 22vw;
      min-width: 180px;
    }
  } */
  @media (max-width: 768px) {
    .header__logo-main {
      width: 80px;
      min-width: inherit;
    }
  }







  .header__map {
    height: 30px;
    margin-right: 10px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
  }

  .header__no1 {
    width: 82px;
    margin-right: 10px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
  }

  .header__text {
    flex-grow: 1;
    font-weight: bold;
    display: flex;
    align-items: center;
    font-size: clamp(14px, 1vw, 20px);
  }

/* @container header__logo-container (max-width: 800px) {
  .header__text {
    font-size:10px;
  }
} */
  /* 右ブロック */
  .header__right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
  }
    
  @media (max-width: 768px) {
    .header__top-nav {
      display: none;
    }
  }
  .header__top-nav ul {
    display: flex;
    list-style-type: none;
    margin-bottom: 10px;
  }
  
  .header__top-nav ul li {
    margin-left: 20px;
  }
  
  .header__top-nav ul li a {
    text-decoration: none;
    color: #333;
    font-size: 14px;
  }
  .header__top-nav-ul .nav-link{
    font-weight: bold;
  }
  

  .header__user-actions {
    display: flex;
    align-items: center;
  }
  @media (max-width: 768px) {
    .header__user-actions {
      position: absolute;
      left: 120px;
    }
  }
  .header__search-form {
    display: flex;
    margin-right: 5px;
    position: relative;
  }

  .header__search-input {
    padding: 5px 5px 5px 30px; /* 左側に余白を追加 */
    border: 1px solid #ddd;
    border-radius: 6px;
    background: url('../img/common/icon-search.svg') no-repeat 10px center #f1f1f1;
    background-size: 16px 16px; 
    max-width:260px;
  }
  @media (max-width: 1430px) {
    .header__search-input {
      max-width:200px;
      font-size:14px;
    }
  }
  @media (max-width: 768px) {
    .header__search-input {
      padding:3px 3px 3px 30px;
    }
  }
  
  .header__search-form button {
    padding: 5px 10px;
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    border-left: none;
    border-radius: 0 3px 3px 0;
    cursor: pointer;
  }
  
  .header__login-button, 
  .header__register-button {
    padding: 8px 1em;
    margin-left: 10px;
    border: 1px solid;
    border-radius: 6px;
    cursor: pointer;    
    font-size: clamp(11px, 2vw, 13px);
    font-weight: bold;
    min-width:4em;
    background: #fff;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    white-space: nowrap;
    }

    @media (max-width: 768px) {
      
      .header__register-button {
        display: none!important;
      }
      
      .header__search-input {
        width: 100%;
        max-width: 200px;
      }
    }
    @media (max-width: 480px) {
      .header__login-button{
        display: none;
      }
      .header__hamburger-open .header__login-button{
        display: inline-block;
        position: fixed;
        right: 70px;
        top: 30px;
        z-index: 1001;
        &.is-loading {
          position: fixed !important;
          right: 70px !important;
          top: 30px !important;
        }
      }
    }

      

  .header__login-button {
    color: var(--colorSubAccent2);
    border:1px solid var(--colorSubAccent2);
    transition: all 0.3s ease;
  }
  
  .header__login-button:hover {
    color: #fff;
    background-color: var(--colorSubAccent2);
  }
  .header__register-button {
    color: var(--colorLightBase);
    border-color: var(--colorLightBase);
    transition: all 0.3s ease;
  }
  .header__register-button:hover {
    color: #fff;
    background-color: var(--colorLightBase);
  }

  /* メインナビゲーション */
  .header__main-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    /* background-color: #f8f9fa; */
    padding: 10px 1em;
    overflow-x: auto;
    white-space: nowrap;
  }
  @media (max-width: 1200px) {
    .header__main-nav {
      justify-content: center;
    }
  }
  @media (max-width: 768px) {
    .header__main-nav {
      background-color: #ffffff;
      padding-top: 0;
    }
  }

  /* 寄付件数 バナー*/
  .header__donation.type-sp{
    display: none;
  }
  .header__donation.type-pc{
    display: flex;
    margin: auto;
  }
  .header__donation{
    border:3px solid var(--colorLightBase);
    display: flex;
    justify-content: center;
    align-items: center;
    margin:0 0 0 3%;
    padding:0 3%;
    border-radius: 10px;
    width:fit-content;
    box-sizing: border-box;
    position: relative;
    min-height: 60px;
    transition: all 0.3s ease;
  }
  @media (max-width: 1160px) {
    .header__donation.type-pc {
      display: none;
    }
  }
  @media (max-width: 960px) {
    .header__donation {
      margin-left:auto;
      margin-right:auto;
      border-radius: 4px;
      padding-top: 5px;
      padding-bottom: 5px;
    }
  }
  @media (max-width: 768px) {
    .header__donation.type-pc{
      display: none;
    }
    .header__donation.type-sp{
      display: flex;
      margin-top: 3%;
      width: calc(100% - 20px);
    }
    .header__donation {
      border:1px solid var(--colorLightBase);
      margin-left:auto;
      margin-right:auto;
      min-height: 40px;
    }
    .header__donation-spinner {
      width: 20px;
      height: 20px;
      border-width: 2px;
    }
  }
  .header__donation__title{
    font-size: clamp(12px, 1.4vw, 18px);
    font-weight: bold;
    margin-right: 3%;
    white-space: nowrap;
    color: var(--colorLightBase);
    line-height: 1.4;
  }
  @media (max-width: 1340px) {
    .header__donation__title{
      font-size:15px;
    }
  }
  @media (max-width: 1260px) {
    .header__donation__title{
      font-size:13px;
    }
  }
  @media (max-width: 768px) {
    .header__donation__title{
      font-size:11px;
    }
  }


  .header__donation-count {
    display: flex;
    align-items: center;
    margin-right: 3%;
  }
  .header__donation-label-block{
    display: flex;
    flex-direction: column;
    margin-right: 10px;
  }

  .header__donation-label{
    font-size: clamp(12px, 2.5vw, 16px);
    font-weight:bold;
    line-height: 1;
    white-space: nowrap;
  }
  @media (max-width: 1340px) {
    .header__donation-label {
      font-size:14px;
    }
  }
  @media (max-width: 1260px) {
    .header__donation-label {
      font-size:12px;
    }
  }
  @media (max-width: 768px) {
    .header__donation-label {
      font-size:11px;
    }
  }

  .header__donation-label--ruiseki{
    display: block;
    font-size: clamp(12px, 2.5vw, 16px);
    font-weight:bold;
    padding-bottom: 5px;
  }
  @media (max-width: 1340px) {
    .header__donation-label--ruiseki {
      font-size:12px;
    }
  }
  @media (max-width: 768px) {
    .header__donation-label--ruiseki {
      font-size:11px;
      padding-bottom: 0;
    }
  }

  .header__donation-unit {
    font-size: clamp(14px, 2.8vw, 20px);
    font-weight:bold;
    line-height: 1;
  }
  .header__donation-number {
    font-size: clamp(18px, 5vw, 48px);
    background: linear-gradient(90deg, #FF724D 0%, #EB0139 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    color: var(--colorAccent);
    font-weight:bold;
    white-space: nowrap;
  }
  @media (max-width: 1340px) {
    .header__donation-number {
      font-size:42px;
    }
  }
  @media (max-width: 1260px) {
    .header__donation-number {
      font-size:36px;
    }
  }
  @media (max-width: 1260px) {
    .header__donation-number {
      font-size:30px;
    }
  }
  @media (max-width: 768px) {
    .header__donation-number {
      font-size:26px;
    }
  }


  .header__donation-unit-block{
    white-space: nowrap;
  }

  
  
  .header__main-nav-list {
    display: flex;
    list-style-type: none;
    padding: 0;
    margin: 0;
  }
  @media (max-width: 768px) {
    .header__main-nav-list{
      display: none;
    }
  }


  .header__main-nav-list li {
    margin-left: 0.8em;
    margin-right: 0.8em;
    position: relative;
  }

  .header__main-nav-list li:not(:last-child)::after {
    content: '';
    position: absolute;
    right: -0.8em;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 13px;
    background-color: #aaa;
  }
  

  .header__nav-link {
    text-decoration: none;
    color: #333;
    white-space: nowrap;
  }

  .header__main-nav-list a.header__nav-link {
    color: #2C91F7;
    text-decoration: underline;
    font-weight: bold;
  }
  .header__main-nav-list a.header__nav-link:hover {
    text-decoration: none;
  }




  /* sp */
  .header__main-nav--sp{
    display: none;
  }
  @media (max-width: 768px) {
    .header__main-nav--sp{
      display: block;
    }
  
    .header__main-nav--sp__list {
      display: flex;
      justify-content: space-between;
      padding: 0;
      margin: 0;
      list-style-type: none;
      border-top: 1px solid var(--colorLightGray);
      border-bottom: 1px solid var(--colorLightGray);
    }
    .header__main-nav-sp__item {
      flex: 1;
      text-align: center;

    }
    .header__nav-link--sp {
      display: block;
      padding: 10px 5px;
      text-decoration: none;
      font-size: 12px;
      color: var(--colorLightBase);
      text-decoration: underline;
      border-right: 1px solid var(--colorLightGray);
    }
  }

  
  .second-header-block{
    background:var(--colorLightGray);
    margin-bottom: 1em;
    align-items: center;
    padding: 1.5em;
    margin-bottom: 5%;
    display: none;
  }
  .second-header__title {
    font-size: clamp(18px, 2.5vw, 28px);
    font-weight: bold;
    display: flex;
    align-items: center;
  }

  /* .second-header-block{
    display: none;
  } */
  /* @media screen and (max-width: 768px) {
    .second-header-block {
      display: block;
    }
  }

  @media screen and (max-width: 600px) {
    .second-header-block {
      padding: 1.5em 10px;
    }
  } */

  
  .header__top-nav-item .header__nav-link{
    font-weight:bold;
  }




  .header__project-title{
    display: none;
  }

  @media (min-width: 768px) {

      /* project詳細の時だけプロジェクト以外も表示させる */
      body.project_detail .header.is-fixed .header__top-nav-item{
        display: none;          
      }
      body.project_detail .header.is-fixed .header__top-nav-item.type-project{
        display: flex;
      }
      

      .header.is-fixed {
        position: fixed;
        width: 100%;
        z-index: 10;
        background:#fff;
        display: flex;
        padding: 0;
        top:0;

        .header__login-button,
        .header__register-button,
        .header__title,
        .header__donation,
        .header__main-nav{
          display: none;
        }
        .header__top{
          width: 100%;
          padding: 10px 20px;
          margin: 0;
        }
        .header__top-nav ul{
          margin-bottom: 4px;
        }
        .header__left{
          width: auto;
        }
        .header__logo-main{
          width: 80px;
          max-width: inherit;
          min-width: inherit;
        }

        .header__right{
          flex-direction: row-reverse;
        }
        .header__main-nav-item{
          display: none;
        }
        .header__main-nav-item:first-child{
          display: block;
        }
        .header__main-nav-item:not(:first-child){
          display: none;
        }
        .header__project-title{
          display: flex;
        }      
        .header__project-title .header__project-title__area{
          font-size: clamp(12px, 2vw, 15px);
          font-weight: bold;
          margin-right: 10px;
          white-space: nowrap;
          display: flex; 
          max-width: max-content; 
          align-items: center;
          flex-shrink: 0;
        }
        .header__project-title__area:not(:empty) + .header__project-title__project:not(:empty) {
          border-left: 1px solid #555;
          padding-left: 10px;
        }
        .header__project-title__area:empty {
          display: none;
        }      
        .header__project-title .header__project-title__project{
          font-size: clamp(12px, 2vw, 15px);
          font-weight: bold;
          padding-right: 1em;
        }      
      }

      .header .header__logo {
        content: url('../img/common/logo-long.svg');
      }
      .header.is-fixed .header__logo {
        content: url('../img/common/logo-rect.svg');
        width: 60px;
      }
  }/*768*/

/* ローディングスピナー用のスタイル */
.header__donation-spinner {
  display: none;
  position: absolute;
  width: 24px;
  height: 24px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: auto;
  left: 0;
  right: 0;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.header__donation-button.loading .header__donation-spinner {
  display: inline-block;
}

.header__donation-button.loading .header__donation-text {
  visibility: hidden;
}

.header__donation.is-loading {
  pointer-events: none;
}

.header__donation.is-loading .header__donation-spinner {
  display: block;
}

.header__donation.is-loading .header__donation-count,
.header__donation.is-loading .header__donation__title {
  opacity: 0.3;
  transition: opacity 0.3s ease;
}

/* ローディング状態のスタイルを修正 */
.header__login-button.is-loading {
    position: relative !important;
    color: transparent !important;
    pointer-events: none;
}

.header__login-button.is-loading::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid var(--colorSubAccent2);
    border-right-color: transparent;
    border-radius: 50%;
    animation: button-loading-spinner 0.75s linear infinite;
}

@keyframes button-loading-spinner {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* side-fixed-amountのアニメーション用スタイル */
@keyframes slideInRight {
    0% {
        transform: translateX(150%);
        opacity: 0;
    }
    70% {
        transform: translateX(-20px);
        opacity: 1;
    }
    85% {
        transform: translateX(10px);
    }
    100% {
        transform: translateX(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.2);
    }
    25% {
        transform: scale(1.08);
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    }
    50% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.2);
    }
    75% {
        transform: scale(1.08);
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.2);
    }
}

/* .side-fixed-amount {
    display: none;
} */

.side-fixed-amount.show-animation {
    animation: 
        slideInRight 1s ease-out forwards,
        pulse 2s ease-in-out 1s forwards;
    transform-origin: center;
}
