/*
Theme Name: CattleWise Theme
Theme URI: https://www.cattlewise.co.za
Author: Viewertech
Author URI: https://viewertech.net
Description: Modern mobile-first livestock marketplace theme for CattleWise.
Version: 0.2.1
Requires at least: 6.9
Requires PHP: 7.4
Text Domain: cattlewise-theme
*/

:root {
	--cw-ink: #101820;
	--cw-navy: #182536;
	--cw-navy-2: #223143;
	--cw-gold: #c3912b;
	--cw-red: #e32121;
	--cw-bg: #f3f6f8;
	--cw-card: #ffffff;
	--cw-line: #dbe2ea;
	--cw-text: #111827;
	--cw-muted: #516071;
	--cw-max: 1380px;
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	background: var(--cw-bg);
	color: var(--cw-text);
	font-family: Arial, Helvetica, sans-serif;
	font-size: 14px;
	line-height: 1.45;
}

a {
	color: inherit;
}

img {
	max-width: 100%;
	height: auto;
}

.site-header {
	position: sticky;
	top: 0;
	z-index: 80;
	background: var(--cw-ink);
	color: #fff;
	box-shadow: 0 2px 8px rgba(10, 18, 28, 0.22);
}

.site-header-inner {
	width: min(var(--cw-max), calc(100% - 28px));
	min-height: 62px;
	display: grid;
	grid-template-columns: auto auto minmax(280px, 1fr) auto;
	align-items: center;
	gap: 14px;
	margin-inline: auto;
}

.site-branding {
	display: flex;
	align-items: center;
	width: 172px;
	min-height: 44px;
	padding: 4px 8px;
	border-radius: 4px;
	background: #fff;
	color: #fff;
	text-decoration: none;
}

.site-branding img {
	width: 100%;
	height: 36px;
	display: block;
	object-fit: contain;
}

.delivery-chip {
	display: grid;
	gap: 1px;
	min-width: 130px;
	font-size: 11px;
}

.delivery-chip span,
.header-link span,
.header-wallet span {
	color: #d8dee7;
	font-size: 11px;
}

.delivery-chip strong,
.header-link strong,
.header-wallet strong {
	color: #fff;
	font-size: 12px;
	font-weight: 900;
}

.header-search {
	height: 44px;
	display: grid;
	grid-template-columns: 142px 1fr 58px;
	overflow: hidden;
	border-radius: 3px;
	background: #fff;
}

.header-search select,
.header-search input,
.header-search button {
	border: 0;
	font: inherit;
}

.header-search select {
	padding-inline: 14px;
	background: #eef2f6;
	color: #0e1722;
}

.header-search input {
	min-width: 0;
	padding-inline: 18px;
}

.header-search button {
	background: var(--cw-gold);
	color: #111;
	font-size: 0;
	font-weight: 900;
	cursor: pointer;
}

.header-search button::before {
	content: "Q";
	font-size: 20px;
}

.main-navigation {
	display: none;
}

.header-actions {
	display: flex;
	align-items: stretch;
	gap: 10px;
}

.header-actions a {
	display: grid;
	align-content: center;
	min-height: 44px;
	color: #fff;
	text-decoration: none;
}

.header-wallet {
	min-width: 120px;
	padding: 6px 13px;
	border-radius: 4px;
	background: #82600c;
}

.header-cart {
	padding-left: 10px;
	font-weight: 900;
}

.secondary-nav {
	display: flex;
	gap: 24px;
	align-items: center;
	min-height: 38px;
	padding-inline: max(14px, calc((100vw - var(--cw-max)) / 2));
	background: var(--cw-navy-2);
}

.secondary-nav a {
	color: #fff;
	font-size: 13px;
	font-weight: 800;
	text-decoration: none;
}

.site-main {
	min-height: 70vh;
}

.entry-header,
.site-main > .entry-content,
.site-main > article > .entry-content {
	width: min(var(--cw-max), calc(100% - 28px));
	margin-inline: auto;
}

