/**
 * Central de Atendimento — header dropdown + widget WhatsApp.
 */

/* ---------- Header card ---------- */
.ks-ca-header-wrap {
	position: relative;
	display: inline-block;
	font-size: 14px;
	line-height: 1.3;
}

/* Ponte entre gatilho e painel (abertura por hover). */
.ks-ca-header-wrap.is-open::before {
	content: '';
	position: absolute;
	left: 0;
	right: 0;
	top: 100%;
	height: 10px;
	z-index: 100049;
}

.ks-ca-header-trigger {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 8px;
	margin: 0;
	border: none;
	background: transparent;
	cursor: pointer;
	color: inherit;
	font: inherit;
}

.ks-ca-header-trigger:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

/* Círculo garantido mesmo com CSS global do tema a retocar img */
.ks-ca-header-att-photo-wrap {
	display: block;
	flex-shrink: 0;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	overflow: hidden;
	line-height: 0;
	margin-top: 0;
}

.ks-ca-header-att-photo-wrap .ks-ca-header-att-photo {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 0;
	vertical-align: top;
}

.ks-ca-header-trigger__chev {
	transition: transform 0.2s ease;
}

.ks-ca-header-wrap.is-open .ks-ca-header-trigger__chev {
	transform: rotate(180deg);
}

.ks-ca-header-panel {
	position: absolute;
	top: calc(100% + 10px);
	right: 0;
	min-width: 280px;
	max-width: min(340px, 92vw);
	padding: 18px 20px;
	background: #fff;
	border-radius: 10px;
	box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
	z-index: 100050;
	text-align: left;
}

.ks-ca-header-panel__beak {
	position: absolute;
	bottom: 100%;
	right: 24px;
	width: 0;
	height: 0;
	border-left: 8px solid transparent;
	border-right: 8px solid transparent;
	border-bottom: 8px solid #fff;
	filter: drop-shadow(0 -1px 1px rgba(0, 0, 0, 0.06));
}

/*
 * Conteúdo do card: secções empilhadas com separador interno (sem <hr>, evita
 * margens colapsadas e texto colado à linha).
 */
.ks-ca-header-stack {
	display: flex;
	flex-direction: column;
	gap: 0;
	min-width: 0;
}

.ks-ca-header-section {
	margin: 0;
	padding: 0;
}

.ks-ca-header-section + .ks-ca-header-section {
	margin-top: 18px;
	padding-top: 18px;
	border-top: 1px solid #e8e8e8;
}

.ks-ca-header-section__title {
	margin: 0 0 12px;
	padding: 0;
	font: inherit;
	font-weight: 700;
	font-size: 14px;
	line-height: 1.3;
	color: #111;
}

.ks-ca-header-row {
	display: flex;
	align-items: flex-start;
	gap: 12px;
}

.ks-ca-header-row__icon {
	flex-shrink: 0;
	width: 22px;
	height: 22px;
	margin-top: 2px;
	background-size: contain;
	background-repeat: no-repeat;
	background-position: center;
}

.ks-ca-header-row__icon--wa {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2325D366'%3E%3Cpath d='M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.435 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413z'/%3E%3C/svg%3E");
}

.ks-ca-header-row__icon--mail {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%23111' stroke-width='1.5' viewBox='0 0 24 24'%3E%3Cpath d='M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z'/%3E%3C/svg%3E");
}

.ks-ca-header-row__icon--clock {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%23111' stroke-width='1.5' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 3'/%3E%3C/svg%3E");
}

.ks-ca-header-row__text {
	display: flex;
	flex-direction: column;
	gap: 2px;
	font-size: 13px;
}

.ks-ca-header-wa-num {
	font-weight: 700;
	color: #111;
	text-decoration: none;
}

.ks-ca-header-wa-num:hover {
	text-decoration: underline;
}

.ks-ca-header-wa-sub {
	font-size: 12px;
	color: #555;
}

.ks-ca-header-mail {
	font-weight: 700;
	color: #111;
	text-decoration: none;
	word-break: break-all;
}

.ks-ca-header-mail:hover {
	text-decoration: underline;
}

.ks-ca-header-row__text--hours span {
	display: block;
	color: #333;
	font-size: 13px;
}

.ks-ca-header-empty {
	margin: 0;
	font-size: 13px;
	color: #666;
}

/* Gatilho mobile (modal): sem chevron */
.ks-ca-header-trigger--mobile-modal .ks-ca-header-trigger__chev {
	display: none;
}

/* Modal centrada — [ks_central_atendimento_mobile] */
.ks-ca-mobile-modal {
	display: inline-block;
	font-size: 14px;
	line-height: 1.3;
}

.ks-ca-mobile-modal__overlay {
	position: fixed;
	inset: 0;
	z-index: 100055;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
	box-sizing: border-box;
}

.ks-ca-mobile-modal__overlay[hidden] {
	display: none !important;
}

.ks-ca-mobile-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.45);
	cursor: pointer;
}

.ks-ca-mobile-modal__dialog {
	position: relative;
	z-index: 1;
	width: min(380px, 100%);
	max-height: min(85vh, 560px);
	display: flex;
	flex-direction: column;
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
	text-align: left;
	overflow: hidden;
}

.ks-ca-mobile-modal__top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 16px;
	border-bottom: 1px solid #e8e8e8;
	flex-shrink: 0;
}

.ks-ca-mobile-modal__title {
	margin: 0;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.25;
	color: #111;
}

.ks-ca-mobile-modal__close {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	margin: 0;
	padding: 0;
	border: none;
	background: transparent;
	color: #333;
	cursor: pointer;
	border-radius: 8px;
	flex-shrink: 0;
}

