/* Organik Pazar Core — WhatsApp live-chat widget. Self-contained: works with any theme. */
.opc-wa {
	--opc-wa-green: #25d366;
	--opc-wa-green-dark: #1da851;
	--opc-wa-head: #075e54;
	--opc-wa-chat: #efeae2;
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 95;
	font-family: inherit;
}

.opc-wa .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	border: 0;
	white-space: nowrap;
}

/* Launcher */
.opc-wa__toggle {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-width: 60px;
	height: 60px;
	margin-left: auto;
	padding: 0 16px;
	border-radius: 999px;
	background: var(--opc-wa-green);
	color: #fff;
	font-size: 15px;
	font-weight: 700;
	text-decoration: none;
	box-shadow: 0 10px 28px -8px rgba(0, 0, 0, 0.35);
	transition: background-color 0.2s, transform 0.2s;
}

.opc-wa__toggle:hover,
.opc-wa__toggle:focus-visible {
	background: var(--opc-wa-green-dark);
	color: #fff;
	transform: translateY(-2px);
}

.opc-wa__toggle:focus-visible {
	outline: 3px solid #fff;
	outline-offset: 2px;
	box-shadow: 0 0 0 6px var(--opc-wa-green-dark);
}

.opc-wa__icon {
	width: 30px;
	height: 30px;
	flex-shrink: 0;
}

.opc-wa__label {
	display: none;
	white-space: nowrap;
}

/* Soft pulse ring while closed — the "someone is here" cue. */
.opc-wa:not(.is-open) .opc-wa__toggle::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.55);
	animation: opc-wa-pulse 2.6s ease-out infinite;
	pointer-events: none;
}

@keyframes opc-wa-pulse {
	0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.55); }
	70% { box-shadow: 0 0 0 14px rgba(37, 211, 102, 0); }
	100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

.opc-wa__badge {
	position: absolute;
	top: -4px;
	right: -2px;
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 22px;
	height: 22px;
	padding: 0 6px;
	border: 2px solid #fff;
	border-radius: 999px;
	background: #e53935;
	color: #fff;
	font-size: 12px;
	font-weight: 800;
	line-height: 1;
}

.opc-wa__badge[hidden] {
	display: none;
}

@media (min-width: 768px) {
	.opc-wa__toggle {
		padding: 0 22px 0 16px;
	}

	.opc-wa__label {
		display: inline;
	}
}

/* Panel */
.opc-wa__panel {
	position: absolute;
	right: 0;
	bottom: calc(100% + 14px);
	display: flex;
	flex-direction: column;
	width: 360px;
	max-width: calc(100vw - 32px);
	overflow: hidden;
	border-radius: 18px;
	background: #fff;
	box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.45);
	opacity: 0;
	transform: translateY(12px) scale(0.98);
	transform-origin: bottom right;
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.opc-wa__panel[hidden] {
	display: none;
}

.opc-wa.is-open .opc-wa__panel {
	opacity: 1;
	transform: none;
}

.opc-wa__head {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 12px 14px 16px;
	background: var(--opc-wa-head);
	color: #fff;
}

.opc-wa__avatar {
	position: relative;
	display: flex;
	flex-shrink: 0;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: #fff;
	color: var(--opc-wa-green);
}

.opc-wa__avatar img {
	width: 44px;
	height: 44px;
	margin: 0;
	border-radius: 50%;
	object-fit: cover;
}

.opc-wa__avatar-icon {
	width: 26px;
	height: 26px;
}

.opc-wa__presence {
	position: absolute;
	right: 0;
	bottom: 1px;
	width: 12px;
	height: 12px;
	border: 2px solid var(--opc-wa-head);
	border-radius: 50%;
	background: #4ade80;
}

.opc-wa.is-offline .opc-wa__presence {
	background: #f5b83d;
}

.opc-wa__who {
	display: flex;
	flex: 1;
	flex-direction: column;
	min-width: 0;
	line-height: 1.3;
}

.opc-wa__who strong {
	font-size: 16px;
}

.opc-wa__status {
	font-size: 12px;
	opacity: 0.85;
}

