/*
Theme Name: Greenly child theme
Theme URI: http://capricasolar.co.za/greenly-child-theme/
Description: Greenly child theme
Author: Caprikan
Author URI: http://capricasolar.co.za
Template: greenly
Version: 1.0.1
*/

/* ==========================================================================
   Caprica Solar brand tokens
   ========================================================================== */
:root {
	--cs-green-deep:  #0E2A1C;
	--cs-green:       #1E7A46;
	--cs-green-hover: #25904F;
	--cs-green-light: #E7F1EA;
	--cs-gold:        #F0A83B;
	--cs-gold-soft:   #FBE4B8;
	--cs-sale:        #E1573D;
	--cs-line:        #E4E0D5;
	--cs-ink:         #151A16;
}

/* ==========================================================================
   Category count badges
   WooCommerce outputs category counts as <mark class="count">(92)</mark>.
   By default that's an unstyled <mark> tag, which is why it showed up as a
   plain yellow highlighter box. This turns it into a small brand-green pill.
   ========================================================================== */
.woocommerce mark.count,
mark.count {
	background: var(--cs-green-light) !important;
	color: var(--cs-green) !important;
	font-weight: 600;
	font-size: 0.75rem;
	padding: 3px 10px !important;
	border-radius: 20px;
	display: inline-block;
}

/* ==========================================================================
   Product category tiles (the "Shop by category" grid)
   ========================================================================== */
.woocommerce ul.products li.product-category {
	border: 1px solid var(--cs-line);
	border-radius: 14px;
	transition: box-shadow 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
}

.woocommerce ul.products li.product-category:hover {
	box-shadow: 0 10px 22px rgba(20, 30, 20, 0.08);
	transform: translateY(-2px);
	border-color: #D3EBD9;
}

.woocommerce ul.products li.product-category h2,
.woocommerce ul.products li.product-category .woocommerce-loop-category__title {
	font-weight: 600;
	color: var(--cs-ink);
}

/* Force every category tile to the same size, regardless of title length
   or image shape, so the grid lines up cleanly. */
.woocommerce ul.products li.product-category {
	display: flex !important;
	flex-direction: column;
	height: 260px;
	padding: 14px 12px 16px;
	overflow: hidden;
}

/* Image area: fixed height, image cropped to fill it instead of stretching
   or leaving empty space (this is what fixes mismatched card heights). */
.woocommerce ul.products li.product-category a {
	display: flex;
	flex-direction: column;
	height: 100%;
}

.woocommerce ul.products li.product-category img {
	height: 130px;
	width: 100%;
	object-fit: cover;
	border-radius: 8px;
	margin-bottom: 12px;
	flex-shrink: 0;
}

/* Title: same font, same size, same max lines for every card. Longer
   names truncate with an ellipsis instead of pushing the card taller. */
.woocommerce ul.products li.product-category h2,
.woocommerce ul.products li.product-category .woocommerce-loop-category__title {
	font-family: 'Space Grotesk', sans-serif !important;
	font-size: 0.85rem !important;
	line-height: 1.3 !important;
	margin: 0 0 6px !important;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	text-overflow: ellipsis;
	flex-grow: 1;
}

/* Count badge: pin to the bottom of the card so it lines up across every
   tile even when titles are different lengths. */
.woocommerce ul.products li.product-category mark.count {
	margin-top: auto;
	align-self: flex-start;
}

/* ==========================================================================
   Buttons / Add to cart
   ========================================================================== */
.woocommerce a.button,
.woocommerce button.button,
.woocommerce .add_to_cart_button,
.woocommerce .single_add_to_cart_button,
.woocommerce #respond input#submit {
	background-color: var(--cs-green) !important;
	color: #fff !important;
	border-color: var(--cs-green) !important;
	border-radius: 8px;
	font-weight: 600;
	transition: background-color 0.15s ease, transform 0.15s ease;
}

.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce .add_to_cart_button:hover,
.woocommerce .single_add_to_cart_button:hover,
.woocommerce #respond input#submit:hover {
	background-color: var(--cs-green-hover) !important;
	border-color: var(--cs-green-hover) !important;
	transform: translateY(-1px);
}

