/* ==========================================================================
   Hazem AI — round badge, gold pulse, welcome tooltip, chat product cards.
   Extends snippet #12 (#hhz-btn / #hhz-panel) from the outside.
   Only active once hazem-widget.js adds body.h7hz (so no JS = old button).
   Brand: petrol #537B7B / #294C50, sand gold #C5A46D, cream #F7F6F0.
   ========================================================================== */

html body.h7hz #hhz-btn,
html body.h7hz #hhz-btn:hover,
html body.h7hz #hhz-btn:focus {
	width: 78px !important;
	height: 78px !important;
	padding: 0 !important;
	gap: 0 !important;
	border-radius: 50% !important;
	background: #537B7B !important;
	box-shadow: 0 10px 26px rgba(30, 59, 62, .32), 0 2px 6px rgba(30, 59, 62, .18) !important;
	overflow: visible !important;
}
html body.h7hz #hhz-btn > :not(.h7hz-badge) { display: none !important; }
html body.h7hz #hhz-btn .h7hz-badge {
	position: relative;
	display: block;
	width: 100%;
	height: 100%;
	border-radius: 50%;
}
html body.h7hz #hhz-btn .h7hz-badge img {
	display: block;
	width: 100%;
	height: 100%;
	border-radius: 50%;
	pointer-events: none;
}
html body.h7hz #hhz-btn:hover { transform: translateY(-2px) scale(1.04); }
html body.h7hz #hhz-btn:focus-visible { outline: 3px solid #C5A46D !important; outline-offset: 3px; }

/* Gold pulse: a soft ring around the gold frame every few seconds. */
html body.h7hz #hhz-btn .h7hz-badge::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: 50%;
	box-shadow: 0 0 0 0 rgba(197, 164, 109, .65);
	animation: h7hz-pulse 4.5s ease-out 2s infinite;
	pointer-events: none;
}
@keyframes h7hz-pulse {
	0%   { box-shadow: 0 0 0 0 rgba(197, 164, 109, .65); }
	22%  { box-shadow: 0 0 0 14px rgba(197, 164, 109, 0); }
	100% { box-shadow: 0 0 0 14px rgba(197, 164, 109, 0); }
}
html body.h7hz #hhz-btn.is-open .h7hz-badge::after { animation: none; }
@media (prefers-reduced-motion: reduce) {
	html body.h7hz #hhz-btn .h7hz-badge::after { animation: none; }
	html body.h7hz #hhz-btn:hover { transform: none; }
}

/* The panel opens above the (taller) round badge. */
html body.h7hz #hhz-panel { bottom: 108px !important; }

/* Welcome tooltip */
.h7hz-tip {
	position: fixed;
	left: 18px;
	bottom: 108px;
	z-index: 99998;
	max-width: min(280px, calc(100vw - 36px));
	padding: 11px 14px 11px 34px;
	border-radius: 14px;
	background: #F7F6F0;
	color: #294C50;
	border: 1px solid #C5A46D;
	box-shadow: 0 8px 22px rgba(30, 59, 62, .18);
	font: 600 14px/1.5 inherit;
	font-family: inherit;
	cursor: pointer;
	opacity: 0;
	transform: translateY(8px);
	transition: opacity .25s ease, transform .25s ease;
	pointer-events: none;
}
html[dir="rtl"] .h7hz-tip { direction: rtl; }
.h7hz-tip.is-on { opacity: 1; transform: none; pointer-events: auto; }
.h7hz-tip::after { /* little arrow pointing at the badge */
	content: "";
	position: absolute;
	left: 30px;
	bottom: -7px;
	width: 12px;
	height: 12px;
	background: #F7F6F0;
	border-right: 1px solid #C5A46D;
	border-bottom: 1px solid #C5A46D;
	transform: rotate(45deg);
}
.h7hz-tip__x {
	position: absolute;
	top: 6px;
	left: 8px;
	width: 22px;
	height: 22px;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: #537B7B;
	font-size: 16px;
	line-height: 22px;
	cursor: pointer;
	padding: 0;
}
@media (prefers-reduced-motion: reduce) { .h7hz-tip { transition: none; } }

