.wc-apg-grid {
	display: grid;
	gap: 24px;
	width: 100%;
	box-sizing: border-box;
}

/* Columns */
.wc-apg-grid.cols-4 {
	grid-template-columns: repeat(4, 1fr);
}
.wc-apg-grid.cols-3 {
	grid-template-columns: repeat(3, 1fr);
}
.wc-apg-grid.cols-2 {
	grid-template-columns: repeat(2, 1fr);
}
.wc-apg-grid.cols-1 {
	grid-template-columns: 1fr;
}

@media (max-width: 1024px) {
	.wc-apg-grid.cols-4,
	.wc-apg-grid.cols-3 {
		grid-template-columns: repeat(2, 1fr);
	}
}
@media (max-width: 640px) {
	.wc-apg-grid.cols-4,
	.wc-apg-grid.cols-3,
	.wc-apg-grid.cols-2 {
		grid-template-columns: 1fr;
	}
}

/* Card layout */
.wc-apg-card {
	display: flex;
	background: #ffffff;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	padding: 24px;
	text-decoration: none !important;
	color: #121212 !important;
	position: relative;
	overflow: hidden;
	transition: box-shadow 0.25s ease, transform 0.25s ease;
	box-sizing: border-box;
}

.wc-apg-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.04), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
	border-color: #d1d5db;
}

/* Left part (Thumb & Badge) */
.wc-apg-left {
	display: flex;
	flex-direction: column;
	align-items: center;
	flex-shrink: 0;
	width: 76px;
	margin-right: 18px;
	position: relative;
	z-index: 2; /* Position thumbnail above rank overlay */
}

/* Giant background rank number */
.wc-apg-rank-num {
	position: absolute;
	top: -6px;
	left: -2px;
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	font-size: 72px;
	font-weight: 900;
	color: #cbd5e1;
	line-height: 1;
	z-index: 1;
	user-select: none;
	pointer-events: none;
}

.wc-apg-thumb-wrapper {
	width: 60px;
	height: 60px;
	border-radius: 10px;
	overflow: hidden;
	position: relative;
	background: #ffffff;
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.04);
	border: 1px solid #f1f5f9;
}

.wc-apg-thumb {
	width: 100% !important;
	height: 100% !important;
	object-fit: cover !important;
	display: block;
}

.wc-apg-sale-badge {
	display: inline-block;
	background-color: #fef2f2;
	border: 1px solid #fee2e2;
	color: #dc2626;
	font-size: 11px;
	font-weight: 600;
	padding: 2px 6px;
	border-radius: 4px;
	margin-top: 10px;
	text-align: center;
	white-space: nowrap;
}

/* Right part (Details) */
.wc-apg-right {
	display: flex;
	flex-direction: column;
	flex-grow: 1;
	position: relative;
	z-index: 2;
}

.wc-apg-title {
	font-family: 'Inter', -apple-system, sans-serif;
	font-size: 16px;
	font-weight: 700;
	color: #121212;
	margin: 0 0 4px 0 !important;
	line-height: 1.3;
}

.wc-apg-desc {
	font-family: 'Inter', -apple-system, sans-serif;
	font-size: 13px;
	color: #4b5563;
	margin: 0 0 12px 0 !important;
	line-height: 1.4;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.wc-apg-rating {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-top: auto;
	margin-bottom: 8px;
}

.wc-apg-stars {
	color: #f59e0b;
	font-size: 13px;
	letter-spacing: -0.5px;
}

.wc-apg-reviews {
	font-family: 'Inter', -apple-system, sans-serif;
	font-size: 12px;
	color: #2563eb;
	font-weight: 500;
}

.wc-apg-price-row {
	display: flex;
	align-items: baseline;
	gap: 2px;
	font-family: 'Inter', -apple-system, sans-serif;
}

.wc-apg-price-current {
	font-size: 18px;
	font-weight: 800;
	color: #121212;
}

.wc-apg-price-current .woocommerce-Price-amount {
	font-size: 18px;
	font-weight: 800;
	color: #121212;
}

.wc-apg-price-lifetime {
	font-size: 12px;
	color: #9ca3af;
	font-weight: 500;
}

.wc-apg-price-original {
	font-size: 12px;
	text-decoration: line-through;
	color: #9ca3af;
	margin-left: 4px;
}

.wc-apg-price-original .woocommerce-Price-amount {
	font-size: 12px;
	text-decoration: line-through;
	color: #9ca3af;
}

/* Category Grid Header Layout */
.wc-apg-section-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 24px;
	width: 100%;
	box-sizing: border-box;
}

.wc-apg-section-title {
	font-family: 'Inter', -apple-system, sans-serif;
	font-size: 24px;
	font-weight: 800;
	color: #121212;
	margin: 0 !important;
	letter-spacing: -0.5px;
}

.wc-apg-view-all {
	font-family: 'Inter', -apple-system, sans-serif;
	font-size: 13px;
	font-weight: 600;
	color: #4b5563;
	text-decoration: none !important;
	border: 1px solid #d1d5db;
	border-radius: 6px;
	padding: 6px 14px;
	transition: all 0.2s ease;
	display: inline-flex;
	align-items: center;
}

.wc-apg-view-all:hover {
	background-color: #f9fafb;
	color: #121212;
	border-color: #9ca3af;
}

/* Modal Popup Styles */
.wc-apg-modal {
	position: fixed;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	z-index: 999999;
	display: none;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
}

.wc-apg-modal-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(18, 18, 18, 0.6);
	backdrop-filter: blur(4px);
}

.wc-apg-modal-content {
	position: relative;
	background: #ffffff;
	width: 90%;
	max-width: 1200px;
	height: 85vh;
	border-radius: 16px;
	box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	z-index: 2;
	animation: wcApgSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
	box-sizing: border-box;
}

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

.wc-apg-modal-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 20px 24px;
	border-bottom: 1px solid #f1f5f9;
}

.wc-apg-modal-title {
	font-family: 'Inter', -apple-system, sans-serif;
	font-size: 20px;
	font-weight: 800;
	color: #121212;
	margin: 0 !important;
}

.wc-apg-modal-close {
	background: none;
	border: none;
	font-size: 32px;
	font-weight: 300;
	color: #64748b;
	cursor: pointer;
	line-height: 1;
	padding: 0;
	transition: color 0.2s ease;
}

.wc-apg-modal-close:hover {
	color: #121212;
}

.wc-apg-modal-search-wrapper {
	padding: 16px 24px;
	border-bottom: 1px solid #f1f5f9;
	background: #f8fafc;
}

.wc-apg-modal-search {
	width: 100%;
	padding: 12px 16px;
	border: 1px solid #cbd5e1;
	border-radius: 8px;
	font-family: 'Inter', -apple-system, sans-serif;
	font-size: 14px;
	color: #121212;
	box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
	box-sizing: border-box;
}

.wc-apg-modal-search:focus {
	outline: none;
	border-color: #2563eb;
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15), inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

.wc-apg-modal-body {
	flex-grow: 1;
	overflow-y: auto;
	padding: 24px;
	background-color: #fcfcfd;
}

.wc-apg-modal-body::-webkit-scrollbar {
	width: 8px;
}

.wc-apg-modal-body::-webkit-scrollbar-track {
	background: #f1f5f9;
}

.wc-apg-modal-body::-webkit-scrollbar-thumb {
	background: #cbd5e1;
	border-radius: 4px;
}

.wc-apg-modal-body::-webkit-scrollbar-thumb:hover {
	background: #94a3b8;
}

