/**
 * ùrlar PD Chat — Progressive Diagnostics branded widget.
 */

.urlar-pd-chat {
	--upc-blue: #009cd8;
	--upc-blue-d: #0683b2;
	--upc-ink: #16242b;
	--upc-slate: #46555d;
	--upc-muted: #73828a;
	--upc-paper: #f6f8f9;
	--upc-line: #e4ebee;
	--upc-white: #fff;
	--upc-font: Inter, Arial, system-ui, sans-serif;
	position: fixed;
	z-index: 99980;
	inset: auto 24px 24px auto;
	font-family: var(--upc-font);
	font-size: 15px;
	line-height: 1.45;
	color: var(--upc-slate);
	/* Sit left of typical floating cart / FAB cluster */
	right: 24px;
	bottom: 24px;
}

.urlar-pd-chat[hidden] {
	display: none !important;
}

.urlar-pd-chat__launcher {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	padding: 12px 18px 12px 14px;
	border: 0;
	border-radius: 999px;
	background: var(--upc-blue);
	color: var(--upc-white);
	font: inherit;
	font-weight: 600;
	font-size: 14px;
	cursor: pointer;
	box-shadow: 0 8px 28px rgba(22, 36, 43, 0.18);
	transition: background 0.15s ease, transform 0.15s ease;
}

.urlar-pd-chat__launcher:hover {
	background: var(--upc-blue-d);
}

.urlar-pd-chat__launcher:focus-visible {
	outline: 2px solid var(--upc-ink);
	outline-offset: 3px;
}

.urlar-pd-chat__launcher-icon {
	display: grid;
	place-items: center;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.18);
}

.urlar-pd-chat__launcher-icon svg {
	width: 16px;
	height: 16px;
	fill: currentColor;
}

.urlar-pd-chat.is-open .urlar-pd-chat__launcher {
	display: none;
}

.urlar-pd-chat__panel {
	display: none;
	position: relative;
	flex-direction: column;
	width: min(380px, calc(100vw - 32px));
	height: min(520px, calc(100vh - 48px));
	background: var(--upc-white);
	border: 1px solid var(--upc-line);
	border-radius: 12px;
	box-shadow: 0 16px 48px rgba(22, 36, 43, 0.2);
	overflow: hidden;
}

.urlar-pd-chat.is-open .urlar-pd-chat__panel {
	display: flex;
}

.urlar-pd-chat__header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
	padding: 16px 16px 14px;
	background: var(--upc-ink);
	color: var(--upc-white);
}

.urlar-pd-chat__header-text {
	min-width: 0;
}

.urlar-pd-chat__title {
	margin: 0;
	font-size: 16px;
	font-weight: 600;
	letter-spacing: -0.01em;
	color: var(--upc-white);
}

.urlar-pd-chat__subtitle {
	margin: 2px 0 0;
	font-size: 12.5px;
	color: #c5d2d8;
}

.urlar-pd-chat__header-actions {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	gap: 2px;
	margin: -6px -4px 0 0;
}

.urlar-pd-chat__close,
.urlar-pd-chat__menu-btn {
	flex-shrink: 0;
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: #c5d2d8;
	cursor: pointer;
}

.urlar-pd-chat__close:hover,
.urlar-pd-chat__menu-btn:hover,
.urlar-pd-chat__menu-btn[aria-expanded="true"] {
	background: rgba(255, 255, 255, 0.08);
	color: var(--upc-white);
}

.urlar-pd-chat__close svg,
.urlar-pd-chat__menu-btn svg {
	width: 18px;
	height: 18px;
	stroke: currentColor;
	stroke-width: 2;
	fill: none;
}

.urlar-pd-chat__menu {
	position: absolute;
	top: 60px;
	right: 12px;
	z-index: 3;
	width: 224px;
	background: var(--upc-white);
	border: 1px solid var(--upc-line);
	border-radius: 12px;
	box-shadow: 0 12px 32px rgba(22, 36, 43, 0.18);
	padding: 6px;
}

.urlar-pd-chat__menu-row {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	box-sizing: border-box;
	padding: 9px 10px;
	border: 0;
	border-radius: 8px;
	background: none;
	color: var(--upc-ink);
	font: inherit;
	font-size: 13.5px;
	font-weight: 500;
	text-align: left;
	text-decoration: none;
	cursor: pointer;
}

