/**
 * Nabux Live Order Chat & Checkout Fields (Material Design 3)
 *
 * @package Nabux_Marketplace
 */

/* ============================================================
   1) LIVE ORDER CHAT BOX (MATERIAL 3)
   ============================================================ */
.nabux-chat-box {
	margin: 28px 0;
	border-radius: 24px;
	background: rgba(18, 15, 13, 0.95);
	backdrop-filter: blur(24px);
	-webkit-backdrop-filter: blur(24px);
	border: 1px solid rgba(255, 255, 255, 0.1);
	box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	color: var(--text, #faf9f8);
	box-sizing: border-box;
	width: 100%;
}

.nabux-chat-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 18px 22px;
	background: rgba(255, 255, 255, 0.02);
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
	gap: 12px;
}

.nabux-chat-vendor-info {
	display: flex;
	align-items: center;
	gap: 14px;
	min-width: 0;
}

.nabux-chat-avatar {
	width: 44px;
	height: 44px;
	border-radius: 14px;
	background: linear-gradient(135deg, rgba(245, 183, 60, 0.25), rgba(224, 138, 95, 0.15));
	border: 1px solid rgba(245, 183, 60, 0.4);
	color: var(--brand, #f5b73c);
	display: grid;
	place-items: center;
	font-size: 18px;
	font-weight: 800;
	position: relative;
	flex-shrink: 0;
}

.nabux-chat-status-dot {
	position: absolute;
	bottom: -2px;
	right: -2px;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: #10b981;
	border: 2px solid #14110e;
	box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

[dir="rtl"] .nabux-chat-status-dot {
	right: auto;
	left: -2px;
}

.nabux-chat-title-group {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}

.nabux-chat-vendor-name {
	display: flex;
	align-items: center;
	gap: 8px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.nabux-chat-vendor-name strong {
	font-size: 16px;
	font-weight: 750;
	color: var(--text, #faf9f8);
	letter-spacing: -0.01em;
}

.nabux-chat-rating-pill {
	display: inline-flex;
	align-items: center;
	padding: 2px 7px;
	border-radius: 6px;
	background: rgba(245, 183, 60, 0.14);
	color: var(--brand, #f5b73c);
	font-size: 11px;
	font-weight: 800;
	line-height: 1;
}

.nabux-chat-sub {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 11.5px;
	color: var(--muted, #a8a29e);
	flex-wrap: wrap;
}

.nabux-chat-live-badge {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	color: #10b981;
	font-weight: 700;
}

.nabux-chat-live-badge .liveDot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: #10b981;
	box-shadow: 0 0 6px rgba(16, 185, 129, 0.8);
	animation: nabuxLivePulse 1.8s infinite;
}

@keyframes nabuxLivePulse {
	0%, 100% { opacity: 1; transform: scale(1); }
	50% { opacity: 0.4; transform: scale(0.85); }
}

.nabux-chat-escrow-pill {
	font-size: 11px;
	color: var(--brand, #f5b73c);
	background: rgba(245, 183, 60, 0.1);
	padding: 2px 8px;
	border-radius: 999px;
	font-weight: 650;
}

.nabux-chat-refresh-btn {
	width: 38px;
	height: 38px;
	border-radius: 12px;
	background: rgba(255, 255, 255, 0.05);
	border: 1px solid rgba(255, 255, 255, 0.08);
	color: var(--muted, #a8a29e);
	display: grid;
	place-items: center;
	cursor: pointer;
	transition: all 0.18s ease;
}

.nabux-chat-refresh-btn:hover {
	background: rgba(255, 255, 255, 0.1);
	color: var(--brand, #f5b73c);
	transform: rotate(180deg);
}

/* Notice Banner */
.nabux-chat-banner {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 18px;
	background: rgba(245, 183, 60, 0.07);
	border-bottom: 1px solid rgba(245, 183, 60, 0.15);
	color: rgba(245, 183, 60, 0.9);
	font-size: 12px;
	line-height: 1.45;
}

.nabux-chat-banner svg {
	flex-shrink: 0;
}

/* Chat Stream */
.nabux-chat-stream {
	padding: 20px;
	display: flex;
	flex-direction: column;
	gap: 14px;
	max-height: 420px;
	min-height: 240px;
	overflow-y: auto;
	scrollbar-width: thin;
	scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
	background: radial-gradient(circle at 50% 0%, rgba(245, 183, 60, 0.02), transparent 70%);
}

.nabux-chat-stream::-webkit-scrollbar {
	width: 6px;
}

.nabux-chat-stream::-webkit-scrollbar-thumb {
	background: rgba(255, 255, 255, 0.15);
	border-radius: 6px;
}

.nabux-chat-empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 32px 16px;
	color: var(--muted, #a8a29e);
	margin: auto;
}

.nabux-chat-empty-icon {
	font-size: 36px;
	margin-bottom: 10px;
	filter: drop-shadow(0 4px 12px rgba(245, 183, 60, 0.3));
}

.nabux-chat-empty h4 {
	font-size: 15px;
	font-weight: 700;
	color: var(--text, #faf9f8);
	margin: 0 0 6px;
}

.nabux-chat-empty p {
	font-size: 12.5px;
	max-width: 380px;
	margin: 0;
	line-height: 1.5;
}

/* Message Bubbles */
.nabux-chat-msg {
	display: flex;
	flex-direction: column;
	max-width: 82%;
	position: relative;
	animation: nabuxMsgFade 0.25s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes nabuxMsgFade {
	from { opacity: 0; transform: translateY(8px); }
	to { opacity: 1; transform: translateY(0); }
}

.nabux-chat-msg.is-me {
	align-self: flex-end;
	align-items: flex-end;
}

.nabux-chat-msg.is-other {
	align-self: flex-start;
	align-items: flex-start;
}

.nabux-chat-msg.is-system {
	align-self: center;
	max-width: 90%;
	margin: 8px 0;
}

.nabux-chat-system-content {
	background: rgba(245, 183, 60, 0.08);
	border: 1px solid rgba(245, 183, 60, 0.22);
	border-radius: 16px;
	padding: 12px 16px;
	display: flex;
	flex-direction: column;
	gap: 6px;
	text-align: start;
	color: #faf9f8;
	font-size: 12.5px;
	line-height: 1.55;
	position: relative;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.nabux-chat-system-icon {
	font-size: 14px;
	margin-bottom: 2px;
}

.nabux-chat-system-text {
	word-break: break-word;
	white-space: pre-line;
}

.nabux-chat-bubble {
	padding: 12px 16px;
	border-radius: 18px;
	font-size: 13.5px;
	line-height: 1.55;
	position: relative;
	word-break: break-word;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.nabux-chat-msg.is-me .nabux-chat-bubble {
	background: linear-gradient(135deg, rgba(245, 183, 60, 0.18) 0%, rgba(224, 138, 95, 0.12) 100%);
	border: 1px solid rgba(245, 183, 60, 0.35);
	color: #ffffff;
	border-bottom-right-radius: 4px;
}

[dir="rtl"] .nabux-chat-msg.is-me .nabux-chat-bubble {
	border-bottom-right-radius: 18px;
	border-bottom-left-radius: 4px;
}

.nabux-chat-msg.is-other .nabux-chat-bubble {
	background: rgba(255, 255, 255, 0.05);
	border: 1px solid rgba(255, 255, 255, 0.09);
	color: var(--text, #faf9f8);
	border-bottom-left-radius: 4px;
}

[dir="rtl"] .nabux-chat-msg.is-other .nabux-chat-bubble {
	border-bottom-left-radius: 18px;
	border-bottom-right-radius: 4px;
}

.nabux-chat-sender-name {
	font-size: 11px;
	font-weight: 800;
	color: var(--brand, #f5b73c);
	margin-bottom: 4px;
	text-transform: capitalize;
}

.nabux-chat-bubble-footer {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 6px;
	margin-top: 6px;
	font-size: 10.5px;
	color: rgba(255, 255, 255, 0.45);
}

.nabux-chat-read-tick {
	color: #10b981;
	font-weight: 800;
}

/* Quick Prompt Chips */
.nabux-chat-quick-chips {
	display: flex;
	gap: 8px;
	padding: 10px 18px;
	background: rgba(255, 255, 255, 0.015);
	border-top: 1px solid rgba(255, 255, 255, 0.05);
	overflow-x: auto;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
}

.nabux-chat-quick-chips::-webkit-scrollbar {
	display: none;
}

.nabux-chat-chip {
	display: inline-flex;
	align-items: center;
	padding: 6px 12px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid rgba(255, 255, 255, 0.08);
	color: var(--muted, #a8a29e);
	font-size: 11.5px;
	font-weight: 600;
	cursor: pointer;
	white-space: nowrap;
	flex-shrink: 0;
	transition: all 0.16s ease;
}

.nabux-chat-chip:hover {
	background: rgba(245, 183, 60, 0.12);
	border-color: rgba(245, 183, 60, 0.35);
	color: var(--brand, #f5b73c);
}

/* Chat Input Bar */
.nabux-chat-input-form {
	padding: 14px 18px;
	background: rgba(255, 255, 255, 0.02);
	border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.nabux-chat-input-wrap {
	display: flex;
	align-items: flex-end;
	gap: 10px;
	background: rgba(255, 255, 255, 0.05);
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 18px;
	padding: 6px 8px 6px 14px;
	transition: all 0.2s ease;
}

[dir="rtl"] .nabux-chat-input-wrap {
	padding: 6px 14px 6px 8px;
}

.nabux-chat-input-wrap:focus-within {
	border-color: var(--brand, #f5b73c);
	box-shadow: 0 0 16px rgba(245, 183, 60, 0.2);
	background: rgba(255, 255, 255, 0.07);
}

.nabux-chat-textarea {
	flex: 1;
	background: transparent;
	border: 0;
	color: var(--text, #faf9f8);
	font-size: 14px;
	line-height: 1.45;
	resize: none;
	outline: none;
	max-height: 110px;
	padding: 6px 0;
	font-family: inherit;
	box-sizing: border-box;
}

.nabux-chat-textarea::placeholder {
	color: rgba(255, 255, 255, 0.35);
}

.nabux-chat-send-btn {
	width: 40px;
	height: 40px;
	border-radius: 12px;
	background: linear-gradient(135deg, #f5b73c 0%, #e08a5f 100%);
	color: #14110e;
	border: 0;
	display: grid;
	place-items: center;
	cursor: pointer;
	flex-shrink: 0;
	transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
	box-shadow: 0 4px 14px rgba(245, 183, 60, 0.35);
}

.nabux-chat-send-btn:hover {
	transform: scale(1.05);
	box-shadow: 0 6px 18px rgba(245, 183, 60, 0.5);
}

.nabux-chat-send-btn:active {
	transform: scale(0.96);
}

[dir="rtl"] .nabux-chat-send-btn svg {
	transform: scaleX(-1);
}

/* ============================================================
   2) PRODUCT-SPECIFIC CHECKOUT FIELDS (MATERIAL 3)
   ============================================================ */
.nabux-checkout-custom-fields {
	margin: 24px 0 32px;
	background: rgba(18, 15, 13, 0.95);
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 22px;
	padding: 22px;
	box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

.nabux-checkout-cf-head {
	margin-bottom: 20px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
	padding-bottom: 16px;
}

.nabux-cf-badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 3px 10px;
	border-radius: 999px;
	background: rgba(245, 183, 60, 0.12);
	color: var(--brand, #f5b73c);
	font-size: 11px;
	font-weight: 800;
	margin-bottom: 8px;
}

.nabux-cf-title {
	font-size: 18px;
	font-weight: 800;
	color: var(--text, #faf9f8);
	letter-spacing: -0.02em;
	margin: 0 0 6px;
}

.nabux-cf-desc {
	font-size: 13px;
	color: var(--muted, #a8a29e);
	margin: 0;
	line-height: 1.5;
}

.nabux-cf-card {
	background: rgba(255, 255, 255, 0.03);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 16px;
	padding: 18px;
	margin-bottom: 16px;
	transition: border-color 0.2s ease;
}

.nabux-cf-card:last-child {
	margin-bottom: 0;
}

.nabux-cf-card:focus-within {
	border-color: rgba(245, 183, 60, 0.4);
}

.nabux-cf-card__header {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 14px;
	padding-bottom: 12px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.nabux-cf-card__thumb {
	width: 42px;
	height: 42px;
	border-radius: 10px;
	background: rgba(255, 255, 255, 0.05);
	border: 1px solid rgba(255, 255, 255, 0.08);
	display: grid;
	place-items: center;
	overflow: hidden;
	flex-shrink: 0;
}

.nabux-cf-card__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.nabux-cf-card__thumb span {
	font-size: 16px;
	font-weight: 800;
	color: var(--brand, #f5b73c);
}

.nabux-cf-card__meta {
	min-width: 0;
}

.nabux-cf-card__name {
	font-size: 15px;
	font-weight: 750;
	color: var(--text, #faf9f8);
	margin: 0 0 3px;
	letter-spacing: -0.01em;
}

.nabux-cf-card__vendor {
	font-size: 11.5px;
	color: var(--muted, #a8a29e);
}

.nabux-cf-card__vendor strong {
	color: var(--brand, #f5b73c);
}

.nabux-cf-card__intro {
	font-size: 12.5px;
	color: var(--muted, #a8a29e);
	margin: 0 0 14px;
}

.nabux-cf-field-group {
	margin-bottom: 14px;
}

.nabux-cf-field-group:last-child {
	margin-bottom: 0;
}

.nabux-cf-label {
	display: block;
	font-size: 12.5px;
	font-weight: 700;
	color: var(--text, #faf9f8);
	margin-bottom: 6px;
}

.nabux-cf-required {
	color: #f43f5e;
}

.nabux-cf-input {
	width: 100%;
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 12px;
	padding: 12px 14px;
	color: var(--text, #faf9f8);
	font-size: 14px;
	font-family: inherit;
	box-sizing: border-box;
	transition: all 0.18s ease;
	outline: none;
}

.nabux-cf-input:focus {
	border-color: var(--brand, #f5b73c);
	background: rgba(255, 255, 255, 0.07);
	box-shadow: 0 0 14px rgba(245, 183, 60, 0.2);
}

.nabux-cf-textarea {
	resize: vertical;
	min-height: 64px;
	line-height: 1.5;
}

.nabux-cf-help {
	display: block;
	font-size: 11px;
	color: var(--muted, #a8a29e);
	margin-top: 4px;
}

/* Material 3 Radio Card Options */
.nabux-cf-radio-group {
	display: grid;
	gap: 8px;
}

.nabux-cf-radio-option {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 14px;
	border-radius: 12px;
	background: rgba(255, 255, 255, 0.025);
	border: 1px solid rgba(255, 255, 255, 0.08);
	cursor: pointer;
	transition: all 0.18s ease;
}

.nabux-cf-radio-option:hover {
	background: rgba(255, 255, 255, 0.05);
	border-color: rgba(255, 255, 255, 0.15);
}

.nabux-cf-radio-option:has(input:checked) {
	background: rgba(245, 183, 60, 0.1) !important;
	border-color: var(--brand, #f5b73c) !important;
	box-shadow: 0 0 12px rgba(245, 183, 60, 0.2);
}

.nabux-cf-radio-option input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.nabux-cf-radio-custom {
	width: 18px;
	height: 18px;
	border-radius: 50%;
	border: 2px solid rgba(255, 255, 255, 0.3);
	display: grid;
	place-items: center;
	flex-shrink: 0;
	transition: all 0.2s ease;
}

.nabux-cf-radio-custom::after {
	content: "";
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--brand, #f5b73c);
	transform: scale(0);
	transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.nabux-cf-radio-option:has(input:checked) .nabux-cf-radio-custom {
	border-color: var(--brand, #f5b73c);
}

.nabux-cf-radio-option:has(input:checked) .nabux-cf-radio-custom::after {
	transform: scale(1);
}

.nabux-cf-radio-text {
	font-size: 13px;
	font-weight: 600;
	color: var(--text, #faf9f8);
}
