/**
 * Machu Picchu Terra VIP – WhatsApp Premium
 * Estilos Frontend (Prefijo exclusivo: mtv-wa-)
 * Paleta: #1E2319 (Verde oscuro), #C8A46A (Dorado), #8D9B63 (Verde oliva), #FFFFFF (Blanco), #FCFBF7 (Marfil)
 */

.mtv-wa-widget-wrap {
	position: fixed;
	z-index: 999999;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	line-height: 1.4;
	box-sizing: border-box;
}

.mtv-wa-widget-wrap * {
	box-sizing: border-box;
}

/* ==========================================================================
   1. BOTÓN FLOTANTE PRINCIPAL
   ========================================================================== */
.mtv-wa-btn-container {
	position: relative;
	display: inline-block;
}

.mtv-wa-floating-btn {
	position: relative;
	border-radius: 50%;
	background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
	border: 2px solid #C8A46A;
	color: #FFFFFF;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: 0 8px 25px rgba(18, 140, 126, 0.4), 0 4px 12px rgba(30, 35, 25, 0.25);
	transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
	outline: none;
	padding: 0;
	z-index: 10;
}

.mtv-wa-floating-btn:hover {
	transform: scale(1.08) rotate(4deg);
	box-shadow: 0 12px 30px rgba(18, 140, 126, 0.5), 0 6px 16px rgba(200, 164, 106, 0.4);
	border-color: #FFFFFF;
}

.mtv-wa-floating-btn:active {
	transform: scale(0.95);
}

.mtv-wa-icon-box {
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.3s ease;
}

.mtv-wa-floating-btn.active .mtv-wa-icon-box {
	transform: rotate(90deg);
}

.mtv-wa-icon-svg {
	width: 34px !important;
	height: 34px !important;
	max-width: 34px !important;
	max-height: 34px !important;
	fill: #FFFFFF !important;
}

/* Anillo de pulso continuo */
.mtv-wa-pulse-glow {
	position: absolute;
	top: -6px;
	left: -6px;
	right: -6px;
	bottom: -6px;
	border-radius: 50%;
	border: 2px solid #25D366;
	animation: mtvWaPulseRing 2.4s infinite cubic-bezier(0.215, 0.61, 0.355, 1);
	pointer-events: none;
	z-index: -1;
}

@keyframes mtvWaPulseRing {
	0% {
		transform: scale(0.9);
		opacity: 0.9;
	}
	70% {
		transform: scale(1.35);
		opacity: 0;
	}
	100% {
		transform: scale(1.35);
		opacity: 0;
	}
}

/* Indicador de Disponibilidad en el Botón */
.mtv-wa-online-badge {
	position: absolute;
	top: 2px;
	right: 2px;
	width: 14px;
	height: 14px;
	background-color: #4ADE80;
	border: 2px solid #1E2319;
	border-radius: 50%;
	z-index: 12;
}

/* Tooltip */
.mtv-wa-tooltip {
	position: absolute;
	top: 50%;
	right: calc(100% + 14px);
	transform: translateY(-50%);
	background: #1E2319;
	color: #FCFBF7;
	border: 1px solid #C8A46A;
	padding: 8px 14px;
	border-radius: 20px;
	font-size: 13px;
	font-weight: 600;
	white-space: nowrap;
	box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
	pointer-events: none;
	opacity: 0;
	visibility: hidden;
	transition: all 0.3s ease;
	z-index: 9;
}

.mtv-wa-btn-container:hover .mtv-wa-tooltip {
	opacity: 1;
	visibility: visible;
	transform: translateY(-50%) translateX(-4px);
}

.mtv-wa-widget-wrap[data-position="bottom-left"] .mtv-wa-tooltip {
	right: auto;
	left: calc(100% + 14px);
}

.mtv-wa-widget-wrap[data-position="bottom-left"] .mtv-wa-btn-container:hover .mtv-wa-tooltip {
	transform: translateY(-50%) translateX(4px);
}

.mtv-wa-tooltip-arrow {
	position: absolute;
	top: 50%;
	right: -6px;
	transform: translateY(-50%);
	width: 0;
	height: 0;
	border-top: 5px solid transparent;
	border-bottom: 5px solid transparent;
	border-left: 6px solid #C8A46A;
}

