/* ==========================================================================
   Header & Slideout Panel
   Mobile-first + CSS Nesting
   ========================================================================== */

html {
	scroll-padding-top: calc(var(--as-header-height) + var(--as-scroll-breathing));
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.as-header {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	z-index: 1000;
	background-color: var(--as-color-surface-blue-100);
	height: var(--as-header-height);

	.as-header__inner {
		display: flex;
		align-items: center;
		height: 100%;
		padding: 0 0 0 16px;

		@media (min-width: 769px) {
			padding: 0 0 0 var(--as-gutter);
		}
	}

	/* Hamburger: mobile=right(order:3), PC=left(order:-1) */
	.as-header__hamburger {
		order: 3;
		display: flex;
		align-items: center;
		justify-content: center;
		width: 60px;
		height: 100%;
		padding: 0;
		border: none;
		background: none;
		cursor: pointer;
		color: var(--as-color-navy);
		flex-shrink: 0;

		@media (min-width: 769px) {
			order: -1;
			width: 32px;
			margin-right: 30px;
		}
	}

	.as-header__hamburger-icon {
		width: 24px;
		height: 14px;

		@media (min-width: 769px) {
			width: 32px;
			height: 18px;
		}
	}

	/* Logo */
	.as-header__logo {
		display: flex;
		align-items: center;
		gap: 8px;
		text-decoration: none;
		color: var(--as-color-navy);
		flex-shrink: 0;
		margin-right: auto;

		@media (min-width: 769px) {
			gap: 10px;
		}
	}

	.as-header__logo-symbol {
		width: 28px;
		height: 28px;

		@media (min-width: 769px) {
			width: 36px;
			height: 36px;
		}
	}

	.as-header__logo-text {
		font-family: var(--as-font-ja-serif);
		font-size: var(--as-font-size-lg);
		font-weight: var(--as-font-weight-regular);
		letter-spacing: var(--as-letter-spacing-xs);
		white-space: nowrap;

		@media (min-width: 769px) {
			font-size: var(--as-font-size-2xl);
		}
	}

	/* Global navigation — hidden on mobile */
	.as-header__nav {
		display: none;

		@media (min-width: 769px) {
			display: flex;
			align-items: center;
			margin-left: auto;
			margin-right: 20px;
		}
	}

	.as-header__nav-list {
		display: flex;
		align-items: center;
		gap: 30px;
		list-style: none;
		margin: 0;
		padding: 0;
	}

	.as-header__nav-item {
		margin: 0;
		padding: 0;
	}

	.as-header__nav-link {
		font-family: var(--as-font-ja-serif-alt);
		font-size: var(--as-font-size-base);
		font-weight: var(--as-font-weight-regular);
		letter-spacing: var(--as-letter-spacing-sm);
		color: var(--as-color-navy);
		text-decoration: none;
		white-space: nowrap;
		transition: opacity 0.2s ease;
	}

	@media (hover: hover) {
		.as-header__nav-link:hover {
			opacity: var(--as-hover-opacity);
		}
	}

	/* Language switcher — hidden on mobile */
	.as-header__lang {
		display: none;

		@media (min-width: 769px) {
			display: flex;
			align-items: center;
			margin-right: 24px;
			margin-left: 24px;
			flex-shrink: 0;
		}
	}

	/* Booking button */
	.as-header__booking {
		display: flex;
		align-items: center;
		justify-content: center;
		height: 100%;
		padding: 0 var(--as-gutter);
		background-color: var(--as-color-navy);
		color: var(--as-color-white);
		font-family: var(--as-font-ja-serif);
		font-size: var(--as-font-size-sm);
		font-weight: var(--as-font-weight-regular);
		letter-spacing: var(--as-letter-spacing-xs);
		text-decoration: none;
		white-space: nowrap;
		flex-shrink: 0;
		transition: opacity 0.2s ease;

		@media (min-width: 769px) {
			font-size: var(--as-font-size-lg);
			padding: 0 30px;
			width: 120px;
		}
	}

	@media (hover: hover) {
		.as-header__booking:hover {
			opacity: var(--as-hover-opacity);
			color: var(--as-color-white);
		}
	}
}

/* --------------------------------------------------------------------------
   Language switcher (shared styles)
   -------------------------------------------------------------------------- */

.as-lang__link {
	font-family: var(--as-font-ja-serif);
	font-size: var(--as-font-size-xl);
	font-weight: var(--as-font-weight-regular);
	color: var(--as-color-navy);
	text-decoration: none;
	transition: opacity 0.2s ease;
}

@media (hover: hover) {
	.as-lang__link:hover {
		opacity: var(--as-hover-opacity);
	}
}

.as-lang__link--active {
	opacity: 1;
}

.as-lang__separator {
	font-family: var(--as-font-ja-serif);
	font-size: var(--as-font-size-sm);
	color: var(--as-color-navy);
	margin: 0 4px;
}

/* --------------------------------------------------------------------------
   Slideout Panel
   -------------------------------------------------------------------------- */

.as-slideout {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 10000;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	background-color: var(--as-color-surface-blue-300);
	transform: translateX(-100%);
	transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);

	@media (min-width: 769px) {
		width: 379px;
		background-color: var(--as-color-surface-blue-200);
	}

	.as-slideout__header {
		display: flex;
		align-items: center;
		height: 60px;
		padding: 0 0 0 16px;
		gap: 8px;

		@media (min-width: 769px) {
			height: 80px;
			padding: 0 0 0 24px;
		}
	}

	/* Close button */
	.as-slideout__close {
		display: flex;
		align-items: center;
		justify-content: center;
		width: 44px;
		height: 44px;
		padding: 0;
		border: none;
		background: none;
		cursor: pointer;
		color: var(--as-color-navy);
		flex-shrink: 0;
		order: 3;

		@media (min-width: 769px) {
			order: -1;
		}
	}

	.as-slideout__close svg {
		width: 20px;
		height: 20px;

		@media (min-width: 769px) {
			width: 24px;
			height: 24px;
		}
	}

	/* Logo in slideout header */
	.as-slideout__logo {
		display: flex;
		align-items: center;
		gap: 10px;
		text-decoration: none;
		color: var(--as-color-navy);
		flex-shrink: 0;
		@media (min-width: 769px) {
			gap: 16px;
		}
	}

	.as-slideout__logo-symbol {
		width: 24px;
		height: 24px;

		@media (min-width: 769px) {
			width: 32px;
			height: 32px;
		}
	}

	.as-slideout__logo-text {
		font-family: var(--as-font-ja-serif);
		font-size: var(--as-font-size-lg);
		font-weight: var(--as-font-weight-regular);
		letter-spacing: var(--as-letter-spacing-xs);
		white-space: nowrap;
		@media (min-width: 769px) {
			font-size: var(--as-font-size-5xl);
		}
	}

	/* Booking button in slideout header — mobile only */
	.as-slideout__booking {
		display: flex;
		align-items: center;
		justify-content: center;
		height: 100%;
		padding: 0 16px;
		margin-left: auto;
		background-color: var(--as-color-navy);
		color: var(--as-color-white);
		font-family: var(--as-font-ja-serif);
		font-size: var(--as-font-size-sm);
		font-weight: var(--as-font-weight-regular);
		letter-spacing: var(--as-letter-spacing-xs);
		text-decoration: none;
		white-space: nowrap;
		flex-shrink: 0;

		@media (min-width: 769px) {
			display: none;
		}
	}

	/* Slideout body */
	.as-slideout__body {
		padding: 30px 40px 60px;

		@media (min-width: 769px) {
			padding: 40px 60px 60px;
		}
	}

	/* Language switcher in slideout — mobile only */
	.as-slideout__lang {
		display: block;
		margin-bottom: 30px;

		@media (min-width: 769px) {
			display: none;
		}
	}

	/* Main navigation */
	.as-slideout__main-nav {
		margin-bottom: 30px;
	}

	.as-slideout__main-nav-list {
		list-style: none;
		margin: 0;
		padding: 0;
	}

	.as-slideout__main-nav-item {
		margin: 0;
		padding: 0;
	}

	.as-slideout__main-nav-link {
		display: block;
		font-family: var(--as-font-ja-serif-alt);
		font-size: var(--as-font-size-xl);
		font-weight: var(--as-font-weight-regular);
		color: var(--as-color-navy);
		text-decoration: none;
		padding: 8px 0;
		letter-spacing: var(--as-letter-spacing-xs);
		transition: opacity 0.2s ease;
	}

	@media (hover: hover) {
		.as-slideout__main-nav-link:hover {
			opacity: var(--as-hover-opacity);
		}
	}

	/* Sub navigation */
	.as-slideout__sub-nav {
		margin-bottom: 30px;
	}

	.as-slideout__sub-nav-list {
		list-style: none;
		margin: 0;
		padding: 0;
	}

	.as-slideout__sub-nav-item {
		margin: 0;
		padding: 0;
	}

	.as-slideout__sub-nav-link {
		display: block;
		font-family: var(--as-font-ja-serif-alt);
		font-size: var(--as-font-size-xs);
		font-weight: var(--as-font-weight-regular);
		color: var(--as-color-navy);
		text-decoration: none;
		padding: 6px 0;
		letter-spacing: var(--as-letter-spacing-xs);
		transition: opacity 0.2s ease;
	}

	@media (hover: hover) {
		.as-slideout__sub-nav-link:hover {
			opacity: var(--as-hover-opacity);
		}
	}

	/* Social links */
	.as-slideout__social {
		display: flex;
		gap: 12px;
		margin-bottom: 30px;
	}

	.as-slideout__social-link {
		display: flex;
		align-items: center;
		justify-content: center;
		color: var(--as-color-navy);
		transition: opacity 0.2s ease;
	}

	@media (hover: hover) {
		.as-slideout__social-link:hover {
			opacity: var(--as-hover-opacity);
		}
	}

	.as-slideout__social-link img {
		width: 30px;
		height: 30px;
	}

	/* Divider */
	.as-slideout__divider {
		width: 160px;
		border: none;
		border-top: 1px solid var(--as-color-surface-blue-100);
		margin: 0 0 30px 0;
	}

	/* Our Brands */
	.as-slideout__brands {
		margin-bottom: 0;
	}

	.as-slideout__brands-heading {
		font-family: var(--as-font-en-serif);
		font-size: var(--as-font-size-xs);
		font-weight: var(--as-font-weight-regular);
		margin: 0 0 16px 0;
		letter-spacing: var(--as-letter-spacing-xs);

		span {
			color: var(--as-color-white);
			background: var(--as-color-navy);
		}
	}

	.as-slideout__brands-list {
		list-style: none;
		margin: 20px 0 0;
		padding: 0;

		li {
			margin: 0;
			padding: 0;
			&:not(:first-child) {
				margin-top: 16px;
			}
		}
	}

	.as-slideout__brands-link {
		display: block;
		font-family: var(--as-font-en-serif);
		font-size: var(--as-font-size-xs);
		font-weight: var(--as-font-weight-regular);
		color: var(--as-color-navy);
		text-decoration: none;
		letter-spacing: var(--as-letter-spacing-xs);
		transition: opacity 0.2s ease;
	}

	@media (hover: hover) {
		.as-slideout__brands-link:hover {
			opacity: var(--as-hover-opacity);
		}
	}
}

