/* OutdoorTrend Chat 0.4.0 - colours come from the settings as --otc-primary / --otc-accent. */
.otc-root {
	--otc-primary: #16221d;
	--otc-accent: #e2672a;
	--otc-bg: #ffffff;
	--otc-soft: #f6f6f4;
	--otc-bubble: #f1f1ee;
	--otc-line: #e8e8e4;
	--otc-text: #1b2420;
	--otc-muted: #6b736f;
	--otc-online: #3ec27a;
	--otc-lift: 0px;
	position: fixed;
	right: 20px;
	bottom: calc(20px + var(--otc-lift));
	z-index: 9995; /* above the product buy bar (9990), below the lightbox and phone menu */
	font-family: inherit;
	font-size: 15px;
	line-height: 1.5;
	color: var(--otc-text);
	transition: bottom .2s ease;
	-webkit-font-smoothing: antialiased;
}
.otc-root.otc-pos-left { right: auto; left: 20px; }
.otc-root *, .otc-root *::before, .otc-root *::after { box-sizing: border-box; }
.otc-root svg { width: 20px; height: 20px; fill: currentColor; display: block; }
.otc-root button { font: inherit; }

/* ---------- launcher ---------- */
.otc-launcher {
	position: relative;
	width: 56px; height: 56px; border-radius: 50%;
	border: 0; cursor: pointer; padding: 0;
	background: var(--otc-primary); color: #fff;
	display: flex; align-items: center; justify-content: center;
	box-shadow: 0 8px 24px rgba(22, 34, 29, .28), 0 2px 6px rgba(22, 34, 29, .18);
	margin-left: auto;
	transition: transform .18s ease, box-shadow .18s ease;
}
.otc-pos-left .otc-launcher { margin-left: 0; }
.otc-launcher:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(22, 34, 29, .32), 0 3px 8px rgba(22, 34, 29, .2); }
.otc-launcher svg { width: 26px; height: 26px; position: absolute; transition: opacity .18s ease, transform .22s ease; }
.otc-launcher .otc-ico-close { opacity: 0; transform: rotate(-90deg) scale(.6); }
.otc-is-open .otc-launcher .otc-ico-chat { opacity: 0; transform: rotate(90deg) scale(.6); }
.otc-is-open .otc-launcher .otc-ico-close { opacity: 1; transform: none; }
.otc-launcher::after { /* small "online" dot */
	content: ""; position: absolute; top: 3px; right: 3px; width: 12px; height: 12px; border-radius: 50%;
	background: var(--otc-online); border: 2px solid #fff;
}
.otc-is-open .otc-launcher::after { display: none; }

.otc-root button:focus-visible, .otc-root a:focus-visible, .otc-log:focus-visible {
	outline: 2px solid var(--otc-accent); outline-offset: 2px;
}

/* ---------- panel ---------- */
.otc-panel {
	position: absolute; bottom: 70px; right: 0;
	width: 392px; max-width: calc(100vw - 32px);
	height: 620px; max-height: calc(100vh - 110px - var(--otc-lift));
	background: var(--otc-bg);
	border-radius: 20px;
	box-shadow: 0 24px 64px rgba(16, 24, 20, .22), 0 4px 16px rgba(16, 24, 20, .08);
	display: flex; flex-direction: column; overflow: hidden;
	transform-origin: bottom right;
	animation: otc-in .22s cubic-bezier(.2, .9, .3, 1.1);
}
.otc-panel[hidden] { display: none; }
.otc-pos-left .otc-panel { right: auto; left: 0; transform-origin: bottom left; }
@keyframes otc-in { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: none; } }

