/**
 * Back In Stock Notifier — Extensions & Promotions Page
 * Clean, modern admin UI with button-based filters
 *
 * @since 7.2.0
 */

/* ── Layout ──────────────────────────────────────────────────── */
.cwg-promo-wrap {
	max-width: 1280px;
	margin: 0 auto;
	padding: 20px 0;
}

/* ── Header ──────────────────────────────────────────────────── */
.cwg-promo-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 24px;
	flex-wrap: wrap;
	gap: 16px;
}

.cwg-promo-header h1 {
	font-size: 23px;
	font-weight: 400;
	margin: 0 0 4px;
	color: #1d2327;
	line-height: 1.3;
}

.cwg-promo-subtitle {
	color: #646970;
	margin: 0;
	font-size: 13px;
}

.cwg-promo-header-right {
	display: flex;
	gap: 12px;
	align-items: center;
	flex-wrap: wrap;
}

.cwg-promo-stats {
	display: flex;
	gap: 10px;
}

.cwg-stat {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 4px 10px;
	background: #f0f0f1;
	border-radius: 4px;
	font-size: 12px;
	color: #50575e;
}

.cwg-stat strong {
	color: #1d2327;
}

.cwg-stat--active {
	background: #edf7ed;
	color: #1e4620;
}

.cwg-stat--active strong {
	color: #1e4620;
}

.cwg-last-fetched {
	font-size: 12px;
	color: #8c8f94;
}

.cwg-promo-header-right .button .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
	margin-right: 2px;
	vertical-align: middle;
	line-height: inherit;
}

.cwg-promo-header-right .button.refreshing .dashicons {
	animation: cwg-spin 1s linear infinite;
}

@keyframes cwg-spin {
	from { transform: rotate(0deg); }
	to   { transform: rotate(360deg); }
}

/* ── Bundle Active Banner ───────────────────────────────────── */
.cwg-promo-bundle-banner {
	display: flex;
	align-items: center;
	gap: 14px;
	background: #edf7ed;
	border: 1px solid #c6e1c6;
	border-left: 4px solid #46b450;
	border-radius: 4px;
	padding: 12px 16px;
	margin-bottom: 24px;
}

.cwg-promo-bundle-icon .dashicons {
	font-size: 24px;
	width: 24px;
	height: 24px;
	color: #46b450;
}

.cwg-promo-bundle-info strong {
	display: block;
	font-size: 13px;
	color: #1e4620;
	margin-bottom: 2px;
}

.cwg-promo-bundle-info p {
	color: #50575e;
	margin: 0;
	font-size: 12px;
}

/* ══════════════════════════════════════════════════════════════ */
/* ── TYPE FILTER BUTTONS (Level 1) ────────────────────────── */
/* ══════════════════════════════════════════════════════════════ */
.cwg-promo-type-buttons {
	display: flex;
	gap: 8px;
	margin-bottom: 16px;
	flex-wrap: wrap;
}

.cwg-type-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 10px 20px;
	border: 2px solid #dcdcde;
	background: #fff;
	border-radius: 6px;
	cursor: pointer;
	font-size: 13px;
	font-weight: 600;
	color: #50575e;
	transition: all 0.2s ease;
	white-space: nowrap;
	line-height: 1.3;
}

.cwg-type-btn .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
}

.cwg-type-btn:hover {
	border-color: #2271b1;
	color: #2271b1;
	background: #f0f6fc;
}

/* Active: All */
.cwg-type-btn--all.active {
	background: #2271b1;
	border-color: #2271b1;
	color: #fff;
}

.cwg-type-btn--all.active .dashicons {
	color: #fff;
}

/* Active: Add-ons */
.cwg-type-btn--addon.active {
	background: #2271b1;
	border-color: #2271b1;
	color: #fff;
}

.cwg-type-btn--addon.active .dashicons {
	color: #fff;
}

