/* PGS Shop Assistant — Goldie storefront widget */

.pgs-sa-root {
	--pgs-sa-accent: #b3932f;
	--pgs-sa-accent-soft: #d4bc6a;
	--pgs-sa-cream: #fffaf0;
	--pgs-sa-ink: #1a1a1a;
	--pgs-sa-muted: #5c5c5c;
	--pgs-sa-line: #e8dfc8;
	--pgs-sa-panel: #fffdf8;
	--pgs-sa-user: #f4ecd8;
	--pgs-sa-shadow: 0 10px 32px rgba(26, 26, 26, 0.16);
	--pgs-sa-bottom: 20px;
	--pgs-sa-side: 20px;
	--pgs-sa-radius: 18px;
	position: fixed;
	bottom: var(--pgs-sa-bottom);
	z-index: 99990;
	font-family: "Roboto Condensed", "Helvetica Neue", Helvetica, Arial, sans-serif;
	color: var(--pgs-sa-ink);
	line-height: 1.45;
}

.pgs-sa-root--right {
	right: var(--pgs-sa-side);
	left: auto;
}

.pgs-sa-root--left {
	left: var(--pgs-sa-side);
	right: auto;
}

/* —— Teaser (Walmart-style intro card) —— */
.pgs-sa-teaser {
	position: absolute;
	bottom: 72px;
	width: min(320px, calc(100vw - 24px));
	padding: 16px 16px 14px;
	background: var(--pgs-sa-cream);
	border: 3px solid var(--pgs-sa-accent-soft);
	border-radius: var(--pgs-sa-radius);
	box-shadow: var(--pgs-sa-shadow);
	animation: pgs-sa-rise 0.28s ease;
}

.pgs-sa-root--right .pgs-sa-teaser {
	right: 0;
	left: auto;
}

.pgs-sa-root--left .pgs-sa-teaser {
	left: 0;
	right: auto;
}

.pgs-sa-teaser[hidden] {
	display: none !important;
}

.pgs-sa-teaser-top {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin-bottom: 10px;
}

.pgs-sa-teaser-copy {
	flex: 1;
	min-width: 0;
}

.pgs-sa-teaser-heading {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin-bottom: 6px;
}

.pgs-sa-teaser-title {
	font-family: "Roboto Slab", Georgia, serif;
	font-size: 1.05rem;
	font-weight: 700;
	letter-spacing: 0.01em;
	line-height: 1.15;
	margin: 0;
}

.pgs-sa-ai-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 4px;
	padding: 2px 8px;
	border-radius: 999px;
	background: rgba(179, 147, 47, 0.16);
	color: #7a6420;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	line-height: 1;
	height: 1.35rem;
	box-sizing: border-box;
}

.pgs-sa-teaser-text {
	margin: 0;
	font-size: 0.92rem;
	color: var(--pgs-sa-muted);
}

.pgs-sa-teaser-actions {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-top: 14px;
}

.pgs-sa-teaser-cta {
	border: 0;
	border-radius: 999px;
	background: var(--pgs-sa-ink);
	color: #fff;
	padding: 10px 18px;
	font: inherit;
	font-weight: 700;
	cursor: pointer;
	transition: transform 0.15s ease, background-color 0.15s ease;
}

.pgs-sa-teaser-cta:hover,
.pgs-sa-teaser-cta:focus-visible {
	background: #333;
	transform: translateY(-1px);
	outline: none;
}

.pgs-sa-avatar {
	flex-shrink: 0;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: var(--pgs-sa-accent);
	color: #fff;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.35);
	overflow: hidden;
}

.pgs-sa-avatar svg {
	display: block;
}

.pgs-sa-badge-img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 50%;
}

.pgs-sa-launcher .pgs-sa-badge-img {
	width: 100%;
	height: 100%;
}

/* —— Launcher —— */
.pgs-sa-launcher {
	width: 58px;
	height: 58px;
	border: 3px solid #fff;
	border-radius: 50%;
	background: var(--pgs-sa-accent);
	color: #fff;
	cursor: pointer;
	box-shadow: var(--pgs-sa-shadow);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	padding: 0;
	transition: transform 0.2s ease, background-color 0.2s ease;
}

