/*
Theme Name: 3D Cartel
Theme URI: https://threedcartel.com
Author: 3D Cartel
Description: Custom theme for 3D Cartel: made-to-order, caliber-specific 3D printed ammo cases. Dark shop look with a build-your-case color preview on the home page. WooCommerce ready.
Version: 0.1.0
Requires at least: 6.4
Requires PHP: 7.4
License: All rights reserved
Text Domain: 3dcartel
*/

/* ---------- Tokens ---------- */
:root {
	--bg: #141414;
	--bg-raised: #1c1c1c;
	--panel: #202020;
	--line: #2e2e2e;
	--text: #f2eee6;
	--muted: #a19d95;
	--brass: #c9a227;
	--brass-hi: #ddb83c;
	--brass-ink: #141414;
	--red: #d7261e;
	--blue: #1f3fbf;

	--font-display: "Bebas Neue", "Oswald", Impact, sans-serif;
	--font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

	--radius: 10px;
	--wrap: 1200px;
	--gutter: clamp(16px, 4vw, 32px);
	--section: clamp(56px, 9vw, 112px);

	/* faint horizontal "layer lines", the texture of an FDM print */
	--layers: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 4px);
}

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

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

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font: 400 1rem/1.6 var(--font-body);
	-webkit-font-smoothing: antialiased;
}

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

a {
	color: var(--brass);
}

a:hover {
	color: var(--brass-hi);
}

h1,
h2,
h3,
h4 {
	font-family: var(--font-display);
	font-weight: 400;
	letter-spacing: 0.02em;
	line-height: 1;
	margin: 0 0 0.5em;
}

p {
	margin: 0 0 1em;
}

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

.wrap {
	max-width: var(--wrap);
	margin: 0 auto;
	padding: 0 var(--gutter);
}

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

.skip-link {
	position: absolute;
	left: -999px;
	top: 8px;
	z-index: 100;
	padding: 8px 14px;
	background: var(--brass);
	color: var(--brass-ink);
}

.skip-link:focus {
	left: 8px;
}

.eyebrow {
	margin: 0 0 12px;
	color: var(--brass);
	font: 600 0.78rem/1 var(--font-body);
	letter-spacing: 0.18em;
	text-transform: uppercase;
}

/* ---------- Buttons ---------- */
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 14px 26px;
	border: 2px solid transparent;
	border-radius: 6px;
	font: 400 1.25rem/1 var(--font-display);
	letter-spacing: 0.06em;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}

.btn--brass {
	background: var(--brass);
	color: var(--brass-ink);
}

.btn--brass:hover {
	background: var(--brass-hi);
	color: var(--brass-ink);
}

.btn--ghost {
	border-color: var(--line);
	color: var(--text);
}

.btn--ghost:hover {
	border-color: var(--brass);
	color: var(--brass);
}

.btn--sm {
	padding: 10px 16px;
	font-size: 1.05rem;
}

.btn--block {
	width: 100%;
}

/* ---------- Header ---------- */
.site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: rgba(20, 20, 20, 0.92);
	backdrop-filter: blur(8px);
	border-bottom: 1px solid var(--line);
}

.admin-bar .site-header {
	top: 32px;
}

.site-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	min-height: 72px;
}

.site-logo img,
.custom-logo {
	width: auto;
	height: 44px;
}

.site-nav {
	display: flex;
	align-items: center;
	gap: 24px;
}

