/**
 * TactNexa WooCommerce — Premium Shop Archives
 *
 * Applies to:
 * - Main Shop
 * - Product Categories
 * - Product Tags
 *
 * Parent Theme: Blocksy
 *
 * Keeps WooCommerce product functionality.
 * Presentation only. No payment or cart logic.
 */

/* =========================================================
   Archive Design Tokens
   ========================================================= */

body:is(
	.woocommerce-shop,
	.post-type-archive-product,
	.tax-product_cat,
	.tax-product_tag
) {
	--tnx-shop-navy: #031126;
	--tnx-shop-navy-light: #0a2548;

	--tnx-shop-blue: #1677ff;
	--tnx-shop-blue-dark: #075fd7;
	--tnx-shop-cyan: #52d7ff;

	--tnx-shop-text: #061a36;
	--tnx-shop-muted: #596e86;

	--tnx-shop-border: #e0e8f2;
	--tnx-shop-radius: 18px;
}


/* =========================================================
   Premium Archive Hero
   ========================================================= */

body:is(
	.woocommerce-shop,
	.post-type-archive-product,
	.tax-product_cat,
	.tax-product_tag
) .hero-section {
	position: relative;
	isolation: isolate;

	overflow: hidden;

	display: flex;
	align-items: center;
	justify-content: center;

	min-height: 260px;

	padding: 48px 24px;

	background:
		radial-gradient(
			ellipse at 82% 24%,
			rgba(27, 112, 236, 0.34),
			transparent 43%
		),
		radial-gradient(
			ellipse at 10% 95%,
			rgba(14, 69, 147, 0.24),
			transparent 45%
		),
		linear-gradient(
			110deg,
			#031126 0%,
			#061a36 51%,
			#092b55 100%
		) !important;

	box-shadow:
		inset 0 -1px 0 rgba(82, 215, 255, 0.12);
}


/* =========================================================
   Hero Technical Grid
   ========================================================= */

body:is(
	.woocommerce-shop,
	.post-type-archive-product,
	.tax-product_cat,
	.tax-product_tag
) .hero-section::before {
	content: "";

	position: absolute;
	z-index: 0;

	inset: 0;

	pointer-events: none;

	background-image:
		linear-gradient(
			rgba(82, 215, 255, 0.10) 1px,
			transparent 1px
		),
		linear-gradient(
			90deg,
			rgba(82, 215, 255, 0.10) 1px,
			transparent 1px
		);

	background-size: 48px 48px;

	-webkit-mask-image:
		linear-gradient(
			90deg,
			transparent 8%,
			rgba(0, 0, 0, 0.28) 42%,
			#000 100%
		);

	mask-image:
		linear-gradient(
			90deg,
			transparent 8%,
			rgba(0, 0, 0, 0.28) 42%,
			#000 100%
		);

	opacity: 0.52;
}


/* =========================================================
   Animated Energy Rings
   ========================================================= */

body:is(
	.woocommerce-shop,
	.post-type-archive-product,
	.tax-product_cat,
	.tax-product_tag
) .hero-section::after {
	content: "";

	position: absolute;
	z-index: 0;

	top: 50%;
	right: max(
		-72px,
		calc((100vw - 1420px) / 2)
	);

	width: min(440px, 48vw);
	aspect-ratio: 1;

	border: 1px solid rgba(82, 215, 255, 0.22);
	border-radius: 50%;

	background:
		radial-gradient(
			circle,
			transparent 39%,
			rgba(82, 215, 255, 0.12) 39.3%,
			transparent 40.3%,
			transparent 61%,
			rgba(82, 215, 255, 0.15) 61.3%,
			transparent 62.3%
		),
		conic-gradient(
			from 12deg,
			transparent 0 28deg,
			rgba(82, 215, 255, 0.34) 50deg,
			transparent 77deg 178deg,
			rgba(22, 119, 255, 0.32) 208deg,
			transparent 234deg 360deg
		);

	box-shadow:
		0 0 0 34px rgba(82, 215, 255, 0.025),
		0 0 0 87px rgba(82, 215, 255, 0.018),
		inset 0 0 75px rgba(22, 119, 255, 0.10);

	opacity: 0.78;

	pointer-events: none;

	transform:
		translateY(-50%) rotate(0deg);

	animation:
		tnx-shop-orbit 36s linear infinite;
}


