/* WhatsApp chat widget (includes/whatsapp.php, assets/js/whatsapp.js). Tokens from the child
   theme design system; WhatsApp green #25d366 for the button and the start-chat action. */
.orvi-wa {
	--wa: #25d366;
	--wa-dark: #1ebe5b;
	--wa-ink: #052e16;
	position: fixed; right: 24px; bottom: 24px; z-index: 9990;
	font-family: var(--orvi-font-body, Inter, system-ui, sans-serif);
	-webkit-font-smoothing: antialiased;
}
.orvi-wa *, .orvi-wa *::before, .orvi-wa *::after { box-sizing: border-box; }

/* Round button */
.orvi-wa__fab {
	position: relative; display: grid; place-items: center;
	width: 60px; height: 60px; border-radius: 50%;
	background: var(--wa); color: #fff !important; text-decoration: none !important;
	box-shadow: 0 8px 24px rgba(7, 17, 5, .22), 0 2px 6px rgba(7, 17, 5, .12);
	transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease;
}
.orvi-wa__fab:hover { background: var(--wa-dark); transform: translateY(-2px) scale(1.03); box-shadow: 0 12px 30px rgba(7, 17, 5, .28), 0 3px 8px rgba(7, 17, 5, .14); }
.orvi-wa__fab:focus-visible { outline: 3px solid var(--orvi-ink, #071105); outline-offset: 3px; }
.orvi-wa__fab-icon { display: grid; place-items: center; transition: transform .25s ease; }
.orvi-wa__fab::before { /* soft attention ring, three pulses after load */
	content: ""; position: absolute; inset: 0; border-radius: 50%;
	box-shadow: 0 0 0 0 rgba(37, 211, 102, .55);
	animation: orvi-wa-pulse 2.4s ease-out 1.5s 3;
}
@keyframes orvi-wa-pulse { 0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, .55); } 80%, 100% { box-shadow: 0 0 0 16px rgba(37, 211, 102, 0); } }
.orvi-wa__fab-dot {
	position: absolute; top: 3px; right: 3px; width: 14px; height: 14px; border-radius: 50%;
	background: #9aa59a; border: 2.5px solid #fff;
}
.orvi-wa[data-online="1"] .orvi-wa__fab-dot, .orvi-wa[data-online="1"] .orvi-wa__dot { background: #22c55e; }

/* "Chat with us" label beside the button (desktop hover / focus) */
.orvi-wa__fab-label {
	position: absolute; right: calc(100% + 12px); top: 50%;
	padding: 9px 14px; border-radius: 999px; white-space: nowrap;
	background: #fff; color: var(--orvi-ink, #071105);
	font-size: .875rem; font-weight: 700; line-height: 1;
	box-shadow: 0 6px 20px rgba(7, 17, 5, .16);
	opacity: 0; transform: translate(6px, -50%); pointer-events: none;
	transition: opacity .2s ease, transform .2s ease;
}
.orvi-wa__fab:hover .orvi-wa__fab-label, .orvi-wa__fab:focus-visible .orvi-wa__fab-label { opacity: 1; transform: translate(0, -50%); }
.orvi-wa.is-open .orvi-wa__fab-label { display: none; }
.orvi-wa.is-open .orvi-wa__fab::before { animation: none; }

/* Chat card */
.orvi-wa__panel {
	position: absolute; right: 0; bottom: 76px; width: 360px; max-width: calc(100vw - 32px);
	border-radius: 20px; overflow: hidden; background: #fff;
	box-shadow: 0 24px 60px rgba(7, 17, 5, .28), 0 4px 14px rgba(7, 17, 5, .12);
	transform-origin: calc(100% - 30px) calc(100% + 30px);
	display: flex; flex-direction: column;
	max-height: calc(100vh - 210px); max-height: calc(100dvh - 210px); /* stays below the sticky site header */
	animation: orvi-wa-in .22s cubic-bezier(.2, .8, .3, 1);
}
.orvi-wa__panel[hidden] { display: none; }
@keyframes orvi-wa-in { from { opacity: 0; transform: translateY(10px) scale(.96); } to { opacity: 1; transform: none; } }

.orvi-wa__head {
	flex: none;
	display: flex; align-items: center; gap: 12px; padding: 16px 14px 16px 16px;
	background: linear-gradient(135deg, #0d1a0b 0%, #173015 100%); color: #fff;
}
.orvi-wa__avatar { position: relative; flex: none; width: 44px; height: 44px; border-radius: 50%; background: #fff; display: grid; place-items: center; }
.orvi-wa__avatar img { width: 36px; height: 36px; object-fit: contain; border-radius: 50%; }
.orvi-wa__dot { position: absolute; right: -1px; bottom: -1px; width: 13px; height: 13px; border-radius: 50%; background: #9aa59a; border: 2.5px solid #13240f; }
.orvi-wa__who { flex: 1; min-width: 0; display: grid; gap: 3px; }
.orvi-wa__who strong { font-family: var(--orvi-font-heading, Outfit, sans-serif); font-size: 1.0625rem; font-weight: 700; letter-spacing: .01em; color: #fff; }
.orvi-wa__status { font-size: .8125rem; line-height: 1.3; color: rgba(255, 255, 255, .8); }
.orvi-wa__close {
	flex: none; width: 36px; height: 36px; border: 0; border-radius: 50%; padding: 0;
	display: grid; place-items: center; background: rgba(255, 255, 255, .1); color: #fff; cursor: pointer;
	transition: background-color .2s;
}
.orvi-wa__close:hover { background: rgba(255, 255, 255, .2); }
.orvi-wa__close:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.orvi-wa__body {
	flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
	padding: 18px 16px 14px;
	background-color: #f2efe8;
	background-image: radial-gradient(rgba(7, 17, 5, .045) 1px, transparent 1px);
	background-size: 14px 14px;
}
.orvi-wa__bubble {
	position: relative; max-width: 92%; padding: 11px 13px 8px; border-radius: 4px 16px 16px 16px;
	background: #fff; box-shadow: 0 1px 2px rgba(7, 17, 5, .1);
	animation: orvi-wa-bubble .3s ease .12s both;
}
.orvi-wa__bubble::before { /* tail */
	content: ""; position: absolute; top: 0; left: -7px; border: 7px solid transparent; border-top-color: #fff; border-right-color: #fff; border-width: 0 8px 8px 0;
}
@keyframes orvi-wa-bubble { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.orvi-wa__bubble p { margin: 0 !important; font-size: 15px !important; line-height: 1.5; color: var(--orvi-text, #2c2e28); }
.orvi-wa__bubble b { color: var(--orvi-ink, #071105); }
.orvi-wa__time { display: block; margin-top: 4px; text-align: right; font-size: .75rem; color: var(--orvi-muted, #5f6f5b); }

.orvi-wa__quick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.orvi-wa__quick a {
	display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 999px;
	background: #fff; border: 1px solid #cfe3c4; color: var(--orvi-green-700, #3a7d00) !important;
	font-size: .8125rem; font-weight: 700; text-decoration: none !important;
	transition: background-color .2s, border-color .2s, color .2s;
}
.orvi-wa__quick a:hover { background: var(--orvi-green-700, #3a7d00); border-color: var(--orvi-green-700, #3a7d00); color: #fff !important; }
.orvi-wa__quick a:focus-visible { outline: 2px solid var(--orvi-ink, #071105); outline-offset: 2px; }

.orvi-wa__foot { flex: none; padding: 14px 16px 16px; background: #fff; }
.orvi-wa__cta {
	display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 50px;
	border-radius: 14px; background: var(--wa); color: var(--wa-ink) !important;
	font-size: 1rem; font-weight: 800; text-decoration: none !important;
	transition: background-color .2s, transform .2s;
}
.orvi-wa__cta:hover { background: var(--wa-dark); transform: translateY(-1px); }
.orvi-wa__cta:focus-visible { outline: 3px solid var(--orvi-ink, #071105); outline-offset: 2px; }
.orvi-wa__meta { margin: 10px 0 0 !important; text-align: center; font-size: 12.5px !important; line-height: 1.45; color: var(--orvi-muted, #5f6f5b); }
.orvi-wa__meta a { color: var(--orvi-ink, #071105) !important; font-weight: 700; text-decoration: none !important; }
.orvi-wa__meta a:hover { text-decoration: underline !important; }

/* Teaser bubble (desktop, once per session) */
.orvi-wa__teaser {
	position: absolute; right: 0; bottom: 76px; width: 250px; padding: 14px 34px 14px 14px;
	border-radius: 16px 16px 4px 16px; background: #fff; color: var(--orvi-text, #2c2e28);
	box-shadow: 0 12px 34px rgba(7, 17, 5, .2); cursor: pointer;
	animation: orvi-wa-in .25s cubic-bezier(.2, .8, .3, 1);
}
.orvi-wa__teaser[hidden] { display: none; }
.orvi-wa__teaser p { margin: 0; font-size: .875rem; line-height: 1.45; }
.orvi-wa__teaser b { display: block; margin-bottom: 2px; color: var(--orvi-ink, #071105); }
.orvi-wa__teaser-close {
	position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border: 0; border-radius: 50%; padding: 0;
	background: transparent; color: var(--orvi-muted, #5f6f5b); font-size: 18px; line-height: 1; cursor: pointer;
}
.orvi-wa__teaser-close:hover { background: #f1f4ee; color: var(--orvi-ink, #071105); }

/* Scroll-to-top sits above the WhatsApp button, centred on it. */
html body #gotop { right: 33px !important; bottom: 100px !important; }

@media (max-width: 767.98px) {
	.orvi-wa { right: 14px; bottom: 14px; }
	.orvi-wa__fab { width: 56px; height: 56px; }
	.orvi-wa__fab-label { display: none; }
	.orvi-wa__panel { position: fixed; right: 14px; left: 14px; bottom: 82px; width: auto; max-width: none; }
	.orvi-wa__teaser { display: none !important; }
	body.single-st_tours .orvi-wa { bottom: 86px; }
	body.single-st_tours .orvi-wa__panel { bottom: 154px; max-height: calc(100dvh - 250px); }
	html body #gotop { right: 22px !important; bottom: 82px !important; }
	html body.single-st_tours #gotop { bottom: 154px !important; }
}
body:has(#orvi-cookie:not([hidden])) .orvi-wa { bottom: 96px; }
html body:has(#orvi-cookie:not([hidden])) #gotop { bottom: 172px !important; }

/* Scroll-to-top out of the way while the chat card is open. */
body:has(.orvi-wa.is-open) #gotop { display: none !important; }

/* Hidden while the booking form is open on a phone (Traveler adds body.st_overflow): it sat on the guest name and Send booking request. */
body.st_overflow .orvi-wa, body.st_overflow #gotop { display: none !important; }

@media (prefers-reduced-motion: reduce) {
	.orvi-wa__fab::before, .orvi-wa__panel, .orvi-wa__bubble, .orvi-wa__teaser { animation: none !important; }
	.orvi-wa__fab, .orvi-wa__fab-label, .orvi-wa__cta { transition: none; }
}
@media print { .orvi-wa { display: none; } }
