/**
 * Product Chatbot — widget styles.
 *
 * Scoped under #ats-pcb-root so nothing here can reach the Woodmart parent
 * theme's own components.
 */

/* The `hidden` attribute is only `display: none` in the user-agent stylesheet,
   which any class rule in this file outranks. Both the panel and the bubble set
   `display: flex`, so hiding them from JavaScript silently did nothing: close()
   left the panel on screen, and the bubble stayed put after a handover — the
   two-bubble state this whole design exists to avoid. */
#ats-pcb-root[hidden],
#ats-pcb-root [hidden] {
	display: none !important;
}

#ats-pcb-root {
	--ats-pcb-accent: #d0011b;
	--ats-pcb-surface: #ffffff;
	--ats-pcb-text: #1b1f24;
	--ats-pcb-muted: #5a6470;
	--ats-pcb-border: #dfe3e8;
	--ats-pcb-line: #dfe3e887;
	--ats-pcb-bot: #f2f5f8;
}

/* button.ats-pcb-bubble {
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 9998;
	display: flex;
	align-items: center;
	gap: 8px;
	min-height: 44px;
	padding: 10px 18px 10px 14px;
	border: 0;
	border-radius: 999px;
	background: var(--ats-pcb-accent);
	color: #fff;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
} */

button.ats-pcb-bubble {
    position: relative;
    /* right: 20px; */
    /* bottom: 20px; */
    /* z-index: 9998; */
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 18px 10px 14px;
    border: 0;
    border-radius: 999px;
    background: #dd0513;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
    width: 100%;
}
button.ats-pcb-bubble:hover {
    background: #b70f1a;
    color: #fff;
}

/* In-page trigger, styled to match the .callbox_wrap adviser panels used on the
   rims, lid and care templates: same border, radius, padding and 70px portrait,
   so it reads as part of the site rather than as a widget bolted on.
   Unlike those panels this one is a control, hence the button reset and the
   chevron. */
.ats-pcb-card {
	display: flex;
	align-items: center;
	justify-content: flex-start;
	gap: 0.8em;
	width: 100%;
	margin-top: 1.75em;
	margin-bottom: 1em;
	padding: 1.1em 1em;
	border: 1px solid #d8d8d8;
	border-radius: 8px;
	background: #fff;
	color: #000;
	font-family: inherit;
	text-align: left;
	cursor: pointer;
}
button.ats-pcb-card {
    background: unset;
    border: 1px solid #dddddd;
    text-transform: unset;
    width: 100%;
    margin: .75em 0;
    border-radius: 10px;
    padding: 14px 20px;
}
button.ats-pcb-card:hover {
	    background-color: #f9f9f9;
}

.ats-pcb-card-portrait {
	flex: 0 0 70px;
	width: 70px;
	height: 70px;
	overflow: hidden;
	background: var(--ats-pcb-accent);
	color: #fff;
	font-size: 24px;
	font-weight: 700;
	line-height: 70px;
	text-align: center;
}

.ats-pcb-card-portrait--image {
	background: transparent;
}

.ats-pcb-card-portrait img {
	width: 70px;
	height: 70px;
	/* contain, not cover: the shipped portrait is a cut-out with transparent
	   margins, and cropping it would clip the head. */
	object-fit: contain;
	display: block;
	background: #eee;
    border-radius: 100%;
}

.ats-pcb-card-copy {
	display: flex;
	flex-direction: column;
	gap: 4px;
	flex: 1 1 auto;
	min-width: 0;
}

/* Matches span.callbox_title. */
.ats-pcb-card-title {
	display: block;
	font-size: 16px;
	font-weight: 500;
	line-height: 1;
	color: #000;
}

.ats-pcb-card-sub {
	color: var(--ats-pcb-accent);
	font-size: 16px;
	font-weight: 600;
	line-height: 1.2;
}

.ats-pcb-card-chevron {
	flex: 0 0 auto;
	color: var(--ats-pcb-accent);
}

.ats-pcb-card-chevron svg {
	width: 16px;
	height: 16px;
	display: block;
}

.ats-pcb-bubble svg {
	width: 22px;
	height: 22px;
	fill: currentColor;
}

button.ats-pcb-bubble[disabled] {
	opacity: 0.6;
	cursor: progress;
}

.ats-pcb-panel {
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 9999;
	display: flex;
	flex-direction: column;
	width: 380px;
	max-width: calc(100vw - 32px);
	height: 576px;
	max-height: calc(100vh - 40px);
	overflow: hidden;
	border: 1px solid var(--ats-pcb-border);
	border-radius: 14px;
	background: var(--ats-pcb-surface);
	color: var(--ats-pcb-text);
	box-shadow: 0 16px 48px rgba(0, 0, 0, 0.24);
}

