/*
Theme Name: DFX Theme
Theme URI: https://desired-fx.com
Author: DFX / Zovkai
Description: Custom theme for Desired.FX — international SFX studio. Shop, custom orders, DFX Royalties, B2B estimator.
Version: 0.1.0
Requires at least: 6.4
Requires PHP: 8.0
License: Proprietary
Text Domain: dfx-theme
*/

/* ---------- Design tokens ----------
   Colors sourced directly from Brand Bible DFX.pdf (page 10):
   Green #29584a (main), Matte Black #2e2e2e, White #ffffff,
   Nature Red #9b5f56, Pink #ffd9d1. Green is the brand's actual dark
   surface color (see the logo treatment on page 6 — white wordmark on
   green, not black), so it replaces the placeholder near-black used
   before this was available.
   Fonts per page 11: Didot (headings/logo — standing in with Cormorant
   Garamond, the closest common webfont, and deliberately the same
   serif the sibling DFX Team Portal already uses) and Montserrat
   (body/UI). Courier Prime (the brand's third, monospace font) isn't
   loaded here — no clear supporting-label use on this site yet. */
:root {
	--dfx-ink: #29584a;
	--dfx-ink-soft: #1f4237;
	--dfx-paper: #ffffff;
	--dfx-surface: #ffffff;
	--dfx-line: #e3e8e5;
	--dfx-text: #2e2e2e;
	--dfx-text-muted: #6b6b6b;
	--dfx-text-on-ink: #ffffff;
	--dfx-moss: #29584a;
	--dfx-moss-dark: #1f4237;
	--dfx-oxblood: #9b5f56;
	--dfx-oxblood-dark: #7d4a43;
	--dfx-pink: #ffd9d1;

	--dfx-font: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	--dfx-font-heading: 'Cormorant Garamond', Didot, Georgia, serif;
	--dfx-container: 1240px;
	--dfx-radius: 6px;
	--dfx-radius-lg: 10px;

	/* Elevation — used sparingly: cards rest flat by default, lift on hover;
	   modals/overlays get the higher tier so they read as "above" the page. */
	--dfx-shadow-sm: 0 1px 3px rgba(46, 46, 46, .06), 0 1px 2px rgba(46, 46, 46, .04);
	--dfx-shadow-md: 0 8px 24px rgba(46, 46, 46, .10), 0 2px 8px rgba(46, 46, 46, .06);
	--dfx-shadow-lg: 0 24px 60px rgba(46, 46, 46, .18);
	--dfx-ease: cubic-bezier(.22, .61, .36, 1);
}

/* ---------- Motion ----------
   One shared rule: respect reduced-motion preference everywhere at once
   rather than repeating the media query per component. */
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		animation-duration: 0.001ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.001ms !important;
		scroll-behavior: auto !important;
	}
}

/* ---------- Botanical motifs (original line-art, see inc/botanical-svg.php) ---------- */
.dfx-leaf, .dfx-branch, .dfx-sprig { color: var(--dfx-moss); }
.dfx-branch--flip { transform: scaleX(-1); }
.dfx-pillar-icon {
	display: block;
	width: 44px;
	height: 44px;
	color: var(--dfx-moss);
	margin-bottom: 1rem;
}
.dfx-corner-flourish {
	position: absolute;
	width: 140px;
	height: 140px;
	pointer-events: none;
	opacity: .5;
}
.dfx-eyebrow {
	display: inline-flex;
	align-items: center;
	gap: .6rem;
	font-family: var(--dfx-font);
	font-size: .78rem;
	font-weight: 600;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--dfx-moss-dark);
	margin-bottom: .75rem;
}
.dfx-eyebrow .dfx-sprig { width: 46px; height: 12px; }

/* ---------- Scroll reveal ---------- */
.dfx-reveal {
	opacity: 0;
	transform: translateY(18px);
	transition: opacity .7s var(--dfx-ease), transform .7s var(--dfx-ease);
}
.dfx-reveal.is-visible { opacity: 1; transform: translateY(0); }
.dfx-reveal--stagger.is-visible { transition-delay: var(--dfx-reveal-delay, 0s); }

/* ---------- Base ---------- */
* { box-sizing: border-box; }

