/*
Theme Name: Cheap Sheep – Neve Child
Theme URI: https://themeisle.com/themes/neve/
Description: Cheap Sheep storefront child theme. Amber-and-ink workshop palette, hazard-stripe signature, stamped mono prices, sheep brand mark.
Author: Muhammad Bilal
Template: neve
Version: 1.3.2
Text Domain: neve-child
*/

/* =========================================================
   TOKENS
   ========================================================= */
:root {
	/* Apex palette */
	--apex-ink: #23272B;         /* Tool Steel */
	--apex-bg: #F1F2F0;          /* Galvanized */
	--apex-card: #FFFFFF;        /* Card white */
	--apex-amber: #FFB100;       /* Safety Amber */
	--apex-amber-dark: #EBA200;  /* Amber hover */
	--apex-teal: #0F6B72;        /* Gauge Teal */
	--apex-red: #D23A17;         /* Signal Red */
	--apex-line: #C7CCCE;        /* Steel Line */
	--apex-footer-text: #E8EAEB;

	/* Type */
	--apex-ff-display: 'Saira Condensed', sans-serif;
	--apex-ff-body: 'Barlow', sans-serif;
	--apex-ff-mono: 'IBM Plex Mono', monospace;

	/* Hazard stripe motif */
	--apex-hazard: repeating-linear-gradient(
		45deg,
		var(--apex-amber) 0px,
		var(--apex-amber) 8px,
		var(--apex-ink) 8px,
		var(--apex-ink) 16px
	);

	/* Neve variable overrides so the design reaches Neve-rendered components */
	--nv-primary-accent: #FFB100;
	--nv-secondary-accent: #0F6B72;
	--nv-site-bg: #F1F2F0;
	--nv-text-color: #23272B;
	--nv-c-1: #FFB100;
	--nv-c-2: #0F6B72;
	--nv-fallback-ff: 'Barlow', sans-serif;
}

/* =========================================================
   BASE / TYPOGRAPHY
   ========================================================= */
body {
	background-color: var(--apex-bg);
	color: var(--apex-ink);
	font-family: var(--apex-ff-body);
	font-weight: 400;
}

h1, h2, h3, h4,
.woocommerce-products-header__title,
.woocommerce ul.products li.product .woocommerce-loop-product__title {
	font-family: var(--apex-ff-display);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: var(--apex-ink);
}

/* Product card titles use Barlow, not condensed display face */
.woocommerce ul.products li.product .woocommerce-loop-product__title {
	font-family: var(--apex-ff-body);
	font-weight: 600;
	text-transform: none;
	letter-spacing: normal;
}

a {
	color: var(--apex-teal);
	text-decoration-color: var(--apex-amber);
}

a:hover,
a:focus {
	color: var(--apex-ink);
	text-decoration: underline;
	text-decoration-color: var(--apex-amber);
	text-decoration-thickness: 2px;
}

/* Prices, SKUs, meta, badges — stamped part-number look */
.price,
.woocommerce-Price-amount,
.amount,
.sku,
span.sku,
.product_meta {
	font-family: var(--apex-ff-mono);
	font-weight: 500;
}

