/**
 * JR WooCommerce category hero.
 *
 * Provides the custom product-category hero used by Jedi-Robe category
 * archives. The component replaces WooCommerce's default archive heading
 * and term description with a responsive text, image and review-stat layout.
 *
 * Responsive layout:
 * - Desktop: 1.2fr / 1fr text-and-image split.
 * - Tablet <= 992px: balanced 1fr / 1fr split.
 * - Mobile <= 768px: image first, content second.
 *
 * Component typography inherits from the shared Jedi Theme typography
 * system wherever possible.
 *
 * @package    Jedi_Theme
 * @subpackage Category_Hero
 * @since      1.0.0
 */


/* ==========================================================================
   WooCommerce archive defaults
   ========================================================================== */

/**
 * Hide the native WooCommerce category heading and term description because
 * the custom JR category hero provides the visible archive introduction.
 */
body.tax-product_cat
	.woocommerce-products-header,
body.tax-product_cat
	.term-description {
	display: none;
}


/* ==========================================================================
   Category title
   ========================================================================== */

body.jr-dark-commerce
	.jr-category-title {
	margin-bottom: 24px;
}


/* ==========================================================================
   Category hero
   ========================================================================== */

body.jr-dark-commerce
	.jr-category-hero {
	display: grid;

	width: 100%;

	grid-template-columns:
		minmax(0, 1.2fr)
		minmax(0, 1fr);

	align-items: center;

	gap:
		clamp(
			2rem,
			4vw,
			4rem
		);

	margin: 0;
	padding: 0;
}


/* ==========================================================================
   Hero content
   ========================================================================== */

body.jr-dark-commerce
	.jr-category-hero__content {
	display: flex;

	min-width: 0;

	flex-direction: column;
	align-items: flex-start;
	align-self: flex-start;
}


/* ==========================================================================
   Hero title
   ========================================================================== */

body.jr-dark-commerce
	.jr-category-hero__content
	.jr-hero-title,
body.jr-dark-commerce
	.jr-category-hero__content
	.jr-hero-title
	.elementor-heading-title {
	margin: 0;
}


/* ==========================================================================
   Hero copy
   ========================================================================== */

body.jr-dark-commerce
	.jr-category-hero__content
	.elementor-widget-text-editor
	p {
	max-width: 48rem;

	margin:
		1.25rem
		0
		0;

	color:
		var(--jr-text-soft);

	line-height: 1.65;
}


/* ==========================================================================
   Hero actions
   ========================================================================== */

body.jr-dark-commerce
	.jr-category-hero
	.jr-actions {
	margin-top: 1.5rem;
}


/* ==========================================================================
   Hero image
   ========================================================================== */

body.jr-dark-commerce
	.jr-category-hero__image {
	overflow: hidden;

	width: 100%;
	max-width: 42.25rem;

	margin: 0;

	border: 0;
	border-radius: 0.25rem;

	background: transparent;

	box-shadow:
		0 2px 12px
		rgba(0, 0, 0, 0.12);
}


body.jr-dark-commerce
	.jr-category-hero__image
	.elementor-widget-image,
body.jr-dark-commerce
	.jr-category-hero__image
	.elementor-widget-container {
	width: 100%;

	margin: 0;
}


body.jr-dark-commerce
	.jr-category-hero__image
	img {
	display: block;

	width: 100%;
	max-width: 100%;
	height: auto;

	margin: 0;
}

/* ==========================================================================
   Tablet
   ========================================================================== */

@media (max-width: 992px) {

	body.jr-dark-commerce
		.jr-category-hero {
		grid-template-columns:
			minmax(0, 1fr);
	}


	body.jr-dark-commerce
		.jr-category-hero__image {
		order: 1;

		width: 100%;
		max-width: none;
	}


	body.jr-dark-commerce
		.jr-category-hero__content {
		order: 2;
	}
}


/* ==========================================================================
   Mobile
   ========================================================================== */

@media (max-width: 768px) {

	/* ------------------------------------------------------------------
	   Hero stack
	   ------------------------------------------------------------------ */

	body.jr-dark-commerce
		div.jr-category-hero {
		grid-template-columns:
			minmax(0, 1fr);

		gap: 1.5rem;

		margin-bottom: 0;
	}


	body.jr-dark-commerce
		.jr-category-hero__content
		.elementor-widget-text-editor
		p {
		margin-top: 1rem;
	}


	body.jr-dark-commerce
		.jr-category-hero
		.jr-actions {
		margin-top: 1.25rem;
	}
}


/**
 * Category Popular navigation: compact cards matching the hub treatment.
 * Four equal columns, two below 992px and one below 540px. minmax(0, 1fr)
 * allows long labels to wrap without expanding the archive container.
 *
 * @package Jedi_Theme
 */
body.tax-product_cat .jr-category-popular {
	width: 100%;
	min-width: 0;
	margin: 3rem 0;
}
body.tax-product_cat .jr-category-popular__heading {
	margin: 0 0 1rem;
	font-size: 1.4rem;
	color: var(--jr-text, #f5f7fa);
}
body.tax-product_cat .jr-category-popular__grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 0.85rem;
	margin: 0;
	padding: 0;
	list-style: none;
}
body.tax-product_cat .jr-category-popular__grid > li {
	min-width: 0;
	margin: 0;
	padding: 0;
	list-style: none;
}
body.tax-product_cat a.jr-category-popular__link {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: center;
	gap: 0.85rem;
	box-sizing: border-box;
	height: 100%;
	min-height: 3.55rem;
	padding: 0.72rem 1rem;
	border: 1px solid rgba(69, 217, 107, 0.2);
	border-radius: 0;
	background: linear-gradient(180deg, rgba(10, 18, 28, 0.72), rgba(6, 11, 18, 0.72));
	color: var(--jr-text, #f5f7fa);
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.3;
	text-decoration: none;
	overflow-wrap: anywhere;
}
body.tax-product_cat a.jr-category-popular__link:hover {
	color: #fff;
    border-color: rgba(69, 217, 107, 0.42);
    background: linear-gradient(115deg, rgba(45, 166, 83, 0.055) 0%, transparent 34%), linear-gradient(180deg, rgba(12, 22, 32, 0.84) 0%, rgba(7, 14, 22, 0.82) 100%);
    transform: translateY(-1px);
}
body.tax-product_cat a.jr-category-popular__link:focus-visible {
	outline: 2px solid #45d96b;
	outline-offset: 3px;
}
@media (max-width: 992px) {
	body.tax-product_cat .jr-category-popular__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}
@media (max-width: 540px) {
	body.tax-product_cat .jr-category-popular__grid {
		grid-template-columns: minmax(0, 1fr);
	}
}