/* =========================================================
   Hero Content Layer
   ========================================================= */

body:is(
	.woocommerce-shop,
	.post-type-archive-product,
	.tax-product_cat,
	.tax-product_tag
) .hero-section > * {
	position: relative;
	z-index: 1;
}


/* =========================================================
   Hero Typography
   ========================================================= */

body:is(
	.woocommerce-shop,
	.post-type-archive-product,
	.tax-product_cat,
	.tax-product_tag
) .hero-section :is(
	.page-title,
	.entry-title
) {
	margin: 0;

	color: #ffffff !important;

	font-size: clamp(2.5rem, 4.6vw, 4.25rem);
	font-weight: 800;
	line-height: 1.12;

	letter-spacing: -0.045em;

	text-align: center;
	text-wrap: balance;

	text-shadow:
		0 5px 30px rgba(0, 0, 0, 0.16);
}


/* =========================================================
   Archive Description
   ========================================================= */

body:is(
	.woocommerce-shop,
	.post-type-archive-product,
	.tax-product_cat,
	.tax-product_tag
) .hero-section :is(
	.page-description,
	.taxonomy-description
) {
	max-width: 680px;

	margin-inline: auto;

	color: #cbdcf1;

	line-height: 1.7;
	text-align: center;
}


/* =========================================================
   Hero Animation
   ========================================================= */

@keyframes tnx-shop-orbit {

	to {
		transform:
			translateY(-50%) rotate(360deg);
	}

}


/* =========================================================
   Archive Content
   ========================================================= */

body:is(
	.woocommerce-shop,
	.post-type-archive-product,
	.tax-product_cat,
	.tax-product_tag
) .site-main {
	color: var(--tnx-shop-text);
}


/* =========================================================
   Result Count
   ========================================================= */

body:is(
	.woocommerce-shop,
	.post-type-archive-product,
	.tax-product_cat,
	.tax-product_tag
) .woocommerce-result-count {
	margin-block: 8px 14px;

	color: var(--tnx-shop-muted);

	font-size: 0.82rem;
	font-weight: 750;

	letter-spacing: 0.045em;
	text-transform: uppercase;
}


/* =========================================================
   Product Sorting
   ========================================================= */

body:is(
	.woocommerce-shop,
	.post-type-archive-product,
	.tax-product_cat,
	.tax-product_tag
) .woocommerce-ordering select {
	min-height: 46px;

	padding: 0 38px 0 16px;

	border: 1px solid var(--tnx-shop-border);
	border-radius: 11px;

	background-color: #ffffff;

	color: var(--tnx-shop-text);

	font-size: 0.88rem;
	font-weight: 650;

	box-shadow:
		0 3px 12px rgba(3, 17, 38, 0.035);
}


body:is(
	.woocommerce-shop,
	.post-type-archive-product,
	.tax-product_cat,
	.tax-product_tag
) .woocommerce-ordering select:focus-visible {
	outline: 3px solid rgba(22, 119, 255, 0.35);
	outline-offset: 3px;
}


/* =========================================================
   Product Grid
   ========================================================= */

body:is(
	.woocommerce-shop,
	.post-type-archive-product,
	.tax-product_cat,
	.tax-product_tag
) ul.products {
	column-gap: 22px;
	row-gap: 28px;

	align-items: stretch;
}


/* =========================================================
   Product Card
   ========================================================= */

body:is(
	.woocommerce-shop,
	.post-type-archive-product,
	.tax-product_cat,
	.tax-product_tag
) ul.products li.product {
	position: relative;

	min-width: 0;

	padding: 14px;

	overflow: hidden;

	border: 1px solid var(--tnx-shop-border);
	border-radius: var(--tnx-shop-radius);

	background: #ffffff;

	box-shadow:
		0 3px 9px rgba(3, 17, 38, 0.025),
		0 16px 36px rgba(3, 17, 38, 0.045);

	transition:
		transform 220ms ease,
		border-color 220ms ease,
		box-shadow 220ms ease;
}


body:is(
	.woocommerce-shop,
	.post-type-archive-product,
	.tax-product_cat,
	.tax-product_tag
) ul.products li.product:hover {
	transform: translateY(-5px);

	border-color: rgba(22, 119, 255, 0.34);

	box-shadow:
		0 10px 20px rgba(3, 17, 38, 0.045),
		0 24px 54px rgba(3, 17, 38, 0.09);
}