.ks-ca-mobile-modal__close:hover,
.ks-ca-mobile-modal__close:focus-visible {
	background: #f3f4f6;
	outline: none;
}

.ks-ca-mobile-modal__body {
	padding: 16px 18px 20px;
	overflow: auto;
	flex: 1;
	min-height: 0;
}

html.ks-ca-mobile-modal-open {
	overflow: hidden;
}

/* Aviso de feriado (header + popup) */
.ks-ca-holiday-notice,
.ks-wa-holiday-notice {
	margin: 0 0 14px;
	padding: 10px 12px;
	font-size: 13px;
	line-height: 1.45;
	font-weight: 600;
	color: #7c2d12;
	background: #ffedd5;
	border: 1px solid #fdba74;
	border-radius: 8px;
}

.ks-wa-holiday-notice {
	margin-bottom: 12px;
	color: #7c2d12;
}

/* ---------- Floating widget ---------- */
#ks-wa-widget {
	position: fixed;
	z-index: 99990;
	right: 24px;
	bottom: 24px;
	font-family: inherit;
	font-size: 14px;
	line-height: 1.4;
	box-sizing: border-box;
}

#ks-wa-widget *,
#ks-wa-widget *::before,
#ks-wa-widget *::after {
	box-sizing: border-box;
}

.ks-wa-widget__launcher {
	position: relative;
	width: 58px;
	height: 58px;
	border: none;
	border-radius: 50%;
	background: #25d366;
	cursor: pointer;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.ks-wa-widget__launcher:hover,
.ks-wa-widget__launcher:focus-visible {
	transform: scale(1.05);
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
	outline: none;
}

.ks-wa-widget__launcher-icon {
	display: block;
	width: 30px;
	height: 30px;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.435 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413z'/%3E%3C/svg%3E") center/contain no-repeat;
}

.ks-wa-widget__panel {
	position: absolute;
	bottom: calc(100% + 14px);
	right: 0;
	width: min(360px, calc(100vw - 32px));
	max-height: min(72vh, 520px);
	overflow: auto;
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.18);
}

/*
 * Visibilidade pelo estado JS (.is-panel-open no #ks-wa-widget), não só pelo atributo [hidden]:
 * evita o card sempre visível (display:flex no bloco base) e garante abertura com especificidade
 * maior que [hidden] quando o painel deve estar aberto.
 */
#ks-wa-widget:not(.is-panel-open) .ks-wa-widget__panel {
	display: none !important;
}

#ks-wa-widget.is-panel-open .ks-wa-widget__panel {
	display: flex !important;
	flex-direction: column;
}

.ks-wa-widget__head {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 14px 16px;
	background: #128c7e;
	color: #fff;
	border-radius: 12px 12px 0 0;
	flex-shrink: 0;
}

.ks-wa-widget__head-icon {
	width: 28px;
	height: 28px;
	flex-shrink: 0;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.435 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413z'/%3E%3C/svg%3E") center/contain no-repeat;
}

.ks-wa-widget__head-text {
	flex: 1;
	min-width: 0;
}

#ks-wa-widget .ks-wa-widget__title {
	margin: 0;
	font-size: 16px;
	font-weight: 700;
	color: #fff;
}

#ks-wa-widget .ks-wa-widget__subtitle {
	margin: 4px 0 0;
	font-size: 13px;
	opacity: 0.95;
	color: #fff;
}

.ks-wa-widget__close {
	margin: 0 0 0 auto;
	padding: 4px 8px;
	border: none;
	background: transparent;
	color: #fff;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	border-radius: 4px;
}

.ks-wa-widget__close:hover,
.ks-wa-widget__close:focus-visible {
	background: rgba(255, 255, 255, 0.15);
}

.ks-wa-widget__body {
	padding: 14px 16px 16px;
	overflow: auto;
	flex: 1;
}

.ks-wa-widget__empty {
	margin: 0;
	color: #666;
}

.ks-wa-card {
	display: flex;
	gap: 12px;
	padding: 12px;
	margin-bottom: 10px;
	background: #f3f4f6;
	border-radius: 10px;
	align-items: flex-start;
}

.ks-wa-card:last-of-type {
	margin-bottom: 0;
}

.ks-wa-card__photo {
	width: 56px;
	height: 56px;
	border-radius: 50%;
	object-fit: cover;
	flex-shrink: 0;
}

.ks-wa-card__photo--placeholder {
	background: #ddd;
}

.ks-wa-card__info {
	flex: 1;
	min-width: 0;
}

.ks-wa-card__name {
	margin: 0;
	font-weight: 700;
	color: #111;
	font-size: 15px;
}

.ks-wa-card__meta {
	margin: 4px 0 10px;
	font-size: 13px;
	color: #666;
}

.ks-wa-card__btn {
	display: inline-block;
	padding: 6px 14px;
	background: #25d366;
	color: #fff !important;
	text-decoration: none !important;
	border-radius: 999px;
	font-size: 13px;
	font-weight: 600;
}

.ks-wa-card__btn:hover {
	filter: brightness(1.05);
}

.ks-wa-widget__email {
	margin: 12px 0 0;
	text-align: center;
	word-break: break-all;
}

.ks-wa-widget__email a {
	color: #128c7e;
	font-weight: 600;
}

.ks-wa-widget__hours {
	margin-top: 12px;
	padding-top: 10px;
	border-top: 1px solid #e5e7eb;
	font-size: 12px;
	color: #555;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

@media (max-width: 768px) {
	#ks-wa-widget {
		right: 16px;
		bottom: 16px;
	}
}
