/* HSA Routine Finder — Widget styles. Namespace .hsa-rf- pour éviter tout conflit avec le thème Blocksy. */

#hsa-rf-root {
	--hsa-rf-accent: #E6957A;
	--hsa-rf-beige: #F0E4D6;
	--hsa-rf-brown: #3D2B1F;
	--hsa-rf-text: #6B6453;
	--hsa-rf-sage: #B6B096;
	position: fixed;
	bottom: 20px;
	right: 20px;
	z-index: 99999;
	font-family: 'Nunito', sans-serif;
}

#hsa-rf-root.hsa-rf-bottom-left {
	right: auto;
	left: 20px;
}

#hsa-rf-root * {
	box-sizing: border-box;
}

/* Indispensable : sans cette règle, display:flex ci-dessous écrase l'attribut [hidden]
   et le panneau ne peut plus se fermer. */
#hsa-rf-root [hidden] {
	display: none !important;
}

.hsa-rf-bubble {
	position: relative;
	width: 60px;
	height: 60px;
	border-radius: 50%;
	background: var(--hsa-rf-accent);
	color: #fff;
	border: none;
	box-shadow: 0 4px 16px rgba(61, 43, 31, 0.25);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	transition: transform 0.2s ease;
}
.hsa-rf-bubble:hover {
	transform: scale(1.04);
}
.hsa-rf-bubble-icon {
	font-size: 24px;
	line-height: 1;
}
/* Bouton « pilule » avec texte : bien plus visible qu'une simple bulle ronde. */
.hsa-rf-bubble-pill {
	width: auto;
	height: 54px;
	padding: 0 22px 0 18px;
	border-radius: 999px;
}
.hsa-rf-bubble-label {
	font-family: 'Nunito', sans-serif;
	font-size: 15px;
	font-weight: 800;
	letter-spacing: 0.01em;
	white-space: nowrap;
}
/* Halo discret pour attirer l'œil (désactivé si la visiteuse préfère moins d'animations). */
.hsa-rf-bubble::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	box-shadow: 0 0 0 0 var(--hsa-rf-accent);
	opacity: 0.55;
	animation: hsaRfPulse 2.8s ease-out infinite;
	pointer-events: none;
}
@keyframes hsaRfPulse {
	0% { box-shadow: 0 0 0 0 var(--hsa-rf-accent); opacity: 0.55; }
	70%, 100% { box-shadow: 0 0 0 16px var(--hsa-rf-accent); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
	.hsa-rf-bubble::after { animation: none; display: none; }
	.hsa-rf-panel, .hsa-rf-teaser { animation: none !important; }
}

/* Bulle d'accroche au-dessus du bouton */
.hsa-rf-teaser {
	position: absolute;
	bottom: 68px;
	right: 0;
	width: 290px;
	max-width: calc(100vw - 24px);
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 8px 28px rgba(61, 43, 31, 0.22);
	padding: 12px 38px 12px 12px;
	animation: hsaRfSlideUp 0.35s ease;
}
#hsa-rf-root.hsa-rf-bottom-left .hsa-rf-teaser {
	right: auto;
	left: 0;
}
.hsa-rf-teaser-main {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	background: transparent;
	border: none;
	padding: 0;
	text-align: left;
	cursor: pointer;
	font-family: inherit;
}
.hsa-rf-teaser-tag {
	flex: 0 0 auto;
	border: 1px solid var(--hsa-rf-sage);
	border-radius: 999px;
	padding: 3px 10px;
	font-size: 12px;
	font-weight: 700;
	color: var(--hsa-rf-brown);
	background: #fff;
}
.hsa-rf-teaser-text {
	font-size: 13px;
	line-height: 1.35;
	color: var(--hsa-rf-brown);
}
.hsa-rf-teaser-close {
	position: absolute;
	top: 8px;
	right: 8px;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	border: none;
	background: var(--hsa-rf-beige);
	color: var(--hsa-rf-brown);
	font-size: 11px;
	cursor: pointer;
}

