/**
 * BoxCart Demo — Frontend Stylesheet
 *
 * Single CSS file, target <10KB.
 * Uses CSS custom properties set via wp_add_inline_style() in enqueue.php.
 *
 * @package BoxCart_Demo
 */

/* ==========================================================================
   1. CSS Custom Properties (defaults — overridden by inline style)
   ========================================================================== */

:root {
	--bcd-accent: #2D7D5F;
	--bcd-accent-hover: #245f4a;
	--bcd-text: #1a1a1a;
	--bcd-text-light: #555;
	--bcd-bg: #fff;
	--bcd-bg-alt: #f7f7f7;
	--bcd-border: #e0e0e0;
	--bcd-radius: 6px;
	--bcd-max-width: 1200px;
	--bcd-header-height: 70px;
	--bcd-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ==========================================================================
   2. Reset & Base
   ========================================================================== */

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

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
}

body {
	margin: 0;
	font-family: var(--bcd-font);
	font-size: 16px;
	line-height: 1.6;
	color: var(--bcd-text);
	background: var(--bcd-bg);
}

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

a {
	color: var(--bcd-accent);
	text-decoration: none;
	transition: color 0.2s ease;
}

a:hover {
	color: var(--bcd-accent-hover);
}

/* ==========================================================================
   3. Layout
   ========================================================================== */

.site-container {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

.site-main {
	flex: 1;
}

.container {
	max-width: var(--bcd-max-width);
	margin: 0 auto;
	padding: 0 20px;
}

/* ==========================================================================
   4. Header
   ========================================================================== */

.site-header {
	background: var(--bcd-bg);
	border-bottom: 1px solid var(--bcd-border);
	position: sticky;
	top: 0;
	z-index: 100;
	height: var(--bcd-header-height);
}

/* WP admin bar offset */
.admin-bar .site-header {
	top: 32px;
}

@media (max-width: 782px) {
	.admin-bar .site-header {
		top: 46px;
	}
}

.header-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: var(--bcd-header-height);
}

/* Logo */
.site-logo {
	display: flex;
	align-items: center;
	font-size: 1.4rem;
	font-weight: 700;
	color: var(--bcd-text);
	text-decoration: none;
	flex-shrink: 0;
}

.site-logo:hover {
	color: var(--bcd-accent);
}

.site-logo-img {
	height: 45px;
	width: auto;
}

/* Navigation */
.site-nav {
	display: flex;
	align-items: center;
	gap: 10px;
}

.nav-menu {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	gap: 5px;
}

.nav-menu li a {
	display: block;
	padding: 8px 14px;
	color: var(--bcd-text);
	font-size: 0.9rem;
	font-weight: 500;
	border-radius: var(--bcd-radius);
	transition: background 0.2s ease, color 0.2s ease;
}

.nav-menu li a:hover,
.nav-menu li.current-menu-item a {
	background: var(--bcd-bg-alt);
	color: var(--bcd-accent);
}

/* Mini basket in header */
.header-mini-basket {
	margin-left: 5px;
	flex-shrink: 0;
}

/* Mobile toggle */
.mobile-toggle {
	display: none;
	background: none;
	border: none;
	cursor: pointer;
	padding: 8px;
	color: var(--bcd-text);
}

.mobile-toggle svg {
	width: 24px;
	height: 24px;
	display: block;
}

@media (max-width: 768px) {
	.mobile-toggle {
		display: block;
	}

	.nav-menu {
		display: none;
		position: absolute;
		top: var(--bcd-header-height);
		left: 0;
		right: 0;
		background: var(--bcd-bg);
		border-bottom: 1px solid var(--bcd-border);
		flex-direction: column;
		padding: 10px 20px 20px;
		gap: 0;
		box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
	}

	.nav-menu.is-open {
		display: flex;
	}

	.nav-menu li a {
		padding: 12px 14px;
		font-size: 1rem;
	}
}

/* ==========================================================================
   5. Hero Section
   ========================================================================== */

.hero {
	position: relative;
	background-color: var(--bcd-accent);
	background-size: cover;
	background-position: center;
	padding: 80px 0;
	text-align: center;
	color: #fff;
	overflow: hidden;
}

.hero::before {
	content: "";
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.4);
	z-index: 1;
}

.hero-content {
	position: relative;
	z-index: 2;
	max-width: 700px;
	margin: 0 auto;
}

.hero h1 {
	font-size: 2.6rem;
	font-weight: 700;
	margin: 0 0 16px;
	line-height: 1.2;
}