/* Active: Pro */
.cwg-type-btn--pro.active {
	background: linear-gradient(135deg, #dba617, #b8860b);
	border-color: #b8860b;
	color: #fff;
}

.cwg-type-btn--pro:hover {
	border-color: #b8860b;
	color: #b8860b;
	background: #fef8e7;
}

.cwg-type-btn--pro.active .dashicons {
	color: #fff;
}

.cwg-type-btn--pro .dashicons {
	color: #dba617;
}

/* Count badge inside type buttons */
.cwg-btn-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 20px;
	height: 20px;
	padding: 0 5px;
	border-radius: 10px;
	font-size: 11px;
	font-weight: 700;
	background: rgba(0, 0, 0, 0.08);
	line-height: 1;
}

.cwg-type-btn.active .cwg-btn-count {
	background: rgba(255, 255, 255, 0.3);
}

/* ══════════════════════════════════════════════════════════════ */
/* ── SUBCATEGORY FILTER BUTTONS (Level 2) ─────────────────── */
/* ══════════════════════════════════════════════════════════════ */
.cwg-promo-subcats {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 20px;
	padding: 12px 16px;
	background: #f6f7f7;
	border: 1px solid #e2e4e7;
	border-radius: 6px;
}

.cwg-subcat-btn {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 7px 14px;
	border: 1px solid #c3c4c7;
	background: #fff;
	border-radius: 20px;
	cursor: pointer;
	font-size: 12px;
	font-weight: 500;
	color: #50575e;
	transition: all 0.15s ease;
	white-space: nowrap;
	line-height: 1.3;
}

.cwg-subcat-btn .dashicons {
	font-size: 13px;
	width: 13px;
	height: 13px;
	line-height: 13px;
}

.cwg-subcat-btn:hover {
	border-color: #2271b1;
	color: #2271b1;
	background: #f0f6fc;
}

/* Active Add-on subcategory */
.cwg-subcat-btn.active {
	background: #2271b1;
	color: #fff;
	border-color: #2271b1;
}

.cwg-subcat-btn.active .dashicons {
	color: #fff;
}

.cwg-subcat-btn.active .cwg-btn-count {
	background: rgba(255, 255, 255, 0.25);
	color: #fff;
}

/* Pro subcategory buttons */
.cwg-subcat-btn--pro:hover {
	border-color: #b8860b;
	color: #b8860b;
	background: #fef8e7;
}

.cwg-subcat-btn--pro.active {
	background: linear-gradient(135deg, #dba617, #b8860b);
	border-color: #b8860b;
	color: #fff;
}

/* Pro subcats panel has a subtle gold tint */
.cwg-promo-subcats--pro {
	background: #fffdf5;
	border-color: #ede0b8;
}

/* Subcategory count badge */
.cwg-subcat-btn .cwg-btn-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 18px;
	height: 18px;
	padding: 0 4px;
	border-radius: 9px;
	font-size: 10px;
	font-weight: 700;
	background: rgba(0, 0, 0, 0.06);
	line-height: 1;
}

/* ── Hidden card (filtered out) ──────────────────────────────── */
.cwg-promo-card.cwg-hidden {
	display: none !important;
}

/* ── Pro Plugin Ribbon ────────────────────────────────────────── */
.cwg-promo-type-ribbon {
	position: absolute;
	top: 0;
	right: 0;
	padding: 4px 10px;
	font-size: 10px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.4px;
	color: #fff;
	border-radius: 0 0 0 6px;
	display: inline-flex;
	align-items: center;
	gap: 3px;
	z-index: 1;
}

.cwg-promo-type-ribbon .dashicons {
	font-size: 12px;
	width: 12px;
	height: 12px;
}

.cwg-promo-type-ribbon--pro {
	background: linear-gradient(135deg, #dba617, #b8860b);
}

/* ── Category Tag (inside card) ──────────────────────────────── */
.cwg-promo-card-cat-tag {
	display: inline-flex;
	align-items: center;
	gap: 3px;
	margin-top: 6px;
	padding: 2px 8px;
	background: #f0f0f1;
	border-radius: 3px;
	font-size: 10px;
	color: #646970;
}

.cwg-promo-card-cat-tag .dashicons {
	font-size: 11px;
	width: 11px;
	height: 11px;
}

/* ── Card Grid ───────────────────────────────────────────────── */
.cwg-promo-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 16px;
}

/* ── Product Card ────────────────────────────────────────────── */
.cwg-promo-card {
	background: #fff;
	border: 1px solid #dcdcde;
	border-radius: 6px;
	padding: 0;
	position: relative;
	display: flex;
	flex-direction: column;
	transition: box-shadow 0.2s ease, border-color 0.2s ease;
	overflow: hidden;
}

