/* BONA K-Beauty Chat-Widget */
#bona-chat-launcher {
	position: fixed;
	bottom: 22px;
	right: 22px;
	width: 60px;
	height: 60px;
	border-radius: 50%;
	background: linear-gradient(135deg, #e59aa8, #c96a86);
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	z-index: 999998;
	border: none;
	transition: transform 0.15s ease;
}
#bona-chat-launcher:hover {
	transform: scale(1.06);
}
#bona-chat-launcher svg {
	width: 28px;
	height: 28px;
	fill: #fff;
}
#bona-chat-launcher .bona-chat-badge {
	position: absolute;
	top: -2px;
	right: -2px;
	background: #2ecc71;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	border: 2px solid #fff;
}

#bona-chat-window {
	position: fixed;
	bottom: 96px;
	right: 22px;
	width: 360px;
	max-width: calc(100vw - 32px);
	height: 520px;
	max-height: calc(100vh - 140px);
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
	display: none;
	flex-direction: column;
	overflow: hidden;
	z-index: 999999;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}
#bona-chat-window.bona-open {
	display: flex;
}

#bona-chat-header {
	background: linear-gradient(135deg, #e59aa8, #c96a86);
	color: #fff;
	padding: 14px 16px;
	display: flex;
	align-items: center;
	justify-content: space-between;
}
#bona-chat-header .bona-title {
	font-weight: 600;
	font-size: 15px;
}
#bona-chat-header .bona-subtitle {
	font-size: 12px;
	opacity: 0.9;
	margin-top: 2px;
}
#bona-chat-header .bona-header-actions {
	display: flex;
	align-items: center;
	flex-shrink: 0;
}
#bona-chat-header .bona-close-btn,
#bona-chat-header .bona-lang-toggle {
	background: rgba(255, 255, 255, 0.2);
	border: none;
	color: #fff;
	border-radius: 8px;
	cursor: pointer;
	font-size: 12px;
	padding: 5px 8px;
	margin-left: 6px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	text-decoration: none;
	line-height: 1;
}
#bona-chat-header .bona-wa-header-btn {
	background: rgba(37, 211, 102, 0.85);
	padding: 6px 7px;
}

/* Produktkarten */
.bona-product-cards {
	display: flex;
	gap: 8px;
	overflow-x: auto;
	padding: 2px 2px 6px 2px;
	align-self: flex-start;
	max-width: 100%;
}
.bona-product-card {
	flex: 0 0 auto;
	width: 118px;
	background: #fff;
	border: 1px solid #eee;
	border-radius: 10px;
	overflow: hidden;
	text-decoration: none;
	color: #2b2b2b;
	display: flex;
	flex-direction: column;
	transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.bona-product-card:hover {
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
	transform: translateY(-1px);
}
.bona-card-img {
	width: 100%;
	height: 90px;
	object-fit: cover;
	background: #f5f0f1;
	display: block;
}
.bona-card-name {
	font-size: 11px;
	font-weight: 600;
	padding: 6px 7px 0 7px;
	line-height: 1.3;
	max-height: 2.6em;
	overflow: hidden;
}
.bona-card-price {
	font-size: 11px;
	color: #c96a86;
	font-weight: 700;
	padding: 2px 7px 0 7px;
}
.bona-card-link {
	font-size: 10.5px;
	color: #999;
	padding: 3px 7px 7px 7px;
	margin-top: auto;
}

/* WhatsApp-Button im Chat */
.bona-whatsapp-btn {
	align-self: flex-start;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: #25d366;
	color: #fff;
	text-decoration: none;
	font-size: 12.5px;
	font-weight: 600;
	padding: 8px 14px;
	border-radius: 18px;
	margin-top: 2px;
}
.bona-whatsapp-btn:hover {
	background: #1ebe5b;
}

#bona-chat-messages {
	flex: 1;
	overflow-y: auto;
	padding: 14px;
	background: #faf7f8;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.bona-msg {
	max-width: 85%;
	padding: 9px 12px;
	border-radius: 14px;
	font-size: 13.5px;
	line-height: 1.45;
	white-space: pre-wrap;
	word-wrap: break-word;
}
.bona-msg a {
	color: inherit;
	text-decoration: underline;
}
.bona-msg.bona-user {
	align-self: flex-end;
	background: #c96a86;
	color: #fff;
	border-bottom-right-radius: 4px;
}
.bona-msg.bona-bot {
	align-self: flex-start;
	background: #fff;
	color: #2b2b2b;
	border: 1px solid #eee;
	border-bottom-left-radius: 4px;
}
.bona-msg.bona-error {
	align-self: center;
	background: #fdecea;
	color: #a33;
	font-size: 12.5px;
}
.bona-msg.bona-typing {
	align-self: flex-start;
	background: #fff;
	border: 1px solid #eee;
	color: #999;
	font-style: italic;
}

#bona-chat-inputbar {
	display: flex;
	border-top: 1px solid #eee;
	padding: 10px;
	gap: 8px;
	background: #fff;
}
#bona-chat-input {
	flex: 1;
	border: 1px solid #ddd;
	border-radius: 20px;
	padding: 9px 14px;
	font-size: 13.5px;
	resize: none;
	max-height: 70px;
	font-family: inherit;
}
#bona-chat-input:focus {
	outline: none;
	border-color: #c96a86;
}
#bona-chat-send {
	background: #c96a86;
	border: none;
	color: #fff;
	border-radius: 50%;
	width: 38px;
	height: 38px;
	flex-shrink: 0;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
}
#bona-chat-send:disabled {
	opacity: 0.5;
	cursor: default;
}
#bona-chat-send svg {
	width: 17px;
	height: 17px;
	fill: #fff;
}

/*
 * WICHTIG: Der bisherige Breakpoint "max-width: 420px" war die eigentliche Ursache dafür,
 * dass die angehobene Position auf dem iPhone der Shop-Betreiberin NIE angewendet wurde:
 * viele aktuelle iPhones (z. B. Pro Max/Plus-Modelle) haben eine CSS-Breite von 428–430px,
 * liegen also OBERHALB von 420px und fielen komplett aus dieser Media Query heraus – das
 * Fenster blieb auf der normalen Desktop-Position. Breakpoint daher deutlich angehoben
 * (768px, WordPress' eigener Standard-Mobile-Breakpoint), damit wirklich jedes Smartphone
 * erfasst wird. Zusätzlich !important, damit Theme-Styles mit gleicher/höherer Spezifität
 * die Position nicht mehr überschreiben können.
 */
@media (max-width: 768px) {
	#bona-chat-window {
		right: 12px !important;
		left: 12px !important;
		width: auto !important;
		/* Deutlich höher als der Standardwert, damit das Fenster auf Mobilgeräten nicht die
		   untere Navigationsleiste des Shops (Shop/Wunschliste/Warenkorb/Konto) verdeckt.
		   env(safe-area-inset-bottom) berücksichtigt zusätzlich die Home-Leiste auf iPhones. */
		bottom: calc(150px + env(safe-area-inset-bottom, 0px)) !important;
		max-height: calc(100vh - 190px - env(safe-area-inset-bottom, 0px)) !important;
	}
	#bona-chat-launcher {
		right: 16px !important;
		/* Ebenfalls deutlich angehoben, aus demselben Grund wie oben. */
		bottom: calc(72px + env(safe-area-inset-bottom, 0px)) !important;
	}
}
