/**
 * BNA AI — Skin Analysis Widget, Camera Modal, Mask Overlay & Shoppable Routine Styles
 */
 
#chat-widget-content:has(.bna-skin-chat-stream) {
	display: block !important;
}
.bna-skin-widget-bar {
	margin-bottom: 10px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 7px 12px;
	background: linear-gradient(90deg, rgba(16, 185, 129, 0.10), rgba(14, 165, 233, 0.10));
	border-top: 1px solid rgba(148, 163, 184, 0.22);
	z-index: 5;
}

.bna-skin-trigger-btn {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 7px 13px;
	border-radius: 999px;
	border: none;
	background: linear-gradient(135deg, #10B981, #0EA5E9);
	color: #ffffff !important;
	font-size: 12.5px;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	box-shadow: 0 2px 8px rgba(16, 185, 129, 0.28);
	transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
	text-decoration: none !important;
}

.bna-skin-trigger-btn:hover {
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(14, 165, 233, 0.36);
}

.bna-skin-demo-tag {
	display: inline-block;
	padding: 1px 6px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.24);
	border: 1px solid rgba(255, 255, 255, 0.45);
	color: #ffffff;
	font-size: 10px;
	letter-spacing: 0.4px;
	line-height: 1.4;
}

.bna-skin-demo-tag--modal {
	background: #fef3c7;
	border-color: #f59e0b;
	color: #b45309;
}

.bna-skin-bar-hint {
	font-size: 11px;
	color: #64748b;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Camera & Upload Modal */
.bna-skin-modal-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(15, 23, 42, 0.72);
	backdrop-filter: blur(4px);
	z-index: 2147483640;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 16px;
}

.bna-skin-modal-backdrop.is-open {
	display: flex;
}

.bna-skin-modal {
	width: 100%;
	max-width: 440px;
	max-height: 92vh;
	overflow-y: auto;
	background: #ffffff;
	color: #0f172a;
	border-radius: 18px;
	box-shadow: 0 24px 48px rgba(0, 0, 0, 0.28);
	display: flex;
	flex-direction: column;
}

.bna-skin-modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 15px 18px;
	border-bottom: 1px solid #f1f5f9;
}

.bna-skin-modal-title {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 16px;
	font-weight: 700;
	margin: 0;
}

.bna-skin-quota-pill {
	display: inline-block;
	font-size: 11px;
	font-weight: 600;
	padding: 2px 8px;
	border-radius: 999px;
	background: #ecfdf5;
	color: #059669;
}

.bna-skin-close-btn {
	width: 30px;
	height: 30px;
	border-radius: 50%;
	border: none;
	background: #f1f5f9;
	color: #475569;
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.bna-skin-close-btn:hover {
	background: #e2e8f0;
	color: #0f172a;
}

.bna-skin-tabs {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 6px;
	padding: 10px 18px 0;
}

.bna-skin-tab-btn {
	padding: 8px 10px;
	border-radius: 8px;
	border: 1px solid #e2e8f0;
	background: #f8fafc;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.15s ease;
}

.bna-skin-tab-btn.is-active {
	background: #eff6ff;
	border-color: #3b82f6;
	color: #1d4ed8;
}

.bna-skin-modal-body {
	padding: 14px 18px 18px;
}

.bna-skin-stage {
	position: relative;
	width: 100%;
	aspect-ratio: 1 / 1;
	background: #0f172a;
	border-radius: 14px;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
}

.bna-skin-stage video,
.bna-skin-stage img.bna-skin-preview-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.bna-skin-stage video {
	transform: scaleX(-1);
}

.bna-skin-face-guide {
	position: absolute;
	inset: 0;
	pointer-events: none;
	display: flex;
	align-items: center;
	justify-content: center;
}

.bna-skin-light-badge {
	position: absolute;
	bottom: 10px;
	left: 50%;
	transform: translateX(-50%);
	background: rgba(15, 23, 42, 0.78);
	color: #f8fafc;
	padding: 4px 12px;
	border-radius: 999px;
	font-size: 11.5px;
	font-weight: 500;
	white-space: nowrap;
	z-index: 2;
}

.bna-skin-light-badge.is-good {
	background: rgba(5, 150, 105, 0.88);
}

.bna-skin-light-badge.is-warn {
	background: rgba(217, 119, 6, 0.90);
}

.bna-skin-upload-dropzone {
	width: 100%;
	height: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 20px;
	text-align: center;
	color: #cbd5e1;
	cursor: pointer;
}

.bna-skin-camera-empty {
	position: absolute;
	inset: 0;
	display: none;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 24px 22px;
	text-align: center;
	background: #0f172a;
	color: #f8fafc;
	z-index: 3;
}

.bna-skin-camera-empty-actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	margin-top: 14px;
}