.hsa-rf-panel {
	position: fixed;
	bottom: 20px;
	right: 20px;
	width: 380px;
	max-width: calc(100vw - 24px);
	height: 600px;
	max-height: calc(100vh - 40px);
	background: #fff;
	border-radius: 18px;
	box-shadow: 0 12px 40px rgba(61, 43, 31, 0.3);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	animation: hsaRfSlideUp 0.25s ease;
}
#hsa-rf-root.hsa-rf-bottom-left .hsa-rf-panel {
	right: auto;
	left: 20px;
}

@keyframes hsaRfSlideUp {
	from { opacity: 0; transform: translateY(16px); }
	to { opacity: 1; transform: translateY(0); }
}

.hsa-rf-header {
	background: var(--hsa-rf-brown);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 10px 14px;
}

.hsa-rf-cart-badge {
	background: rgba(255,255,255,0.12);
	color: #fff;
	border: none;
	border-radius: 20px;
	padding: 6px 12px;
	font-size: 13px;
	cursor: pointer;
}

.hsa-rf-header-actions {
	display: flex;
	gap: 8px;
}
.hsa-rf-reset,
.hsa-rf-close {
	background: transparent;
	border: none;
	color: #fff;
	font-size: 16px;
	cursor: pointer;
	width: 30px;
	height: 30px;
	border-radius: 50%;
}
.hsa-rf-reset:hover,
.hsa-rf-close:hover {
	background: rgba(255,255,255,0.15);
}

