/**
 * 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: 1;
	min-width: 0;
}

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

.site-logo-img {
	height: 45px;
	width: auto;
	max-width: 100%;
	object-fit: contain;
	object-position: left center;
}

@media (max-width: 480px) {
	.site-logo-img {
		height: 36px;
	}
}

/* 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;
	}
}

/* ==========================================================================
   6b. Demo bar, "What this demo shows" panel, Free/Pro badges
   ========================================================================== */

.demo-bar {
	background: #1a2332;
	color: #fff;
	font-size: 0.82rem;
	line-height: 1.4;
}

.demo-bar-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	min-height: 38px;
	padding-top: 6px;
	padding-bottom: 6px;
}

.demo-bar-label {
	color: rgba(255, 255, 255, 0.82);
}

.demo-bar-label strong {
	color: #fff;
}

.demo-bar-links {
	display: flex;
	align-items: center;
	gap: 16px;
	flex-shrink: 0;
}

.demo-bar a {
	color: #fff;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.demo-bar a:hover {
	color: #e8f5f0;
}

.demo-bar a.demo-bar-cta {
	background: #2d7d5f;
	padding: 4px 12px;
	border-radius: 999px;
	font-weight: 600;
	text-decoration: none;
}

.demo-bar a.demo-bar-cta:hover {
	background: #245f4a;
	color: #fff;
}

@media (max-width: 480px) {
	.demo-bar {
		font-size: 0.76rem;
	}

	.demo-bar-inner,
	.demo-bar-links {
		gap: 10px;
	}
}

.demo-tier {
	display: inline-block;
	min-width: 46px;
	padding: 2px 7px;
	border-radius: 999px;
	font-size: 0.66rem;
	font-weight: 700;
	letter-spacing: 0.05em;
	line-height: 1.5;
	text-align: center;
	text-transform: uppercase;
	vertical-align: 1px;
	flex-shrink: 0;
}

.demo-tier--free {
	background: #e8f5f0;
	color: #1b4d3a;
}

.demo-tier--pro {
	background: #1a2332;
	color: #fff;
}

.demo-shows {
	background: var(--bcd-bg-alt);
	border-bottom: 1px solid var(--bcd-border);
	padding: 28px 0;
}

.demo-shows-inner {
	display: grid;
	grid-template-columns: minmax(220px, 1fr) 2fr;
	gap: 10px 40px;
	align-items: start;
}

.demo-shows-intro h2 {
	font-size: 1.05rem;
	margin: 0 0 6px;
}

.demo-shows-intro p {
	margin: 0;
	color: var(--bcd-text-light);
	font-size: 0.95rem;
}

.demo-shows-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 8px 24px;
	font-size: 0.92rem;
}

.demo-shows-list li,
.showcase-card-shows li {
	display: flex;
	align-items: baseline;
	gap: 8px;
}

.demo-shows-note {
	grid-column: 2;
	margin: 6px 0 0;
	font-size: 0.8rem;
	color: var(--bcd-text-light);
}

.demo-shows-note a,
.showcase-note a {
	color: var(--bcd-accent);
	text-decoration: underline;
	text-underline-offset: 2px;
}

@media (max-width: 768px) {
	.demo-shows {
		padding: 22px 0;
	}

	.demo-shows-inner,
	.demo-shows-list {
		grid-template-columns: 1fr;
	}

	.demo-shows-note {
		grid-column: 1;
	}
}

.demo-login {
	grid-column: 2;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 16px;
	padding: 14px 16px;
	background: #fff;
	border: 1px solid var(--bcd-border);
	border-left: 4px solid var(--bcd-accent);
	border-radius: var(--bcd-radius);
	font-size: 0.9rem;
}

.demo-login p {
	margin: 0;
}

.demo-login-title {
	font-weight: 700;
	flex-basis: 100%;
}

.demo-login code {
	background: var(--bcd-bg-alt);
	border: 1px solid var(--bcd-border);
	border-radius: 4px;
	padding: 1px 6px;
	margin-right: 10px;
	font-size: 0.9em;
}

.demo-login-button {
	background: var(--bcd-accent);
	color: #fff;
	padding: 8px 14px;
	border-radius: var(--bcd-radius);
	font-weight: 600;
	text-decoration: none;
}

.demo-login-button:hover {
	background: var(--bcd-accent-hover);
	color: #fff;
}

button.demo-login-button {
	border: 0;
	cursor: pointer;
	font: inherit;
}

/* Above the sign-in form on the account page. */
.demo-login--account {
	margin: 0 0 28px;
}

@media (max-width: 768px) {
	.demo-login {
		grid-column: 1;
	}
}

.showcase-card-body {
	text-align: left;
}

.showcase-card-body p {
	flex: 0 0 auto;
}

/* The tags take the spare height (not the story), so they sit under the
   story and "View Demo" still lines up across the cards. */
.showcase-card-shows {
	list-style: none;
	margin: 0 0 18px;
	padding: 0;
	display: grid;
	align-content: start;
	flex: 1;
	gap: 6px;
	font-size: 0.85rem;
}

.showcase-card-body .showcase-card-link {
	align-self: flex-start;
}

/* Beats ".showcase > .container > p", which would zero the top margin. */
.showcase > .container > .showcase-note {
	margin: 56px auto 0;
	max-width: 720px;
	font-size: 0.9rem;
	color: var(--bcd-text-light);
}

@media (max-width: 768px) {
	.showcase > .container > .showcase-note {
		margin-top: 40px;
	}
}

/* ==========================================================================
   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;
}
