/**
 * CLW Product Loop & Card Styles — hello-theme-child
 * Matches the pixel-perfect clw-card design for Archive, Shop, & Related Products
 */

/* =========================================================
   WOOCOMMERCE LOOP GRID LAYOUT
   ========================================================= */
ul.products,
.woocommerce ul.products,
.woocommerce-page ul.products {
	display: grid !important;
	grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)) !important;
	gap: 24px !important;
	margin: 0 0 40px 0 !important;
	padding: 0 !important;
	list-style: none !important;
}

ul.products::before,
ul.products::after,
.woocommerce ul.products::before,
.woocommerce ul.products::after {
	display: none !important;
	content: none !important;
}

ul.products li.product,
.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product {
	float: none !important;
	width: 100% !important;
	margin: 0 !important;
	padding: 0 !important;
	background: transparent !important;
	border: none !important;
	box-shadow: none !important;
	position: relative !important;
	display: flex !important;
	flex-direction: column !important;
}

/* Remove default WC elements if any slip through */
ul.products li.product .woocommerce-loop-product__title,
ul.products li.product .price,
ul.products li.product .star-rating,
ul.products li.product .button.add_to_cart_button,
ul.products li.product .added_to_cart,
ul.products li.product .onsale {
	display: none !important;
}

/* =========================================================
   CLW PRODUCT CARD
   ========================================================= */
.clw-card {
	background-color: #ffffff;
	border-radius: 16px;
	border: 1px solid #e2e8f0;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	height: 100%;
	width: 100%;
	max-width: 300px;
	margin: 0 auto;
	transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s ease;
	box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.03);
	position: relative;
	box-sizing: border-box;
}

.clw-card *,
.clw-card *::before,
.clw-card *::after {
	box-sizing: border-box;
}

.clw-card:hover {
	transform: translateY(-6px);
	box-shadow: 0 20px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.05);
	border-color: #cbd5e1;
}

/* =========================================================
   IMAGE & BADGES
   ========================================================= */
.clw-card-img-wrap {
	position: relative;
	width: 100%;
	height: 205px;
	overflow: hidden;
	background-color: #f1f5f9;
	flex-shrink: 0;
}

.clw-card-img-link {
	display: block;
	width: 100%;
	height: 100%;
	text-decoration: none;
}

.clw-card-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	display: block;
	transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.clw-card:hover .clw-card-img {
	transform: scale(1.05);
}

/* Top Badge */
.clw-badge-top {
	position: absolute;
	top: 12px;
	left: 12px;
	font-size: 10.5px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: #ffffff;
	background-color: #C11920;
	padding: 5px 12px;
	border-radius: 9999px;
	z-index: 2;
	box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
	pointer-events: none;
	line-height: 1.2;
}

