/**
 * RenewTech component styles.
 *
 * Every colour resolves to a token published by the plugin, so changing the
 * palette in the admin restyles all of this.
 */

/* ------------------------------------------------------------------ buttons */

.rt-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	min-height: 46px;
	padding: 0.7rem 1.35rem;
	border: 1px solid transparent;
	border-radius: 6px;
	font: inherit;
	font-weight: 600;
	font-size: 0.95rem;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.rt-btn--primary {
	background: var(--rt-brand);
	color: #fff;
}

.rt-btn--primary:hover,
.rt-btn--primary:focus {
	background: var(--rt-brand-dark);
	color: #fff;
}

.rt-btn--ghost {
	background: transparent;
	border-color: var(--rt-line);
	color: var(--rt-ink);
}

.rt-btn--ghost:hover,
.rt-btn--ghost:focus {
	border-color: var(--rt-brand);
	color: var(--rt-brand);
}

.rt-btn--wa {
	background: #1f8f4e;
	color: #fff;
}

.rt-btn--wa:hover,
.rt-btn--wa:focus {
	background: #197340;
	color: #fff;
}

.rt-btn:focus-visible,
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
	outline: 2px solid var(--rt-brand);
	outline-offset: 2px;
}

/* ------------------------------------------------------------- availability */

.rt-availability {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	font-size: 0.8rem;
	font-weight: 600;
	letter-spacing: 0.01em;
}

.rt-availability__dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: currentColor;
	flex: none;
}