.opc-wa__close {
	display: inline-flex;
	flex-shrink: 0;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: #fff;
	cursor: pointer;
}

.opc-wa__close:hover,
.opc-wa__close:focus-visible {
	background: rgba(255, 255, 255, 0.15);
}

.opc-wa__body {
	min-height: 150px;
	padding: 20px 16px;
	background-color: var(--opc-wa-chat);
	background-image: radial-gradient(rgba(0, 0, 0, 0.035) 1px, transparent 1px);
	background-size: 14px 14px;
}

.opc-wa__bubble {
	position: relative;
	max-width: 88%;
	padding: 8px 12px 20px;
	border-radius: 0 10px 10px 10px;
	background: #fff;
	color: #111b21;
	font-size: 14px;
	line-height: 1.45;
	box-shadow: 0 1px 1px rgba(0, 0, 0, 0.12);
	animation: opc-wa-in 0.25s ease-out;
}

.opc-wa__bubble::before {
	content: "";
	position: absolute;
	top: 0;
	left: -8px;
	border-top: 10px solid #fff;
	border-left: 8px solid transparent;
}

.opc-wa__bubble[hidden],
.opc-wa__typing[hidden] {
	display: none;
}

.opc-wa__bubble-name {
	display: block;
	margin-bottom: 2px;
	color: var(--opc-wa-head);
	font-size: 13px;
	font-weight: 700;
}

.opc-wa__time {
	position: absolute;
	right: 10px;
	bottom: 4px;
	color: #667781;
	font-size: 11px;
}

.opc-wa__typing {
	display: inline-flex;
	gap: 4px;
	padding: 12px 14px;
	border-radius: 0 10px 10px 10px;
	background: #fff;
	box-shadow: 0 1px 1px rgba(0, 0, 0, 0.12);
}

.opc-wa__typing span {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #9aa5ab;
	animation: opc-wa-dot 1s infinite ease-in-out;
}

.opc-wa__typing span:nth-child(2) { animation-delay: 0.15s; }
.opc-wa__typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes opc-wa-dot {
	0%, 60%, 100% { transform: none; opacity: 0.5; }
	30% { transform: translateY(-4px); opacity: 1; }
}

@keyframes opc-wa-in {
	from { opacity: 0; transform: translateY(6px); }
	to { opacity: 1; transform: none; }
}

.opc-wa__form {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	margin: 0;
	padding: 10px 10px 6px 12px;
	background: #fff;
}

.opc-wa__form textarea {
	flex: 1;
	min-height: 44px;
	max-height: 120px;
	margin: 0;
	padding: 11px 14px;
	border: 1px solid #e3e5e4;
	border-radius: 22px;
	background: #f7f8f7;
	color: #111b21;
	font: inherit;
	font-size: 14px;
	line-height: 1.4;
	resize: none;
}

.opc-wa__form textarea:focus {
	border-color: var(--opc-wa-green);
	outline: none;
	box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.2);
}

.opc-wa__send {
	display: inline-flex;
	flex-shrink: 0;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--opc-wa-green);
	color: #fff;
	cursor: pointer;
	transition: background-color 0.2s;
}

.opc-wa__send:hover,
.opc-wa__send:focus-visible {
	background: var(--opc-wa-green-dark);
}

.opc-wa__note {
	margin: 0;
	padding: 0 12px 10px;
	background: #fff;
	color: #8a9396;
	font-size: 11px;
	text-align: center;
}

/* Phones: slightly smaller launcher, panel fills the width. */
@media (max-width: 767px) {
	.opc-wa {
		right: 14px;
		bottom: 14px;
	}

	.opc-wa__toggle {
		min-width: 56px;
		height: 56px;
		padding: 0;
	}

	.opc-wa__panel {
		position: fixed;
		right: 12px;
		bottom: 82px;
		left: 12px;
		width: auto;
		max-width: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.opc-wa__toggle::after,
	.opc-wa__bubble,
	.opc-wa__typing span {
		animation: none !important;
	}

	.opc-wa__panel,
	.opc-wa__toggle {
		transition: none;
	}
}

@media print {
	.opc-wa {
		display: none;
	}
}