.ats-pcb-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 16px;
	border-bottom: 1px solid var(--ats-pcb-border);
}

.ats-pcb-title {
	margin: 0;
	font-size: 16px;
	font-weight: 600;
}

.ats-pcb-header button.ats-pcb-close {
    min-width: 44px;
    min-height: 44px;
    border: 0;
    background: none;
    color: var(--ats-pcb-muted);
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
}

.ats-pcb-log {
	flex: 1;
	overflow-y: auto;
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.ats-pcb-msg {
	max-width: 85%;
	padding: 10px 13px;
	border-radius: 12px;
	font-size: 14px;
	line-height: 1.5;
	/* Model output is plain text; preserve its paragraph breaks. */
	white-space: pre-wrap;
	overflow-wrap: anywhere;
}

.ats-pcb-msg--bot {
    background: var(--ats-pcb-bot);
    display: inline-block;
    align-self: flex-start;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    line-height: 1.5;
    border-radius: 1.25rem;
    border-bottom-left-radius: 0.25rem;
    box-shadow: 0 0.25rem 6px rgba(50, 50, 93, 0.08), 0 1px 3px rgba(0, 0, 0, 0.05);
}

.ats-pcb-msg--user {
    align-self: flex-end;
    /* background: var(--ats-pcb-accent); */
    background: #505050;
    color: #fff;
    border-radius: 1em;
    border-bottom-right-radius: 0.25rem;
    box-shadow: 0 0.25rem 6px rgba(50, 50, 93, 0.08), 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Avatar + bubble + name, for anyone who is not the visitor. */
.ats-pcb-row {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	align-self: flex-start;
	max-width: 88%;
}

.ats-pcb-avatar {
	flex: 0 0 28px;
	width: 28px;
	height: 28px;
	margin-top: 2px;
	border-radius: 50%;
	overflow: hidden;
	background: #f0f0f0;
	/* background: var(--ats-pcb-accent); */
	color: #fff;
	font-size: 11px;
	font-weight: 600;
	line-height: 28px;
	text-align: center;
	/* The circle must not collapse when it holds initials rather than an image. */
	display: block;
}

.ats-pcb-avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.ats-pcb-stack {
	display: flex;
	flex-direction: column;
	gap: 3px;
	min-width: 0;
}

.ats-pcb-stack .ats-pcb-msg {
	max-width: 100%;
}

.ats-pcb-author {
	padding-left: 2px;
	color: var(--ats-pcb-muted);
	font-size: 11.5px;
	opacity: .75;
}

/* A human agent. Visually distinct from the bot so the visitor can tell at a
   glance who is answering — the whole reason the handover happens in place. */
.ats-pcb-msg--agent {
    background: var(--ats-pcb-bot);
    display: inline-block;
    align-self: flex-start;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    line-height: 1.5;
    border-radius: 1.25rem;
    border-bottom-left-radius: 0.25rem;
    box-shadow: 0 0.25rem 6px rgba(50, 50, 93, 0.08), 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Satisfaction survey. Centred like a note: it is the widget speaking, not a
   participant in the conversation. */
.ats-pcb-rating {
	align-self: center;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	padding: 10px 12px;
	max-width: 100%;
	text-align: center;
}

.ats-pcb-rating-label {
	color: var(--ats-pcb-muted);
	font-size: 12.5px;
}

.ats-pcb-rating-stars {
	display: flex;
	gap: 4px;
}

button.ats-pcb-star {
	min-width: 34px;
	min-height: 34px;
	border: 0;
	background: none;
	color: #c9ccd1;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	padding: 0;
}

button.ats-pcb-star:hover, 
button.ats-pcb-star:focus-visible {
    color: var(--ats-pcb-accent);
    background: unset;
}

/* A system note, not a party in the conversation: centred, quiet, no bubble. */
.ats-pcb-msg--note {
	align-self: center;
	max-width: 100%;
	padding: 4px 10px;
	background: none;
	color: var(--ats-pcb-muted);
	font-size: 12.5px;
	text-align: center;
	margin: 10px 0 5px;
}

.ats-pcb-callback-actions {
	align-self: flex-start;
}

button.ats-pcb-action-btn {
    min-height: 34px !important;
    height: 34px !important;
    padding: 10px 16px !important;
    border: 1px solid var(--ats-pcb-accent);
    border-radius: 999px;
    background: transparent;
    color: var(--ats-pcb-accent);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-transform: unset;
    margin-left: 28px;
}
.ats-pcb-callback-actions button.ats-pcb-action-btn:hover {
    background: red !important;
    color: #fff;
}
/* The starter questions and the callback offer, between the transcript and the
   composer. The bar is always one line; the questions fold in and out below it,
   so the section costs a single row when closed instead of the four or five the
   wrapped German questions used to take permanently. */
.ats-pcb-extras {
	display: flex;
	flex-direction: column;
	border-top: 1px solid var(--ats-pcb-line);
}
#ats-pcb-root [hidden] .ats-pcb-extras--bare {
    border-top: unset !important;
}
/* Set while the bar is empty — at the greeting, where the questions follow the
   intro directly and a rule between them would divide one thought in two. */
.ats-pcb-extras--bare {
	border-top: 0;
}

.ats-pcb-extras-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 2px 16px 3px;
}

#ats-pcb-root button.ats-pcb-chips-toggle,
#ats-pcb-root button.ats-pcb-callback-link {
	min-height: 32px;
	padding: 4px 0;
	border: 0;
	background: none;
	color: var(--ats-pcb-muted);
	font-size: 12px;
	text-align: left;
	text-transform: unset;
	cursor: pointer;
}