.entry-header {
	padding-top: 24px;
}

.entry-title {
	margin: 0 0 18px;
	font-size: clamp(28px, 5vw, 52px);
	line-height: 1;
}

.site-footer {
	margin-top: 56px;
	padding: 0;
	background: #fff;
	border-top: 1px solid #dfe5ec;
	box-shadow: 0 -14px 30px rgba(16, 24, 32, 0.04);
	color: var(--cw-ink);
}

.site-footer-inner {
	width: min(var(--cw-max), calc(100% - 28px));
	display: grid;
	grid-template-columns: minmax(280px, 1.35fr) repeat(3, minmax(140px, 0.65fr));
	gap: clamp(28px, 5vw, 64px);
	margin-inline: auto;
	padding: 34px 0 28px;
	align-items: start;
}

.footer-logo {
	width: 142px;
	height: auto;
	display: block;
	margin-bottom: 16px;
	background: #fff;
}

.footer-tagline {
	margin: 0 0 10px;
	color: #0e1a2a;
	font-size: 14px;
	font-weight: 900;
}

.footer-note {
	max-width: 420px;
	margin: 0;
	color: #536174;
	font-size: 14px;
	line-height: 1.55;
}

.footer-links {
	display: grid;
	align-content: start;
	gap: 8px;
}

.footer-links h2 {
	margin: 0 0 10px;
	color: #0e1a2a;
	font-size: 12px;
	font-weight: 900;
	letter-spacing: 0;
	text-transform: uppercase;
}

.footer-links a,
.site-footer a {
	color: #0e1a2a;
	font-weight: 700;
	text-decoration: none;
}

.footer-links a {
	color: #536174;
	font-size: 14px;
	line-height: 1.35;
}

.site-footer a:hover,
.site-footer a:focus {
	color: var(--cw-gold);
}

.footer-bottom {
	width: min(var(--cw-max), calc(100% - 28px));
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	margin-inline: auto;
	padding: 16px 0 20px;
	border-top: 1px solid #e7ecf2;
	color: #64748b;
	font-size: 12px;
	line-height: 1.45;
}

.footer-bottom p {
	max-width: 720px;
	margin: 0;
}

.footer-bottom p:last-child {
	flex: 0 0 auto;
	color: #0e1a2a;
	font-weight: 800;
	text-align: right;
}

.mobile-bottom-nav {
	position: fixed;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 90;
	display: none;
	grid-template-columns: repeat(5, 1fr);
	background: #fff;
	border-top: 1px solid var(--cw-line);
}

.mobile-bottom-nav a {
	min-height: 58px;
	display: grid;
	place-items: center;
	color: var(--cw-ink);
	font-size: 12px;
	font-weight: 900;
	text-decoration: none;
}

.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product {
	overflow: hidden;
	border: 1px solid var(--cw-line);
	border-radius: 6px;
	background: #fff;
}

.woocommerce ul.products li.product .button {
	border-radius: 4px;
	background: var(--cw-gold);
	color: #fff;
	font-weight: 900;
}

@media (max-width: 1080px) {
	.site-header-inner {
		grid-template-columns: auto 1fr auto;
	}

	.delivery-chip {
		display: none;
	}

	.header-actions .header-link {
		display: none;
	}
}

@media (max-width: 760px) {
	body {
		padding-bottom: 58px;
	}

	.site-header-inner {
		grid-template-columns: 1fr;
		padding-block: 10px;
	}

	.header-search {
		grid-template-columns: 94px 1fr 48px;
	}

	.header-actions {
		display: none;
	}

	.secondary-nav {
		overflow-x: auto;
		gap: 18px;
	}

	.site-footer-inner {
		grid-template-columns: 1fr;
		gap: 24px;
		padding-block: 32px 24px;
	}

	.footer-bottom {
		display: grid;
		gap: 12px;
	}

	.footer-bottom p:last-child {
		text-align: left;
	}

	.mobile-bottom-nav {
		display: grid;
	}
}