.hero p {
	font-size: 1.15rem;
	margin: 0 0 30px;
	opacity: 0.9;
}

.hero-cta {
	display: inline-block;
	background: #fff;
	color: var(--bcd-accent);
	padding: 14px 32px;
	border-radius: var(--bcd-radius);
	font-weight: 600;
	font-size: 1rem;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hero-cta:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
	color: var(--bcd-accent);
}

@media (max-width: 768px) {
	.hero {
		padding: 50px 0;
	}

	.hero h1 {
		font-size: 1.8rem;
	}

	.hero p {
		font-size: 1rem;
	}
}

/* ==========================================================================
   6. Showcase (Main Site)
   ========================================================================== */

.showcase {
	padding: 60px 0 80px;
	text-align: center;
}

.showcase h2 {
	font-size: 1.8rem;
	margin: 0 0 10px;
	color: var(--bcd-text);
}

.showcase > .container > p {
	color: var(--bcd-text-light);
	margin: 0 0 40px;
	font-size: 1.05rem;
}

.showcase-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 30px;
}

.showcase-card {
	border-radius: var(--bcd-radius);
	overflow: hidden;
	border: 1px solid var(--bcd-border);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
	text-decoration: none;
	color: inherit;
	display: flex;
	flex-direction: column;
}

.showcase-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
	color: inherit;
}

.showcase-card-image {
	height: 200px;
	background-size: cover;
	background-position: center;
	background-color: var(--bcd-bg-alt);
}

.showcase-card-body {
	padding: 24px;
	flex: 1;
	display: flex;
	flex-direction: column;
}

.showcase-card-body h3 {
	font-size: 1.2rem;
	margin: 0 0 8px;
}

.showcase-card-body p {
	color: var(--bcd-text-light);
	font-size: 0.9rem;
	margin: 0 0 16px;
	flex: 1;
}

.showcase-card-link {
	display: inline-block;
	font-weight: 600;
	font-size: 0.9rem;
	align-self: center;
}

@media (max-width: 768px) {
	.showcase-grid {
		grid-template-columns: 1fr;
		gap: 20px;
		max-width: 400px;
		margin: 0 auto;
	}

	.showcase-card-image {
		height: 160px;
	}
}

/* ==========================================================================
   7. Products Section (Sub-site front page)
   ========================================================================== */

.products-section {
	padding: 50px 0 70px;
}

.products-section h2 {
	text-align: center;
	font-size: 1.6rem;
	margin: 0 0 30px;
}

/* ==========================================================================
   8. Page Title Bar & Content
   ========================================================================== */

.page-title-bar {
	background: var(--bcd-accent);
	color: #fff;
	padding: 35px 0;
	text-align: center;
}

.page-title-bar h1 {
	font-size: 1.8rem;
	font-weight: 700;
	margin: 0;
	line-height: 1.3;
}

.page-content {
	padding: 40px 0 60px;
}

/* 404 */
.error-404 {
	text-align: center;
	padding: 80px 0;
}

.error-404 h1 {
	font-size: 4rem;
	color: var(--bcd-accent);
	margin: 0 0 10px;
}

.error-404 p {
	font-size: 1.1rem;
	color: var(--bcd-text-light);
	margin: 0 0 30px;
}

.error-404 a {
	display: inline-block;
	background: var(--bcd-accent);
	color: #fff;
	padding: 12px 28px;
	border-radius: var(--bcd-radius);
	font-weight: 600;
	transition: background 0.2s ease;
}

.error-404 a:hover {
	background: var(--bcd-accent-hover);
	color: #fff;
}

/* ==========================================================================
   9. Footer
   ========================================================================== */

.site-footer {
	background: var(--bcd-text);
	color: rgba(255, 255, 255, 0.7);
	padding: 30px 0;
	font-size: 0.85rem;
}

.footer-inner {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	text-align: center;
}

.footer-text p {
	margin: 0;
}

.footer-social {
	display: flex;
	gap: 12px;
}

.footer-social a {
	color: rgba(255, 255, 255, 0.6);
	transition: color 0.2s ease;
}

.footer-social a:hover {
	color: #fff;
}

.footer-social svg {
	width: 20px;
	height: 20px;
	display: block;
	fill: currentColor;
}

/* ==========================================================================
   10. Utilities
   ========================================================================== */

.screen-reader-text {
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	width: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	word-wrap: normal !important;
}

.screen-reader-text:focus {
	clip: auto;
	clip-path: none;
	display: block;
	height: auto;
	width: auto;
	position: static;
}