body:is(
	.woocommerce-shop,
	.post-type-archive-product,
	.tax-product_cat,
	.tax-product_tag
) ul.products li.product:focus-within {
	border-color: rgba(22, 119, 255, 0.65);
}


/* =========================================================
   Product Image Stage
   ========================================================= */

body:is(
	.woocommerce-shop,
	.post-type-archive-product,
	.tax-product_cat,
	.tax-product_tag
) ul.products li.product :is(
	.ct-image-container,
	.ct-media-container,
	figure
) {
	overflow: hidden;

	border-radius: 12px;

	background:
		linear-gradient(
			145deg,
			#f8fbff,
			#eef4fc
		);
}


/* =========================================================
   Product Image
   ========================================================= */

body:is(
	.woocommerce-shop,
	.post-type-archive-product,
	.tax-product_cat,
	.tax-product_tag
) ul.products li.product img.wp-post-image {
	display: block;

	width: 100%;
	height: auto;

	aspect-ratio: 1 / 1;

	object-fit: contain;
	object-position: center;

	border-radius: 12px;

	background: #ffffff;

	transition: transform 240ms ease;
}


body:is(
	.woocommerce-shop,
	.post-type-archive-product,
	.tax-product_cat,
	.tax-product_tag
) ul.products li.product:hover img.wp-post-image {
	transform: scale(1.035);
}


/* =========================================================
   Product Titles
   ========================================================= */

body:is(
	.woocommerce-shop,
	.post-type-archive-product,
	.tax-product_cat,
	.tax-product_tag
) ul.products li.product :is(
	.woocommerce-loop-product__title,
	.ct-woo-card-title
) {
	font-size: 0.96rem;
	font-weight: 750;
	line-height: 1.5;

	letter-spacing: -0.013em;

	color: var(--tnx-shop-text);

	overflow-wrap: anywhere;

	transition: color 180ms ease;
}


body:is(
	.woocommerce-shop,
	.post-type-archive-product,
	.tax-product_cat,
	.tax-product_tag
) ul.products li.product a:hover :is(
	.woocommerce-loop-product__title,
	.ct-woo-card-title
) {
	color: var(--tnx-shop-blue-dark);
}


/* =========================================================
   Product Price
   ========================================================= */

body:is(
	.woocommerce-shop,
	.post-type-archive-product,
	.tax-product_cat,
	.tax-product_tag
) ul.products li.product .price {
	font-size: 1.17rem;
	font-weight: 800;
	line-height: 1.45;

	color: var(--tnx-shop-text);
}


body:is(
	.woocommerce-shop,
	.post-type-archive-product,
	.tax-product_cat,
	.tax-product_tag
) ul.products li.product .price .amount {
	font-weight: inherit;
	color: inherit;
}


body:is(
	.woocommerce-shop,
	.post-type-archive-product,
	.tax-product_cat,
	.tax-product_tag
) ul.products li.product .price del {
	margin-right: 5px;

	color: #697d95;

	font-size: 0.83rem;
	font-weight: 500;
}


body:is(
	.woocommerce-shop,
	.post-type-archive-product,
	.tax-product_cat,
	.tax-product_tag
) ul.products li.product .price ins {
	color: var(--tnx-shop-blue-dark);

	font-weight: 800;

	text-decoration: none;
}


/* =========================================================
   Product Category Label
   ========================================================= */

body:is(
	.woocommerce-shop,
	.post-type-archive-product,
	.tax-product_cat,
	.tax-product_tag
) ul.products li.product :is(
	.entry-meta,
	.ct-woo-card-category
) {
	color: var(--tnx-shop-muted);

	font-size: 0.72rem;
	font-weight: 700;
	line-height: 1.5;

	letter-spacing: 0.04em;
	text-transform: uppercase;
}


/* =========================================================
   Native WooCommerce Buttons
   ========================================================= */