.cwg-promo-card:hover {
	box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
	border-color: #b4b9be;
}

.cwg-promo-card--sale:not(.cwg-promo-card--active):not(.cwg-promo-card--bundle_activated) {
	border-color: #d63638;
}

.cwg-promo-card--active,
.cwg-promo-card--bundle_activated {
	border-color: #46b450;
	background: #fcfffc;
}

/* ── Status / Badge Ribbon ──────────────────────────────────── */
.cwg-promo-status,
.cwg-promo-badge {
	position: absolute;
	top: 0;
	right: 0;
	padding: 4px 10px;
	font-size: 10px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.4px;
	color: #fff;
	border-radius: 0 0 0 6px;
	display: inline-flex;
	align-items: center;
	gap: 3px;
	z-index: 1;
}

.cwg-promo-status .dashicons,
.cwg-promo-badge .dashicons {
	font-size: 12px;
	width: 12px;
	height: 12px;
}

.cwg-promo-status--active {
	background: #46b450;
}

.cwg-promo-status--bundle_activated {
	background: #2271b1;
}

.cwg-promo-badge--sale { background: #d63638; }
.cwg-promo-badge--hot { background: #e65100; }
.cwg-promo-badge--new { background: #00a32a; }
.cwg-promo-badge--popular { background: #7c3aed; }
.cwg-promo-badge--best-value { background: #2271b1; }
.cwg-promo-badge--big-offer { background: #d63638; }

/* ── Card Body (icon + content) ─────────────────────────────── */
.cwg-promo-card-body {
	display: flex;
	gap: 12px;
	padding: 16px 16px 12px;
	flex-grow: 1;
}

.cwg-promo-card-icon {
	flex-shrink: 0;
}

.cwg-promo-card-icon img {
	border-radius: 8px;
	display: block;
}

.cwg-promo-card-icon .dashicons {
	font-size: 28px;
	width: 48px;
	height: 48px;
	line-height: 48px;
	text-align: center;
	color: #2271b1;
	background: #f0f6fc;
	border-radius: 8px;
	display: block;
}

/* ── Card Content ────────────────────────────────────────────── */
.cwg-promo-card-content {
	min-width: 0;
}

.cwg-promo-card-title {
	font-size: 13px;
	font-weight: 600;
	margin: 0 0 4px;
	color: #1d2327;
	line-height: 1.4;
}

.cwg-promo-card-desc {
	font-size: 12px;
	color: #646970;
	line-height: 1.5;
	margin: 0;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* ── Card Footer ─────────────────────────────────────────────── */
.cwg-promo-card-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 10px 16px;
	background: #f9f9f9;
	border-top: 1px solid #f0f0f1;
}

/* ── Pricing ─────────────────────────────────────────────────── */
.cwg-promo-card-pricing {
	display: flex;
	align-items: baseline;
	gap: 6px;
}

.cwg-promo-price {
	font-size: 15px;
	font-weight: 600;
	color: #1d2327;
}

.cwg-promo-price--old {
	font-size: 12px;
	text-decoration: line-through;
	color: #a7aaad;
	font-weight: 400;
}

.cwg-promo-price--sale {
	color: #d63638;
}

/* ── Card Button ─────────────────────────────────────────────── */
.cwg-promo-card-btn {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 6px 12px;
	background: #2271b1;
	color: #fff;
	text-decoration: none;
	border-radius: 4px;
	font-weight: 600;
	font-size: 12px;
	transition: background 0.15s ease;
	white-space: nowrap;
	line-height: 1.4;
}

.cwg-promo-card-btn:hover,
.cwg-promo-card-btn:focus {
	background: #135e96;
	color: #fff;
}

.cwg-promo-card--sale:not(.cwg-promo-card--active):not(.cwg-promo-card--bundle_activated) .cwg-promo-card-btn {
	background: #d63638;
}

.cwg-promo-card--sale:not(.cwg-promo-card--active):not(.cwg-promo-card--bundle_activated) .cwg-promo-card-btn:hover {
	background: #b32d2e;
}

.cwg-promo-card-btn .dashicons {
	font-size: 12px;
	width: 12px;
	height: 12px;
}

/* ── Active / Installed Label ───────────────────────────────── */
.cwg-promo-active-label {
	display: inline-flex;
	align-items: center;
	gap: 3px;
	padding: 5px 10px;
	border-radius: 4px;
	font-weight: 600;
	font-size: 11px;
	white-space: nowrap;
}

.cwg-promo-active-label .dashicons {
	font-size: 14px;
	width: 14px;
	height: 14px;
}

.cwg-promo-active-label--active {
	background: #edf7ed;
	color: #1e4620;
}

.cwg-promo-active-label--bundle_activated {
	background: #f0f6fc;
	color: #135e96;
}

/* ══════════════════════════════════════════════════════════════ */
/* ── PRO PLUGIN CARDS (in unified grid) ──────────────────────── */
/* ══════════════════════════════════════════════════════════════ */
.cwg-pro-card {
	border-left: 3px solid #dba617;
}

.cwg-pro-card:hover {
	border-left-color: #b8860b;
}

.cwg-pro-card .cwg-promo-card-icon .dashicons {
	color: #dba617;
	background: #fef8e7;
}

.cwg-pro-card .cwg-promo-card-btn {
	background: linear-gradient(135deg, #dba617, #b8860b);
}

.cwg-pro-card .cwg-promo-card-btn:hover {
	background: #b8860b;
}

.cwg-pro-card .cwg-promo-card-cat-tag {
	background: #fef8e7;
	color: #8b6914;
}

/* ── Empty State ─────────────────────────────────────────────── */
.cwg-promo-empty {
	text-align: center;
	padding: 48px 24px;
	background: #fff;
	border: 1px solid #dcdcde;
	border-radius: 6px;
}

.cwg-promo-empty-icon .dashicons {
	font-size: 40px;
	width: 40px;
	height: 40px;
	color: #dcdcde;
	margin-bottom: 12px;
}

.cwg-promo-empty h2 {
	font-size: 18px;
	font-weight: 400;
	margin: 0 0 8px;
	color: #1d2327;
}

.cwg-promo-empty p {
	color: #646970;
	margin: 0 0 20px;
	max-width: 440px;
	margin-left: auto;
	margin-right: auto;
	font-size: 13px;
}

/* ── Footer ──────────────────────────────────────────────────── */
.cwg-promo-footer {
	margin-top: 28px;
	padding-top: 16px;
	border-top: 1px solid #dcdcde;
	text-align: center;
	color: #646970;
	font-size: 13px;
}

.cwg-promo-footer a {
	text-decoration: none;
}

/* ── Email Settings Buttons (Settings Page) ──────────────────── */
.cwg-email-buttons-wrap {
	padding: 12px 0;
}

.cwg-email-btn-row {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 10px;
}

.cwg-email-template-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 16px;
	background: #2271b1;
	color: #fff !important;
	text-decoration: none !important;
	border-radius: 4px;
	font-weight: 600;
	font-size: 13px;
	transition: background 0.15s ease;
}

.cwg-email-template-btn:hover,
.cwg-email-template-btn:focus {
	background: #135e96;
	color: #fff !important;
}

.cwg-email-template-btn .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
}

.cwg-email-info-box {
	background: #f0f6fc;
	border: 1px solid #c5d9ed;
	border-radius: 4px;
	padding: 10px 14px;
	margin-top: 10px;
	font-size: 12px;
	color: #50575e;
	line-height: 1.5;
}

.cwg-email-info-box .dashicons {
	color: #2271b1;
	margin-right: 4px;
	vertical-align: middle;
	font-size: 14px;
	width: 14px;
	height: 14px;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media screen and (max-width: 960px) {
	.cwg-promo-grid {
		grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	}
}

@media screen and (max-width: 600px) {
	.cwg-promo-header {
		flex-direction: column;
		align-items: flex-start;
	}
	.cwg-promo-header-right {
		flex-direction: column;
		align-items: flex-start;
	}
	.cwg-promo-grid {
		grid-template-columns: 1fr;
	}
	.cwg-promo-type-buttons {
		flex-direction: column;
	}
	.cwg-type-btn {
		width: 100%;
		justify-content: center;
	}
}