.hsa-rf-body {
	flex: 1;
	overflow-y: auto;
	padding: 16px;
	background: var(--hsa-rf-beige);
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.hsa-rf-home {
	text-align: center;
	padding: 20px 4px;
}
.hsa-rf-greeting {
	font-family: 'Tan Meringue', serif;
	color: var(--hsa-rf-brown);
	font-size: 22px;
	margin: 0 0 4px;
}
.hsa-rf-subtext {
	color: var(--hsa-rf-text);
	font-size: 14px;
	margin: 0 0 18px;
}

.hsa-rf-quick-buttons {
	display: flex;
	flex-direction: column;
	gap: 10px;
}
.hsa-rf-quick-btn {
	display: flex;
	align-items: center;
	gap: 10px;
	background: #fff;
	border: 1px solid var(--hsa-rf-sage);
	border-radius: 12px;
	padding: 12px 14px;
	cursor: pointer;
	text-align: left;
	transition: border-color 0.15s ease;
}
.hsa-rf-quick-btn:hover {
	border-color: var(--hsa-rf-accent);
}
.hsa-rf-quick-icon {
	font-size: 18px;
}
.hsa-rf-quick-label {
	flex: 1;
	color: var(--hsa-rf-brown);
	font-weight: 600;
	font-size: 14px;
}
.hsa-rf-quick-arrow {
	color: var(--hsa-rf-accent);
}

.hsa-rf-msg {
	max-width: 85%;
	padding: 10px 14px;
	border-radius: 14px;
	font-size: 14px;
	line-height: 1.4;
}
.hsa-rf-msg-user {
	align-self: flex-end;
	background: var(--hsa-rf-accent);
	color: #fff;
	border-bottom-right-radius: 4px;
}
.hsa-rf-msg-ai {
	align-self: flex-start;
	background: #fff;
	color: var(--hsa-rf-brown);
	border-bottom-left-radius: 4px;
}
.hsa-rf-msg-error {
	align-self: flex-start;
	background: #fbe3e3;
	color: #8a2c2c;
	border-radius: 12px;
}

.hsa-rf-typing span {
	display: inline-block;
	width: 6px;
	height: 6px;
	margin-right: 3px;
	border-radius: 50%;
	background: var(--hsa-rf-sage);
	animation: hsaRfBlink 1.2s infinite ease-in-out;
}
.hsa-rf-typing span:nth-child(2) { animation-delay: 0.2s; }
.hsa-rf-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes hsaRfBlink {
	0%, 80%, 100% { opacity: 0.3; }
	40% { opacity: 1; }
}

.hsa-rf-carousel-wrap {
	position: relative;
	display: flex;
	align-items: center;
}
.hsa-rf-carousel-track {
	display: flex;
	gap: 10px;
	overflow-x: auto;
	scroll-behavior: smooth;
	padding-bottom: 4px;
}
.hsa-rf-carousel-next {
	position: absolute;
	right: -6px;
	background: #fff;
	border: 1px solid var(--hsa-rf-sage);
	border-radius: 50%;
	width: 28px;
	height: 28px;
	cursor: pointer;
	font-size: 16px;
	color: var(--hsa-rf-brown);
}

.hsa-rf-card {
	flex: 0 0 150px;
	background: #fff;
	border-radius: 12px;
	padding: 10px;
	display: flex;
	flex-direction: column;
	gap: 4px;
	box-shadow: 0 2px 8px rgba(61, 43, 31, 0.08);
}
.hsa-rf-card-img-wrap {
	position: relative;
}
.hsa-rf-card-img {
	width: 100%;
	height: 110px;
	object-fit: cover;
	border-radius: 8px;
	cursor: pointer;
}
.hsa-rf-card-zoom {
	position: absolute;
	top: 6px;
	right: 6px;
	background: rgba(255,255,255,0.85);
	border: none;
	border-radius: 50%;
	width: 24px;
	height: 24px;
	font-size: 11px;
	cursor: pointer;
}
.hsa-rf-card-name {
	font-size: 13px;
	font-weight: 700;
	color: var(--hsa-rf-brown);
	line-height: 1.3;
}
.hsa-rf-card-benefit {
	font-size: 11px;
	color: var(--hsa-rf-text);
	line-height: 1.3;
	min-height: 28px;
}
.hsa-rf-card-price {
	font-size: 13px;
	font-weight: 700;
	color: var(--hsa-rf-accent);
}
.hsa-rf-card-add {
	margin-top: 4px;
	background: var(--hsa-rf-brown);
	color: #fff;
	border: none;
	border-radius: 8px;
	padding: 7px 8px;
	font-size: 12px;
	cursor: pointer;
}
.hsa-rf-card-add:hover {
	background: var(--hsa-rf-accent);
}
.hsa-rf-card-add:disabled {
	opacity: 0.7;
	cursor: default;
}

.hsa-rf-suggestions-label {
	font-size: 12px;
	color: var(--hsa-rf-text);
	margin-bottom: 6px;
}
.hsa-rf-suggestions-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}
.hsa-rf-suggestion-chip {
	background: #fff;
	border: 1px solid var(--hsa-rf-sage);
	border-radius: 16px;
	padding: 6px 12px;
	font-size: 12px;
	color: var(--hsa-rf-brown);
	cursor: pointer;
}
.hsa-rf-suggestion-chip:hover {
	border-color: var(--hsa-rf-accent);
	color: var(--hsa-rf-accent);
}

.hsa-rf-input-row {
	display: flex;
	gap: 8px;
	padding: 12px;
	border-top: 1px solid var(--hsa-rf-beige);
	background: #fff;
}
.hsa-rf-input {
	flex: 1;
	border: 1px solid var(--hsa-rf-sage);
	border-radius: 20px;
	padding: 10px 16px;
	font-size: 14px;
	font-family: inherit;
}
.hsa-rf-input:focus {
	outline: none;
	border-color: var(--hsa-rf-accent);
}
.hsa-rf-send {
	background: var(--hsa-rf-accent);
	color: #fff;
	border: none;
	border-radius: 20px;
	padding: 10px 18px;
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
}
.hsa-rf-send:hover {
	opacity: 0.9;
}

/* Mobile-first : le site fait ~82% de trafic mobile */
@media (max-width: 480px) {
	.hsa-rf-panel {
		width: 100vw;
		max-width: 100vw;
		height: 100vh;
		max-height: 100vh;
		bottom: 0;
		right: 0;
		left: 0;
		border-radius: 0;
	}
	#hsa-rf-root.hsa-rf-bottom-left .hsa-rf-panel {
		left: 0;
	}
	#hsa-rf-root {
		bottom: 76px; /* repli : au-dessus d'un menu mobile typique (affiné en JS) */
		right: 12px;
	}
}