.rt-availability--positive { color: #1f7a4d; }
.rt-availability--warning  { color: #9a6212; }
.rt-availability--brand    { color: var(--rt-brand); }
.rt-availability--renew    { color: #5E7A16; }
.rt-availability--muted    { color: #6d7a80; }

.rt-eta {
	display: block;
	margin-top: 0.2rem;
	font-size: 0.78rem;
	color: #5c686e;
}

.rt-price--request {
	font-weight: 600;
	color: var(--rt-brand);
}

/* ------------------------------------------------------------------ badges */

.rt-badge {
	display: inline-block;
	padding: 0.22rem 0.55rem;
	border-radius: 3px;
	font-size: 0.68rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	white-space: nowrap;
}

/* The logo green is too pale to use as text on white, so it is used as a
   fill behind the ink colour instead. */
.rt-badge--grade {
	background: var(--rt-accent);
	color: var(--rt-ink);
	border: 1px solid rgba(var(--rt-accent-rgb), 0.9);
}

.rt-badge--upcoming {
	background: rgba(var(--rt-brand-rgb), 0.1);
	color: var(--rt-brand);
	border: 1px solid rgba(var(--rt-brand-rgb), 0.25);
}

.rt-badge--warranty {
	background: var(--rt-surface-2);
	color: var(--rt-ink);
	border: 1px solid var(--rt-line);
}

/* ------------------------------------------------------------------ search */

.rt-search__results {
	position: absolute;
	z-index: 60;
	top: calc(100% + 8px);
	left: 0;
	right: 0;
	background: var(--rt-surface);
	border: 1px solid var(--rt-line);
	border-radius: 8px;
	box-shadow: 0 18px 40px -24px rgba(16, 23, 32, 0.4);
	max-height: 70vh;
	overflow-y: auto;
}

.rt-search__list {
	list-style: none;
	margin: 0;
	padding: 0.4rem;
}

.rt-search__list a {
	display: flex;
	gap: 0.75rem;
	align-items: center;
	padding: 0.6rem;
	border-radius: 6px;
	text-decoration: none;
	color: var(--rt-ink);
}

.rt-search__list a:hover,
.rt-search__list a:focus {
	background: var(--rt-surface-2);
}

.rt-search__list img,
.rt-search__noimg {
	width: 48px;
	height: 48px;
	object-fit: contain;
	border-radius: 4px;
	background: var(--rt-surface-2);
	flex: none;
}

.rt-search__meta {
	display: flex;
	flex-direction: column;
	gap: 0.1rem;
	min-width: 0;
}

.rt-search__title {
	font-weight: 600;
	font-size: 0.9rem;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.rt-search__specs {
	font-size: 0.78rem;
	color: #5c686e;
}

.rt-search__price {
	font-size: 0.82rem;
	font-weight: 600;
	color: var(--rt-brand);
}

.rt-search__state {
	margin: 0;
	padding: 1rem;
	font-size: 0.88rem;
	color: #5c686e;
}

.rt-search__all {
	display: block;
	padding: 0.7rem 1rem;
	border-top: 1px solid var(--rt-line);
	font-size: 0.85rem;
	font-weight: 600;
	text-align: center;
	color: var(--rt-brand);
	text-decoration: none;
}

/* ------------------------------------------------------------------- forms */

.rt-enquiry__row {
	display: flex;
	flex-direction: column;
	gap: 0.3rem;
	margin: 0 0 0.9rem;
}

.rt-enquiry__grid {
	display: grid;
	gap: 0 1rem;
	grid-template-columns: 1fr 1fr;
}

.rt-enquiry label {
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--rt-ink);
}

.rt-enquiry input,
.rt-enquiry textarea,
.rt-track input {
	width: 100%;
	padding: 0.65rem 0.8rem;
	border: 1px solid var(--rt-line);
	border-radius: 6px;
	background: var(--rt-surface);
	color: var(--rt-ink);
	font: inherit;
	font-size: 0.95rem;
}

.rt-enquiry input:focus,
.rt-enquiry textarea:focus {
	border-color: var(--rt-brand);
}

.rt-enquiry__hp {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

.rt-enquiry__status {
	margin: 0.7rem 0 0;
	font-size: 0.88rem;
	min-height: 1.2em;
}

.rt-enquiry__status.is-success { color: #1f7a4d; }
.rt-enquiry__status.is-error   { color: #a3341f; }

/* -------------------------------------------------------------------- chat */

.rt-chat {
	position: fixed;
	right: 18px;
	bottom: 18px;
	z-index: 90;
}

.rt-chat__launcher {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.7rem 1.1rem;
	border: 0;
	border-radius: 999px;
	background: var(--rt-brand);
	color: #fff;
	font: inherit;
	font-weight: 600;
	font-size: 0.9rem;
	cursor: pointer;
	box-shadow: 0 12px 28px -12px rgba(16, 23, 32, 0.5);
}

.rt-chat__launcher:hover { background: var(--rt-brand-dark); }
.rt-chat.is-open .rt-chat__launcher { display: none; }

.rt-chat__panel {
	position: fixed;
	right: 18px;
	bottom: 18px;
	width: min(380px, calc(100vw - 36px));
	max-height: min(620px, calc(100vh - 40px));
	display: flex;
	flex-direction: column;
	background: var(--rt-surface);
	border: 1px solid var(--rt-line);
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 24px 60px -28px rgba(16, 23, 32, 0.55);
}

.rt-chat__header {
	display: flex;
	align-items: center;
	gap: 0.7rem;
	padding: 0.85rem 1rem;
	background: var(--rt-ink);
	color: #fff;
}

.rt-chat__avatar {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	object-fit: cover;
}

.rt-chat__name {
	margin: 0;
	font-weight: 600;
	font-size: 0.95rem;
}

.rt-chat__status {
	margin: 0;
	font-size: 0.75rem;
	opacity: 0.72;
}

.rt-chat__close {
	margin-left: auto;
	background: none;
	border: 0;
	color: inherit;
	cursor: pointer;
	padding: 0.25rem;
}

.rt-chat__log {
	flex: 1;
	overflow-y: auto;
	padding: 1rem;
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
	background: var(--rt-surface-2);
}

.rt-chat__msg {
	max-width: 85%;
	padding: 0.6rem 0.8rem;
	border-radius: 10px;
	font-size: 0.9rem;
	line-height: 1.5;
	white-space: pre-wrap;
}

.rt-chat__msg--bot {
	background: var(--rt-surface);
	border: 1px solid var(--rt-line);
	color: var(--rt-ink);
	align-self: flex-start;
}

.rt-chat__msg--user {
	background: var(--rt-brand);
	color: #fff;
	align-self: flex-end;
}

.rt-chat__msg.is-pending { opacity: 0.6; }

.rt-chat__form {
	display: flex;
	gap: 0.5rem;
	padding: 0.7rem;
	border-top: 1px solid var(--rt-line);
}

.rt-chat__form input {
	flex: 1;
	padding: 0.6rem 0.75rem;
	border: 1px solid var(--rt-line);
	border-radius: 6px;
	font: inherit;
	font-size: 0.9rem;
}

.rt-chat__form button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	border: 0;
	border-radius: 6px;
	background: var(--rt-brand);
	color: #fff;
	cursor: pointer;
}

.rt-chat__handoff {
	display: block;
	padding: 0.7rem;
	border-top: 1px solid var(--rt-line);
	font-size: 0.83rem;
	font-weight: 600;
	text-align: center;
	color: var(--rt-brand);
	text-decoration: none;
}

/* --------------------------------------------------------- floating action */

.rt-float-wa {
	position: fixed;
	right: 18px;
	bottom: 18px;
	z-index: 85;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	border-radius: 50%;
	background: #1f8f4e;
	color: #fff;
	box-shadow: 0 12px 28px -12px rgba(16, 23, 32, 0.5);
	text-decoration: none;
}

.rt-float-wa:hover { background: #197340; color: #fff; }

/* ------------------------------------------------------------------ modals */

.rt-modal {
	position: fixed;
	inset: 0;
	z-index: 120;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
}

.rt-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(16, 23, 32, 0.55);
}

.rt-modal__box {
	position: relative;
	width: min(880px, 100%);
	max-height: 90vh;
	overflow-y: auto;
	background: var(--rt-surface);
	border-radius: 12px;
	padding: 1.5rem;
}

.rt-modal__close {
	position: absolute;
	top: 0.6rem;
	right: 0.8rem;
	background: none;
	border: 0;
	font-size: 1.6rem;
	line-height: 1;
	cursor: pointer;
	color: var(--rt-ink);
}

.rt-quickview {
	display: grid;
	gap: 1.5rem;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
}

.rt-quickview__media img {
	width: 100%;
	height: auto;
	border-radius: 8px;
	background: var(--rt-surface-2);
}

.rt-quickview__title {
	margin: 0 0 0.5rem;
	font-size: 1.25rem;
	line-height: 1.3;
}

.rt-quickview__price {
	font-size: 1.15rem;
	font-weight: 700;
	margin-bottom: 0.5rem;
}

.rt-quickview__specs {
	display: grid;
	gap: 0;
	margin: 1rem 0;
	border-top: 1px solid var(--rt-line);
}

.rt-quickview__specs > div {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.5rem 0;
	border-bottom: 1px solid var(--rt-line);
	font-size: 0.88rem;
}

.rt-quickview__specs dt { color: #5c686e; margin: 0; }
.rt-quickview__specs dd { margin: 0; font-weight: 600; text-align: right; }

.rt-quickview__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
	margin-top: 1rem;
}

/* ----------------------------------------------------------------- compare */

.rt-compare-wrap { overflow-x: auto; }

.rt-compare {
	width: 100%;
	border-collapse: collapse;
	min-width: 620px;
}

.rt-compare th,
.rt-compare td {
	padding: 0.75rem;
	border-bottom: 1px solid var(--rt-line);
	text-align: left;
	vertical-align: top;
	font-size: 0.9rem;
}

.rt-compare th[scope="row"] {
	width: 170px;
	color: #5c686e;
	font-weight: 600;
	background: var(--rt-surface-2);
}

.rt-compare__product {
	display: block;
	text-decoration: none;
	color: var(--rt-ink);
	font-weight: 600;
}

.rt-compare__product img {
	display: block;
	width: 100%;
	max-width: 150px;
	height: auto;
	margin-bottom: 0.4rem;
	background: var(--rt-surface-2);
	border-radius: 6px;
}

.rt-compare__remove {
	margin-top: 0.4rem;
	background: none;
	border: 0;
	padding: 0;
	font-size: 0.8rem;
	color: #a3341f;
	cursor: pointer;
	text-decoration: underline;
}

/* ----------------------------------------------------------------- consent */

.rt-consent {
	position: fixed;
	left: 12px;
	right: 12px;
	bottom: 12px;
	z-index: 130;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 1rem;
	padding: 1rem 1.2rem;
	background: var(--rt-ink);
	color: #fff;
	border-radius: 10px;
	box-shadow: 0 20px 48px -24px rgba(0, 0, 0, 0.6);
}

.rt-consent__text {
	flex: 1 1 320px;
	margin: 0;
	font-size: 0.87rem;
	line-height: 1.5;
}

.rt-consent__text a { color: #fff; }

.rt-consent__actions {
	display: flex;
	gap: 0.6rem;
	flex-wrap: wrap;
}

.rt-consent .rt-btn--ghost {
	border-color: rgba(255, 255, 255, 0.35);
	color: #fff;
}

.rt-consent .rt-btn--ghost:hover {
	border-color: #fff;
	color: #fff;
}

/* ------------------------------------------------------------------- toast */

.rt-toast {
	position: fixed;
	left: 50%;
	bottom: 90px;
	z-index: 140;
	transform: translate(-50%, 12px);
	padding: 0.65rem 1.1rem;
	border-radius: 999px;
	background: var(--rt-ink);
	color: #fff;
	font-size: 0.85rem;
	opacity: 0;
	transition: opacity 0.2s ease, transform 0.2s ease;
	pointer-events: none;
}

.rt-toast.is-visible {
	opacity: 1;
	transform: translate(-50%, 0);
}

/* --------------------------------------------------------------- FAQ, misc */

.rt-faq__item {
	border-bottom: 1px solid var(--rt-line);
}

.rt-faq__q {
	padding: 1rem 0;
	font-weight: 600;
	font-size: 1rem;
	cursor: pointer;
	list-style: none;
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	align-items: center;
}

.rt-faq__q::-webkit-details-marker { display: none; }

.rt-faq__q::after {
	content: "+";
	font-size: 1.3rem;
	line-height: 1;
	color: var(--rt-brand);
	flex: none;
}

.rt-faq__item[open] .rt-faq__q::after { content: "\2212"; }

.rt-faq__a {
	padding-bottom: 1rem;
	color: #4b565c;
	font-size: 0.95rem;
	line-height: 1.65;
	max-width: 68ch;
}

.rt-contact {
	display: grid;
	gap: 2.5rem;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	align-items: start;
}

.rt-contact__list {
	list-style: none;
	margin: 1.5rem 0 0;
	padding: 0;
	display: grid;
	gap: 1rem;
}

.rt-contact__label {
	display: block;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: #6d7a80;
	margin-bottom: 0.15rem;
}

.rt-contact__map {
	margin-top: 2.5rem;
	border-radius: 10px;
	overflow: hidden;
	border: 1px solid var(--rt-line);
}

.rt-contact__map iframe {
	display: block;
	width: 100%;
	height: 380px;
	border: 0;
}

.rt-social {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	list-style: none;
	margin: 1.5rem 0 0;
	padding: 0;
}

.rt-track__form {
	display: grid;
	gap: 1rem;
	max-width: 520px;
	margin-bottom: 2rem;
}

.rt-track__row {
	display: flex;
	flex-direction: column;
	gap: 0.3rem;
	margin: 0;
}

.rt-track__result {
	padding: 1.5rem;
	border: 1px solid var(--rt-line);
	border-radius: 10px;
	background: var(--rt-surface-2);
}

.rt-track__result--error {
	border-color: rgba(163, 52, 31, 0.3);
	background: rgba(163, 52, 31, 0.05);
}

.rt-track__facts {
	display: grid;
	gap: 1rem;
	grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
	margin: 1rem 0 0;
}

.rt-track__facts dt {
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: #6d7a80;
}

.rt-track__facts dd {
	margin: 0.2rem 0 0;
	font-weight: 600;
}

.rt-empty {
	padding: 3rem 1.5rem;
	text-align: center;
	border: 1px dashed var(--rt-line);
	border-radius: 10px;
}

.rt-no-scroll { overflow: hidden; }

/* ------------------------------------------------------------- responsive */

@media (max-width: 782px) {
	.rt-quickview,
	.rt-contact {
		grid-template-columns: 1fr;
	}

	.rt-enquiry__grid {
		grid-template-columns: 1fr;
	}

	.rt-chat__launcher-label {
		display: none;
	}

	.rt-chat__launcher {
		width: 52px;
		height: 52px;
		padding: 0;
		justify-content: center;
		border-radius: 50%;
	}
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.001ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.001ms !important;
		scroll-behavior: auto !important;
	}
}
