/* CasaOmnia - Catalogo & Merchandising 2.1.1 */

/*
 * Subcategory directory only.
 * The wrapper is deliberately NOT .products, so these rules do not alter
 * the real WooCommerce product grid or Razzi's product-loop layout.
 */
.co-category-section {
	clear: both;
	width: 100%;
	margin: 8px 0 46px;
	padding: 0 0 44px;
	border-bottom: 1px solid rgba(0, 0, 0, 0.10);
}

.co-archive-section-title {
	margin: 0 0 24px;
	font-size: clamp(24px, 2.1vw, 32px);
	font-weight: 500;
	line-height: 1.2;
	letter-spacing: -0.02em;
}

.co-category-section > .co-archive-section-title {
	margin-bottom: 20px;
}

.co-category-grid {
	display: grid !important;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 16px;
	width: 100%;
	margin: 0 !important;
	padding: 0 !important;
	list-style: none !important;
}

.co-category-grid--columns-1 { grid-template-columns: minmax(0, 1fr); }
.co-category-grid--columns-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.co-category-grid--columns-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.co-category-grid--columns-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.co-category-grid--columns-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.co-category-grid--columns-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }

.co-category-grid::before,
.co-category-grid::after {
	display: none !important;
	content: none !important;
}

.co-category-grid > li.product-category,
.co-category-grid .product-category.product {
	float: none !important;
	position: relative;
	min-width: 0;
	width: auto !important;
	max-width: none !important;
	margin: 0 !important;
	padding: 7px 7px 0 !important;
	border: 1px solid rgba(22, 22, 22, 0.08);
	border-radius: 14px;
	background: #fff;
	overflow: hidden;
	box-shadow: 0 1px 2px rgba(22, 22, 22, 0.025);
	transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}


.co-category-grid .product-category > a,
.co-category-grid .product-category .woocommerce-LoopProduct-link {
	display: block;
	position: relative;
	height: 100%;
	color: inherit;
	text-decoration: none;
}

.co-category-grid .product-category img {
	display: block;
	width: 100% !important;
	height: auto;
	margin: 0 !important;
	padding: 14px;
	aspect-ratio: 4 / 3;
	object-fit: contain;
	background: #f6f6f4;
	border-radius: 10px;
	transition: transform 220ms ease;
}


.co-category-grid .woocommerce-loop-category__title,
.co-category-grid .product-category h2,
.co-category-grid .product-category h3 {
	margin: 0 !important;
	padding: 13px 44px 14px 5px !important;
	min-height: 64px;
	font-size: 15px !important;
	font-weight: 500 !important;
	line-height: 1.25 !important;
	letter-spacing: -0.01em;
	text-align: left !important;
	color: #202020;
}

.co-category-grid .count {
	display: block;
	margin-top: 3px;
	font-size: 12px !important;
	font-weight: 400;
	line-height: 1.2;
	color: rgba(32, 32, 32, 0.50);
	opacity: 1;
	background: transparent;
}

.co-category-grid .product-category > a::after,
.co-category-grid .product-category .woocommerce-LoopProduct-link::after {
	/* Decorative arrow: the alt-text syntax keeps screen readers silent;
	 * browsers without support keep the first declaration. */
	content: "\2192";
	content: "\2192" / "";
	display: inline-flex;
	align-items: center;
	justify-content: center;
	position: absolute;
	right: 4px;
	bottom: 10px;
	width: 32px;
	height: 32px;
	border-radius: 999px;
	background: #f2f2f0;
	color: #202020;
	font-size: 16px;
	font-weight: 400;
	line-height: 1;
	transition: transform 180ms ease, background-color 180ms ease, color 180ms ease;
}

/* Hover effects only on devices that really hover (no sticky hover on touch). */
@media (hover: hover) {
	.co-category-grid > li.product-category:hover,
	.co-category-grid .product-category.product:hover {
		transform: translateY(-3px);
		border-color: rgba(22, 22, 22, 0.14);
		box-shadow: 0 12px 30px rgba(22, 22, 22, 0.08);
	}

	.co-category-grid .product-category:hover img {
		transform: scale(1.012);
	}

	.co-category-grid .product-category:hover > a::after,
	.co-category-grid .product-category:hover .woocommerce-LoopProduct-link::after {
		transform: translateX(2px);
		background: #202020;
		color: #fff;
	}
}

/* Keyboard users get the same affordance as mouse users. */
.co-category-grid .product-category > a:focus-visible,
.co-category-grid .product-category .woocommerce-LoopProduct-link:focus-visible {
	outline: 2px solid #202020;
	outline-offset: 3px;
	border-radius: 10px;
}

@media (prefers-reduced-motion: reduce) {
	.co-category-grid > li.product-category,
	.co-category-grid .product-category.product,
	.co-category-grid .product-category img,
	.co-category-grid .product-category > a::after,
	.co-category-grid .product-category .woocommerce-LoopProduct-link::after {
		transition: none;
	}

	.co-category-grid > li.product-category:hover,
	.co-category-grid .product-category.product:hover,
	.co-category-grid .product-category:hover img,
	.co-category-grid .product-category:hover > a::after,
	.co-category-grid .product-category:hover .woocommerce-LoopProduct-link::after {
		transform: none;
	}
}

/* The variable-price note style is printed inline on every page
 * (handle casaomnia-price-note), so it also applies outside Shop/categories. */

/* Product heading. */
.co-product-section-heading {
	clear: both;
	width: 100%;
	margin: 0 0 18px;
	padding-top: 2px;
}

.co-product-section-heading .co-archive-section-title {
	margin-bottom: 0;
}

/* Keep four category columns on desktop; collapse only on tablet/mobile. */
@media (max-width: 991px) {
	.co-category-grid,
	.co-category-grid--columns-3,
	.co-category-grid--columns-4,
	.co-category-grid--columns-5,
	.co-category-grid--columns-6 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 14px;
	}
}

@media (max-width: 575px) {
	.co-category-section {
		margin-bottom: 34px;
		padding-bottom: 34px;
	}

	.co-category-grid,
	.co-category-grid--columns-2,
	.co-category-grid--columns-3,
	.co-category-grid--columns-4,
	.co-category-grid--columns-5,
	.co-category-grid--columns-6 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 10px;
	}

	.co-category-grid > li.product-category,
	.co-category-grid .product-category.product {
		padding: 5px 5px 0 !important;
		border-radius: 11px;
	}

	.co-category-grid .product-category img {
		padding: 8px;
		border-radius: 8px;
	}

	.co-category-grid .woocommerce-loop-category__title,
	.co-category-grid .product-category h2,
	.co-category-grid .product-category h3 {
		min-height: 58px;
		padding: 10px 34px 11px 3px !important;
		font-size: 13px !important;
	}

	.co-category-grid .count {
		font-size: 11px !important;
	}

	.co-category-grid .product-category > a::after,
	.co-category-grid .product-category .woocommerce-LoopProduct-link::after {
		right: 2px;
		bottom: 9px;
		width: 27px;
		height: 27px;
		font-size: 14px;
	}
}

@media (max-width: 360px) {
	.co-category-grid,
	.co-category-grid--columns-2,
	.co-category-grid--columns-3,
	.co-category-grid--columns-4,
	.co-category-grid--columns-5,
	.co-category-grid--columns-6 {
		grid-template-columns: minmax(0, 1fr);
	}
}
