/*
 * Mighty Kids — Product Showcase block
 *
 * The card/ribbon/filter/value-bar visual treatment lives in mk-shop.css
 * (with .mk-showcase added as a scope). This file only holds what is
 * UNIQUE to the block: outer wrapper layout, heading typography, Swiper
 * carousel layout, navigation arrows, pagination dots, CTA, empty state.
 * Do NOT re-declare card/ribbon/filter styles here — that desyncs the
 * block from /shop/.
 */

/* ============================================================================
   WRAPPER
   ============================================================================ */
.mk-showcase {
	/* Outer bottom spacing only — horizontal padding/width comes from
	   ul.products and .mk-shop-value-bar rules so the inner layout
	   matches /shop/ pixel-for-pixel. */
	margin: 0 auto 48px;
	box-sizing: border-box;
}

/* ============================================================================
   OPTIONAL HEADER (heading + subheading) — only rendered when the editor
   fills these fields. Shop page doesn't use them, so they have no archive
   counterpart.
   ============================================================================ */
.mk-showcase__header {
	text-align: center;
	margin: 0 0 24px;
}

.mk-showcase__title {
	font-size: clamp(1.75rem, 3vw, 2.5rem);
	font-weight: 700;
	line-height: 1.15;
	margin: 0 0 12px;
	color: #0f1e2e;
}

.mk-showcase__subtitle {
	font-size: 1rem;
	color: #5a6775;
	margin: 0 auto;
	max-width: 60ch;
	line-height: 1.5;
}

/* Hide filtered products / slides (used in both grid and carousel). */
.mk-showcase .mk-filter-hidden {
	display: none !important;
}

/* mk-wc-blocks.css (homepage product grid) globally forces
   `.wc-product-image { aspect-ratio: 1/1 !important }`. We want the 3:4
   shop aspect when the block is on the page, so override with higher
   specificity + important here. */
.mk-showcase ul.products li.product .wc-product-image {
	aspect-ratio: 3 / 4 !important;
	padding-bottom: 0 !important;
	height: auto !important;
}

/* ============================================================================
   CAROUSEL (Swiper) — overrides and extras only. Card visuals come from
   mk-shop.css.
   ============================================================================ */

/* Swiper requires its wrapper to be flex. The shop CSS applies
   `display: grid !important` to .mk-showcase ul.products, so we override. */
.mk-showcase--carousel ul.products.swiper-wrapper {
	display: flex !important;
	grid-template-columns: none !important;
	gap: 0 !important;
	padding: 0 !important;
	max-width: none !important;
	margin: 0 !important;
	align-items: stretch !important;
}

/* Swiper sets slide widths via inline element.style.width. Inline styles
   beat any non-!important stylesheet rule, so WC layout's `width: 22.05%`
   cannot override them. We only need flex: 0 0 auto to suppress flex-grow.
   Margins: Swiper controls margin-right (spaceBetween); zero the rest so
   WooCommerce's default `margin: 0 0 2em` doesn't push slides out of view. */
.mk-showcase--carousel ul.products li.product.swiper-slide {
	flex: 0 0 auto;
	margin-top: 0 !important;
	margin-bottom: 0 !important;
	margin-left: 0 !important;
}

.mk-showcase__carousel {
	position: relative;
	/* 50px gutter on each side so arrows sit outside the card area */
	margin: 0 50px;
}

@media (max-width: 550px) {
	.mk-showcase__carousel { margin-left: 0; margin-right: 0; }
}

.mk-showcase__swiper-clip {
	/* Clip slides that overflow left/right (Swiper peek); allow full vertical
	   overflow so shadows, ribbons, and hover lift are never cut. */
	overflow-x: clip;
	overflow-y: visible;
}

.mk-showcase__swiper {
	overflow: visible;
}

/* Carousel slides: no hover lift or scale — avoids fighting the clip boundary */
.mk-showcase--carousel ul.products li.product.swiper-slide:hover {
	transform: none !important;
}
.mk-showcase--carousel ul.products li.product.swiper-slide:hover .wc-product-image img {
	transform: none !important;
}

.mk-showcase__pagination {
	/* Override Swiper's default position:absolute so dots flow below the cards */
	position: static !important;
	margin-top: 16px;
	text-align: center;
}

.mk-showcase__pagination .swiper-pagination-bullet {
	width: 8px;
	height: 8px;
	opacity: 0.3;
	background: #2c3e50;
	transition: opacity 0.2s, transform 0.2s;
}

.mk-showcase__pagination .swiper-pagination-bullet-active {
	opacity: 1;
	transform: scale(1.2);
	background: #c98e1f;
}

.mk-showcase__nav {
	position: absolute;
	top: calc(50% - 22px);
	transform: translateY(-50%);
	z-index: 5;
	background: #fff;
	border: 1px solid #ddd;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	cursor: pointer;
	font-size: 28px;
	line-height: 1;
	color: #2c3e50;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
	transition: background-color 0.2s, color 0.2s, border-color 0.2s;
	display: flex;
	align-items: center;
	justify-content: center;
}

.mk-showcase__nav:hover {
	background: #2c3e50;
	border-color: #2c3e50;
	color: #fff;
}

.mk-showcase__nav--prev { left: -44px; }
.mk-showcase__nav--next { right: -44px; }

.mk-showcase__nav[aria-disabled="true"],
.mk-showcase__nav.swiper-button-disabled {
	opacity: 0.35;
	pointer-events: none;
}

@media (max-width: 550px) {
	.mk-showcase__nav { display: none; }
}

/* ============================================================================
   CTA
   ============================================================================ */
.mk-showcase__cta {
	text-align: center;
	margin-top: 32px;
}

.mk-showcase__cta-btn {
	display: inline-block;
	background: #c98e1f;
	color: #fff;
	padding: 14px 32px;
	border-radius: 999px;
	font-weight: 600;
	font-size: 15px;
	text-decoration: none;
	transition: background-color 0.2s, transform 0.2s;
}

.mk-showcase__cta-btn:hover {
	background: #a37214;
	color: #fff;
	transform: translateY(-1px);
}

/* ============================================================================
   EMPTY STATE
   ============================================================================ */
.mk-showcase__empty {
	text-align: center;
	padding: 48px 16px;
	color: #5a6775;
	font-style: italic;
}