body {
	margin: 0;
	font-family: var(--dfx-font);
	background: var(--dfx-paper);
	color: var(--dfx-text);
	line-height: 1.55;
	font-size: 16px;
}

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

a { color: var(--dfx-moss); text-decoration: none; }
a:hover { color: var(--dfx-moss-dark); text-decoration: underline; }

h1, h2, h3, h4, h5, h6 {
	font-family: var(--dfx-font-heading);
	font-weight: 600;
	line-height: 1.2;
	color: var(--dfx-ink);
	margin: 0 0 .6em;
	letter-spacing: -.01em;
}

h1 { font-size: clamp(1.9rem, 3vw, 2.75rem); }
h2 { font-size: clamp(1.5rem, 2.4vw, 2rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1.1em; }

.dfx-container {
	max-width: var(--dfx-container);
	margin: 0 auto;
	padding: 0 1.5rem;
}

/* ---------- Buttons ---------- */
.button,
input[type="submit"],
.woocommerce a.button,
.woocommerce button.button,
.woocommerce #respond input#submit {
	display: inline-block;
	font-family: var(--dfx-font);
	font-weight: 600;
	font-size: .95rem;
	padding: .7em 1.4em;
	border-radius: var(--dfx-radius);
	border: 1px solid var(--dfx-oxblood);
	/* !important: WooCommerce's own stylesheet styles the `.alt` variant
	   (the single-product "Add to cart" button) with a same-or-higher
	   specificity selector list, painting it WC's brand purple (#7f54b3)
	   unless we win outright rather than by specificity. */
	background: var(--dfx-oxblood) !important;
	color: #fff !important;
	cursor: pointer;
	text-decoration: none !important;
	transition: background-color .15s ease, border-color .15s ease;
}

.button:hover,
input[type="submit"]:hover,
.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce #respond input#submit:hover {
	background: var(--dfx-oxblood-dark) !important;
	border-color: var(--dfx-oxblood-dark);
}

/* Secondary (outline) button — for when more than one CTA appears together
   and only one should read as the primary action. */
.button--secondary {
	background: transparent !important;
	border-color: var(--dfx-oxblood);
	color: var(--dfx-oxblood) !important;
}
.button--secondary:hover {
	background: var(--dfx-oxblood) !important;
	color: #fff !important;
}

/* ---------- Header ---------- */
.dfx-header {
	background: var(--dfx-ink);
	color: var(--dfx-text-on-ink);
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1.5rem;
	padding: 1rem 1.5rem;
	position: sticky;
	top: 0;
	z-index: 100;
	flex-wrap: wrap;
}

/* Two-part lockup matching the Brand Bible's actual logo treatment
   (page 6): a large serif "DFX" mark beside a ruled, letter-spaced
   "Desired.FX" wordmark. */
.dfx-logo {
	display: flex;
	align-items: center;
	gap: .75rem;
	color: var(--dfx-text-on-ink) !important;
	text-decoration: none !important;
}
.dfx-logo__mark {
	font-family: var(--dfx-font-heading);
	font-weight: 600;
	font-size: 2rem;
	line-height: 1;
	letter-spacing: -.01em;
}
.dfx-logo__wordmark {
	font-family: var(--dfx-font);
	font-size: .78rem;
	font-weight: 500;
	letter-spacing: .12em;
	text-transform: uppercase;
	line-height: 1.6;
}
.dfx-logo__rule {
	display: block;
	width: 100%;
	height: 1px;
	background: currentColor;
	opacity: .6;
	margin-bottom: .3em;
}

.dfx-header nav ul {
	list-style: none;
	display: flex;
	gap: 1.5rem;
	margin: 0;
	padding: 0;
	flex-wrap: wrap;
}

.dfx-header nav a {
	color: var(--dfx-text-on-ink) !important;
	text-decoration: none !important;
	font-size: .92rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: .04em;
	opacity: .85;
}

