/* ===========================================================================
 * Maithu Product Check — Western UI Style
 * --------------------------------------------------------------------------
 * Mọi class prefix: .mtpc-
 * =========================================================================== */

/* ---------- Animations ---------- */
@keyframes mtpc-fade-in {
	from { opacity: 0; transform: translateY(10px); }
	to { opacity: 1; transform: translateY(0); }
}

@keyframes mtpc-skeleton-shimmer {
	0% { background-position: 200% 0; }
	100% { background-position: -200% 0; }
}

/* ---------- Base Widget ---------- */
.mtpc-widget {
	width: 100%;
	margin: 2em 0;
	font-family: inherit;
	font-size: 16px;
	line-height: 1.6;
	color: #333;
}

.mtpc-widget * {
	box-sizing: border-box;
}

/* ---------- Lock overlay (khi shortcode bị tắt qua settings) ---------- */

.mtpc-widget--locked {
	position: relative;
}

.mtpc-lock-overlay {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(255, 255, 255, 0.35);
	backdrop-filter: blur(1.5px);
	-webkit-backdrop-filter: blur(1.5px);
	z-index: 10;
	border-radius: 4px;
	padding: 1em;
}

.mtpc-lock-overlay__message {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 14px;
	max-width: 480px;
	padding: 24px 32px;
	background: #fff;
	border-radius: 8px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
	text-align: center;
}

.mtpc-lock-overlay__icon {
	color: #888;
	flex-shrink: 0;
}

.mtpc-lock-overlay__text {
	margin: 0;
	color: #333;
	font-size: 15px;
	font-weight: 500;
	line-height: 1.5;
}

/* ---------- Form Wrapper ---------- */
.mtpc-form-wrapper {
	background: #f5f5f5;
	padding: 40px 20px;
	text-align: center;
	border-radius: 4px;
	margin-bottom: 20px;
}

.mtpc-title {
	font-size: 24px;
	font-weight: 700;
	text-transform: uppercase;
	color: #222;
	margin: 0 0 16px 0;
}

.mtpc-desc {
	font-size: 16px;
	color: #555;
	max-width: 1000px;
	margin: 0 auto 24px auto;
	line-height: 1.5;
}

.mtpc-hotline {
	margin-top: 24px;
	font-size: 16px;
	color: #444;
}

.mtpc-hotline a {
	color: #0073e6;
	text-decoration: none;
}

/* ---------- Form Elements ---------- */
.mtpc-form {
	width: 100%;
	max-width: 500px;
	margin: 0 auto;
}

.mtpc-field--center {
	width: 100%;
}

.mtpc-input-group {
	width: 100%;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.mtpc-input-group--dual {
	flex-direction: row;
}

.mtpc-widget input.mtpc-input[type="text"],
.mtpc-widget select.mtpc-select {
	width: 100% !important;
	max-width: 100% !important;
	height: 48px !important;
	padding: 0 16px !important;
	border: 1px solid #ced4da !important;
	border-radius: 6px !important;
	font-size: 16px !important;
	background: #fff !important;
	color: #212529 !important;
	box-shadow: none !important;
	transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out !important;
}

.mtpc-widget input.mtpc-input[type="text"]:focus,
.mtpc-widget select.mtpc-select:focus {
	outline: none !important;
	border-color: #86b7fe !important;
	box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25) !important;
}

.mtpc-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 48px;
	min-width: 240px;
	padding: 2px 60px 0;
	margin-top: 16px;
	border: none;
	border-radius: 4px;
	background: #0073e6;
	color: #ffffff;
	font-size: 16px;
	font-weight: 600;
	line-height: 1;
	text-transform: uppercase;
	cursor: pointer;
	transition: background 0.2s ease;
}

.mtpc-button:hover {
	background: #005bb5;
}

.mtpc-button[disabled] {
	background: #cfcfcf;
	color: #888;
	cursor: not-allowed;
}

.mtpc-inline-error {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	color: #c62828;
	background: #ffebee;
	padding: 6px 16px;
	border-radius: 20px;
	font-size: 14px;
	font-weight: 500;
	margin-top: 12px;
	margin-bottom: 0;
}

/* ---------- Result Area ---------- */
.mtpc-result {
	min-height: 10px;
	animation: mtpc-fade-in 0.4s ease-out;
}

.mtpc-banner {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	padding: 16px;
	text-align: center;
	border-radius: 4px;
	font-size: 16px;
	font-weight: 600;
	margin-bottom: 24px;
}