/* ---- v1.2 : accueil compact, cartes, fiches intégrées au chat, mini-panier ---- */
.hsa-rf-home-compact { padding: 8px 4px; }
.hsa-rf-home-compact .hsa-rf-subtext { margin-bottom: 12px; }
.hsa-rf-home-compact .hsa-rf-quick-buttons { gap: 8px; }
.hsa-rf-home-compact .hsa-rf-quick-btn { padding: 10px 14px; }

.hsa-rf-cart-badge { font-family: inherit; }

.hsa-rf-card-tag {
	position: absolute;
	top: 6px;
	left: 6px;
	background: var(--hsa-rf-brown);
	color: #fff;
	font-size: 10px;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	padding: 2px 8px;
	border-radius: 999px;
}
.hsa-rf-card-name { cursor: pointer; }
.hsa-rf-price-old { color: var(--hsa-rf-text); font-weight: 400; opacity: 0.7; margin-right: 2px; }
.hsa-rf-card-link {
	background: transparent;
	border: none;
	padding: 2px 0;
	text-align: left;
	font-family: inherit;
	font-size: 11px;
	font-weight: 700;
	color: var(--hsa-rf-brown);
	text-decoration: underline;
	cursor: pointer;
}

.hsa-rf-sheet {
	position: absolute;
	inset: 0;
	z-index: 5;
	background: #fff;
	display: flex;
	flex-direction: column;
	animation: hsaRfSlideUp 0.2s ease;
}
.hsa-rf-sheet-head {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 14px;
	background: var(--hsa-rf-brown);
	color: #fff;
}
.hsa-rf-sheet-back {
	background: rgba(255,255,255,0.14);
	color: #fff;
	border: none;
	border-radius: 999px;
	padding: 6px 12px;
	font-family: inherit;
	font-size: 13px;
	font-weight: 700;
	cursor: pointer;
}
.hsa-rf-sheet-title { font-size: 13px; opacity: 0.9; }
.hsa-rf-sheet-body {
	flex: 1;
	overflow-y: auto;
	padding: 16px;
	color: var(--hsa-rf-text);
	font-size: 14px;
}
.hsa-rf-busy { opacity: 0.55; pointer-events: none; }
.hsa-rf-sheet-img {
	width: 100%;
	max-height: 230px;
	object-fit: contain;
	background: var(--hsa-rf-beige);
	border-radius: 14px;
}
.hsa-rf-sheet-name {
	margin-top: 12px;
	font-family: 'Tan Meringue', serif;
	font-size: 19px;
	line-height: 1.25;
	color: var(--hsa-rf-brown);
}
.hsa-rf-sheet-price { font-size: 16px; margin-top: 4px; }
.hsa-rf-sheet-reason {
	margin: 10px 0 0;
	padding: 10px 12px;
	background: var(--hsa-rf-beige);
	border-radius: 10px;
	color: var(--hsa-rf-brown);
	font-size: 13px;
}
.hsa-rf-sheet-h {
	margin: 16px 0 6px;
	font-size: 12px;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--hsa-rf-brown);
}
.hsa-rf-sheet-p { margin: 0; line-height: 1.5; }
.hsa-rf-sheet-actions {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-top: 18px;
}
.hsa-rf-sheet-add {
	display: block;
	text-align: center;
	background: var(--hsa-rf-brown);
	color: #fff;
	border: none;
	border-radius: 12px;
	padding: 13px 16px;
	font-family: inherit;
	font-size: 14px;
	font-weight: 800;
	text-decoration: none;
	cursor: pointer;
}
.hsa-rf-sheet-add:hover { background: var(--hsa-rf-accent); color: #fff; }
.hsa-rf-sheet-add:disabled { opacity: 0.7; cursor: default; }
.hsa-rf-sheet-full {
	display: block;
	text-align: center;
	color: var(--hsa-rf-brown);
	font-size: 13px;
	font-weight: 700;
	text-decoration: underline;
	padding: 6px;
}

.hsa-rf-pack-list {
	border: 1px solid var(--hsa-rf-beige);
	border-radius: 12px;
	overflow: hidden;
}
.hsa-rf-pack-item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 9px 10px;
	text-decoration: none;
	color: var(--hsa-rf-brown);
	border-top: 1px solid var(--hsa-rf-beige);
}
.hsa-rf-pack-item:first-child { border-top: none; }
.hsa-rf-pack-n {
	flex: 0 0 22px;
	height: 22px;
	border-radius: 50%;
	background: var(--hsa-rf-beige);
	font-size: 11px;
	font-weight: 800;
	display: flex;
	align-items: center;
	justify-content: center;
}
.hsa-rf-pack-item img { width: 40px; height: 40px; object-fit: cover; border-radius: 8px; }
.hsa-rf-pack-name { flex: 1; font-size: 13px; font-weight: 700; line-height: 1.3; }
.hsa-rf-pack-price { font-size: 13px; font-weight: 700; white-space: nowrap; }

