/* Masa Geo-Pricing — Frontend styles */

/* ─── Currency Switcher ─── */
.masa-currency-switcher {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	direction: rtl;
}
.masa-switcher-label {
	font-size: 13px;
	color: #374151;
	white-space: nowrap;
}
.masa-switcher-select {
	padding: 4px 8px;
	border: 1px solid #d1d5db;
	border-radius: 6px;
	font-size: 13px;
	cursor: pointer;
	background: #fff;
}
.masa-floating-switcher {
	position: fixed;
	bottom: 20px;
	inset-inline-start: 20px;
	z-index: 9999;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	padding: 8px 12px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, .12);
}

/* ─── رسالة "غير متاح في بلدك" (Visibility) ─── */
.masa-geo-unavailable {
	margin: 1rem 0;
	padding: .9rem 1.2rem;
	background: #fef2f2;
	border: 1px solid #fecaca;
	border-radius: 8px;
	color: #991b1b;
	font-weight: 600;
}

/* ─── شارة "باقي N فقط في منطقتك" ─── */
.masa-geo-low-stock {
	display: inline-block;
	margin: .4rem 0 .8rem;
	padding: .35rem .9rem;
	background: #fff7ed;
	border: 1px solid #fed7aa;
	border-radius: 999px;
	color: #c2410c;
	font-weight: 700;
	font-size: .88rem;
}

/* ─── زرار الواتساب (WhatsApp Inquiry) ─── */
.masa-geo-whatsapp-container {
	margin: 1.8rem 0;
}
.masa-geo-whatsapp-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	padding: 14px 32px;
	background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
	color: #ffffff !important;
	border: none;
	border-radius: 12px;
	font-weight: 700;
	font-size: 16px;
	text-decoration: none !important;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	box-shadow: 0 4px 15px rgba(18, 140, 126, 0.25);
	cursor: pointer;
	border: 1px solid rgba(255, 255, 255, 0.1);
}
.masa-geo-whatsapp-btn:hover {
	background: linear-gradient(135deg, #20ba5a 0%, #0d7367 100%);
	transform: translateY(-3px);
	box-shadow: 0 8px 24px rgba(18, 140, 126, 0.35);
}
.masa-geo-whatsapp-btn:active {
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(18, 140, 126, 0.2);
}
.masa-geo-whatsapp-btn svg {
	width: 22px;
	height: 22px;
	fill: currentColor;
	display: block;
	transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.masa-geo-whatsapp-btn:hover svg {
	transform: scale(1.1) rotate(8deg);
}
/* زرار الواتساب في الكتالوج/الأرشيف */
.masa-geo-loop-whatsapp-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background-color: #25D366 !important;
	color: #ffffff !important;
	transition: background-color 0.2s ease, transform 0.1s ease !important;
}
.masa-geo-loop-whatsapp-btn:hover {
	background-color: #20ba5a !important;
	color: #ffffff !important;
}

/* ─── شارة العملة المحلية (Currency Badge) ─── */
.masa-geo-currency-badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 8px 0;
	padding: 4px 10px;
	border-radius: 6px;
	font-weight: 600;
	direction: rtl;
	transition: all 0.3s ease;
}
.masa-geo-currency-badge--single {
	background: #f0fdf4;
	border: 1px solid #bbf7d0;
	color: #166534;
	font-size: 0.9rem;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
	animation: masaFadeInUp 0.4s ease;
}
.masa-geo-currency-badge--loop {
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	color: #475569;
	font-size: 0.75rem;
	padding: 2px 6px;
}
.masa-geo-badge-flag {
	font-size: 1.1em;
	line-height: 1;
}

/* ─── شريط تقدم الشحن المجاني (Free Shipping Progress Bar) ─── */
.masa-geo-free-shipping-bar-wrapper {
	background: linear-gradient(135deg, #f8fafc, #f1f5f9);
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	padding: 16px 20px;
	margin: 20px 0;
	box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
	direction: rtl;
	font-family: inherit;
	animation: masaFadeInUp 0.5s ease;
}
.masa-geo-free-shipping-text {
	font-size: 15px;
	font-weight: 700;
	color: #1e293b;
	margin-bottom: 12px;
	display: flex;
	align-items: center;
	gap: 8px;
}
.masa-geo-free-shipping-progress {
	background-color: #e2e8f0;
	border-radius: 9999px;
	height: 10px;
	overflow: hidden;
	position: relative;
}
.masa-geo-free-shipping-progress-inner {
	background: linear-gradient(90deg, #10b981, #34d399);
	height: 100%;
	border-radius: 9999px;
	transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
	box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
	position: relative;
}
.masa-geo-free-shipping-progress-inner::after {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: linear-gradient(
		90deg,
		rgba(255, 255, 255, 0) 0%,
		rgba(255, 255, 255, 0.3) 50%,
		rgba(255, 255, 255, 0) 100%
	);
	animation: masaProgressShine 2s infinite linear;
}

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

@keyframes masaProgressShine {
	0% {
		transform: translateX(-100%);
	}
	100% {
		transform: translateX(100%);
	}
}

/* ??? Affiliate Dashboard ??? */
.masa-dashboard-container {
	font-family: system-ui, -apple-system, sans-serif;
	color: #334155;
	background: #f8fafc;
	padding: 24px;
	border-radius: 12px;
	box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
	max-width: 1200px;
	margin: 0 auto;
}
.masa-dashboard-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	border-bottom: 2px solid #f1f5f9;
	padding-bottom: 20px;
	margin-bottom: 24px;
	flex-wrap: wrap;
	gap: 15px;
}
.masa-welcome-area h2 {
	margin: 0 0 6px 0;
	font-size: 24px;
	font-weight: 700;
	color: #0f172a;
}
.masa-badge {
	display: inline-block;
	padding: 4px 10px;
	border-radius: 9999px;
	font-size: 12px;
	font-weight: 600;
}
.badge-brand {
	background: #dbeafe;
	color: #1d4ed8;
}
.badge-affiliate {
	background: #dcfce7;
	color: #15803d;
}
.masa-code-display {
	background: #fff;
	padding: 10px 16px;
	border-radius: 8px;
	border: 1px solid #e2e8f0;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
}
.masa-code-display .label {
	font-size: 11px;
	color: #64748b;
	margin-bottom: 2px;
}
.masa-code-display .code {
	font-size: 18px;
	color: #0f172a;
	letter-spacing: 1px;
}
.masa-stats-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: 20px;
	margin-bottom: 28px;
}
.masa-stat-card {
	background: #fff;
	border-radius: 10px;
	padding: 20px;
	display: flex;
	align-items: center;
	gap: 16px;
	border: 1px solid #e2e8f0;
	box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}