/* Slideout open state */
.as-slideout.is-open {
	transform: translateX(0);
}

/* --------------------------------------------------------------------------
   Slideout Backdrop
   -------------------------------------------------------------------------- */

.as-slideout-backdrop {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 9999;
	background-color: var(--as-color-overlay-dark);
	opacity: 0;
	transition: opacity 0.35s ease;

	@media (min-width: 769px) {
		display: block;
		pointer-events: none;
	}
}

.as-slideout-backdrop.is-visible {
	opacity: 1;
	pointer-events: auto;
}

/* --------------------------------------------------------------------------
   Body scroll lock
   -------------------------------------------------------------------------- */

body.as-slideout-open {
	overflow: hidden;
}

/* --------------------------------------------------------------------------
   Hide GP header elements that may leak through
   -------------------------------------------------------------------------- */

.slideout-navigation,
#generate-slideout-menu,
.main-navigation .slideout-toggle {
	display: none !important;
}

/* --------------------------------------------------------------------------
   Fixed header offset
   -------------------------------------------------------------------------- */

body {
	padding-top: var(--as-header-height);
}

/* --------------------------------------------------------------------------
   Japanese page heading overrides
   Counters html[lang="ja"] h2 { font-size: 20px!important; } in style.css
   -------------------------------------------------------------------------- */

html[lang="ja"] .as-slideout__brands-heading {
	font-size: var(--as-font-size-xs) !important;
}