#ats-pcb-root button.ats-pcb-chips-toggle::before {
	content: '▸';
	display: inline-block;
	margin-right: 6px;
	transition: transform 0.15s ease;
}

#ats-pcb-root button.ats-pcb-chips-toggle[aria-expanded='true']::before {
	transform: rotate(90deg);
}

#ats-pcb-root button.ats-pcb-callback-link {
	flex: none;
	color: var(--ats-pcb-accent);
	text-decoration: underline;
}

#ats-pcb-root button.ats-pcb-chips-toggle:hover,
#ats-pcb-root button.ats-pcb-callback-link:hover {
	color: var(--ats-pcb-text);
	background: none;
}

@media (prefers-reduced-motion: reduce) {
	#ats-pcb-root button.ats-pcb-chips-toggle::before {
		transition: none;
	}
}

.ats-pcb-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	padding: 0 16px 10px;
}

/* At the greeting there is no header above the questions, so they would sit
   flush against the border that separates them from the transcript. The bar
   normally supplies that gap. Attribute selectors still match a hidden element,
   which is what lets the spacing follow the bar rather than a state class. */
.ats-pcb-extras-bar[hidden] + .ats-pcb-chips {
	padding-top: 12px;
}

.ats-pcb-chips button.ats-pcb-chip {
    min-height: 34px;
    padding: 7px 12px;
    border: 1px solid var(--ats-pcb-border);
    border-radius: 999px;
    background: #fff;
    color: var(--ats-pcb-text);
    font-size: 13px;
    text-align: left;
    cursor: pointer;
	text-transform: unset;
}
.ats-pcb-chips button.ats-pcb-chip:hover {
    background: #eaeaea;
}

/* Product cards for same-size alternatives. Every value in here comes from the
   server's own catalog query, never from the model's reply. */
.ats-pcb-alts {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin: 2px 0 4px;
}

#ats-pcb-root a.ats-pcb-alt {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px;
	border: 1px solid var(--ats-pcb-border);
	border-radius: 10px;
	background: #fff;
	color: var(--ats-pcb-text);
	text-decoration: none;
}

#ats-pcb-root a.ats-pcb-alt:hover {
	border-color: var(--ats-pcb-accent);
	background: #fcfcfc;
}

.ats-pcb-alt-img {
	flex: 0 0 52px;
	width: 52px;
	height: 52px;
	/* contain, not cover: catalog shots are cut-outs on transparent margins and
	   cropping one clips the tread. */
	object-fit: contain;
	display: block;
}