body:is(
	.woocommerce-shop,
	.post-type-archive-product,
	.tax-product_cat,
	.tax-product_tag
) ul.products li.product :is(
	.button,
	.add_to_cart_button,
	.added_to_cart
) {
	display: inline-flex;
	align-items: center;
	justify-content: center;

	min-height: 44px;

	padding: 10px 17px;

	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 9px;

	background:
		linear-gradient(
			135deg,
			#1677ff,
			#2f8cff
		);

	color: #ffffff;

	font-size: 0.84rem;
	font-weight: 800;
	line-height: 1.35;

	text-align: center;
	text-decoration: none;

	box-shadow:
		0 8px 22px rgba(22, 119, 255, 0.18);

	transition:
		transform 180ms ease,
		background 180ms ease,
		box-shadow 180ms ease;
}


body:is(
	.woocommerce-shop,
	.post-type-archive-product,
	.tax-product_cat,
	.tax-product_tag
) ul.products li.product :is(
	.button,
	.add_to_cart_button,
	.added_to_cart
):hover {
	transform: translateY(-2px);

	background:
		linear-gradient(
			135deg,
			#075fd7,
			#1677ff
		);

	color: #ffffff;

	box-shadow:
		0 12px 28px rgba(22, 119, 255, 0.24);
}


body:is(
	.woocommerce-shop,
	.post-type-archive-product,
	.tax-product_cat,
	.tax-product_tag
) ul.products li.product :is(
	.button,
	.add_to_cart_button,
	.added_to_cart
):focus-visible {
	outline: 3px solid var(--tnx-shop-cyan);
	outline-offset: 3px;
}


body:is(
	.woocommerce-shop,
	.post-type-archive-product,
	.tax-product_cat,
	.tax-product_tag
) ul.products li.product :is(
	.button,
	.add_to_cart_button
):disabled {
	opacity: 0.6;
	cursor: not-allowed;
}


/* =========================================================
   WooCommerce Product Badges
   ========================================================= */

body:is(
	.woocommerce-shop,
	.post-type-archive-product,
	.tax-product_cat,
	.tax-product_tag
) ul.products li.product :is(
	.onsale,
	.out-of-stock-badge
) {
	border-radius: 7px;

	font-size: 0.73rem;
	font-weight: 800;
}


/* =========================================================
   Future Category Navigation
   ========================================================= */

/*
 * These classes will be used by the PHP category component.
 * No hardcoded category URLs or product information.
 */

body:is(
	.woocommerce-shop,
	.post-type-archive-product,
	.tax-product_cat,
	.tax-product_tag
) .tnx-shop-collections {
	margin: 0 auto 34px;
	padding: 0;
}


body:is(
	.woocommerce-shop,
	.post-type-archive-product,
	.tax-product_cat,
	.tax-product_tag
) .tnx-shop-collections__list {
	display: flex;
	flex-wrap: wrap;
	align-items: center;

	gap: 10px;

	margin: 0;
	padding: 0;

	list-style: none;
}


body:is(
	.woocommerce-shop,
	.post-type-archive-product,
	.tax-product_cat,
	.tax-product_tag
) .tnx-shop-collections__link {
	display: inline-flex;
	align-items: center;

	min-height: 42px;

	padding: 10px 16px;

	border: 1px solid var(--tnx-shop-border);
	border-radius: 999px;

	background: #ffffff;

	color: var(--tnx-shop-text);

	font-size: 0.85rem;
	font-weight: 700;
	line-height: 1.3;

	text-decoration: none;

	transition:
		color 160ms ease,
		border-color 160ms ease,
		background 160ms ease;
}


body:is(
	.woocommerce-shop,
	.post-type-archive-product,
	.tax-product_cat,
	.tax-product_tag
) .tnx-shop-collections__link:hover,
body:is(
	.woocommerce-shop,
	.post-type-archive-product,
	.tax-product_cat,
	.tax-product_tag
) .tnx-shop-collections__link[aria-current="page"] {
	border-color: var(--tnx-shop-blue);

	background: #eaf3ff;

	color: var(--tnx-shop-blue-dark);
}


body:is(
	.woocommerce-shop,
	.post-type-archive-product,
	.tax-product_cat,
	.tax-product_tag
) .tnx-shop-collections__link:focus-visible {
	outline: 3px solid rgba(22, 119, 255, 0.35);
	outline-offset: 3px;
}


/* =========================================================
   Pagination
   ========================================================= */

body:is(
	.woocommerce-shop,
	.post-type-archive-product,
	.tax-product_cat,
	.tax-product_tag
) .woocommerce-pagination {
	margin-top: 44px;
}


