/* ===== 八幡宿第一ホテル チャットボット ===== */

.yhotel-chatbot__toggle {
	position: fixed;
	bottom: 24px;
	right: 24px;
	z-index: 9998;
	width: 68px;
	height: 68px;
	border-radius: 50%;
	border: 3px solid #2D6A4F;
	background: #fff;
	color: #fff;
	cursor: pointer;
	box-shadow: 0 8px 20px rgba(27, 67, 50, 0.35);
	transition: transform 0.2s, opacity 0.2s;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	font-family: inherit;
	animation: yhotel-cb-toggle-pulse 2.4s ease-out infinite;
}

@keyframes yhotel-cb-toggle-pulse {
	0% { box-shadow: 0 8px 20px rgba(27, 67, 50, 0.35), 0 0 0 0 rgba(45, 106, 79, 0.55); }
	70% { box-shadow: 0 8px 20px rgba(27, 67, 50, 0.35), 0 0 0 18px rgba(45, 106, 79, 0); }
	100% { box-shadow: 0 8px 20px rgba(27, 67, 50, 0.35), 0 0 0 0 rgba(45, 106, 79, 0); }
}

.yhotel-chatbot__avatar-img--toggle {
	border-radius: 50%;
}

.yhotel-chatbot__toggle:hover {
	transform: translateY(-2px) scale(1.08);
	box-shadow: 0 12px 24px rgba(27, 67, 50, 0.45);
}

.yhotel-chatbot__toggle:active {
	transform: translateY(0) scale(0.95);
}

.yhotel-chatbot__toggle.is-hidden {
	opacity: 0;
	pointer-events: none;
	transform: scale(0.8);
}

.yhotel-chatbot__toggle-icon {
	font-size: 26px;
	line-height: 1;
}

/* やわっぴーアバター画像 共通 */
.yhotel-chatbot__avatar-img {
	display: block;
	object-fit: contain;
}

.yhotel-chatbot__avatar-img--toggle {
	width: 100%;
	height: 100%;
	padding: 4px;
	box-sizing: border-box;
}

.yhotel-chatbot__avatar-img--header {
	width: 100%;
	height: 100%;
	padding: 2px;
	box-sizing: border-box;
}

.yhotel-chatbot__avatar-img--msg {
	width: 100%;
	height: 100%;
	padding: 2px;
	box-sizing: border-box;
}

.yhotel-chatbot__avatar-fallback {
	font-size: 20px;
	line-height: 1;
}

.yhotel-chatbot__toggle-badge {
	display: none;
}

/* やわっぴーのウェーブ(body経由でクリック委譲なのでpointer-events設定は不要) */
.yhotel-chatbot__avatar-img--toggle {
	animation: yhotel-cb-wave 4s ease-in-out infinite;
	transform-origin: 50% 90%;
}

@keyframes yhotel-cb-wave {
	0%, 50%, 100% { transform: rotate(0deg); }
	60% { transform: rotate(-8deg); }
	70% { transform: rotate(6deg); }
	80% { transform: rotate(-4deg); }
	90% { transform: rotate(0deg); }
}

.yhotel-chatbot__panel {
	position: fixed;
	bottom: 24px;
	right: 24px;
	z-index: 9999;
	width: 380px;
	max-width: calc(100vw - 32px);
	height: 600px;
	max-height: calc(100vh - 48px);
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	opacity: 0;
	transform: translateY(20px) scale(0.95);
	transition: opacity 0.25s ease, transform 0.25s ease;
	font-family: 'Noto Sans JP', sans-serif;
	pointer-events: none;
}

.yhotel-chatbot__panel[hidden] {
	display: none;
}

.yhotel-chatbot__panel.is-open {
	opacity: 1;
	transform: translateY(0) scale(1);
	pointer-events: auto;
}