/* Breadcrumbs + product meta (SKU, categories) */
.woocommerce-breadcrumb,
.posted_in,
.product_meta,
.product_meta > span {
	font-family: var(--apex-ff-mono);
	font-size: 13px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.woocommerce-breadcrumb a:hover {
	color: var(--apex-teal);
}

/* Hazard-stripe title underline — main page/shop titles only */
h1.entry-title,
.woocommerce-products-header__title {
	position: relative;
	display: inline-block;
	padding-bottom: 0.5rem;
}

h1.entry-title::after,
.woocommerce-products-header__title::after {
	content: '';
	position: absolute;
	left: 0;
	bottom: 0;
	width: 72px;
	height: 6px;
	background: var(--apex-hazard);
}

/* =========================================================
   HEADER / FOOTER
   Custom templates: header.php + footer.php render
   template-parts/header/site-header.php and
   template-parts/footer/site-footer.php; their styles live in
   assets/css/header-footer.css.
   ========================================================= */

/* =========================================================
   BUTTONS
   ========================================================= */
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #respond input#submit,
.woocommerce .single_add_to_cart_button,
.woocommerce-checkout #payment #place_order,
.nv-button.button-primary,
.button-primary {
	background-color: var(--apex-amber);
	color: var(--apex-ink);
	font-family: var(--apex-ff-body);
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	border-radius: 2px;
	border: 2px solid var(--apex-ink);
	box-shadow: 3px 3px 0 var(--apex-ink);
	transition: background-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
	padding: 0.75em 1.5em;
}

.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover,
.woocommerce #respond input#submit:hover,
.woocommerce .single_add_to_cart_button:hover,
.woocommerce-checkout #payment #place_order:hover,
.nv-button.button-primary:hover,
.button-primary:hover {
	background-color: var(--apex-amber-dark);
	color: var(--apex-ink);
}

.woocommerce a.button:active,
.woocommerce button.button:active,
.woocommerce input.button:active,
.woocommerce #respond input#submit:active,
.woocommerce .single_add_to_cart_button:active,
.woocommerce-checkout #payment #place_order:active,
.nv-button.button-primary:active,
.button-primary:active {
	box-shadow: 1px 1px 0 var(--apex-ink);
	transform: translate(2px, 2px);
}

.woocommerce a.button:focus-visible,
.woocommerce button.button:focus-visible,
.nv-button.button-primary:focus-visible {
	outline: 3px solid var(--apex-amber);
	outline-offset: 2px;
}

/* =========================================================
   PRODUCT GRID
   ========================================================= */
.woocommerce ul.products li.product {
	background-color: var(--apex-card);
	border: 2px solid var(--apex-line);
	border-radius: 2px;
	padding: 1rem;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
	position: relative;
}

.woocommerce ul.products li.product:hover {
	border-color: var(--apex-ink);
	box-shadow: 4px 4px 0 var(--apex-amber);
}

.woocommerce ul.products li.product img {
	transition: transform 0.2s ease;
}

.woocommerce ul.products li.product:hover img {
	transform: scale(1.02);
}

.woocommerce ul.products li.product .price {
	color: var(--apex-ink);
}

/* Square product images: Sparks' "same image height" forces a fixed 320px
   height on .sp-product-image AND .img-wrap, which is taller than the grid
   column is wide — portrait crops / dead space. Both must collapse to the
   1:1 box; contain avoids cropping. */
.woocommerce ul.products li.product .sp-product-image {
	height: auto !important;
	min-height: 0 !important;
	/* Sparks also sizes this via flex-basis, which beats height inside our
	   flex-column card — reset it or the 320px comes back. */
	flex-basis: auto !important;
}

/* Sparks' hover-overlay carries the same fixed height; pin it to the box
   so it can't extend below the image and swallow clicks. */
.woocommerce ul.products li.product .sp-product-image .sp-image-buttons {
	height: 100% !important;
}

.woocommerce ul.products li.product .sp-product-image .img-wrap {
	height: auto !important;
	aspect-ratio: 1 / 1;
	background: #FFFFFF;
}

.woocommerce ul.products li.product .sp-product-image .img-wrap img {
	width: 100%;
	height: 100% !important;
	object-fit: contain;
}

/* Equal-height cards: long titles must not push "Add to cart" out of line.
   Card is a flex column; margin-top:auto pins the button to the bottom. */
.woocommerce ul.products li.product {
	display: flex;
	flex-direction: column;
}

.woocommerce ul.products li.product .nv-card-content-wrapper {
	display: flex;
	flex-direction: column;
	flex: 1;
}

.woocommerce ul.products li.product .nv-product-content {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	flex: 1;
}

.woocommerce ul.products li.product .nv-product-content .button {
	margin-top: auto;
}

/* Star ratings */
.woocommerce .star-rating span,
.woocommerce .star-rating::before {
	color: var(--apex-amber);
}

/* Sale badge */
.woocommerce span.onsale,
.woocommerce ul.products li.product .onsale {
	background-color: var(--apex-red);
	color: #FFFFFF;
	font-family: var(--apex-ff-mono);
	font-weight: 600;
	text-transform: uppercase;
	border-radius: 0;
	top: 0;
	left: 0;
	right: auto;
	min-height: auto;
	min-width: auto;
	line-height: 1.4;
	padding: 0.25em 0.65em;
	position: absolute;
	z-index: 2;
}

/* =========================================================
   SINGLE PRODUCT
   ========================================================= */
.woocommerce div.product p.price,
.woocommerce div.product span.price {
	color: var(--apex-ink);
	font-size: 1.4em;
}

.woocommerce div.product .product_meta {
	color: var(--apex-ink);
	opacity: 0.8;
}

.woocommerce div.product .stock.in-stock {
	color: var(--apex-teal);
	font-family: var(--apex-ff-mono);
	text-transform: uppercase;
	letter-spacing: 0.04em;
	font-size: 13px;
}

.woocommerce div.product .stock.out-of-stock {
	color: var(--apex-red);
	font-family: var(--apex-ff-mono);
	text-transform: uppercase;
	letter-spacing: 0.04em;
	font-size: 13px;
}

/* =========================================================
   CART / CHECKOUT
   ========================================================= */
.woocommerce table.shop_table {
	border-collapse: collapse;
}

.woocommerce table.shop_table thead th {
	border-bottom: 2px solid var(--apex-ink);
	font-family: var(--apex-ff-display);
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

.woocommerce table.shop_table td.product-total,
.woocommerce table.shop_table td.product-subtotal,
.woocommerce table.shop_table .amount,
.woocommerce-checkout-review-order-table .amount {
	font-family: var(--apex-ff-mono);
}

.woocommerce table.shop_table tfoot tr:last-child .amount {
	font-weight: 600;
}

.woocommerce-cart .cart-collaterals .cart_totals table td,
.woocommerce-cart .cart-collaterals .cart_totals table th {
	border-bottom: 1px solid var(--apex-line);
}

/* =========================================================
   NOTICES
   ========================================================= */
.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
	border-top: 4px solid transparent;
	background: var(--apex-card);
	border-left: none;
	border-radius: 2px;
	box-shadow: none;
}

.woocommerce-message,
.woocommerce-info {
	position: relative;
	border-top: 4px solid var(--apex-amber);
}

.woocommerce-message::before,
.woocommerce-info::before {
	content: '';
	position: absolute;
	top: -4px;
	left: 0;
	right: 0;
	height: 4px;
	background: var(--apex-hazard);
}

.woocommerce-error {
	border-top: 4px solid var(--apex-red);
	color: var(--apex-ink);
}

/* =========================================================
   FORMS
   ========================================================= */
.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea,
.woocommerce table.cart td.actions .coupon .input-text,
.woocommerce div.product form.cart .quantity .qty,
.select2-container .select2-selection,
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="password"],
textarea,
select {
	background-color: var(--apex-card);
	border: 2px solid var(--apex-line);
	border-radius: 2px;
	color: var(--apex-ink);
	transition: border-color 0.15s ease;
}