/* Sale badge */
.woocommerce span.onsale {
	background-color: var(--cs-sale) !important;
	border-radius: 5px;
	font-size: 0.7rem;
	font-weight: 700;
	text-transform: uppercase;
}

/* Struck-through "was" price */
.woocommerce .price del {
	color: #9AA39C;
	opacity: 1;
}

.woocommerce .price ins {
	text-decoration: none;
	color: var(--cs-ink);
	font-weight: 600;
}


/* ==========================================================================
   Fix: sidebar (Basket widget) dropping below the product grid instead of
   sitting alongside it on shop/category pages.

   Cause: the theme applies Bootstrap grid classes (col-md-9 / col-md-3) to
   the content area and sidebar, but the shared "row" wrapper that makes
   those classes sit side-by-side is missing from the actual template
   output. This recreates that flex-row behaviour directly, scoped to the
   WooCommerce content wrapper only.
   ========================================================================== */
@media (min-width: 768px) {
	#content.site-content.container {
		display: flex;
		flex-wrap: wrap;
		align-items: flex-start;
	}

	#content.site-content.container > #primary.content-area {
		flex: 0 0 75%;
		max-width: 75%;
	}

	#content.site-content.container > #secondary.widget-area {
		flex: 0 0 25%;
		max-width: 25%;
		padding-left: 24px;
	}
}

.cs-hero {
	position: relative;
	background: var(--cs-green-deep);
	color: #fff;
	overflow: hidden;
	padding: 56px 20px 40px;
	border-radius: 16px;
	margin-bottom: 32px;
}

.cs-hero::before {
	content: "";
	position: absolute;
	top: -40%;
	right: -10%;
	width: 520px;
	height: 520px;
	background: radial-gradient(circle, rgba(240, 168, 59, 0.28) 0%, rgba(240, 168, 59, 0) 65%);
}

.cs-hero-inner {
	max-width: 900px;
	margin: 0 auto;
	position: relative;
	z-index: 1;
}

.cs-arc {
	width: 64px;
	height: 4px;
	background: linear-gradient(90deg, var(--cs-gold) 0%, #F5C567 35%, var(--cs-green) 100%);
	border-radius: 4px;
	margin-bottom: 20px;
}

.cs-eyebrow {
	font-size: 0.78rem;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	color: var(--cs-gold-soft);
	font-weight: 600;
	margin-bottom: 14px;
}

.cs-hero-title {
	font-family: 'Space Grotesk', sans-serif;
	font-weight: 700;
	letter-spacing: -0.01em;
	font-size: 2rem;
	line-height: 1.15;
	max-width: 13ch;
	margin-bottom: 16px;
	color: #fff;
}

@media (min-width: 640px) {
	.cs-hero-title {
		font-size: 2.6rem;
	}
}

.cs-hero-sub {
	color: #C9D6CD;
	font-size: 1rem;
	max-width: 46ch;
	margin-bottom: 28px;
}

.cs-hero-ctas {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-bottom: 40px;
}

.cs-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 13px 22px;
	border-radius: 8px;
	font-weight: 600;
	font-size: 0.92rem;
	cursor: pointer;
	border: 1px solid transparent;
	transition: transform 0.15s ease, background 0.15s ease;
	text-decoration: none;
}

.cs-btn:hover {
	transform: translateY(-1px);
}

.cs-btn-primary {
	background: var(--cs-green);
	color: #fff;
}

.cs-btn-primary:hover {
	background: var(--cs-green-hover);
	color: #fff;
}

.cs-btn-ghost {
	background: transparent;
	border-color: rgba(255, 255, 255, 0.35);
	color: #fff;
}

.cs-btn-ghost:hover {
	background: rgba(255, 255, 255, 0.08);
	color: #fff;
}

.cs-trust-strip {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 18px;
	border-top: 1px solid rgba(255, 255, 255, 0.14);
	padding-top: 24px;
}

@media (min-width: 640px) {
	.cs-trust-strip {
		grid-template-columns: repeat(4, 1fr);
	}
}

.cs-trust-item {
	display: flex;
	align-items: center;
	gap: 10px;
}

.cs-trust-icon {
	color: var(--cs-gold);
	font-size: 0.6rem;
	flex-shrink: 0;
}

.cs-trust-item span:last-child {
	font-size: 0.82rem;
	color: #D9E4DC;
	line-height: 1.3;
}