body:is(
	.woocommerce-shop,
	.post-type-archive-product,
	.tax-product_cat,
	.tax-product_tag
) .woocommerce-pagination .page-numbers {
	border-radius: 9px;
}


/* =========================================================
   Tablet
   ========================================================= */

@media (max-width: 1024px) {

	body:is(
		.woocommerce-shop,
		.post-type-archive-product,
		.tax-product_cat,
		.tax-product_tag
	) ul.products {
		grid-template-columns:
			repeat(2, minmax(0, 1fr)) !important;

		gap: 20px;
	}

	body:is(
		.woocommerce-shop,
		.post-type-archive-product,
		.tax-product_cat,
		.tax-product_tag
	) .hero-section {
		min-height: 224px;

		padding: 42px 20px;
	}
}


/* =========================================================
   Mobile
   ========================================================= */

@media (max-width: 600px) {

	body:is(
		.woocommerce-shop,
		.post-type-archive-product,
		.tax-product_cat,
		.tax-product_tag
	) ul.products {
		grid-template-columns:
			minmax(0, 1fr) !important;

		gap: 18px;
	}

	body:is(
		.woocommerce-shop,
		.post-type-archive-product,
		.tax-product_cat,
		.tax-product_tag
	) ul.products li.product {
		padding: 13px;
	}

	body:is(
		.woocommerce-shop,
		.post-type-archive-product,
		.tax-product_cat,
		.tax-product_tag
	) .hero-section {
		min-height: 180px;

		padding: 34px 16px;
	}

	body:is(
		.woocommerce-shop,
		.post-type-archive-product,
		.tax-product_cat,
		.tax-product_tag
	) .hero-section::after {
		right: -95px;

		width: 265px;

		opacity: 0.5;
	}

	body:is(
		.woocommerce-shop,
		.post-type-archive-product,
		.tax-product_cat,
		.tax-product_tag
	) .hero-section :is(
		.page-title,
		.entry-title
	) {
		font-size: clamp(2rem, 9vw, 2.85rem);
	}

	body:is(
		.woocommerce-shop,
		.post-type-archive-product,
		.tax-product_cat,
		.tax-product_tag
	) .woocommerce-ordering select {
		max-width: 100%;
	}

	body:is(
		.woocommerce-shop,
		.post-type-archive-product,
		.tax-product_cat,
		.tax-product_tag
	) .tnx-shop-collections__list {
		flex-wrap: nowrap;

		overflow-x: auto;

		padding-block: 3px 10px;

		scroll-snap-type: x proximity;
	}

	body:is(
		.woocommerce-shop,
		.post-type-archive-product,
		.tax-product_cat,
		.tax-product_tag
	) .tnx-shop-collections__list li {
		flex: 0 0 auto;

		scroll-snap-align: start;
	}
}


/* =========================================================
   Reduced Motion
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

	body:is(
		.woocommerce-shop,
		.post-type-archive-product,
		.tax-product_cat,
		.tax-product_tag
	) .hero-section::after {
		animation: none;
	}

	body:is(
		.woocommerce-shop,
		.post-type-archive-product,
		.tax-product_cat,
		.tax-product_tag
	) ul.products li.product,
	body:is(
		.woocommerce-shop,
		.post-type-archive-product,
		.tax-product_cat,
		.tax-product_tag
	) ul.products li.product img,
	body:is(
		.woocommerce-shop,
		.post-type-archive-product,
		.tax-product_cat,
		.tax-product_tag
	) ul.products li.product :is(
		.button,
		.add_to_cart_button,
		.added_to_cart
	),
	body:is(
		.woocommerce-shop,
		.post-type-archive-product,
		.tax-product_cat,
		.tax-product_tag
	) .tnx-shop-collections__link {
		transition: none;
	}

	body:is(
		.woocommerce-shop,
		.post-type-archive-product,
		.tax-product_cat,
		.tax-product_tag
	) ul.products li.product:hover,
	body:is(
		.woocommerce-shop,
		.post-type-archive-product,
		.tax-product_cat,
		.tax-product_tag
	) ul.products li.product:hover img,
	body:is(
		.woocommerce-shop,
		.post-type-archive-product,
		.tax-product_cat,
		.tax-product_tag
	) ul.products li.product :is(
		.button,
		.add_to_cart_button,
		.added_to_cart
	):hover {
		transform: none;
	}
}