.clw-badge-blue   { background-color: #0284c7 !important; color: #ffffff !important; }
.clw-badge-green  { background-color: #16a34a !important; color: #ffffff !important; }
.clw-badge-red    { background-color: #dc2626 !important; color: #ffffff !important; }
.clw-badge-orange { background-color: #ea580c !important; color: #ffffff !important; }

/* Chassis / Ribbon Badge (Bottom Right on Image) */
.clw-badge-chassis {
	position: absolute;
	bottom: 10px;
	right: 10px;
	background-color: rgba(15, 23, 42, 0.85);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	color: #ffffff;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	padding: 4px 9px;
	border-radius: 6px;
	z-index: 2;
	pointer-events: none;
	line-height: 1.2;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* =========================================================
   CARD BODY
   ========================================================= */
.clw-card-body {
	padding: 18px 20px 20px;
	display: flex;
	flex-direction: column;
	flex-grow: 1;
}

/* Title */
.clw-card-title {
	font-size: 16.5px;
	font-weight: 700;
	color: #0f172a;
	margin: 0 0 8px 0;
	line-height: 1.35;
	letter-spacing: -0.015em;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.clw-card-title a {
	color: inherit;
	text-decoration: none;
	transition: color 0.2s ease;
}

.clw-card-title a:hover {
	color: #C11920;
}

/* Excerpt / Short description */
.clw-card-excerpt {
	font-size: 13px;
	color: #64748b;
	line-height: 1.45;
	margin: 0 0 14px 0;
	min-height: 38px;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* =========================================================
   QUICK SPECS BOX (2x2 Grid with Icons & Main Values)
   ========================================================= */
.clw-specs-box {
	background-color: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	padding: 10px 12px;
	margin-bottom: 16px;
	transition: border-color 0.25s ease, background-color 0.25s ease;
}

.clw-card:hover .clw-specs-box {
	border-color: #cbd5e1;
	background-color: #f8fafc;
}

.clw-specs-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 8px 12px;
}

.clw-spec-item {
	display: flex;
	align-items: center;
	gap: 8px;
	overflow: hidden;
	min-width: 0;
	padding: 2px 0;
}

.clw-spec-icon-box {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	min-width: 26px;
	border-radius: 7px;
	background-color: #ffffff;
	border: 1px solid #e2e8f0;
	color: #475569;
	font-size: 11px;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
	transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
	flex-shrink: 0;
}

.clw-card:hover .clw-spec-icon-box {
	background-color: #fef2f2;
	border-color: #fecaca;
	color: #C11920;
	transform: scale(1.06);
}

.clw-spec-val {
	font-size: 12.5px;
	font-weight: 600;
	color: #1e293b;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	line-height: 1.25;
	letter-spacing: -0.01em;
}

/* =========================================================
   PRICE ROW & DISCOUNT BADGE
   ========================================================= */
.clw-card-price-row {
	display: flex;
	align-items: center;
	justify-content: flex-start;
	margin-bottom: 16px;
	padding: 2px 0 0 0;
	gap: 10px;
}

.clw-price-discount-tag {
	display: inline-flex;
	align-items: center;
	font-size: 11px;
	font-weight: 700;
	color: #C11920;
	background-color: #fee2e2;
	padding: 2px 6px;
	border-radius: 4px;
	line-height: 1.1;
	letter-spacing: 0.02em;
	border: 1px solid rgba(193, 25, 32, 0.2);
}

.clw-price-wrap {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}

.clw-price-regular {
	font-size: 13px;
	font-weight: 500;
	color: #94a3b8;
	text-decoration: line-through;
	white-space: nowrap;
}

.clw-price-val {
	font-size: 18px;
	font-weight: 800;
	color: #C11920;
	letter-spacing: -0.025em;
	white-space: nowrap;
	line-height: 1;
}

.clw-price-val.clw-has-sale {
	color: #C11920;
}

/* =========================================================
   BUTTON
   ========================================================= */
.clw-card-btn-wrap {
	margin-top: auto;
}

.clw-btn-quote {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	padding: 11px 16px;
	background-color: #C11920;
	color: #ffffff !important;
	font-size: 13.5px;
	font-weight: 600;
	border-radius: 8px;
	border: none;
	cursor: pointer;
	text-decoration: none !important;
	transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
	box-shadow: 0 2px 4px rgba(193, 25, 32, 0.15);
	user-select: none;
}

.clw-btn-icon {
	margin-right: 8px;
	font-size: 13px;
	transform: rotate(-10deg);
	transition: transform 0.2s ease;
}

.clw-btn-quote:hover {
	background-color: #a5141a;
	color: #ffffff !important;
	box-shadow: 0 6px 16px rgba(193, 25, 32, 0.3);
	transform: translateY(-1px);
}

.clw-btn-quote:hover .clw-btn-icon {
	transform: rotate(0deg) scale(1.12);
}

.clw-btn-quote:active {
	transform: translateY(0);
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 767px) {
	ul.products,
	.woocommerce ul.products,
	.woocommerce-page ul.products {
		grid-template-columns: 1fr !important;
		gap: 18px !important;
	}

	.clw-card-body {
		padding: 16px;
	}

	.clw-card-title {
		font-size: 15.5px;
	}
}