.site-nav__list {
	display: flex;
	gap: 24px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.site-nav__list a,
.cart-link {
	color: var(--text);
	font-weight: 500;
	font-size: 0.95rem;
	text-decoration: none;
}

.site-nav__list a:hover,
.cart-link:hover {
	color: var(--brass);
}

.cart-link__count {
	display: inline-grid;
	place-items: center;
	min-width: 22px;
	height: 22px;
	margin-left: 4px;
	padding: 0 6px;
	border-radius: 11px;
	background: var(--panel);
	font-size: 0.75rem;
}

.nav-toggle {
	display: none;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
}

.nav-toggle__bar,
.nav-toggle__bar::before,
.nav-toggle__bar::after {
	display: block;
	width: 24px;
	height: 2px;
	margin: 0 auto;
	background: var(--text);
	transition: transform 0.2s;
}

.nav-toggle__bar {
	position: relative;
}

.nav-toggle__bar::before,
.nav-toggle__bar::after {
	content: "";
	position: absolute;
	left: 0;
}

.nav-toggle__bar::before {
	top: -7px;
}

.nav-toggle__bar::after {
	top: 7px;
}

.nav-open .nav-toggle__bar {
	background: transparent;
}

.nav-open .nav-toggle__bar::before {
	transform: translateY(7px) rotate(45deg);
}

.nav-open .nav-toggle__bar::after {
	transform: translateY(-7px) rotate(-45deg);
}

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

	.site-nav {
		display: none;
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		flex-direction: column;
		align-items: stretch;
		gap: 16px;
		padding: 20px var(--gutter) 28px;
		background: var(--bg);
		border-bottom: 1px solid var(--line);
	}

	.nav-open .site-nav {
		display: flex;
	}

	.site-nav__list {
		flex-direction: column;
		gap: 4px;
	}

	.site-nav__list a {
		display: block;
		padding: 10px 0;
		font-size: 1.1rem;
	}

	.site-logo img,
	.custom-logo {
		height: 36px;
	}
}

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

/* ---------- Hero ---------- */
.hero {
	padding: clamp(40px, 7vw, 88px) 0 clamp(48px, 7vw, 96px);
	background:
		radial-gradient(ellipse at 75% 40%, rgba(201, 162, 39, 0.1), transparent 60%),
		var(--layers);
}

.hero__inner {
	display: grid;
	grid-template-columns: 1fr;
	gap: 40px;
	align-items: center;
}

@media (min-width: 960px) {
	.hero__inner {
		grid-template-columns: 0.85fr 1.15fr;
	}
}

.hero__title {
	font-size: clamp(3.2rem, 8vw, 6rem);
	line-height: 0.92;
	margin-bottom: 24px;
}

.hero__title span {
	color: var(--brass);
}

.hero__lede {
	max-width: 34em;
	color: var(--muted);
	font-size: 1.1rem;
}

.hero__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 28px;
}

.hero__media img {
	border-radius: var(--radius);
	box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.7);
}

/* ---------- Highlight strip ---------- */
.strip {
	border-top: 1px solid var(--line);
	border-bottom: 1px solid var(--line);
	background: var(--bg-raised);
}

.strip__list {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 12px 32px;
	margin: 0 auto;
	padding-top: 18px;
	padding-bottom: 18px;
	list-style: none;
}

.strip__list li {
	display: flex;
	align-items: center;
	gap: 10px;
	font: 400 1.2rem/1 var(--font-display);
	letter-spacing: 0.08em;
}

.strip__list li::before {
	content: "";
	width: 10px;
	height: 10px;
	border: 2px solid var(--brass);
	border-right: 0;
	border-bottom: 0;
}

/* ---------- Sections ---------- */
.section {
	padding: var(--section) 0;
}

.section--panel {
	background: var(--bg-raised) var(--layers);
	border-top: 1px solid var(--line);
	border-bottom: 1px solid var(--line);
}

.section__title {
	font-size: clamp(2.4rem, 5vw, 3.6rem);
	margin-bottom: 40px;
}