.woocommerce form .form-row input.input-text:focus,
.woocommerce form .form-row textarea:focus,
.woocommerce table.cart td.actions .coupon .input-text:focus,
.woocommerce div.product form.cart .quantity .qty:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="number"]:focus,
input[type="password"]:focus,
textarea:focus,
select:focus {
	border-color: var(--apex-ink);
	outline: 3px solid var(--apex-amber);
	outline-offset: 2px;
}

/* =========================================================
   404 (template: 404.php)
   ========================================================= */
.apex-404 {
	padding-block: clamp(4rem, 12vw, 8rem);
}

.apex-404__inner {
	max-width: 640px;
	margin-inline: auto;
	padding-inline: clamp(1rem, 4vw, 2rem);
	text-align: center;
}

.apex-404__code {
	font-family: var(--apex-ff-mono), monospace;
	text-transform: uppercase;
	letter-spacing: 0.12em;
	font-size: 0.8rem;
	color: var(--apex-red);
	margin: 0 0 0.5rem;
}

.apex-404 h1.entry-title {
	font-size: clamp(2.5rem, 7vw, 4rem);
}

.apex-404__sub {
	max-width: 44ch;
	margin: 1rem auto 2rem;
}

.apex-404__search {
	display: flex;
	justify-content: center;
	gap: 0;
	margin-bottom: 2rem;
}

.apex-404__search input[type="search"] {
	width: min(320px, 70%);
	border-radius: 2px 0 0 2px;
}

.apex-404__search .apex-btn-ink {
	background: var(--apex-ink);
	color: #FFFFFF;
	border: 2px solid var(--apex-ink);
	border-radius: 0 2px 2px 0;
	font-family: var(--apex-ff-body), sans-serif;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	padding: 0 1.2em;
	cursor: pointer;
}

.apex-404__search .apex-btn-ink:hover {
	background: var(--apex-amber);
	color: var(--apex-ink);
}

.apex-404__actions {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: 1.5rem;
}

.apex-404__home {
	font-family: var(--apex-ff-mono), monospace;
	font-size: 0.85rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

/* =========================================================
   ACCESSIBILITY & REDUCED MOTION
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
	.woocommerce a.button,
	.woocommerce button.button,
	.woocommerce input.button,
	.woocommerce .single_add_to_cart_button,
	.nv-button.button-primary,
	.button-primary,
	.woocommerce ul.products li.product img,
	.woocommerce ul.products li.product {
		transition: none !important;
		transform: none !important;
	}
}

:focus-visible {
	outline: 3px solid var(--apex-amber);
	outline-offset: 2px;
}

/* =========================================================
   MOBILE (max-width 768px)
   ========================================================= */
@media (max-width: 768px) {
	h1, h2, h3, h4,
	.woocommerce-products-header__title {
		letter-spacing: 0.02em;
	}

	h1.entry-title,
	.woocommerce-products-header__title {
		font-size: 1.6em;
	}

	.woocommerce ul.products li.product {
		padding: 0.75rem;
	}

	.woocommerce a.button,
	.woocommerce button.button,
	.woocommerce input.button,
	.woocommerce .single_add_to_cart_button,
	.nv-button.button-primary,
	.button-primary {
		padding: 0.65em 1.1em;
	}

	.woocommerce div.product p.price,
	.woocommerce div.product span.price {
		font-size: 1.2em;
	}
}
