/* ==========================================================================
   Header
   ========================================================================== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  z-index: 1000;
  transition:
    background-color 0.3s ease,
    box-shadow 0.3s ease;
}

.header.is-scrolled {
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.header__inner {
  max-width: var(--container-width);
  margin: 0 auto;
  height: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 1.5rem;
}

/* Logo */
.header__logo a {
  display: flex;
  flex-direction: column;
}

.header__logo-text {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--c-white);
  line-height: 1;
  transition: color 0.3s;
}

.header.is-scrolled .header__logo-text {
  color: var(--c-main);
}

/* 色付きロゴ候補確認用: 透明時/スクロール時の画像を重ねてopacityで切り替える(カートアイコンと同じ方式) */
.header__logo-mark {
  position: relative;
  display: block;
  width: 130px;
  height: 50px;
}

@media (min-width: 992px) {
  .header__logo-mark {
    width: 200px;
    height: 60px;
  }
}

.header__logo-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
  transition: opacity 0.3s;
}

.header__logo-img--scrolled {
  opacity: 0;
}

.header.is-scrolled .header__logo-img--transparent {
  opacity: 0;
}

.header.is-scrolled .header__logo-img--scrolled {
  opacity: 1;
}

.header__logo-sub {
  font-family: var(--font-base);
  font-size: 0.625rem;
  color: var(--c-accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Nav (Desktop) */
.header__nav {
  display: none;
}

@media (min-width: 992px) {
  .header__nav {
    display: flex;
    align-items: center;
    gap: 2rem;
  }

  .header__list {
    display: flex;
    gap: 2rem;
  }

  .header__link {
    font-size: 0.95rem;
    color: var(--c-white);
    position: relative;
    padding-bottom: 4px;
  }

  .header.is-scrolled .header__link {
    color: var(--c-main);
  }

  .header__link::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--c-accent);
    transition: width 0.3s;
  }

  .header__link:hover::after,
  .header__link.is-active::after {
    width: 100%;
  }
}

/* Mobile Header Actions (Cart Icon + Toggle) */
.header__mobile-actions {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  z-index: 1001;
}

@media (min-width: 992px) {
  .header__mobile-actions {
    display: none;
  }
}

/* Mobile Cart Icon */
.header__cart-icon-link {
  position: relative;
  display: inline-flex;
}

.header__cart-icon {
  position: relative;
  display: block;
  width: 22px;
  height: 22px;
}

.header__cart-icon-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transition: opacity 0.3s;
}

.header__cart-icon-img--dark {
  opacity: 0;
}

.header.is-scrolled .header__cart-icon-img--light {
  opacity: 0;
}

.header.is-scrolled .header__cart-icon-img--dark {
  opacity: 1;
}

/* メニュー表示中はドロワーが常に紺背景のため、カートアイコンは白を優先する */
.header.is-open .header__cart-icon-img--light {
  opacity: 1;
}

.header.is-open .header__cart-icon-img--dark {
  opacity: 0;
}

.header__cart-icon-link .cart-badge {
  position: absolute;
  top: -8px;
  right: -10px;
}

/* Mobile Menu Toggle */
.header__toggle {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 26px;
  height: 18px;
  background: none;
  border: none;
  cursor: pointer;
}

.header__toggle-bar {
  width: 100%;
  height: 2px;
  background-color: var(--c-white);
  transition: 0.3s;
}

.header.is-scrolled .header__toggle-bar {
  background-color: var(--c-main);
}

/* メニュー表示中は背景スクロールをロック（iOS Safari対策でposition:fixedを使用） */
body.is-menu-open {
  position: fixed;
  width: 100%;
  overflow: hidden;
}

/* Mobile Menu Overlay */
.header.is-open .header__nav {
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background-color: var(--c-main);
  justify-content: flex-start;
  align-items: center;
  padding: 6rem 2rem 3rem;
  overflow-y: auto;
  z-index: 1000;
}

.header.is-open .header__list {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.75rem;
}

.header.is-open .header__link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--c-white);
  font-size: 1.15rem;
}

.header.is-open .header__link::after {
  content: "\276F";
  font-size: 0.7em;
  opacity: 0.55;
}

.header__link-icon {
  display: none;
}

.header.is-open .header__link-icon {
  display: inline-block;
  width: 16px;
  height: auto;
}

/* Mobile Menu: Sub Links (Footer Items) */
.header.is-open .header__list--sub {
  flex-direction: column;
  gap: 1.1rem;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.header.is-open .header__link--sub {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
}

@media (min-width: 992px) {
  .header__list--sub {
    display: none;
  }
}

/* Mobile Menu: SNS */
.header__social {
  display: none;
}

.header.is-open .header__social {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 2rem;
}

.header__social-link img {
  width: 26px;
  height: 26px;
}

@media (min-width: 992px) {
  .header__social {
    display: none;
  }
}

.header.is-open .header__cta {
  margin-top: 2.5rem;
}

/* SPでは header__cta のカートボタンを btn--lg 相当のサイズにする */
@media (max-width: 991px) {
  .header__cta .btn {
    padding: 0.8rem 3.5rem;
    font-size: 1.125rem;
    min-width: 280px;
  }
}

.header.is-open .header__toggle-bar {
  background-color: var(--c-white);
}

.header.is-open .header__toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.header.is-open .header__toggle-bar:nth-child(2) {
  opacity: 0;
}
.header.is-open .header__toggle-bar:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

/* Header Dark (for Subpages) */
.header--dark .header__link {
  color: var(--c-main);
}
.header--dark .header__toggle-bar {
  background-color: var(--c-main);
}