.mtv-wa-widget-wrap[data-position="bottom-left"] .mtv-wa-tooltip-arrow {
	right: auto;
	left: -6px;
	border-left: none;
	border-right: 6px solid #C8A46A;
}

/* ==========================================================================
   2. VENTANA DE CHAT MODAL
   ========================================================================== */
.mtv-wa-panel {
	position: absolute;
	bottom: calc(100% + 18px);
	right: 0;
	width: 360px;
	max-width: calc(100vw - 30px);
	height: auto;
	max-height: 540px;
	background: #FCFBF7;
	border-radius: 18px;
	box-shadow: 0 16px 45px rgba(30, 35, 25, 0.28), 0 0 0 1px rgba(200, 164, 106, 0.35);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	animation: mtvWaSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
	z-index: 99;
}

.mtv-wa-widget-wrap[data-position="bottom-left"] .mtv-wa-panel {
	right: auto;
	left: 0;
}

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

/* Encabezado */
.mtv-wa-panel-header {
	background: #1E2319;
	border-bottom: 2px solid #C8A46A;
	padding: 16px 18px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	color: #FFFFFF;
}

.mtv-wa-header-brand {
	display: flex;
	align-items: center;
	gap: 12px;
}

.mtv-wa-logo-box {
	position: relative;
	width: 44px;
	height: 44px;
	flex-shrink: 0;
}

.mtv-wa-logo-img {
	width: 44px !important;
	height: 44px !important;
	max-width: 44px !important;
	max-height: 44px !important;
	border-radius: 50% !important;
	object-fit: cover !important;
	border: 2px solid #C8A46A !important;
	background: #FFFFFF !important;
	display: block !important;
}

.mtv-wa-status-dot {
	position: absolute;
	bottom: 0;
	right: 0;
	width: 12px;
	height: 12px;
	background: #4ADE80;
	border: 2px solid #1E2319;
	border-radius: 50%;
}

.mtv-wa-brand-info {
	display: flex;
	flex-direction: column;
}

.mtv-wa-brand-name {
	font-size: 15px !important;
	font-weight: 700 !important;
	color: #FFFFFF !important;
	margin: 0 0 2px 0 !important;
	line-height: 1.2 !important;
	letter-spacing: 0.3px !important;
}

.mtv-wa-brand-tagline {
	font-size: 12px !important;
	color: #C8A46A !important;
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 0 !important;
	line-height: 1.2 !important;
}

.mtv-wa-live-dot {
	width: 7px;
	height: 7px;
	background: #4ADE80;
	border-radius: 50%;
	display: inline-block;
}

.mtv-wa-close-btn {
	background: rgba(255, 255, 255, 0.1);
	border: none;
	color: #FFFFFF;
	font-size: 20px;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: all 0.2s ease;
	line-height: 1;
	padding: 0;
}

.mtv-wa-close-btn:hover {
	background: rgba(200, 164, 106, 0.35);
	color: #C8A46A;
}

/* Cuerpo del Chat */
.mtv-wa-panel-body {
	padding: 18px;
	overflow-y: auto;
	flex: 1;
	max-height: 330px;
	background-color: #FCFBF7;
}

.mtv-wa-time-stamp {
	text-align: center;
	margin-bottom: 12px;
}

.mtv-wa-time-stamp span {
	font-size: 11px;
	color: #888888;
	background: rgba(0, 0, 0, 0.05);
	padding: 2px 8px;
	border-radius: 10px;
}

/* Burbuja de Mensaje */
.mtv-wa-msg-bubble {
	background: #FFFFFF;
	border: 1px solid #ECE7D9;
	border-radius: 14px 14px 14px 2px;
	padding: 14px 16px;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
	margin-bottom: 14px;
	position: relative;
}

.mtv-wa-msg-text {
	font-size: 13.5px !important;
	line-height: 1.55 !important;
	color: #1E2319 !important;
	margin: 0 !important;
}

.mtv-wa-bubble-time {
	display: block;
	font-size: 10.5px;
	color: #999999;
	text-align: right;
	margin-top: 6px;
}