.yhotel-chatbot__header {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 16px;
	background: linear-gradient(135deg, #1B4332 0%, #2D6A4F 100%);
	color: #fff;
	flex-shrink: 0;
}

.yhotel-chatbot__avatar {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 20px;
	flex-shrink: 0;
	overflow: hidden;
}

.yhotel-chatbot__title-block {
	flex: 1;
	min-width: 0;
}

.yhotel-chatbot__title {
	margin: 0;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;
}

.yhotel-chatbot__subtitle {
	margin: 2px 0 0;
	font-size: 12px;
	opacity: 0.85;
	line-height: 1.2;
}

.yhotel-chatbot__close {
	width: 32px;
	height: 32px;
	border: none;
	background: rgba(255, 255, 255, 0.15);
	color: #fff;
	border-radius: 50%;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	transition: background 0.2s;
	flex-shrink: 0;
	padding: 0;
}

.yhotel-chatbot__close:hover {
	background: rgba(255, 255, 255, 0.3);
}

.yhotel-chatbot__body {
	flex: 1;
	overflow-y: auto;
	padding: 16px;
	background: #f5f7f6;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.yhotel-chatbot__msg {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	max-width: 100%;
	animation: yhotel-cb-msg-in 0.3s ease-out;
}

@keyframes yhotel-cb-msg-in {
	from { opacity: 0; transform: translateY(8px); }
	to { opacity: 1; transform: translateY(0); }
}

.yhotel-chatbot__msg--user {
	justify-content: flex-end;
}

.yhotel-chatbot__msg-avatar {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: #fff;
	border: 1.5px solid #2D6A4F;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 16px;
	flex-shrink: 0;
	overflow: hidden;
}

.yhotel-chatbot__msg-bubble {
	padding: 10px 14px;
	border-radius: 16px;
	font-size: 14px;
	line-height: 1.6;
	max-width: 78%;
	word-wrap: break-word;
}

.yhotel-chatbot__msg--bot .yhotel-chatbot__msg-bubble {
	background: #fff;
	color: #333;
	border-bottom-left-radius: 4px;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.yhotel-chatbot__msg--user .yhotel-chatbot__msg-bubble {
	background: linear-gradient(135deg, #1B4332 0%, #2D6A4F 100%);
	color: #fff;
	border-bottom-right-radius: 4px;
}

.yhotel-chatbot__typing {
	display: inline-flex;
	gap: 4px;
	padding: 12px 14px;
	align-items: center;
}

.yhotel-chatbot__typing span {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: #999;
	animation: yhotel-cb-typing 1.4s infinite ease-in-out;
}

.yhotel-chatbot__typing span:nth-child(1) { animation-delay: 0s; }
.yhotel-chatbot__typing span:nth-child(2) { animation-delay: 0.2s; }
.yhotel-chatbot__typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes yhotel-cb-typing {
	0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
	30% { opacity: 1; transform: translateY(-4px); }
}

.yhotel-chatbot__categories {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
	margin-top: 8px;
}

.yhotel-chatbot__cat-btn {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	padding: 12px 8px;
	border: 1.5px solid #e5eae8;
	background: #fff;
	border-radius: 12px;
	cursor: pointer;
	transition: all 0.2s;
	font-family: inherit;
}

.yhotel-chatbot__cat-btn:hover {
	border-color: #2D6A4F;
	background: #f5faf7;
	transform: translateY(-1px);
}

.yhotel-chatbot__cat-emoji {
	font-size: 22px;
	line-height: 1;
}

.yhotel-chatbot__cat-label {
	font-size: 12px;
	color: #333;
	font-weight: 500;
	line-height: 1.3;
	text-align: center;
}

.yhotel-chatbot__questions {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin-top: 6px;
}

.yhotel-chatbot__q-btn {
	padding: 10px 14px;
	border: 1.5px solid #e5eae8;
	background: #fff;
	border-radius: 20px;
	cursor: pointer;
	transition: all 0.2s;
	font-size: 13px;
	color: #1B4332;
	text-align: left;
	font-family: inherit;
	line-height: 1.4;
}

.yhotel-chatbot__q-btn:hover {
	border-color: #2D6A4F;
	background: #f5faf7;
}

.yhotel-chatbot__actions {
	display: flex;
	gap: 8px;
	margin-top: 4px;
	justify-content: center;
}

.yhotel-chatbot__action-btn {
	padding: 8px 16px;
	border: 1px solid #e5eae8;
	background: #fff;
	border-radius: 16px;
	cursor: pointer;
	font-size: 12px;
	color: #666;
	font-family: inherit;
	transition: all 0.2s;
}

.yhotel-chatbot__action-btn:hover {
	border-color: #2D6A4F;
	color: #1B4332;
	background: #f5faf7;
}

.yhotel-chatbot__footer {
	padding: 12px 16px;
	background: #fff;
	border-top: 1px solid #e5eae8;
	display: flex;
	gap: 8px;
	align-items: center;
	flex-shrink: 0;
}

.yhotel-chatbot__search {
	flex: 1;
}

.yhotel-chatbot__search input {
	width: 100%;
	padding: 8px 12px;
	border: 1.5px solid #e5eae8;
	border-radius: 20px;
	font-size: 13px;
	outline: none;
	transition: border-color 0.2s;
	font-family: inherit;
	color: #333;
	background: #fff;
}

.yhotel-chatbot__search input:focus {
	border-color: #2D6A4F;
}

.yhotel-chatbot__reset {
	padding: 8px 12px;
	border: 1px solid #e5eae8;
	background: transparent;
	color: #666;
	border-radius: 16px;
	cursor: pointer;
	font-size: 11px;
	font-family: inherit;
	white-space: nowrap;
	transition: all 0.2s;
}

.yhotel-chatbot__reset:hover {
	border-color: #2D6A4F;
	color: #1B4332;
}

/* ===== 挨拶吹き出し ===== */
.yhotel-chatbot__greet {
	position: fixed;
	bottom: 108px;
	right: 20px;
	z-index: 9997;
	max-width: 260px;
	background: #fff;
	border: 2px solid #2D6A4F;
	border-radius: 14px;
	padding: 12px 34px 12px 14px;
	box-shadow: 0 6px 18px rgba(27, 67, 50, 0.18);
	opacity: 0;
	transform: translateY(8px) scale(0.95);
	transition: opacity 0.35s ease, transform 0.35s ease;
	pointer-events: none;
	cursor: pointer;
	font-family: 'Noto Sans JP', sans-serif;
}

.yhotel-chatbot__greet.is-visible {
	opacity: 1;
	transform: translateY(0) scale(1);
	pointer-events: auto;
	animation: yhotel-cb-greet-bounce 0.6s ease-out;
}

@keyframes yhotel-cb-greet-bounce {
	0% { transform: translateY(8px) scale(0.9); }
	60% { transform: translateY(-2px) scale(1.02); }
	100% { transform: translateY(0) scale(1); }
}

.yhotel-chatbot__greet::after {
	content: '';
	position: absolute;
	bottom: -10px;
	right: 28px;
	width: 0;
	height: 0;
	border-left: 8px solid transparent;
	border-right: 8px solid transparent;
	border-top: 10px solid #2D6A4F;
}

.yhotel-chatbot__greet::before {
	content: '';
	position: absolute;
	bottom: -7px;
	right: 30px;
	width: 0;
	height: 0;
	border-left: 6px solid transparent;
	border-right: 6px solid transparent;
	border-top: 8px solid #fff;
	z-index: 1;
}

.yhotel-chatbot__greet-text {
	margin: 0;
	font-size: 13px;
	line-height: 1.55;
	color: #1B4332;
	font-weight: 500;
}

.yhotel-chatbot__greet-close {
	position: absolute;
	top: 4px;
	right: 6px;
	width: 22px;
	height: 22px;
	border: none;
	background: transparent;
	color: #999;
	font-size: 16px;
	line-height: 1;
	cursor: pointer;
	padding: 0;
	border-radius: 50%;
	font-family: inherit;
}

.yhotel-chatbot__greet-close:hover {
	background: rgba(0, 0, 0, 0.06);
	color: #1B4332;
}

@media (max-width: 500px) {
	.yhotel-chatbot__panel {
		width: calc(100vw - 20px);
		right: 10px;
		bottom: 10px;
		height: calc(100vh - 20px);
		max-height: none;
		border-radius: 12px;
	}
	.yhotel-chatbot__toggle {
		bottom: 16px;
		right: 16px;
		width: 56px;
		height: 56px;
	}
	.yhotel-chatbot__toggle-icon {
		font-size: 24px;
	}
	.yhotel-chatbot__greet {
		bottom: 88px;
		right: 12px;
		max-width: calc(100vw - 24px);
		padding: 10px 30px 10px 12px;
	}
	.yhotel-chatbot__greet-text {
		font-size: 12px;
	}
}