.card-icon {
	font-size: 32px;
	background: #f1f5f9;
	padding: 10px;
	border-radius: 8px;
	line-height: 1;
}
.card-info h3 {
	margin: 0 0 4px 0;
	font-size: 14px;
	font-weight: 600;
	color: #64748b;
}
.card-info .amount {
	margin: 0;
	font-size: 22px;
	font-weight: 700;
}
.card-pending .amount {
	color: #d97706;
}
.card-paid .amount {
	color: #16a34a;
}
.card-info .subtext {
	font-size: 11px;
	color: #94a3b8;
	display: block;
	margin-top: 2px;
}
.masa-section-card {
	background: #fff;
	border-radius: 10px;
	padding: 24px;
	border: 1px solid #e2e8f0;
	margin-bottom: 24px;
	box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}
.section-title {
	margin: 0 0 6px 0;
	font-size: 18px;
	font-weight: 700;
	color: #0f172a;
}
.section-desc {
	margin: 0 0 20px 0;
	font-size: 13px;
	color: #64748b;
}
.masa-links-list {
	display: flex;
	flex-direction: column;
	gap: 16px;
}
.masa-link-item {
	background: #f8fafc;
	padding: 16px;
	border-radius: 8px;
	border: 1px solid #f1f5f9;
}
.link-name {
	font-size: 14px;
	font-weight: 600;
	color: #475569;
	display: block;
	margin-bottom: 8px;
}
.link-input-group {
	display: flex;
	gap: 10px;
}
.link-url-input {
	flex-grow: 1;
	background: #fff !important;
	border: 1px solid #cbd5e1 !important;
	padding: 8px 12px !important;
	border-radius: 6px !important;
	font-size: 13px !important;
	color: #0f172a !important;
	font-family: monospace !important;
}
.copy-btn {
	background: #1e293b;
	color: #fff;
	border: none;
	padding: 8px 16px;
	border-radius: 6px;
	font-weight: 600;
	cursor: pointer;
	font-size: 13px;
	transition: background 0.2s;
}
.copy-btn:hover {
	background: #0f172a;
}
.table-responsive {
	overflow-x: auto;
}
.masa-dashboard-table {
	width: 100%;
	border-collapse: collapse;
	text-align: right;
}
.masa-dashboard-table th {
	background: #f8fafc;
	padding: 12px 16px;
	font-weight: 600;
	color: #475569;
	border-bottom: 2px solid #e2e8f0;
	font-size: 13px;
}
.masa-dashboard-table td {
	padding: 14px 16px;
	border-bottom: 1px solid #f1f5f9;
	font-size: 13px;
}
.amount-cell {
	font-weight: 600;
	color: #16a34a;
}
.status-badge {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 4px;
	font-size: 11px;
	font-weight: 600;
}
.status-pending {
	background: #fef3c7;
	color: #d97706;
}
.status-paid {
	background: #dcfce7;
	color: #16a34a;
}
.status-cancelled {
	background: #fee2e2;
	color: #dc2626;
}
.empty-row {
	text-align: center;
	padding: 30px !important;
	color: #94a3b8;
}
@media (max-width: 600px) {
	.link-input-group {
		flex-direction: column;
	}
	.copy-btn {
		width: 100%;
	}
	.masa-dashboard-header {
		flex-direction: column;
		align-items: flex-start;
	}
	.masa-code-display {
		width: 100%;
		align-items: flex-start;
	}
}

.masa-affiliate-alert {
	background: #f8fafc;
	border-right: 4px solid #3b82f6;
	padding: 16px 20px;
	border-radius: 6px;
	color: #1e293b;
	font-weight: 500;
	box-shadow: 0 1px 3px rgba(0,0,0,0.05);
	margin: 20px 0;
	font-family: system-ui, -apple-system, sans-serif;
}
.masa-affiliate-alert a {
	color: #2563eb;
	text-decoration: underline;
	font-weight: 600;
	margin-right: 6px;
}
.masa-affiliate-alert a:hover {
	color: #1d4ed8;
}

