/* ============================================================
   Mcakey – Category Cards Widget
   ============================================================ */

/* Grid */
.mcakey-cat-grid {
	display: grid;
	gap: 16px;
	width: 100%;
}

.mcakey-cols-1 { grid-template-columns: repeat(1, 1fr); }
.mcakey-cols-2 { grid-template-columns: repeat(2, 1fr); }
.mcakey-cols-3 { grid-template-columns: repeat(3, 1fr); }
.mcakey-cols-4 { grid-template-columns: repeat(4, 1fr); }
.mcakey-cols-5 { grid-template-columns: repeat(5, 1fr); }
.mcakey-cols-6 { grid-template-columns: repeat(6, 1fr); }

/* Responsive breakpoints */
@media (max-width: 1024px) {
	.mcakey-cols-5,
	.mcakey-cols-6 { grid-template-columns: repeat(3, 1fr); }
	.mcakey-cols-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
	.mcakey-cols-3,
	.mcakey-cols-4,
	.mcakey-cols-5,
	.mcakey-cols-6 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
	.mcakey-cat-grid { grid-template-columns: 1fr !important; }
}

/* ── Card ─────────────────────────────────────────────────── */
.mcakey-cat-card {
	position: relative;
	height: 280px;
	border-radius: 16px;
	overflow: hidden;
	border: 1.5px solid #eeeeee;
	transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
	cursor: pointer;
}

.mcakey-cat-card:hover {
	border-color: var(--mcakey-card-color, #1e90ff);
	box-shadow: 0 8px 32px color-mix(in srgb, var(--mcakey-card-color, #1e90ff) 40%, transparent);
	transform: translateY(-4px);
}

/* Full-card link — covers entire card */
.mcakey-cat-card__link {
	display: block;
	position: absolute;
	inset: 0;
	text-decoration: none;
	color: inherit;
}

/* ── Background layer ─────────────────────────────────────── */
.mcakey-cat-bg {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
}

/* Shape decorations — all styles are inline per-preset, no helper classes needed */

/* ── Content layer ────────────────────────────────────────── */
.mcakey-cat-card__content {
	position: absolute;
	z-index: 2;
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 20px 24px;
	max-width: 55%;
}

/* Text positions */
.mcakey-text-top-left     .mcakey-cat-card__content { top: 0;    left: 0;  }
.mcakey-text-top-right    .mcakey-cat-card__content { top: 0;    right: 0; left: auto; text-align: right; }
.mcakey-text-bottom-left  .mcakey-cat-card__content { bottom: 0; left: 0;  }
.mcakey-text-bottom-right .mcakey-cat-card__content { bottom: 0; right: 0; left: auto; text-align: right; }

.mcakey-cat-card__title {
	margin: 0;
	padding: 0;
	font-size: clamp(1rem, 1.4vw, 1.35rem);
	font-weight: 600;
	color: #ffffff;
	line-height: 1.25;
}

.mcakey-cat-card__cta {
	font-size: 0.85rem;
	color: rgba(255, 255, 255, 0.85);
	font-weight: 400;
	letter-spacing: 0.01em;
}

/* ── Product image ────────────────────────────────────────── */
.mcakey-cat-card__img-wrap {
	position: absolute;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
}

.mcakey-cat-card__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
	filter: drop-shadow(0 8px 24px rgba(0,0,0,0.25));
}

/* Image positions */
.mcakey-img-right .mcakey-cat-card__img-wrap {
	right: -5%;
	top: 50%;
	transform: translateY(-50%);
	width: 52%;
	height: 90%;
}

.mcakey-img-left .mcakey-cat-card__img-wrap {
	left: -5%;
	top: 50%;
	transform: translateY(-50%);
	width: 52%;
	height: 90%;
}

.mcakey-img-left .mcakey-cat-card__content {
	left: auto;
	right: 0;
}

.mcakey-img-bottom .mcakey-cat-card__img-wrap {
	bottom: 0;
	left: 50%;
	transform: translateX(-50%);
	width: 60%;
	height: 55%;
}

.mcakey-img-bottom .mcakey-cat-card__content {
	max-width: 100%;
}

/* Corner variants: same anchor offset/size as the side variants (right/
   left), just pinned to the bottom instead of vertically centered —
   image sits in a bottom corner rather than spanning the full width like
   plain "Bottom". Push content to the opposite side so it never overlaps,
   same defensive pattern as .mcakey-img-left does for the side variant. */
.mcakey-img-bottom-left .mcakey-cat-card__img-wrap {
	left: -5%;
	bottom: -5%;
	width: 55%;
	height: 55%;
}

.mcakey-img-bottom-left .mcakey-cat-card__content {
	left: auto;
	right: 0;
}

.mcakey-img-bottom-right .mcakey-cat-card__img-wrap {
	right: -5%;
	bottom: -5%;
	width: 55%;
	height: 55%;
}

.mcakey-img-bottom-right .mcakey-cat-card__content {
	left: 0;
	right: auto;
}

/* When image is hidden — content can use full width */
.mcakey-img-hidden .mcakey-cat-card__content {
	max-width: 100%;
}

/* ── Fallback empty state ─────────────────────────────────── */
.mcakey-no-cats {
	color: #666;
	font-style: italic;
}