/* Phones: a bit smaller so it never covers "add to cart". */
@media (max-width: 480px) {
	html body.h7hz #hhz-btn,
	html body.h7hz #hhz-btn:hover,
	html body.h7hz #hhz-btn:focus { width: 64px !important; height: 64px !important; }
	html body.h7hz #hhz-panel { bottom: 88px !important; }
	.h7hz-tip { left: 12px; bottom: 88px; font-size: 13px; }
}

/* ------------------------------------------------------- chat window */
/* Roomier window: 480 × 580 on desktop, brand border, soft corners. */
@media (min-width: 641px) {
	html body.h7hz #hhz-panel {
		width: 480px !important;
		height: 580px !important;
		max-width: calc(100vw - 36px) !important;
		max-height: calc(100vh - 134px) !important;
		border: 1px solid rgba(83, 123, 123, .35) !important;
		border-radius: 20px !important;
		box-shadow: 0 18px 48px rgba(30, 59, 62, .22) !important;
	}
}
@media (max-width: 640px) {
	html body.h7hz #hhz-panel { border: 1px solid rgba(83, 123, 123, .3) !important; }
}
@media (max-width: 480px) {
	html body.h7hz #hhz-panel { height: calc(100vh - 112px) !important; max-height: none !important; }
}

/* Friendly fallback line + its buttons */
#hhz-panel .h7hz-soft { background: #F7F6F0 !important; border: 1px solid #E7DCC6 !important; color: #294C50 !important; }
#hhz-panel .h7hz-acts { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 10px; align-self: stretch; }
#hhz-panel .h7hz-act {
	display: inline-flex; align-items: center; gap: 6px;
	min-height: 34px; padding: 6px 14px; border-radius: 999px;
	background: #fff; border: 1px solid #537B7B; color: #294C50 !important;
	font: 700 13px/1.2 inherit; font-family: inherit; text-decoration: none !important;
}
#hhz-panel .h7hz-act:hover { background: #EEF3F2; }
#hhz-panel .h7hz-act--wa { background: #537B7B; color: #fff !important; border-color: #537B7B; }
#hhz-panel .h7hz-act--wa::before { content: ""; width: 16px; height: 16px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 0 0-8.6 15.1L2 22l5-1.3A10 10 0 1 0 12 2zm5.3 14.1c-.2.6-1.3 1.2-1.8 1.2-.5.1-1 .2-3.3-.7-2.8-1.1-4.6-4-4.7-4.2-.1-.2-1.1-1.5-1.1-2.9s.7-2 1-2.3c.2-.3.5-.3.7-.3h.5c.2 0 .4 0 .6.5l.8 2c.1.2.1.4 0 .5l-.4.6-.4.4c-.1.1-.3.3-.1.6.2.3.8 1.3 1.7 2.1 1.2 1 2.1 1.3 2.4 1.5.3.1.5.1.6-.1l.9-1.1c.2-.3.4-.2.6-.1l1.9.9c.3.1.5.2.5.3.1.1.1.6-.2 1.1z'/%3E%3C/svg%3E") center/contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 0 0-8.6 15.1L2 22l5-1.3A10 10 0 1 0 12 2zm5.3 14.1c-.2.6-1.3 1.2-1.8 1.2-.5.1-1 .2-3.3-.7-2.8-1.1-4.6-4-4.7-4.2-.1-.2-1.1-1.5-1.1-2.9s.7-2 1-2.3c.2-.3.5-.3.7-.3h.5c.2 0 .4 0 .6.5l.8 2c.1.2.1.4 0 .5l-.4.6-.4.4c-.1.1-.3.3-.1.6.2.3.8 1.3 1.7 2.1 1.2 1 2.1 1.3 2.4 1.5.3.1.5.1.6-.1l.9-1.1c.2-.3.4-.2.6-.1l1.9.9c.3.1.5.2.5.3.1.1.1.6-.2 1.1z'/%3E%3C/svg%3E") center/contain no-repeat; }