/* Indicador Contextual */
.mtv-wa-context-pill {
	background: #F4F1E8;
	border: 1px solid rgba(200, 164, 106, 0.4);
	border-radius: 8px;
	padding: 8px 12px;
	margin-bottom: 14px;
	font-size: 12px;
	line-height: 1.4;
	color: #555555;
}

.mtv-wa-context-label {
	display: block;
	font-size: 10.5px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: #8D9B63;
	font-weight: 700;
	margin-bottom: 2px;
}

.mtv-wa-context-title {
	color: #1E2319;
	font-weight: 600;
	word-break: break-word;
}

/* Botones de Acceso Rápido */
.mtv-wa-quick-box {
	margin-top: 8px;
}

.mtv-wa-quick-title {
	display: block;
	font-size: 11.5px;
	text-transform: uppercase;
	letter-spacing: 0.6px;
	color: #777777;
	font-weight: 700;
	margin-bottom: 8px;
}

.mtv-wa-quick-grid {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.mtv-wa-quick-btn {
	background: #FFFFFF;
	border: 1px solid rgba(200, 164, 106, 0.35);
	border-radius: 8px;
	padding: 9px 12px;
	font-size: 12.5px;
	font-weight: 600;
	color: #1E2319;
	text-align: left;
	cursor: pointer;
	transition: all 0.2s ease;
	display: flex;
	align-items: center;
	gap: 8px;
	outline: none;
	width: 100%;
}

.mtv-wa-quick-btn:hover {
	background: #1E2319;
	color: #C8A46A;
	border-color: #1E2319;
	transform: translateX(3px);
}

.mtv-wa-btn-icon {
	font-size: 14px;
	flex-shrink: 0;
}

/* Pie del Chat */
.mtv-wa-panel-footer {
	background: #FFFFFF;
	border-top: 1px solid #ECE7D9;
	padding: 14px 16px;
}

.mtv-wa-input-row {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 10px;
}

.mtv-wa-input {
	flex: 1;
	background: #FCFBF7;
	border: 1px solid #D9D4C7;
	border-radius: 20px;
	padding: 10px 14px;
	font-size: 13px;
	color: #1E2319;
	outline: none;
	transition: border-color 0.2s ease;
	font-family: inherit;
}

.mtv-wa-input:focus {
	border-color: #25D366;
	background: #FFFFFF;
}

.mtv-wa-send-btn {
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: #128C7E;
	border: none;
	color: #FFFFFF;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: background 0.2s ease, transform 0.15s ease;
	flex-shrink: 0;
	padding: 0;
}

.mtv-wa-send-btn:hover {
	background: #25D366;
	transform: scale(1.05);
}

.mtv-wa-cta-btn {
	width: 100%;
	background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
	border: none;
	border-radius: 25px;
	color: #FFFFFF;
	padding: 10px 16px;
	font-size: 13.5px;
	font-weight: 700;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	box-shadow: 0 4px 14px rgba(18, 140, 126, 0.35);
	transition: all 0.2s ease;
}

.mtv-wa-cta-btn:hover {
	box-shadow: 0 6px 18px rgba(18, 140, 126, 0.5);
	transform: translateY(-1px);
}

/* ==========================================================================
   3. ADAPTACIÓN RESPONSIVE (MÓVIL)
   ========================================================================== */
@media (max-width: 480px) {
	.mtv-wa-widget-wrap {
		bottom: 18px !important;
		right: 18px !important;
	}
	.mtv-wa-widget-wrap[data-position="bottom-left"] {
		left: 18px !important;
		right: auto !important;
	}
	.mtv-wa-floating-btn {
		width: 58px !important;
		height: 58px !important;
	}
	.mtv-wa-icon-svg {
		width: 30px !important;
		height: 30px !important;
	}
	.mtv-wa-tooltip {
		display: none !important;
	}
	.mtv-wa-panel {
		position: fixed;
		bottom: 86px;
		right: 15px;
		left: 15px;
		width: auto;
		max-width: none;
		max-height: calc(100vh - 120px);
	}
	.mtv-wa-widget-wrap[data-position="bottom-left"] .mtv-wa-panel {
		left: 15px;
		right: 15px;
	}
}