/* ---------- Steps ---------- */
.steps {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 20px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.steps__item {
	position: relative;
	padding: 28px;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: var(--bg-raised);
}

.steps__num {
	display: block;
	margin-bottom: 16px;
	color: var(--brass);
	font: 400 2.6rem/1 var(--font-display);
}

.steps__item h3 {
	font-size: 1.8rem;
}

.steps__item p {
	margin: 0;
	color: var(--muted);
}

/* ---------- Build your case ---------- */
.build {
	display: grid;
	grid-template-columns: 1fr;
	gap: 40px;
	align-items: start;
}

@media (min-width: 960px) {
	.build {
		grid-template-columns: 1.1fr 0.9fr;
		gap: 64px;
	}

	.build__preview {
		position: sticky;
		top: 110px;
	}
}

.build__preview {
	padding: clamp(24px, 5vw, 56px);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: radial-gradient(ellipse at 50% 35%, #2b2b2b, #161616 70%);
}

.case-svg {
	--case: var(--red);
	--accent: var(--blue);
	width: 100%;
	filter: drop-shadow(0 24px 30px rgba(0, 0, 0, 0.55));
}

.case-svg__body {
	fill: var(--case);
	transition: fill 0.25s;
}

.case-svg__shade {
	fill: none;
	stroke: rgba(0, 0, 0, 0.18);
	stroke-width: 2;
}

.case-svg__accent-stroke {
	fill: none;
	stroke: var(--accent);
	stroke-width: 7;
	stroke-linecap: square;
	transition: stroke 0.25s;
}

.case-svg__round {
	fill: none;
	stroke: var(--accent);
	stroke-width: 3;
	stroke-linejoin: round;
	transition: stroke 0.25s;
}

.case-svg__label {
	fill: var(--accent);
	font: 400 34px/1 var(--font-display);
	letter-spacing: 0.04em;
	transition: fill 0.25s;
}

.case-svg__latch {
	fill: var(--accent);
	transition: fill 0.25s;
}

.build__summary {
	margin: 24px 0 0;
	color: var(--muted);
	text-align: center;
	font-size: 0.95rem;
}

.build__form .section__title {
	margin-bottom: 28px;
}

.build__group {
	margin: 0 0 24px;
	padding: 0;
	border: 0;
}

.build__group legend {
	margin-bottom: 12px;
	padding: 0;
	color: var(--muted);
	font-size: 0.85rem;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.build__group legend strong {
	color: var(--text);
}

.chips,
.swatches {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.chip,
.swatch {
	position: relative;
	cursor: pointer;
}

.chip input,
.swatch input {
	position: absolute;
	opacity: 0;
	inset: 0;
	margin: 0;
	cursor: pointer;
}

.chip span {
	display: block;
	min-width: 64px;
	padding: 10px 16px;
	border: 2px solid var(--line);
	border-radius: 6px;
	background: var(--panel);
	text-align: center;
	font: 400 1.25rem/1 var(--font-display);
	letter-spacing: 0.06em;
	transition: border-color 0.15s, color 0.15s;
}

.chip:hover span {
	border-color: #4a4a4a;
}

.chip input:checked + span {
	border-color: var(--brass);
	color: var(--brass);
}

.chip input:focus-visible + span {
	outline: 2px solid var(--brass);
	outline-offset: 3px;
}

.swatch {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: var(--swatch);
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15), inset 0 -6px 10px rgba(0, 0, 0, 0.25);
	transition: transform 0.15s;
}

.swatch:hover {
	transform: scale(1.06);
}

.swatch:has(input:checked) {
	box-shadow: 0 0 0 3px var(--bg-raised), 0 0 0 5px var(--brass), inset 0 -6px 10px rgba(0, 0, 0, 0.25);
}

.swatch:has(input:focus-visible) {
	outline: 2px solid var(--brass);
	outline-offset: 6px;
}

.build__note {
	margin: 14px 0 0;
	color: var(--muted);
	font-size: 0.82rem;
}

/* ---------- Lineup ---------- */
.lineup {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 20px;
}

.card {
	display: block;
	overflow: hidden;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: var(--bg-raised);
	color: var(--text);
	text-decoration: none;
	transition: border-color 0.2s, transform 0.2s;
}

.card:hover {
	border-color: var(--brass);
	color: var(--text);
	transform: translateY(-3px);
}

.card__media {
	aspect-ratio: 3 / 2;
	overflow: hidden;
}

.card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.4s;
}

.card:hover .card__media img {
	transform: scale(1.04);
}

.card__body {
	padding: 18px 20px 20px;
}

.card__title {
	margin: 0 0 4px;
	font-size: 1.7rem;
}

.card__meta {
	margin: 0;
	color: var(--muted);
	font-size: 0.9rem;
}

/* ---------- CTA ---------- */
.cta {
	padding: var(--section) 0;
	background:
		linear-gradient(90deg, rgba(20, 20, 20, 0.95), rgba(20, 20, 20, 0.75)),
		var(--layers),
		var(--panel);
	border-top: 1px solid var(--line);
	text-align: center;
}

.cta__title {
	font-size: clamp(2.4rem, 5vw, 3.6rem);
}

.cta p {
	color: var(--muted);
	margin-bottom: 28px;
}

/* ---------- Footer ---------- */
.site-footer {
	padding: 56px 0 24px;
	border-top: 1px solid var(--line);
	background: #101010;
}

.site-footer__inner {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 32px;
}

.site-footer__brand {
	max-width: 360px;
}

.site-footer__brand p {
	margin-top: 16px;
	color: var(--muted);
	font-size: 0.92rem;
}

.site-footer__nav {
	display: flex;
	flex-wrap: wrap;
	gap: 12px 28px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.site-footer__nav a {
	color: var(--text);
	text-decoration: none;
}

.site-footer__legal {
	margin-top: 40px;
	padding-top: 20px;
	border-top: 1px solid var(--line);
	color: var(--muted);
	font-size: 0.82rem;
}

.site-footer__legal p {
	margin: 0;
}

/* ---------- Pages & posts ---------- */
.page-body {
	padding-top: clamp(40px, 6vw, 72px);
	padding-bottom: var(--section);
}

.page-body--center {
	text-align: center;
}

.page-title {
	font-size: clamp(2.6rem, 6vw, 4.2rem);
	margin-bottom: 32px;
}

.entry__content {
	max-width: 72ch;
}

.entry__content > * + * {
	margin-top: 1em;
}

.entry--summary {
	padding: 24px 0;
	border-bottom: 1px solid var(--line);
}

.entry__title {
	font-size: 2rem;
}

.entry__title a {
	color: var(--text);
	text-decoration: none;
}

/* ---------- WooCommerce basics ---------- */
.shop .woocommerce-products-header__title,
.shop .product_title {
	font-family: var(--font-display);
	font-size: clamp(2.4rem, 5vw, 3.6rem);
}

.shop ul.products li.product {
	padding: 0 0 16px;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: var(--bg-raised);
	overflow: hidden;
}

.shop ul.products li.product a img {
	margin: 0 0 12px;
}

.shop ul.products li.product .woocommerce-loop-product__title,
.shop ul.products li.product .price {
	padding: 0 16px;
}

.shop ul.products li.product .woocommerce-loop-product__title {
	font-family: var(--font-display);
	font-size: 1.6rem;
	font-weight: 400;
	color: var(--text);
}

.shop .price,
.shop ul.products li.product .price {
	color: var(--brass);
	font-weight: 600;
}

.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #respond input#submit,
.woocommerce a.button.alt,
.woocommerce button.button.alt {
	border-radius: 6px;
	background: var(--brass);
	color: var(--brass-ink);
	font: 400 1.15rem/1 var(--font-display);
	letter-spacing: 0.06em;
	padding: 12px 20px;
}

.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce a.button.alt:hover,
.woocommerce button.button.alt:hover {
	background: var(--brass-hi);
	color: var(--brass-ink);
}

.shop ul.products li.product .button {
	margin: 8px 16px 0;
}

.woocommerce .quantity .qty,
.woocommerce select,
.woocommerce input.input-text,
.woocommerce textarea {
	padding: 10px 12px;
	border: 1px solid var(--line);
	border-radius: 6px;
	background: var(--panel);
	color: var(--text);
}

.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
	background: var(--panel);
	color: var(--text);
	border-top-color: var(--brass);
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		transition: none !important;
		scroll-behavior: auto !important;
	}
}