/* ---------- header ---------- */
.otc-head {
	display: flex; align-items: center; gap: 12px;
	padding: 16px 12px 16px 18px;
	background: var(--otc-primary); color: #fff;
}
.otc-avatar {
	position: relative; flex: none;
	width: 40px; height: 40px; border-radius: 50%;
	background: rgba(255, 255, 255, .12);
	display: flex; align-items: center; justify-content: center;
}
.otc-avatar svg { width: 22px; height: 22px; }
.otc-avatar::after {
	content: ""; position: absolute; right: 0; bottom: 0; width: 11px; height: 11px; border-radius: 50%;
	background: var(--otc-online); border: 2px solid var(--otc-primary);
}
.otc-head-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.otc-title { font-weight: 700; font-size: 16px; line-height: 1.25; letter-spacing: -.01em; }
.otc-sub { font-size: 12.5px; opacity: .72; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.otc-head-actions { display: flex; gap: 2px; }
.otc-icon-btn {
	width: 36px; height: 36px; border: 0; border-radius: 50%; cursor: pointer; padding: 0;
	background: transparent; color: #fff; display: flex; align-items: center; justify-content: center;
	opacity: .85; text-decoration: none; transition: background .15s ease, opacity .15s ease;
}
.otc-icon-btn:hover { background: rgba(255, 255, 255, .14); opacity: 1; }
.otc-icon-btn svg { width: 19px; height: 19px; }

.otc-test {
	background: #fff6dc; color: #7a5900; font-size: 11.5px; font-weight: 600;
	text-align: center; padding: 5px 8px; letter-spacing: .01em;
}

/* ---------- messages ---------- */
.otc-log {
	flex: 1; overflow-y: auto; padding: 18px 16px 8px;
	background: var(--otc-bg);
	display: flex; flex-direction: column; gap: 6px;
	overscroll-behavior: contain;
}
/* thin bar without arrow buttons; it shows only while hovering the messages */
.otc-log::-webkit-scrollbar { width: 6px; }
.otc-log::-webkit-scrollbar-button { display: none; height: 0; }
.otc-log::-webkit-scrollbar-track { background: transparent; }
.otc-log::-webkit-scrollbar-thumb { background: transparent; border-radius: 3px; }
.otc-log:hover::-webkit-scrollbar-thumb { background: #d6d6d0; }
@supports not selector(::-webkit-scrollbar) {
	.otc-log { scrollbar-width: thin; scrollbar-color: #d6d6d0 transparent; }
}

.otc-day { align-self: center; font-size: 11.5px; color: var(--otc-muted); margin: 0 0 6px; }

.otc-msg { max-width: 85%; padding: 10px 14px; border-radius: 18px; word-wrap: break-word; overflow-wrap: anywhere; font-size: 14.5px; }
.otc-bot { align-self: flex-start; background: var(--otc-bubble); border-bottom-left-radius: 6px; }
.otc-user { align-self: flex-end; background: var(--otc-primary); color: #fff; border-bottom-right-radius: 6px; white-space: pre-wrap; margin-top: 8px; }
.otc-user + .otc-bot, .otc-cards + .otc-user { margin-top: 8px; }
.otc-fallback { background: #fff4ea; }
.otc-text p { margin: 0 0 8px; }
.otc-text p:last-child { margin-bottom: 0; }
.otc-text ul { margin: 4px 0 8px; padding-left: 18px; }
.otc-text ul:last-child { margin-bottom: 0; }
.otc-text li { margin: 3px 0; }
.otc-text strong { font-weight: 650; }
.otc-text a { color: var(--otc-accent); text-decoration: underline; text-underline-offset: 2px; }

.otc-typing { display: flex; gap: 5px; align-items: center; padding: 14px 16px; }
.otc-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--otc-muted); opacity: .35; animation: otc-blink 1.2s infinite; }
.otc-typing span:nth-child(2) { animation-delay: .2s; }
.otc-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes otc-blink { 0%, 80%, 100% { opacity: .25; transform: none; } 40% { opacity: .9; transform: translateY(-2px); } }

/* ---------- product cards ---------- */
.otc-cards { display: flex; flex-direction: column; gap: 8px; align-self: stretch; margin: 4px 0 2px; }
.otc-card {
	display: flex; gap: 12px; align-items: center; padding: 8px 12px 8px 8px;
	background: #fff; border: 1px solid var(--otc-line); border-radius: 14px;
	color: var(--otc-text); text-decoration: none;
	transition: border-color .15s ease, box-shadow .15s ease;
}
.otc-card:hover { border-color: #d3d3cc; box-shadow: 0 4px 14px rgba(16, 24, 20, .08); }
.otc-card img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; flex: none; background: var(--otc-soft); }
.otc-card-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.otc-card-name { font-weight: 600; font-size: 14px; line-height: 1.3; }
.otc-card-price { font-size: 13.5px; color: var(--otc-muted); }
.otc-card-price strong { color: var(--otc-text); font-weight: 700; }
.otc-card-price s { font-size: 12px; }
.otc-card-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 2px; }
.otc-tag { font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: var(--otc-soft); color: var(--otc-muted); letter-spacing: .02em; text-transform: uppercase; }
.otc-tag-sale { background: var(--otc-accent); color: #fff; }
.otc-card-go { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--otc-soft); color: var(--otc-text); display: flex; align-items: center; justify-content: center; }
.otc-card:hover .otc-card-go { background: var(--otc-primary); color: #fff; }
.otc-card-go svg { width: 16px; height: 16px; }

/* ---------- composer ---------- */
.otc-foot { padding: 10px 14px 10px; background: var(--otc-bg); border-top: 1px solid var(--otc-line); }
.otc-form {
	display: flex; gap: 6px; align-items: flex-end;
	padding: 5px 5px 5px 16px;
	background: var(--otc-soft); border: 1px solid transparent; border-radius: 24px;
	transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.otc-form:focus-within { background: #fff; border-color: #cfcfc8; box-shadow: 0 0 0 3px rgba(22, 34, 29, .06); }
.otc-input {
	flex: 1; resize: none; min-height: 36px; max-height: 120px;
	padding: 7px 0; border: 0; outline: 0; background: transparent;
	font: inherit; font-size: 16px; /* 16px: no zoom on iPhone */ line-height: 1.4; color: var(--otc-text);
}
.otc-input::placeholder { color: #8c938f; }
/* the shop theme styles every textarea (border, focus ring) - reset it inside the chat */
#otc-root .otc-input, #otc-root .otc-input:focus, #otc-root .otc-input:hover {
	border: 0 !important; outline: 0 !important; box-shadow: none !important; background: transparent !important;
	border-radius: 0 !important; margin: 0 !important; width: auto !important;
	padding: 7px 0 !important; min-height: 36px !important; font-size: 16px !important; line-height: 1.4 !important;
	overflow-y: hidden; scrollbar-width: none; /* no arrow scrollbar; chat.js switches to auto past 120 px */
}
#otc-root .otc-input::-webkit-scrollbar { width: 0; height: 0; }
.otc-send {
	width: 36px; height: 36px; flex: none; border: 0; border-radius: 50%; cursor: pointer; padding: 0;
	background: var(--otc-primary); color: #fff; display: flex; align-items: center; justify-content: center;
	transition: background .15s ease, opacity .15s ease, transform .15s ease;
}
.otc-send svg { width: 18px; height: 18px; }
.otc-send.otc-empty { background: #cfd2cf; cursor: default; }
.otc-send:not(.otc-empty):hover { background: var(--otc-accent); }
.otc-send:disabled { opacity: .55; cursor: wait; }
.otc-meta {
	display: flex; justify-content: space-between; gap: 10px; align-items: center;
	font-size: 11px; color: var(--otc-muted); padding: 8px 4px 0; line-height: 1.35;
}
.otc-meta a { color: var(--otc-muted); text-decoration: underline; text-underline-offset: 2px; white-space: nowrap; }
.otc-meta a:hover { color: var(--otc-text); }

/* ---------- cookie badge ----------
   While the chat is on the page, the floating CookieScript badge is not shown (two floating buttons covered the
   product page). The visitor changes consent with "Cookie-indstillinger" in the footer, added by chat.js next to
   "Cookiepolitik". Pages without the chat (cart, checkout) keep the badge. */
html body.otc-on-right #cookiescript_badge, html body.otc-on-left #cookiescript_badge { display: none !important; }

/* ---------- protect the chat's colours from the shop theme's button styles ---------- */
#otc-root .otc-launcher, #otc-root .otc-launcher:hover, #otc-root .otc-launcher:focus, #otc-root .otc-launcher:active {
	background: var(--otc-primary) !important; color: #fff !important; border: 0 !important; padding: 0 !important;
	border-radius: 50% !important; outline: none;
}
/* thin light ring: the dark button stays visible on dark photos (front page hero) */
#otc-root .otc-launcher { box-shadow: 0 0 0 2px rgba(255, 255, 255, .9), 0 8px 24px rgba(22, 34, 29, .28), 0 2px 6px rgba(22, 34, 29, .18); }
#otc-root .otc-icon-btn, #otc-root .otc-icon-btn:hover, #otc-root .otc-icon-btn:focus, #otc-root .otc-icon-btn:active {
	color: #fff !important; border: 0 !important; padding: 0 !important; border-radius: 50% !important; box-shadow: none !important;
}
#otc-root .otc-icon-btn, #otc-root .otc-icon-btn:focus:not(:hover) { background: transparent !important; }
#otc-root .otc-icon-btn:hover { background: rgba(255, 255, 255, .14) !important; }
#otc-root .otc-send, #otc-root .otc-send:focus { background: var(--otc-primary) !important; color: #fff !important; border: 0 !important; padding: 0 !important; border-radius: 50% !important; }
#otc-root .otc-send:not(.otc-empty):hover { background: var(--otc-accent) !important; }
#otc-root .otc-send.otc-empty { background: #cfd2cf !important; }
#otc-root .otc-launcher:focus-visible, #otc-root .otc-send:focus-visible, #otc-root .otc-icon-btn:focus-visible {
	outline: 2px solid var(--otc-accent) !important; outline-offset: 3px;
}

/* phone: page behind the open full-screen chat is locked (no scrolling, nothing showing through) */
html.otc-lock, html.otc-lock body { overflow: hidden !important; overscroll-behavior: none; }

/* ---------- phone ---------- */
@media (max-width: 520px) {
	/* raised off the screen edge (iPhone home bar / browser toolbar), never lower than 28 px */
	.otc-root { right: 16px; bottom: calc(max(28px, env(safe-area-inset-bottom, 0px) + 18px) + var(--otc-lift)); }
	.otc-root.otc-pos-left { left: 16px; }
	.otc-launcher { width: 52px; height: 52px; }
	.otc-launcher svg { width: 24px; height: 24px; }
	.otc-root.otc-is-open { inset: 0; }
	.otc-is-open .otc-launcher { display: none; }
	.otc-is-open .otc-panel {
		position: fixed; left: 0; right: 0; bottom: auto;
		top: var(--otc-vtop, 0px); height: var(--otc-vh, 100%);
		width: 100%; max-width: none; max-height: none;
		border-radius: 0; animation: otc-in-m .2s ease-out;
	}
	.otc-head { padding-top: max(14px, env(safe-area-inset-top, 0px)); }
	.otc-foot { padding-bottom: max(10px, env(safe-area-inset-bottom, 0px)); }
	.otc-msg { max-width: 88%; }
}
/* phone: fade only - a slide could leave the input below the screen edge if the animation is paused */
/* small phones (360 px): header text must fit without "…" */
@media (max-width: 380px) {
	.otc-head { gap: 8px; padding-left: 12px; padding-right: 6px; }
	.otc-avatar { width: 34px; height: 34px; }
	.otc-avatar svg { width: 19px; height: 19px; }
	.otc-title { font-size: 15px; }
	.otc-sub { font-size: 11.5px; }
	.otc-icon-btn { width: 34px; height: 34px; }
}
@keyframes otc-in-m { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
	.otc-root, .otc-launcher, .otc-launcher svg { transition: none; }
	.otc-panel, .otc-is-open .otc-panel { animation: none; }
	.otc-typing span { animation: none; opacity: .7; }
}
@media print { .otc-root { display: none !important; } }
