/* === ハンバーガー見た目（OK） === */
.burger {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 8px;
	background: transparent;
	border: none;
	outline: none;
	cursor: pointer;
	min-width: 44px;
	min-height: 44px;
	float: right;
}
.burger__lines {
	width: 24px;
	height: 16px;
	position: relative;
	display: inline-block;
}
.burger__lines::before,
.burger__lines::after,
.burger__lines span {
	content: '';
	position: absolute;
	left: 0;
	right: 0;
	height: 2px;
	background: #111;
	border-radius: 2px;
}
.burger__lines::before {
	top: 0;
}
.burger__lines span {
	top: 7px;
}
.burger__lines::after {
	top: 14px;
}
.burger__label {
	font-size: 9px;
	line-height: 1;
	color: #111;
	margin-top: 2px;
	user-select: none;
}
.burger:focus-visible {
	outline: 2px solid #555;
	border-radius: 6px;
	outline-offset: 2px;
}

/* --- オフキャンバス基礎 --- */
.offcanvas-wrap {
	position: fixed;
	inset: 0;
	z-index: 90;
	pointer-events: none;
}
.offcanvas-overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.4);
	opacity: 0;
	transition: opacity 0.28s;
}

/* パネル本体：左からスライド＋縦レイアウト（ボタンを最下部に） */
.offcanvas {
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	width: 280px;
	background: #fff;
	transform: translateX(-100%);
	transition: transform 0.28s;
	padding: 16px;
	box-shadow: 2px 0 20px rgba(0, 0, 0, 0.08);
	display: flex;
	flex-direction: column; /* ここがポイント */
	/* overflow は付けない（リスト側に付ける） */
}

/* 開いた状態 */
.offcanvas-wrap.is-active {
	pointer-events: auto;
}
.offcanvas-wrap.is-active .offcanvas {
	transform: translateX(0);
}
.offcanvas-wrap.is-active .offcanvas-overlay {
	opacity: 1;
}

nav.offcanvas li a {
	color: #333;
	float: none;
	width: auto;
}
.offcanvas__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	overflow: auto; /* リストだけスクロール */
}
.offcanvas__list li {
	border-bottom: 1px solid #ccc;
	padding: 16px;
}

/* スクリーンリーダー用（視覚は非表示） */
.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 1px, 1px);
	white-space: nowrap;
	border: 0;
}

/* × ボタン：一番下に固定（全幅） */
.offcanvas__close {
	position: relative; /* 擬似要素の基準 */
	width: 100%;
	height: 48px;
	margin-top: auto; /* 最下部へ */
	border: none;
	background: #f2f2f2;
	color: #111;
	cursor: pointer;
	border-radius: 10px;
}
.offcanvas__close::before,
.offcanvas__close::after {
	content: '';
	position: absolute;
	left: 50%;
	top: 50%;
	width: 22px;
	height: 2px;
	background: #111;
	transform-origin: center;
}
.offcanvas__close::before {
	transform: translate(-50%, -50%) rotate(45deg);
}
.offcanvas__close::after {
	transform: translate(-50%, -50%) rotate(-45deg);
}
.offcanvas__close:focus-visible {
	outline: 2px solid #555;
	outline-offset: 4px;
	border-radius: 10px;
}

/* 599px以上はハンバーガー非表示＆オフキャンバス自体も無効に見せる */
@media (min-width: 599px) {
	.burger {
		display: none;
	}
	.offcanvas-wrap {
		display: none;
	} /* オーバーレイ/パネルも消す */
	/* もしPC用の水平ナビを出すなら */
	.pc-nav {
		display: inline-flex;
	}
}