/* ------------------------------------------------------------------ cards */
/* Shared card parts (vertical layout: image on top). */
#hhz-panel .h7hz-card {
	position: relative;
	display: flex;
	flex-direction: column;
	flex-shrink: 0;
	background: #fff;
	border: 1px solid #DDE4E1;
	border-radius: 16px;
	box-shadow: 0 2px 10px rgba(30, 59, 62, .07);
	overflow: hidden;
	color: #294C50;
	text-decoration: none;
}
#hhz-panel .h7hz-card__badge { display: none; }
#hhz-panel .h7hz-card__img { display: block; background: #F7F6F0; aspect-ratio: 1 / 1; overflow: hidden; }
#hhz-panel .h7hz-card__img img { width: 100%; height: 100%; object-fit: contain; display: block; mix-blend-mode: multiply; }
#hhz-panel .h7hz-card__body { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px 12px; flex: 1; min-width: 0; }
#hhz-panel .h7hz-card__name {
	font-weight: 700; font-size: 14px; line-height: 1.4; color: #1E3B3E; text-decoration: none;
	display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.8em;
}
#hhz-panel .h7hz-card__price { font-weight: 800; font-size: 16px; color: #B08D52; }
#hhz-panel .h7hz-card__by { font-size: 12px; color: #5E6E6C; }
#hhz-panel .h7hz-card__out { font-size: 12px; color: #9a4b1f; margin-top: auto; }
#hhz-panel .h7hz-card__btn {
	margin-top: auto; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
	min-height: 38px; padding: 8px 14px; border: 0; border-radius: 12px;
	background: #537B7B; color: #fff !important; font: 700 13px/1.2 inherit; font-family: inherit;
	text-decoration: none !important; cursor: pointer; transition: background .15s ease;
}
#hhz-panel .h7hz-card__btn:hover { background: #294C50; }
#hhz-panel .h7hz-card__btn[disabled] { opacity: .75; cursor: default; }
#hhz-panel .h7hz-card__btn.is-done { background: #294C50; }
#hhz-panel .h7hz-card__cart { font-size: 12px; color: #294C50; text-decoration: underline; text-align: center; }

/* One product → hero card across the chat width, soft gold frame. */
#hhz-panel .hhz-cards.h7hz-one { display: block !important; overflow: visible !important; flex-shrink: 0; padding: 0 0 4px; }
#hhz-panel .hhz-cards.h7hz-one > .h7hz-card {
	width: 100%; max-width: 360px; margin: 2px auto 8px;
	border: 2px solid #C5A46D; box-shadow: 0 6px 22px rgba(197, 164, 109, .22);
}
#hhz-panel .hhz-cards.h7hz-one .h7hz-card__badge {
	display: inline-flex; position: absolute; top: 10px; inset-inline-start: 10px; z-index: 1;
	padding: 4px 10px; border-radius: 999px; background: #F7F6F0; border: 1px solid #C5A46D;
	color: #294C50; font-size: 12px; font-weight: 700;
}
/* Wide picture (16:10) so the whole card — button included — fits the window. */
#hhz-panel .hhz-cards.h7hz-one .h7hz-card__img { aspect-ratio: 16 / 10; }
#hhz-panel .hhz-cards.h7hz-one .h7hz-card__name { font-size: 16px; -webkit-line-clamp: 3; min-height: 0; }
#hhz-panel .hhz-cards.h7hz-one .h7hz-card__price { font-size: 19px; }
#hhz-panel .hhz-cards.h7hz-one .h7hz-card__btn { min-height: 46px; font-size: 15px; border-radius: 14px; margin-top: 8px; }

/* 2+ products → horizontal carousel (swipe / scroll-snap, arrows on desktop). */
#hhz-panel .h7hz-car { position: relative; align-self: stretch; flex-shrink: 0; margin: 0 0 8px; }
#hhz-panel .hhz-cards.h7hz-many {
	display: flex !important; gap: 10px; overflow-x: auto !important; overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory; scroll-padding: 0 4px; padding: 2px 4px 10px; scrollbar-width: thin;
}
#hhz-panel .hhz-cards.h7hz-many > .h7hz-card { flex: 0 0 min(200px, 64%); scroll-snap-align: start; }
#hhz-panel .h7hz-car__nav {
	position: absolute; top: 34%; z-index: 2; width: 32px; height: 32px; border-radius: 50%;
	border: 1px solid #DDE4E1; background: rgba(255, 255, 255, .95); color: #294C50;
	font-size: 20px; line-height: 28px; text-align: center; cursor: pointer; padding: 0;
	box-shadow: 0 2px 8px rgba(30, 59, 62, .15);
}
#hhz-panel .h7hz-car__nav--prev { inset-inline-start: -6px; }
#hhz-panel .h7hz-car__nav--next { inset-inline-end: -6px; }
@media (hover: none) { #hhz-panel .h7hz-car__nav { display: none; } }
