/* ==========================================================================
   RAPIDTECH CATALOGUE — Lenovo-style product cards on shop / category / search
   ========================================================================== */
:root{ --navy:#1e2a78; --gold:#d72821; --ink:#1a1a1a; --muted:#6b7280; --line:#e6e8ee; }

/* ---- Card ---- */
ul.products li.product{
	background:#fff !important;
	border:1px solid var(--line) !important;
	border-radius:2px !important;
	padding:14px !important;
	position:relative;
	transition:box-shadow .2s, border-color .2s;
	display:flex; flex-direction:column;
	align-self:stretch !important; /* theme uses flex-start; stretch so every card in a row is equally tall
	                                  and the margin-top:auto buttons line up even when price/stock rows differ */
}
ul.products li.product:hover{
	box-shadow:0 8px 24px rgba(16,24,64,.12) !important;
	border-color:#d2d6e2 !important;
}

/* ---- Image ---- */
ul.products li.product .woocommerce-image__wrapper{ position:relative; }
ul.products li.product .woocommerce-image__wrapper img,
ul.products li.product img.attachment-woocommerce_thumbnail{
	height:180px !important;
	width:auto !important;
	max-width:100% !important;
	margin:0 auto 6px !important;
	object-fit:contain !important;
	mix-blend-mode:multiply;
}

/* ---- Category eyebrow ---- */
ul.products li.product p.product__categories{
	font-size:11px !important; color:var(--muted) !important;
	text-transform:uppercase; letter-spacing:.3px; margin:0 0 4px !important;
}
ul.products li.product p.product__categories a{ color:var(--muted) !important; }

/* ---- Title (2-line clamp) ---- */
ul.products li.product .woocommerce-loop-product__title,
ul.products li.product h2.woocommerce-loop-product__title{
	font-size:13px !important; font-weight:600 !important; line-height:1.35 !important;
	color:var(--ink) !important; padding:0 !important; margin:0 0 6px !important;
	min-height:35px;
	display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
}

/* ---- Rating ---- */
ul.products li.product .star-rating span::before{ color:#f5a623; }
ul.products li.product .star-rating{ margin:2px 0 6px !important; font-size:14px; }

/* ---- Price + Starting at + Free delivery ---- */
.rt-loop-starting{ display:block; font-size:11px; color:var(--muted); line-height:1.2; }
ul.products li.product .price{
	color:var(--ink) !important; font-size:17px !important; font-weight:700 !important;
	margin:0 !important;
}
ul.products li.product .price del{ font-size:12px !important; color:#9aa0ad !important; font-weight:400 !important; opacity:1; }
ul.products li.product .price ins{ text-decoration:none; }
ul.products li.product .price ins,
ul.products li.product .price ins .amount,
ul.products li.product .price ins bdi{ color:var(--navy) !important; } /* sale price: brand blue (was theme gold) */
.rt-loop-ship{ font-size:11px; font-weight:700; color:#1a7f37; letter-spacing:.2px; margin:6px 0 2px; display:flex; align-items:center; gap:5px; }
.rt-loop-ship svg{ width:16px; height:16px; flex:0 0 16px; }

/* ---- Add to cart button (only the real cart/read-more button, NOT compare) ----
   Always visible (theme hides it until hover on desktop, absolutely positioned), pinned to the
   bottom of every card so buttons line up across a row whatever the title/price height. */
ul.products li.product .woocommerce-card__header{
	display:flex !important; flex-direction:column; flex:1 1 auto;
}
ul.products li.product a.add_to_cart_button,
ul.products li.product a.product_type_simple,
ul.products li.product a.product_type_variable,
ul.products li.product a.product_type_grouped,
ul.products li.product a.product_type_external,
ul.products li.product .added_to_cart{
	position:static !important; left:auto !important; right:auto !important; bottom:auto !important;
	opacity:1 !important; visibility:visible !important; transform:none !important;
	display:block !important; width:100% !important; box-sizing:border-box !important;
	margin:auto 0 0 !important;           /* auto top margin = sit at the card bottom */
	padding:11px 16px !important; text-align:center; line-height:1.2 !important;
	font-size:13px !important; font-weight:700 !important; letter-spacing:.02em;
	border-radius:2px !important;
	clip-path:none !important;
	transition:filter .15s ease;
}
ul.products li.product .rt-loop-ship{ margin-bottom:10px; }
ul.products li.product a.add_to_cart_button:hover,
ul.products li.product a.product_type_simple:hover,
ul.products li.product a.product_type_variable:hover{ filter:brightness(1.08); }
/* "View cart" link WooCommerce adds after an ajax add — keep it from stacking a second button */
ul.products li.product .added_to_cart{ margin-top:8px !important; clip-path:none; background:transparent !important; color:var(--navy) !important; padding:0 !important; font-weight:600 !important; }

/* ---- Action row ABOVE the image: ☐ Compare (left) + heart (right) ----
   Reserve a strip at the top of the card; actions sit there, image starts below. */
ul.products li.product{ padding-top:44px !important; }

/* Built-in compare checkbox (top-left) + wishlist heart (top-right) — inc/catalogue.php */
ul.products li.product .rt-card-actions{
	position:absolute; top:12px; left:14px; right:14px; z-index:6;
	display:flex; align-items:center; justify-content:space-between; height:24px;
}
.rt-compare{ display:inline-flex; align-items:center; gap:7px; margin:0; cursor:pointer; font-size:12px; font-weight:500; color:#555; line-height:1; user-select:none; }
.rt-compare input{ width:15px; height:15px; margin:0; accent-color:var(--rt-navy,#1e2a78); cursor:pointer; }
.rt-compare:hover{ color:var(--rt-navy,#1e2a78); }
.rt-compare input:checked + span{ color:var(--rt-navy,#1e2a78); font-weight:700; }
.rt-wish{
	display:inline-flex; align-items:center; justify-content:center; width:30px; height:30px; margin:0 -5px 0 0; padding:0;
	background:transparent !important; border:0 !important; box-shadow:none !important; border-radius:50%;
	color:#9aa0ad; cursor:pointer; transition:color .15s, transform .15s;
}
.rt-wish:hover{ color:#e23744; transform:scale(1.12); }
.rt-wish.is-on{ color:#e23744; }
.rt-wish.is-on svg{ fill:currentColor; }

/* ---- Sale badge: on the image, just under the action row (doubled class beats theme) ---- */
ul.products li.product .onsale.onsale{
	position:absolute !important; top:52px !important; left:14px !important; right:auto !important; bottom:auto !important; z-index:5;
	border-radius:4px; font-size:11px; font-weight:700; padding:3px 8px; margin:0 !important;
}

/* ==========================================================================
   Category description: first 3 sentences + Read more (assets/category-desc.js)
   ========================================================================== */
.rt-desc-clamped{ position:relative; overflow:hidden; }
.rt-desc-clamped::after{
	content:""; position:absolute; left:0; right:0; bottom:0; height:46px; pointer-events:none;
	background:linear-gradient(to bottom, rgba(243,245,250,0), #f3f5fa);
}
.rt-desc-toggle{
	display:inline-flex; align-items:center; gap:6px; margin:8px 0 0; padding:0;
	background:none !important; border:0 !important; box-shadow:none !important;
	color:var(--rt-navy,#1e2a78) !important; font-size:14px; font-weight:700; cursor:pointer; text-decoration:underline; text-underline-offset:3px;
}
.rt-desc-toggle::after{ content:""; width:7px; height:7px; border-right:2px solid currentColor; border-bottom:2px solid currentColor; transform:rotate(45deg) translateY(-2px); }
.rt-desc-toggle[aria-expanded="true"]::after{ transform:rotate(-135deg) translateY(-1px); }
.rt-desc-toggle:hover{ color:var(--rt-accent,#d72821) !important; }
.rt-desc-toggle[hidden]{ display:none; }
.woocommerce-products-header{ flex-wrap:wrap; }
.woocommerce-products-header .term-description,
.woocommerce-products-header .page-description{ flex:1 1 100%; }
.woocommerce-products-header .rt-desc-toggle{ flex:0 0 100%; justify-content:flex-start; }

/* Brand above product title (inc/catalogue.php: rt_loop_brand_html) */
ul.products li.product .rt-card-brand{
	display:flex; align-items:center; height:22px; margin:2px 0 4px; text-decoration:none !important; max-width:100%;
}
ul.products li.product .rt-card-brand .rt-brand-logo{
	height:20px; width:auto; max-width:90px; object-fit:contain; object-position:left center;
	filter:grayscale(1) contrast(1.15); opacity:.8; transition:opacity .15s, filter .15s;
}
ul.products li.product .rt-card-brand .rt-brand-name{
	font-family:'Jost','Inter',sans-serif; font-size:12.5px; font-weight:700; line-height:1;
	text-transform:uppercase; letter-spacing:.07em; color:#111 !important;
	white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
ul.products li.product .rt-card-brand:hover .rt-brand-logo{ opacity:1; }
ul.products li.product .rt-card-brand:hover .rt-brand-name{ color:var(--rt-accent,#d72821) !important; }
