/**
 * Navigation
 * ハンバーガーボタン・ドロワーメニュー・オーバーレイ
 *
 * @package KNOT_For_Dogs
 */

/* ===== ハンバーガーボタン ===== */
.c-hamburger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: var(--z-hamburger);
  position: relative;
  color: var(--color-text);
}

@media (min-width: 768px) {
  .c-hamburger {
    display: none;
  }
}

.c-hamburger__svg {
  display: block;
  width: 35px;
  height: 31px;
  transition: opacity var(--duration-fast);
}

/* 開いた状態: SVGを非表示（ドロワーのcloseボタンで代替） */
.c-hamburger[aria-expanded='true'] .c-hamburger__svg {
  opacity: 0;
}

/* 透明ヘッダー時: 白色 */
.l-header--transparent .c-hamburger {
  color: var(--color-bg-white);
}

.l-header--transparent.l-header--scrolled .c-hamburger {
  color: var(--color-text);
}

/* ===== ドロワーメニュー ===== */
.c-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 100%;
  height: 100vh;
  background-color: var(--color-bg-white);
  z-index: var(--z-drawer);
  padding: 80px 24px 24px; /* Figma: header height (64px) + 16px gap */
  transform: translateX(100%);
  transition: transform var(--duration-normal) var(--ease-out);
  overflow-y: auto;
}

.c-drawer[aria-hidden='false'] {
  transform: translateX(0);
}

.c-drawer__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 24px; /* Figma: spacing/lg = 24px（メニュー項目間gap） */
}

.c-drawer__item {
  /* Figma: ドロワーメニュー項目間に罫線なし */
}

/* .c-drawer__item a は削除 → .c-drawer__link で一元管理（特異性競合を回避） */

/* ===== オーバーレイ ===== */
.c-overlay {
  position: fixed;
  inset: 0;
  background-color: var(--color-overlay);
  z-index: var(--z-overlay);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--duration-normal) var(--ease-out),
              visibility var(--duration-normal);
}

.c-overlay.is-active {
  opacity: 1;
  visibility: visible;
}

/* ===== ドロワーヘッダー ===== */
.c-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px; /* Figma: py-16 px-24 */
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
}

.c-drawer__logo {
  flex-shrink: 0;
}

.c-drawer__logo a {
  display: block;
  text-decoration: none;
}

/* SVGロゴ画像（ドロワー内） — Figma準拠 */
.c-drawer__logo-img {
  display: block;
  height: 28px;
  width: auto;
}

.c-drawer__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-main);
}

/* ===== ドロワーリンク（button/a共通） ===== */
.c-drawer__link {
  display: block;
  padding: 0; /* Figma: gap-24 で間隔調整のためpadding-y不要 */
  font-family: var(--font-en); /* Cormorant Garamond */
  font-size: 32px; /* Figma: en/display-en = 32px */
  font-weight: 500; /* Figma: Medium */
  line-height: 1.4;
  color: var(--color-text-main);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  width: 100%;
  text-align: left;
}

/* ===== サブメニュー ===== */
.c-drawer__submenu {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 16px; /* Figma: spacing/md = 16px */
  overflow: hidden;
  max-height: 0;
  transition: max-height var(--duration-normal) var(--ease-out),
              padding var(--duration-normal) var(--ease-out);
}

.js-drawer-submenu-toggle[aria-expanded='true'] + .c-drawer__submenu {
  max-height: 300px;
  padding-top: 8px; /* Figma: spacing/xs = 8px */
}

.c-drawer__submenu-item a {
  display: flex;
  align-items: center;
  gap: 4px; /* Figma: spacing/2xs = 4px */
  padding: 0; /* Figma: gap-16 でコンテナが間隔管理 */
  font-family: var(--font-ja); /* Figma: Zen Old Mincho */
  font-size: 18px; /* Figma: ja/body-xl = 18px */
  font-weight: 500; /* Figma: Medium */
  line-height: 1.6;
  color: var(--color-text-main);
  text-decoration: none;
}

.c-drawer__submenu-item a::before {
  content: '›';
  font-family: var(--font-en);
  font-size: 16px;
  margin-right: 0;
  color: var(--color-text-muted);
  display: inline-block;
  flex-shrink: 0;
}

.c-drawer__badge {
  font-size: var(--fz-xs);
  color: var(--color-text-muted);
  margin-left: 2px;
}

.c-drawer__submenu-item--disabled > a {
  cursor: default;
  pointer-events: none;
}

/* ===== ドロワーCTAボタン ===== */
.c-drawer__cta {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: var(--sp-lg) 0 0;
  margin-top: auto;
}

.c-drawer__cta-btn {
  width: 100%;
  text-align: center;
}

/* ===== ドロワーCTAボタン — Figma SP デザイン準拠 ===== */
.c-drawer__cta .c-btn {
  border-radius: 0;
}

.c-drawer__cta .c-btn--outline {
  background-color: var(--color-bg-white);
  color: #80746A;
  border: 1px solid #80746A;
}

.c-drawer__cta .c-btn--outline:hover {
  background-color: #80746A;
  color: var(--color-bg-white);
}