.ats-pcb-alt-body {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.ats-pcb-alt-badge {
	align-self: flex-start;
	padding: 1px 7px;
	border-radius: 999px;
	background: var(--ats-pcb-bot);
	color: var(--ats-pcb-muted);
	font-size: 10px;
	font-weight: 600;
	letter-spacing: .02em;
	text-transform: uppercase;
}

/* Only the comparative badges are coloured. The server awards these solely when
   the claim holds against the tyre on screen, so the emphasis is earned; 'house'
   and 'alternative' state a fact about the row and stay neutral. */
.ats-pcb-alt-badge--cheapest,
.ats-pcb-alt-badge--wet,
.ats-pcb-alt-badge--fuel,
.ats-pcb-alt-badge--noise,
.ats-pcb-alt-badge--ice,
.ats-pcb-alt-badge--snow,
.ats-pcb-alt-badge--premium {
	background: #fff0f2;
	color: var(--ats-pcb-accent);
}

.ats-pcb-alt-title {
	font-size: 13px;
	font-weight: 600;
	line-height: 1.3;
	overflow-wrap: anywhere;
}

.ats-pcb-alt-meta {
	color: var(--ats-pcb-muted);
	font-size: 11px;
	line-height: 1.3;
}

.ats-pcb-alt-price {
	display: flex;
	align-items: baseline;
	gap: 6px;
	font-size: 14px;
	font-weight: 700;
}

.ats-pcb-alt-saving {
	color: var(--ats-pcb-accent);
	font-size: 11px;
	font-weight: 600;
}

/* Callback request form, drawn inside the transcript rather than over it: the
   panel is already role="dialog", and a second layer would have to trap focus
   all over again. */
.ats-pcb-callback {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 8px 0 0;
    padding: 14px;
    border: 1px solid var(--ats-pcb-border);
    border-radius: 10px;
    background: #fafafa;
    box-shadow: 0px 0px 8px #e7e7e7;
}

.ats-pcb-callback-intro {
	margin: 0 0 10px;
	color: var(--ats-pcb-text);
	font-size: 13px;
	line-height: 1.4;
	font-weight: 600;
}

.ats-pcb-callback-field {
	display: flex;
	flex-direction: column;
	gap: 1px;
	font-size: 12px;
	color: var(--ats-pcb-muted);
}
label.ats-pcb-callback-field > span {
    font-style: italic;
}
#ats-pcb-root .ats-pcb-callback-field input,
#ats-pcb-root .ats-pcb-callback-field select {
	min-height: 32px;
    height: 32px;
    width: 100%;
    margin: 0;
    padding: 2px 10px;
    border: 1px solid var(--ats-pcb-border);
    border-radius: 8px;
    background: #fff;
    color: var(--ats-pcb-text);
    font-size: 14px;
}

.ats-pcb-callback-consent {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	color: var(--ats-pcb-muted);
	font-size: 11px;
	line-height: 1.4;
}

#ats-pcb-root .ats-pcb-callback-consent input {
	flex: none;
	width: 16px;
	height: 16px;
	margin: 2px 0 0;
	/* Recolours the native tick without replacing the control, so the checkbox
	   keeps its own keyboard and screen-reader behaviour. */
	accent-color: var(--ats-pcb-accent);
}

.ats-pcb-callback-consent a {
	color: var(--ats-pcb-accent);
	text-decoration: underline;
}

.ats-pcb-callback-error {
	margin: 0;
	color: var(--ats-pcb-accent);
	font-size: 12px;
	line-height: 1.4;
}

.ats-pcb-callback-actions {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 10px 0;
}

#ats-pcb-root button.ats-pcb-callback-cancel {
	min-height: 36px;
	padding: 4px 8px;
	border: 0;
	background: none;
	color: var(--ats-pcb-muted);
	font-size: 12px;
	text-transform: unset;
	cursor: pointer;
}

/* Off-screen rather than display:none — a field that is not rendered at all is
   also not filled in by the scripts this is meant to catch. */
.ats-pcb-honey {
	position: absolute !important;
	left: -9999px !important;
	width: 1px !important;
	height: 1px !important;
	opacity: 0 !important;
}
.ats-pcb-form {
    display: flex;
    gap: 8px;
    padding: 10px 16px 14px;
    border-top: 1px solid #dfe3e84d;
}

.ats-pcb-input {
	flex: 1;
	min-height: 44px;
	padding: 10px 12px;
	border: 1px solid var(--ats-pcb-border);
	border-radius: 8px;
	font-size: 14px;
	color: var(--ats-pcb-text);
	background: #fff;
}

button.ats-pcb-send {
	min-height: 44px;
	padding: 10px 18px;
	border: 0;
	border-radius: 8px;
	background: var(--ats-pcb-accent);
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
}

.ats-pcb-disclaimer {
	margin: 0;
	padding: 0 16px 12px;
	color: var(--ats-pcb-muted);
	font-size: 11px;
	line-height: 1.4;
	display: none !important;
}

#ats-pcb-root :focus-visible {
    outline: 2px solid #d0011b45;
    /* outline-offset: 0px; */
    border: unset;
}

@media (max-width: 480px) {
	.ats-pcb-panel {
		right: 0;
		bottom: 0;
		width: 100vw;
		max-width: 100vw;
		height: 100dvh;
		max-height: 100dvh;
		border: 0;
		border-radius: 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	#ats-pcb-root * {
		transition: none !important;
		animation: none !important;
	}
}