.dfx-header nav a:hover { opacity: 1; color: #fff !important; }

.dfx-header__country a.dfx-country-trigger {
	color: var(--dfx-text-on-ink) !important;
	text-decoration: none !important;
	font-size: .85rem;
	border: 1px solid rgba(255,255,255,.25);
	border-radius: 999px;
	padding: .35em .9em;
	white-space: nowrap;
}
.dfx-header__country a.dfx-country-trigger:hover { border-color: rgba(255,255,255,.6); }

/* ---------- Main content ---------- */
#main.dfx-main,
.woocommerce {
	max-width: var(--dfx-container);
	margin: 0 auto;
	padding: 2.5rem 1.5rem 4rem;
}

/* ---------- Footer ---------- */
.dfx-footer {
	background: var(--dfx-ink);
	color: var(--dfx-text-on-ink);
	padding: 3rem 1.5rem 1.5rem;
	margin-top: 3rem;
}

.dfx-footer__inner {
	max-width: var(--dfx-container);
	margin: 0 auto;
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 2rem 3rem;
	padding-bottom: 2rem;
}

.dfx-footer__brand { max-width: 38ch; }

.dfx-footer__wordmark {
	display: block;
	font-family: var(--dfx-font-heading);
	font-size: 1.65rem;
	letter-spacing: .01em;
}

.dfx-footer__tagline {
	margin: .5rem 0 0;
	font-size: .85rem;
	line-height: 1.6;
	opacity: .7;
}

.dfx-footer__menu {
	list-style: none;
	display: grid;
	grid-template-columns: repeat(2, auto);
	gap: .65rem 2.5rem;
	margin: 0;
	padding: 0;
}

.dfx-footer nav a { color: var(--dfx-text-on-ink) !important; opacity: .8; font-size: .9rem; }
.dfx-footer nav a:hover { opacity: 1; }

.dfx-footer__bar {
	max-width: var(--dfx-container);
	margin: 0 auto;
	padding-top: 1.5rem;
	border-top: 1px solid rgba(255, 255, 255, .14);
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: baseline;
	gap: .4rem 1.5rem;
}

.dfx-footer__bar p {
	margin: 0;
	font-size: .82rem;
	opacity: .6;
}

.dfx-footer__credit { font-size: .78rem !important; opacity: .5 !important; }
.dfx-footer__credit a { color: var(--dfx-text-on-ink) !important; opacity: 1; text-decoration: underline; }

@media (max-width: 600px) {
	.dfx-footer__menu { grid-template-columns: 1fr; }
	/* Unlike mid-scroll overlaps elsewhere, the footer's copyright line sits
	   at the true end of the page — every visitor who scrolls to the bottom
	   lands here, so it needs guaranteed clearance from the fixed mascot/
	   WhatsApp buttons rather than the occasional-overlap tradeoff. */
	.dfx-footer__bar { padding-bottom: 4.5rem; }
}

/* ---------- WooCommerce shop grid ---------- */
.woocommerce ul.products {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 1.75rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.woocommerce ul.products li.product {
	background: var(--dfx-surface);
	border: 1px solid var(--dfx-line);
	border-radius: var(--dfx-radius-lg);
	text-align: left;
	overflow: hidden;
	box-shadow: var(--dfx-shadow-sm);
	transition: box-shadow .3s var(--dfx-ease), transform .3s var(--dfx-ease), border-color .3s var(--dfx-ease);
	/* WooCommerce's own stylesheet gives li.product a float-based percentage
	   width (e.g. 22.05% for 4 columns) at the exact same specificity as this
	   rule; since we lay the grid out ourselves via `ul.products{display:grid}`,
	   these must be explicitly reset or WC's values win by default. */
	width: auto;
	float: none;
	margin: 0;
	padding: 0;
}
.woocommerce ul.products li.product:hover {
	box-shadow: var(--dfx-shadow-md);
	transform: translateY(-4px);
	border-color: var(--dfx-moss);
}

.woocommerce ul.products li.product img {
	margin: 0 0 .9rem;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	border-radius: 0;
	transition: transform .5s var(--dfx-ease);
}
.woocommerce ul.products li.product:hover img { transform: scale(1.06); }

.woocommerce ul.products li.product h2,
.woocommerce ul.products li.product .woocommerce-loop-product__title {
	font-size: 1rem;
	margin: 0 1rem .3em;
}

.woocommerce ul.products li.product .price {
	color: var(--dfx-moss-dark);
	font-weight: 700;
	margin: 0 1rem;
}

.dfx-price-approx { display: block; font-size: .78em; color: var(--dfx-text-muted); font-weight: 500; margin-top: .15em; }

.woocommerce ul.products li.product .button {
	margin: 1rem 0 0;
	width: 100%;
	text-align: center;
	font-size: .85rem;
	padding: .7em 1em;
	border-radius: 0;
}

/* ---------- Single product page ----------
   The shop LOOP (ul.products li.product, above) was styled in an earlier
   pass; the single-product template was missed entirely and was rendering
   fully unstyled WooCommerce defaults (purple button, olive price, plain
   tab list) until this pass. */
.single-product div.images {
	border-radius: var(--dfx-radius-lg);
	overflow: hidden;
	box-shadow: var(--dfx-shadow-sm);
}

.single-product .summary .price {
	/* !important: beats WooCommerce's own `div.product span.price` rule,
	   which despite its :where() wrapper (zero specificity) still out-scores
	   this selector on element-type count alone. */
	color: var(--dfx-ink) !important;
	font-size: 1.35rem;
	font-weight: 700;
}
.single-product .summary .price .dfx-price-approx { font-size: .62em; }

.single-product .quantity .qty {
	border: 1px solid var(--dfx-line);
	border-radius: var(--dfx-radius);
	padding: .65em .75em;
	font-family: var(--dfx-font);
	font-size: .95rem;
	height: auto;
}

.single-product .cart { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }

.woocommerce-tabs ul.tabs {
	list-style: none;
	display: flex;
	gap: 1.75rem;
	margin: 2.5rem 0 0;
	padding: 0 0 0;
	border-bottom: 1px solid var(--dfx-line);
}
.woocommerce-tabs ul.tabs li { margin: 0; }
.woocommerce-tabs ul.tabs li a {
	display: inline-block;
	padding: 0 0 .85em;
	color: var(--dfx-text-muted) !important;
	font-weight: 600;
	text-decoration: none !important;
	border-bottom: 2px solid transparent;
}
.woocommerce-tabs ul.tabs li.active a {
	color: var(--dfx-ink) !important;
	border-bottom-color: var(--dfx-moss);
}
.woocommerce-tabs .panel { padding: 1.75rem 0 0; }

/* ---------- Country selector modal ---------- */
.dfx-country-modal {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(23, 21, 18, .75);
	z-index: 9999;
	align-items: center;
	justify-content: center;
	padding: 1.5rem;
}
.dfx-country-modal.is-open { display: flex; }

.dfx-country-modal__panel {
	background: var(--dfx-surface);
	padding: 2rem;
	border-radius: var(--dfx-radius-lg);
	max-width: 520px;
	width: 100%;
	max-height: 80vh;
	overflow-y: auto;
	box-shadow: 0 20px 60px rgba(0,0,0,.35);
}

.dfx-country-modal__panel h2 { margin-bottom: .2em; }
.dfx-country-modal__panel > p { color: var(--dfx-text-muted); }

.dfx-country-modal__grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: .5rem;
	margin: 1.25rem 0;
}

.dfx-country-modal__grid button {
	text-align: left;
	padding: .6em .85em;
	border: 1px solid var(--dfx-line);
	border-radius: var(--dfx-radius);
	background: var(--dfx-paper);
	color: var(--dfx-text);
	cursor: pointer;
	font-family: var(--dfx-font);
	font-size: .9rem;
}
.dfx-country-modal__grid button:hover { background: #f0ebe0; border-color: var(--dfx-moss); }

.dfx-country-skip {
	display: inline-block;
	margin-top: .25rem;
	font-size: .85rem;
	color: var(--dfx-text-muted) !important;
}

/* ---------- Mobile nav ---------- */
.dfx-nav-toggle { display: none; }

@media (max-width: 720px) {
	.dfx-header { flex-direction: row; }
	.dfx-nav-toggle {
		display: inline-block;
		background: transparent;
		border: 1px solid rgba(255,255,255,.3);
		color: var(--dfx-text-on-ink);
		border-radius: var(--dfx-radius);
		padding: .4em .7em;
		order: 3;
	}
	.dfx-header nav { order: 4; width: 100%; display: none; }
	.dfx-header nav.is-open { display: block; }
	.dfx-header nav ul { flex-direction: column; gap: .25rem; }
	.dfx-header__country { order: 2; }
	.dfx-country-modal__grid { grid-template-columns: 1fr; }
}
