/* ==========================================================================
   Woo Mã Giảm Giá Tiện Lợi — Giao diện mã kiểu Shopee
   ========================================================================== */

.wmgg-coupons {
	--wmgg-red: #ee4d2d;
	--wmgg-red-dark: #d73211;
	--wmgg-bg: #fff;
	--wmgg-border: #f0f0f0;
	--wmgg-text: #222;
	--wmgg-muted: #757575;
	margin: 24px 0;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.wmgg-coupons-title {
	font-size: 18px;
	font-weight: 700;
	margin: 0 0 14px;
	color: var(--wmgg-text);
	display: flex;
	align-items: center;
	gap: 6px;
}

.wmgg-coupons-grid {
	display: grid;
	gap: 14px;
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.wmgg-coupons[data-columns="1"] .wmgg-coupons-grid { grid-template-columns: 1fr; }
.wmgg-coupons[data-columns="3"] .wmgg-coupons-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.wmgg-coupons[data-columns="4"] .wmgg-coupons-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 768px) {
	.wmgg-coupons-grid,
	.wmgg-coupons[data-columns="3"] .wmgg-coupons-grid,
	.wmgg-coupons[data-columns="4"] .wmgg-coupons-grid {
		grid-template-columns: 1fr;
	}
}

/* --- Thẻ vé giảm giá --- */
.wmgg-coupon {
	position: relative;
	display: flex;
	background: var(--wmgg-bg);
	border: 1px solid var(--wmgg-border);
	border-radius: 10px;
	overflow: hidden;
	box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.wmgg-coupon:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 18px rgba(238, 77, 45, 0.18);
}

.wmgg-coupon.is-eligible {
	border-color: var(--wmgg-red);
	box-shadow: 0 0 0 2px rgba(238, 77, 45, 0.18);
}

/* Khối bên trái (phần trăm) */
.wmgg-coupon-left {
	flex: 0 0 96px;
	background: linear-gradient(135deg, var(--wmgg-red), var(--wmgg-red-dark));
	color: #fff;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 14px 8px;
	position: relative;
}

/* Dải răng cưa phân cách (kiểu vé) */
.wmgg-coupon-left::after {
	content: "";
	position: absolute;
	top: 0;
	right: -1px;
	height: 100%;
	width: 2px;
	background-image: radial-gradient(circle, var(--wmgg-bg) 3px, transparent 3px);
	background-size: 2px 12px;
	background-repeat: repeat-y;
}

/* Hai nốt tròn lõm trên/dưới tạo hình vé */
.wmgg-coupon-left::before {
	content: "";
	position: absolute;
	right: -7px;
	top: -7px;
	width: 14px;
	height: 14px;
	background: var(--wmgg-border);
	border-radius: 50%;
	box-shadow: 0 calc(100% + 14px) 0 0 var(--wmgg-border);
}

.wmgg-coupon-percent {
	font-size: 26px;
	font-weight: 800;
	line-height: 1;
}

.wmgg-coupon-label {
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 1px;
	margin-top: 4px;
	opacity: 0.95;
}

/* Khối nội dung bên phải */
.wmgg-coupon-body {
	flex: 1;
	padding: 12px 14px;
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
}

.wmgg-coupon-code-row {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}

.wmgg-coupon-code {
	font-size: 16px;
	font-weight: 800;
	letter-spacing: 0.5px;
	color: var(--wmgg-text);
	border: 1px dashed var(--wmgg-red);
	border-radius: 6px;
	padding: 3px 10px;
	background: #fff6f3;
}

.wmgg-coupon-actions {
	display: flex;
	gap: 8px;
	margin-top: 4px;
	flex-wrap: wrap;
}

.wmgg-copy,
.wmgg-use {
	appearance: none;
	cursor: pointer;
	font-size: 13px;
	font-weight: 600;
	padding: 7px 14px;
	border-radius: 6px;
	transition: background 0.15s ease, color 0.15s ease, transform 0.05s ease;
	font-family: inherit;
	flex: 1 1 auto;
	text-align: center;
}

/* Nút Sao chép: kiểu viền */
.wmgg-copy {
	background: #fff;
	color: var(--wmgg-red);
	border: 1px solid var(--wmgg-red);
}
.wmgg-copy:hover { background: #fff6f3; }

/* Nút Dùng mã này: nền đỏ nổi bật */
.wmgg-use {
	background: var(--wmgg-red);
	color: #fff;
	border: 1px solid var(--wmgg-red);
}
.wmgg-use:hover { background: var(--wmgg-red-dark); border-color: var(--wmgg-red-dark); }

.wmgg-copy:active,
.wmgg-use:active { transform: scale(0.97); }

.wmgg-copy.wmgg-copied {
	background: #2e7d32;
	border-color: #2e7d32;
	color: #fff;
	pointer-events: none;
}

.wmgg-use.wmgg-loading {
	opacity: 0.7;
	pointer-events: none;
}

.wmgg-coupon-cond {
	margin: 0;
	font-size: 13px;
	color: var(--wmgg-muted);
	line-height: 1.4;
}

.wmgg-coupon-badge {
	display: inline-block;
	font-size: 12px;
	font-weight: 600;
	color: #2e7d32;
	background: #eafaef;
	border-radius: 4px;
	padding: 2px 8px;
	width: fit-content;
}