.mtpc-banner--ok {
	background: #e3f2fd;
	color: #1565c0;
	border: 1px solid #bbdefb;
}

.mtpc-banner--error {
	background: #fff2f2;
	color: #c62828;
	border: 1px solid #ffcdd2;
}

.mtpc-result__error {
	background: #fff2f2;
	color: #c62828;
	padding: 16px;
	text-align: center;
	border-radius: 4px;
	border: 1px solid #ffcdd2;
}

/* ---------- Skeleton Loader ---------- */
.mtpc-skeleton-card {
	background: #ffffff;
	border-radius: 8px;
	box-shadow: 0 4px 12px rgba(0,0,0,0.05);
	padding: 24px;
	display: flex;
	gap: 24px;
	margin-top: 20px;
	border: 1px solid #eaeaea;
}
.mtpc-skel-img {
	width: 200px;
	height: 200px;
	border-radius: 6px;
	flex-shrink: 0;
}
.mtpc-skel-lines {
	display: flex;
	flex-direction: column;
	gap: 16px;
	justify-content: center;
	flex-grow: 1;
}
.mtpc-skel-line { height: 16px; border-radius: 2px; width: 100%; }
.mtpc-skel-line.short { width: 50%; }

.mtpc-skel-anim {
	background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
	background-size: 200% 100%;
	animation: mtpc-skeleton-shimmer 1.5s infinite linear;
}

/* ---------- Result Card ---------- */
.mtpc-card {
	background: #ffffff;
	border-radius: 8px;
	box-shadow: 0 4px 12px rgba(0,0,0,0.05);
	padding: 24px;
	display: flex;
	gap: 24px;
	margin-top: 20px;
	border: 1px solid #eaeaea;
}

.mtpc-card__image {
	width: 200px;
	height: 200px;
	object-fit: contain;
	background: #f9f9f9;
	border-radius: 6px;
	padding: 12px;
	flex-shrink: 0;
}

.mtpc-card__image--placeholder {
	background: #f0f0f0;
}

.mtpc-card__body {
	display: flex;
	flex-direction: column;
	justify-content: center;
	flex-grow: 1;
}

.mtpc-product-name {
	font-size: 18px;
	font-weight: 700;
	text-transform: uppercase;
	color: #222;
	margin: 0 0 4px 0;
}

.mtpc-product-sku {
	font-size: 14px;
	color: #666;
	margin-bottom: 20px;
}

.mtpc-info-grid {
	display: flex;
	flex-direction: column;
}

.mtpc-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 12px 0;
	border-bottom: 1px solid #f0f0f0;
	font-size: 14px;
}

.mtpc-row:last-child {
	border-bottom: none;
}

.mtpc-row__label {
	color: #555;
	font-weight: 600;
}

.mtpc-row__value {
	color: #222;
	font-weight: 700;
	display: flex;
	align-items: center;
	gap: 12px;
}

/* ---------- Badges ---------- */
.mtpc-badge {
	display: inline-block;
	padding: 4px 8px;
	border-radius: 4px;
	font-size: 12px;
	font-weight: 700;
	text-transform: lowercase;
	line-height: 1;
	color: #fff;
}

.mtpc-badge::first-letter {
	text-transform: uppercase;
}

.mtpc-badge--ok {
	background: #2e7d32;
}

.mtpc-badge--danger {
	background: #f9a825;
}

/* ---------- Mobile ---------- */
@media (max-width: 600px) {
	.mtpc-card, .mtpc-skeleton-card {
		flex-direction: column;
		align-items: center;
		text-align: center;
		gap: 20px;
	}
	
	.mtpc-card__image, .mtpc-skel-img {
		margin: 0 auto;
	}

	.mtpc-row {
		flex-direction: column;
		gap: 8px;
		justify-content: center;
		text-align: center;
	}
	
	.mtpc-row__value {
		justify-content: center;
	}
	
	.mtpc-input-group--dual {
		flex-direction: column;
	}
}

/* ---------- Accessibility: respect prefers-reduced-motion ---------- */
/* User chọn "reduce motion" trong OS → tắt skeleton shimmer + fade-in.
   Scope dưới .mtpc-widget để KHÔNG đụng animation của theme/plugin khác. */
@media (prefers-reduced-motion: reduce) {
	.mtpc-widget *,
	.mtpc-widget *::before,
	.mtpc-widget *::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}