.hsa-rf-cart-list { display: flex; flex-direction: column; }
.hsa-rf-cart-item {
	display: flex;
	gap: 10px;
	align-items: center;
	padding: 10px 0;
	border-bottom: 1px solid var(--hsa-rf-beige);
}
.hsa-rf-cart-item img { width: 56px; height: 56px; object-fit: cover; border-radius: 10px; }
.hsa-rf-cart-info { flex: 1; min-width: 0; }
.hsa-rf-cart-name {
	display: block;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.3;
	color: var(--hsa-rf-brown);
	text-decoration: none;
}
.hsa-rf-qty { display: inline-flex; align-items: center; gap: 10px; margin-top: 6px; }
.hsa-rf-qty button {
	width: 26px;
	height: 26px;
	border-radius: 50%;
	border: 1px solid var(--hsa-rf-sage);
	background: #fff;
	color: var(--hsa-rf-brown);
	font-size: 15px;
	line-height: 1;
	cursor: pointer;
}
.hsa-rf-cart-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.hsa-rf-cart-total { font-size: 13px; font-weight: 800; color: var(--hsa-rf-brown); white-space: nowrap; }
.hsa-rf-cart-remove {
	background: transparent;
	border: none;
	font-size: 17px;
	cursor: pointer;
	padding: 2px 4px;
	border-radius: 8px;
}
.hsa-rf-cart-remove:hover { background: var(--hsa-rf-beige); }
.hsa-rf-cart-subtotal {
	display: flex;
	justify-content: space-between;
	margin-top: 14px;
	font-size: 15px;
	color: var(--hsa-rf-brown);
}

@media (max-width: 480px) {
	.hsa-rf-teaser { width: min(290px, calc(100vw - 24px)); }
	.hsa-rf-bubble-pill { height: 50px; padding: 0 18px 0 14px; }
	.hsa-rf-bubble-label { font-size: 14px; }
}

.hsa-rf-add-msg {
	margin-top: 4px;
	padding: 7px 10px;
	background: #fbe3e3;
	color: #8a2c2c;
	border-radius: 8px;
	font-size: 12px;
	line-height: 1.35;
}

.hsa-rf-opt {
	width: 100%;
	margin-top: 6px;
	padding: 9px 10px;
	border: 1px solid var(--hsa-rf-sage);
	border-radius: 10px;
	background: #fff;
	color: var(--hsa-rf-brown);
	font-family: inherit;
	font-size: 13px;
}
.hsa-rf-opt:focus { outline: none; border-color: var(--hsa-rf-accent); }
.hsa-rf-pack-mid { flex: 1; min-width: 0; }
.hsa-rf-pack-item-opt { align-items: flex-start; }
.hsa-rf-opt-hint { margin-top: 8px; font-size: 12px; }