.urlar-pd-chat__menu-row svg {
	flex-shrink: 0;
	width: 16px;
	height: 16px;
	stroke: currentColor;
	stroke-width: 1.8;
	fill: none;
}

.urlar-pd-chat__menu-row:hover {
	background: var(--upc-paper);
	color: var(--upc-blue-d);
}

.urlar-pd-chat__menu-row--static {
	color: var(--upc-slate);
	cursor: default;
}

.urlar-pd-chat__menu-row--static:hover {
	background: none;
	color: var(--upc-slate);
}

.urlar-pd-chat__menu-sep {
	border: 0;
	border-top: 1px solid var(--upc-line);
	margin: 4px 2px;
}

.urlar-pd-chat__messages {
	flex: 1;
	overflow-y: auto;
	padding: 16px;
	background: var(--upc-paper);
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.urlar-pd-chat__bubble {
	max-width: 88%;
	padding: 10px 12px;
	border-radius: 12px;
	font-size: 14.5px;
	word-break: break-word;
}

.urlar-pd-chat__bubble--user {
	align-self: flex-end;
	background: var(--upc-blue);
	color: var(--upc-white);
	border-bottom-right-radius: 4px;
	white-space: pre-wrap;
}

.urlar-pd-chat__bubble--bot {
	align-self: flex-start;
	background: var(--upc-white);
	border: 1px solid var(--upc-line);
	color: var(--upc-slate);
	border-bottom-left-radius: 4px;
	line-height: 1.45;
}

.urlar-pd-chat__bubble--bot.is-revealing {
	animation: urlar-pd-chat-reveal 0.28s ease-out;
}

@keyframes urlar-pd-chat-reveal {
	from {
		opacity: 0.35;
		transform: translateY(4px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

.urlar-pd-chat__list {
	margin: 0.35em 0 0.15em;
	padding-left: 1.15em;
}

.urlar-pd-chat__list li {
	margin: 0.2em 0;
}

.urlar-pd-chat__list li + li {
	margin-top: 0.35em;
}

.urlar-pd-chat__bubble a {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 2px;
	word-break: break-word;
}

.urlar-pd-chat__bubble--bot a {
	color: var(--upc-blue-d);
}

.urlar-pd-chat__bubble--status {
	align-self: center;
	background: transparent;
	border: 0;
	color: var(--upc-muted);
	font-size: 12.5px;
	padding: 4px;
}

.urlar-pd-chat__typing {
	display: inline-flex;
	flex-direction: column;
	gap: 6px;
	padding: 11px 14px;
	min-height: 20px;
}

.urlar-pd-chat__typing-dots {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	height: 14px;
}

.urlar-pd-chat__typing-dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--upc-muted);
	animation: urlar-pd-chat-typing 1.2s ease-in-out infinite;
}

.urlar-pd-chat__typing-dot:nth-child(2) {
	animation-delay: 0.15s;
}

.urlar-pd-chat__typing-dot:nth-child(3) {
	animation-delay: 0.3s;
}

@keyframes urlar-pd-chat-typing {
	0%,
	60%,
	100% {
		opacity: 0.35;
		transform: translateY(0);
	}
	30% {
		opacity: 1;
		transform: translateY(-3px);
	}
}

/* Cycles through the stacked phrases below the dots — same "generating a
   reply" state said three ways, so a slow answer reads as working rather
   than stuck. */
.urlar-pd-chat__typing-status {
	position: relative;
	height: 15px;
	min-width: 150px;
}

.urlar-pd-chat__typing-phrase {
	position: absolute;
	left: 0;
	top: 0;
	font-size: 12px;
	font-weight: 500;
	color: var(--upc-muted);
	white-space: nowrap;
	animation: urlar-pd-chat-typing-phrase 6.6s ease-in-out infinite;
}

.urlar-pd-chat__typing-phrase:nth-child(2) {
	animation-delay: -2.2s;
}

.urlar-pd-chat__typing-phrase:nth-child(3) {
	animation-delay: -4.4s;
}

@keyframes urlar-pd-chat-typing-phrase {
	0% {
		opacity: 0;
		transform: translateY(3px);
	}
	4%,
	28% {
		opacity: 1;
		transform: none;
	}
	33%,
	100% {
		opacity: 0;
		transform: translateY(-3px);
	}
}

.urlar-pd-chat__enquiry {
	padding: 12px 16px 14px;
	border-top: 1px solid var(--upc-line);
	background: var(--upc-white);
}

.urlar-pd-chat__enquiry-title {
	margin: 0 0 10px;
	font-size: 14px;
	font-weight: 600;
	color: var(--upc-ink);
}

.urlar-pd-chat__enquiry-form {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.urlar-pd-chat__enquiry-input {
	width: 100%;
	box-sizing: border-box;
	padding: 10px 12px;
	border: 1px solid #d4dee2;
	border-radius: 10px;
	font: inherit;
	font-size: 14px;
	color: var(--upc-ink);
	background: var(--upc-white);
}

.urlar-pd-chat__enquiry-input:focus {
	outline: 2px solid var(--upc-blue);
	outline-offset: 0;
	border-color: var(--upc-blue);
}

.urlar-pd-chat__enquiry-textarea {
	resize: vertical;
	min-height: 88px;
}

.urlar-pd-chat__enquiry-actions {
	display: flex;
	justify-content: space-between;
	gap: 10px;
	align-items: center;
	margin-top: 4px;
}

.urlar-pd-chat__enquiry-cancel {
	background: none;
	border: 0;
	padding: 0;
	color: var(--upc-muted);
	font: inherit;
	font-size: 13px;
	cursor: pointer;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.urlar-pd-chat__enquiry-send {
	margin: 0;
	padding: 10px 14px;
	border: 0;
	border-radius: 10px;
	background: var(--upc-blue);
	color: var(--upc-white);
	font: inherit;
	font-size: 13.5px;
	font-weight: 600;
	cursor: pointer;
}

.urlar-pd-chat__enquiry-send:hover:not(:disabled) {
	background: var(--upc-blue-d);
}

.urlar-pd-chat__enquiry-send:disabled {
	opacity: 0.55;
	cursor: not-allowed;
}

.urlar-pd-chat__hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	opacity: 0;
	pointer-events: none;
}

.urlar-pd-chat__composer {
	display: flex;
	gap: 8px;
	padding: 12px 12px 14px;
	border-top: 1px solid var(--upc-line);
	background: var(--upc-white);
}

.urlar-pd-chat__input {
	flex: 1;
	min-width: 0;
	padding: 10px 12px;
	border: 1px solid #d4dee2;
	border-radius: 10px;
	font: inherit;
	font-size: 14.5px;
	color: var(--upc-ink);
	background: var(--upc-white);
}

.urlar-pd-chat__input:focus {
	outline: 2px solid var(--upc-blue);
	outline-offset: 0;
	border-color: var(--upc-blue);
}

.urlar-pd-chat__input:disabled {
	opacity: 0.7;
}

.urlar-pd-chat__send {
	flex-shrink: 0;
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--upc-blue);
	color: var(--upc-white);
	cursor: pointer;
}

.urlar-pd-chat__send:hover:not(:disabled) {
	background: var(--upc-blue-d);
}

.urlar-pd-chat__send:disabled {
	opacity: 0.55;
	cursor: not-allowed;
}

.urlar-pd-chat__send svg {
	width: 18px;
	height: 18px;
	fill: currentColor;
}

@media (max-width: 640px) {
	.urlar-pd-chat {
		inset: auto 12px 12px 12px;
		right: 12px;
		left: 12px;
		bottom: 12px;
		display: flex;
		justify-content: flex-end;
		align-items: flex-end;
	}

	.urlar-pd-chat.is-open {
		inset: 0;
		padding: 12px;
		background: rgba(22, 36, 43, 0.46);
		align-items: stretch;
		justify-content: flex-end;
	}

	.urlar-pd-chat.is-open .urlar-pd-chat__panel {
		width: 100%;
		height: min(88vh, 640px);
		border-radius: 16px 16px 12px 12px;
		align-self: flex-end;
	}
}

@media (prefers-reduced-motion: reduce) {
	.urlar-pd-chat__launcher {
		transition: none;
	}

	.urlar-pd-chat__typing-dot {
		animation: none;
		opacity: 0.7;
	}

	.urlar-pd-chat__typing-phrase {
		animation: none;
		opacity: 0;
	}

	.urlar-pd-chat__typing-phrase:first-child {
		opacity: 1;
	}
}