.bna-skin-camera-switch-btn {
	padding: 8px 14px;
	border-radius: 999px;
	border: none;
	background: linear-gradient(135deg, #10B981, #0EA5E9);
	color: #ffffff;
	font-size: 12.5px;
	font-weight: 600;
	cursor: pointer;
}

.bna-skin-camera-retry-btn {
	padding: 8px 13px;
	border-radius: 999px;
	border: 1px solid rgba(148, 163, 184, 0.45);
	background: rgba(255, 255, 255, 0.08);
	color: #e2e8f0;
	font-size: 12.5px;
	font-weight: 600;
	cursor: pointer;
}

.bna-skin-tips {
	display: flex;
	justify-content: space-between;
	gap: 6px;
	margin: 10px 0;
	padding: 8px 10px;
	background: #f5f5f5;
	border-radius: 8px;
	font-size: 12px;
}

.bna-skin-error-box {
	display: none;
	margin: 10px 0 0;
	padding: 9px 12px;
	border-radius: 8px;
	background: #fef2f2;
	border: 1px solid #fecaca;
	color: #b91c1c;
	font-size: 12.5px;
	line-height: 1.4;
}

.bna-skin-actions {
	display: flex;
	gap: 8px;
	margin-top: 12px;
}

.bna-skin-primary-btn {
	flex: 1;
	padding: 10px 14px;
	border-radius: 10px;
	border: none;
	background: linear-gradient(135deg, #10B981, #0EA5E9);
	color: #ffffff;
	font-size: 13.5px;
	font-weight: 600;
	cursor: pointer;
}

.bna-skin-primary-btn:disabled {
	opacity: 0.55;
	cursor: not-allowed;
}

.bna-skin-secondary-btn {
	padding: 10px 14px;
	border-radius: 10px;
	border: 1px solid #cbd5e1;
	background: #ffffff;
	color: #334155;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
}

.bna-skin-privacy-note {
	margin: 10px 0 0;
	font-size: 11px;
	color: #94a3b8;
	text-align: center;
	line-height: 1.35;
}

/* Scanning Progress Overlay */
.bna-skin-scanning-overlay {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, 0.76);
	display: none;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	color: #ffffff;
	z-index: 4;
	padding: 20px;
	text-align: center;
}

.bna-skin-scanning-overlay.is-active {
	display: flex;
}

.bna-skin-scan-line {
	position: absolute;
	left: 10%;
	right: 10%;
	height: 2px;
	background: linear-gradient(90deg, transparent, #10B981, #38BDF8, transparent);
	box-shadow: 0 0 12px #10B981;
	animation: bnaSkinScanMove 2.2s ease-in-out infinite;
}

@keyframes bnaSkinScanMove {
	0%, 100% { top: 14%; }
	50% { top: 86%; }
}

/* In-Chat Result Card + Mask Overlay + Consultation Stream */
.bna-skin-chat-stream {
	padding: 10px 12px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.bna-skin-report-card {
	background: #ffffff;
	color: #1e293b;
	border: 1px solid #e2e8f0;
	border-radius: 14px;
	overflow: hidden;
	box-shadow: 0 4px 14px rgba(15, 23, 42, 0.07);
}

.bna-skin-mask-viewer {
	position: relative;
	width: 100%;
	aspect-ratio: 1 / 1;
	max-height: 270px;
	background: #0f172a;
	overflow: hidden;
}

.bna-skin-mask-viewer img.bna-skin-base-selfie {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
}

.bna-skin-mask-viewer img.bna-skin-overlay-img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: contain;
	pointer-events: none;
	opacity: 0.85;
	transition: opacity 0.2s ease;
}

.bna-skin-mask-chips {
	display: flex;
	gap: 6px;
	overflow-x: auto;
	padding: 8px 10px;
	background: #f8fafc;
	border-bottom: 1px solid #e2e8f0;
	scrollbar-width: thin;
}

.bna-skin-mask-chip {
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 4px 10px;
	border-radius: 999px;
	border: 1px solid #cbd5e1;
	background: #ffffff;
	color: #334155;
	font-size: 11.5px;
	font-weight: 600;
	cursor: pointer;
}

.bna-skin-mask-chip.is-active {
	background: #0f172a;
	border-color: #0f172a;
	color: #ffffff;
}

.bna-skin-score-summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 14px;
	border-bottom: 1px solid #f1f5f9;
}

.bna-skin-overall-circle {
	width: 52px;
	height: 52px;
	border-radius: 50%;
	background: linear-gradient(135deg, #ecfdf5, #eff6ff);
	border: 3px solid #10B981;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.bna-skin-overall-num {
	font-size: 17px;
	font-weight: 800;
	color: #0f172a;
	line-height: 1;
}

.bna-skin-overall-sub {
	font-size: 9px;
	color: #64748b;
	margin-top: 2px;
}

.bna-skin-concerns-list {
	padding: 10px 14px 12px;
}

.bna-skin-concern-row {
	margin-bottom: 8px;
}

.bna-skin-concern-row:last-child {
	margin-bottom: 0;
}

.bna-skin-concern-head {
	display: flex;
	justify-content: space-between;
	font-size: 12px;
	margin-bottom: 3px;
}

.bna-skin-bar-track {
	width: 100%;
	height: 6px;
	background: #f1f5f9;
	border-radius: 999px;
	overflow: hidden;
}

.bna-skin-bar-fill {
	height: 100%;
	border-radius: 999px;
}

/* AI Consultation Bubble */
.bna-skin-advice-bubble {
	background: #f8fafc;
	color: #1e293b;
	border: 1px solid #e2e8f0;
	border-radius: 14px;
	padding: 12px 14px;
	font-size: 13px;
	line-height: 1.55;
}

.bna-skin-advice-bubble h3,
.bna-skin-advice-bubble h4 {
	margin: 10px 0 4px;
	font-size: 13.5px;
	font-weight: 700;
	color: #0f172a;
}

.bna-skin-advice-bubble p {
	margin: 0 0 8px;
}

.bna-skin-advice-bubble ul,
.bna-skin-advice-bubble ol {
	margin: 4px 0 10px 18px;
	padding: 0;
}

.bna-skin-advice-bubble li {
	margin-bottom: 4px;
}

.bna-skin-advice-bubble a {
	color: #0284c7;
	font-weight: 600;
	text-decoration: underline;
}

/* Shoppable WooCommerce Product Mini-Cards */
.bna-skin-products-grid {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.bna-skin-product-card {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 9px 10px;
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
}

.bna-skin-product-card img {
	width: 54px;
	height: 54px;
	border-radius: 8px;
	object-fit: cover;
	flex-shrink: 0;
	background: #f8fafc;
}

.bna-skin-product-info {
	flex: 1;
	min-width: 0;
}

.bna-skin-product-title {
	display: block;
	font-size: 12.5px;
	font-weight: 600;
	color: #0f172a !important;
	text-decoration: none !important;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	margin-bottom: 2px;
}

.bna-skin-product-price {
	font-size: 12px;
	font-weight: 700;
	color: #059669;
	margin-bottom: 5px;
}

.bna-skin-cart-btn {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 4px 10px;
	border-radius: 6px;
	border: none;
	background: #0f172a;
	color: #ffffff !important;
	font-size: 11.5px;
	cursor: pointer;
	text-decoration: none !important;
}

.bna-skin-cart-btn + a.added_to_cart {
	display: inline-block;
	margin-left: 6px;
	font-size: 11.5px;
}

.bna-skin-cart-btn.is-added {
	background: #059669;
}

/* Standalone Drawer Fallback if Chat Widget hasn't mounted */
.bna-skin-standalone-drawer {
	position: fixed;
	right: 20px;
	bottom: 90px;
	width: 380px;
	max-width: calc(100vw - 32px);
	max-height: 76vh;
	overflow-y: auto;
	background: #ffffff;
	border: 1px solid #cbd5e1;
	border-radius: 16px;
	box-shadow: 0 20px 40px rgba(15, 23, 42, 0.22);
	z-index: 2147483630;
}