.pgs-sa-launcher:hover,
.pgs-sa-launcher:focus-visible {
	transform: translateY(-2px) scale(1.03);
	outline: none;
}

.pgs-sa-launcher.is-open {
	background: var(--pgs-sa-ink);
}

/* —— Chat panel —— */
.pgs-sa-panel {
	position: absolute;
	bottom: 72px;
	width: min(380px, calc(100vw - 24px));
	height: min(560px, calc(100vh - 110px));
	background: var(--pgs-sa-panel);
	border: 3px solid var(--pgs-sa-accent-soft);
	border-radius: var(--pgs-sa-radius);
	box-shadow: var(--pgs-sa-shadow);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	animation: pgs-sa-rise 0.22s ease;
}

.pgs-sa-root--right .pgs-sa-panel {
	right: 0;
	left: auto;
}

.pgs-sa-root--left .pgs-sa-panel {
	left: 0;
	right: auto;
}

.pgs-sa-panel[hidden] {
	display: none !important;
}

@keyframes pgs-sa-rise {
	from {
		opacity: 0;
		transform: translateY(12px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.pgs-sa-header {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 14px 14px 12px;
	background: var(--pgs-sa-cream);
	border-bottom: 1px solid var(--pgs-sa-line);
}

.pgs-sa-header-text {
	flex: 1;
	min-width: 0;
}

.pgs-sa-title-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
}

.pgs-sa-title {
	font-family: "Roboto Slab", Georgia, serif;
	font-size: 1rem;
	font-weight: 700;
	letter-spacing: 0.01em;
	line-height: 1.15;
	margin: 0;
}

.pgs-sa-subtitle {
	margin-top: 2px;
	font-size: 0.78rem;
	color: var(--pgs-sa-muted);
}

.pgs-sa-close {
	border: 0;
	background: transparent;
	color: var(--pgs-sa-muted);
	font-size: 1.45rem;
	line-height: 1;
	cursor: pointer;
	padding: 0 2px;
	margin-left: auto;
}

.pgs-sa-close:hover,
.pgs-sa-close:focus-visible {
	color: var(--pgs-sa-ink);
	outline: none;
}

.pgs-sa-body {
	flex: 1;
	min-height: 0;
	display: flex;
	flex-direction: column;
	background: linear-gradient(180deg, #fffdf8 0%, #f7f3ea 100%);
}

.pgs-sa-messages {
	flex: 1;
	overflow-y: auto;
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.pgs-sa-bubble {
	max-width: 92%;
	padding: 11px 13px;
	font-size: 0.94rem;
	word-wrap: break-word;
	border-radius: 14px;
}

.pgs-sa-bubble--assistant {
	align-self: flex-start;
	background: #fff;
	border: 1px solid var(--pgs-sa-line);
	border-bottom-left-radius: 4px;
}

.pgs-sa-bubble--assistant a {
	color: var(--pgs-sa-accent);
	text-decoration: underline;
	word-break: break-word;
}

.pgs-sa-bubble--assistant a:hover,
.pgs-sa-bubble--assistant a:focus-visible {
	color: var(--pgs-sa-ink);
}

.pgs-sa-bubble--user {
	align-self: flex-end;
	background: var(--pgs-sa-user);
	border: 1px solid #e6d9b5;
	border-bottom-right-radius: 4px;
}

.pgs-sa-thinking {
	color: var(--pgs-sa-muted);
	font-style: italic;
	animation: pgs-sa-pulse 1.2s ease infinite;
}

@keyframes pgs-sa-pulse {
	0%,
	100% {
		opacity: 0.55;
	}
	50% {
		opacity: 1;
	}
}

.pgs-sa-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding: 0 16px 12px;
}

.pgs-sa-chips[hidden] {
	display: none !important;
}

.pgs-sa-chip {
	border: 1px solid var(--pgs-sa-accent);
	border-radius: 999px;
	background: #fff;
	color: var(--pgs-sa-ink);
	padding: 7px 12px;
	font-size: 0.82rem;
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.pgs-sa-chip:hover,
.pgs-sa-chip:focus-visible {
	background: var(--pgs-sa-accent);
	color: #fff;
	outline: none;
}

.pgs-sa-form {
	display: flex;
	gap: 8px;
	padding: 12px;
	border-top: 1px solid var(--pgs-sa-line);
	background: #fff;
}

.pgs-sa-input {
	flex: 1;
	resize: none;
	min-height: 44px;
	max-height: 96px;
	border: 1px solid var(--pgs-sa-line);
	border-radius: 12px;
	padding: 11px 12px;
	font: inherit;
	color: var(--pgs-sa-ink);
	background: #fff;
}

.pgs-sa-input:focus {
	outline: 2px solid rgba(179, 147, 47, 0.35);
	border-color: var(--pgs-sa-accent);
}

.pgs-sa-send {
	border: 0;
	border-radius: 999px;
	background: var(--pgs-sa-accent);
	color: #fff;
	padding: 0 16px;
	font: inherit;
	font-weight: 700;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	cursor: pointer;
}

.pgs-sa-send:hover,
.pgs-sa-send:focus-visible {
	background: #9f8128;
	outline: none;
}

.pgs-sa-cards {
	display: flex;
	flex-direction: column;
	gap: 8px;
	align-self: stretch;
}

.pgs-sa-card {
	display: grid;
	grid-template-columns: 64px 1fr;
	gap: 10px;
	padding: 10px;
	background: #fff;
	border: 1px solid var(--pgs-sa-line);
	border-radius: 12px;
}

.pgs-sa-card-thumb {
	width: 64px;
	height: 64px;
	background: #f3f3f3;
	overflow: hidden;
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.pgs-sa-card-thumb.is-empty::after {
	content: "";
	width: 28px;
	height: 22px;
	border: 2px solid #c9c9c9;
	border-radius: 2px;
	box-sizing: border-box;
	background:
		radial-gradient(circle at 30% 35%, #c9c9c9 0 3px, transparent 4px),
		linear-gradient(135deg, transparent 45%, #c9c9c9 46% 54%, transparent 55%);
	opacity: 0.7;
}

.pgs-sa-card-img {
	width: 64px;
	height: 64px;
	object-fit: cover;
	display: block;
}

.pgs-sa-card-title {
	font-size: 0.88rem;
	font-weight: 600;
	margin-bottom: 2px;
}

.pgs-sa-card-ira {
	display: inline-block;
	margin-bottom: 4px;
	padding: 2px 8px;
	border-radius: 999px;
	background: rgba(179, 147, 47, 0.16);
	color: #7a6420;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.03em;
	text-transform: uppercase;
}

.pgs-sa-card-price {
	font-size: 0.84rem;
	color: var(--pgs-sa-accent);
	margin-bottom: 6px;
}

.pgs-sa-card-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.pgs-sa-card-link,
.pgs-sa-card-add {
	font-size: 0.78rem;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	font-weight: 600;
	text-decoration: none;
	border: 1px solid var(--pgs-sa-ink);
	border-radius: 999px;
	background: #fff;
	color: var(--pgs-sa-ink);
	padding: 5px 10px;
	cursor: pointer;
}

.pgs-sa-card-add {
	border-color: var(--pgs-sa-accent);
	background: var(--pgs-sa-accent);
	color: #fff;
}

.pgs-sa-card-link:hover,
.pgs-sa-card-add:hover,
.pgs-sa-card-link:focus-visible,
.pgs-sa-card-add:focus-visible {
	opacity: 0.9;
	outline: none;
}

.pgs-sa-card-add:disabled {
	opacity: 0.7;
	cursor: default;
}

@media (max-width: 480px) {
	.pgs-sa-root {
		--pgs-sa-side: 12px;
	}

	.pgs-sa-teaser,
	.pgs-sa-panel {
		width: calc(100vw - 24px);
	}

	.pgs-sa-panel {
		height: min(70vh, 560px);
		bottom: 68px;
	}
}
