/* Shared components + cross-cutting rules */
/* Subtle interaction and page motion system */
.nav-link,
.nav-icon-btn,
.mega-menu a,
.button,
button,
a {
	transition: color 180ms ease, background-color 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.nav-group .nav-link.is-active {
	color: var(--ds-primary) !important;
	position: relative;
}

.nav-group .nav-link:hover,
.nav-icon-btn:hover {
	transform: translateY(-1px);
}

/* Cart icon token: keep one geometry/style across header and add-to-cart CTAs */
.ds-cart-icon {
	width: 18px;
	height: 18px;
	flex: 0 0 auto;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

/* accent span used in titles (page headlines, tabs, etc.) */
.ds-headline-accent {
	display: inline-block;
	color: var(--ds-primary);
}

/* Override section-header h2 !important color so the accent word stays sage green */
.section-header h2 .ds-headline-accent,
.section-header > h2 .ds-headline-accent {
	color: var(--ds-primary) !important;
}

.ds-motion-ready .ds-reveal {
	opacity: 0;
	transform: translateY(10px);
	transition: opacity 460ms ease, transform 460ms ease;
}

.ds-motion-ready .ds-reveal.is-visible {
	opacity: 1;
	transform: translateY(0);
}

.ds-motion-ready .ds-cart-item:nth-child(2n),
.ds-motion-ready .products-grid > *:nth-child(2n),
.ds-motion-ready .woocommerce ul.products > li:nth-child(2n) {
	transition-delay: 70ms;
}

.ds-motion-ready .ds-cart-item:nth-child(3n),
.ds-motion-ready .products-grid > *:nth-child(3n),
.ds-motion-ready .woocommerce ul.products > li:nth-child(3n) {
	transition-delay: 120ms;
}

@media (prefers-reduced-motion: reduce) {
	.nav-link,
	.nav-icon-btn,
	.mega-menu a,
	.button,
	button,
	a {
		transition: none !important;
	}

	.ds-motion-ready .ds-reveal {
		opacity: 1 !important;
		transform: none !important;
		transition: none !important;
	}
}

/* Brand system pass for internal/support-style pages */
:root {
	--ds-font-display: "Roboto Flex", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	--ds-font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
	font-family: var(--ds-font-sans);
}

h1,
h2,
h3,
h4,
h5,
h6,
button,
.button,
.wp-element-button,
input[type="submit"],
input[type="button"],
input[type="reset"] {
	font-family: var(--ds-font-display);
}

.card-base {
	background: var(--ds-surface);
	border: 1px solid var(--ds-border);
	border-radius: 16px;
	padding: clamp(0.95rem, 1.5vw, 1.35rem);
}

.input-base {
	width: 100%;
	min-height: 44px;
	border: 1px solid var(--ds-border);
	border-radius: 10px;
	background: var(--ds-surface);
	color: var(--ds-text);
	padding: 0.56rem 0.68rem;
	font-size: 0.95rem;
	line-height: 1.4;
}

.input-base::placeholder {
	color: var(--ds-muted);
}

.input-base:focus-visible {
	outline: 2px solid var(--ds-primary);
	outline-offset: 2px;
	border-color: var(--ds-primary);
}

/* .btn-cta and .btn-secondary are defined in assets/css/components/buttons.css */

body:not(.woocommerce):not(.woocommerce-page) #main-content .entry-content h1,
body:not(.woocommerce):not(.woocommerce-page) #main-content .entry-content h2,
body:not(.woocommerce):not(.woocommerce-page) #main-content .entry-content h3 {
	color: var(--ds-text);
	letter-spacing: -0.02em;
	line-height: 1.1;
}

body:not(.woocommerce):not(.woocommerce-page) #main-content .entry-content p {
	color: var(--ds-muted);
	line-height: 1.7;
}

body:not(.woocommerce):not(.woocommerce-page) #main-content form:not(.woocommerce-form):not(.cart):not(.checkout) {
	background: var(--ds-surface);
	border: 1px solid var(--ds-border);
	border-radius: 18px;
	padding: clamp(0.95rem, 1.6vw, 1.4rem);
}

body:not(.woocommerce):not(.woocommerce-page) #main-content input[type="text"],
body:not(.woocommerce):not(.woocommerce-page) #main-content input[type="email"],
body:not(.woocommerce):not(.woocommerce-page) #main-content input[type="tel"],
body:not(.woocommerce):not(.woocommerce-page) #main-content input[type="number"],
body:not(.woocommerce):not(.woocommerce-page) #main-content input[type="search"],
body:not(.woocommerce):not(.woocommerce-page) #main-content select,
body:not(.woocommerce):not(.woocommerce-page) #main-content textarea {
	border: 1px solid var(--ds-border);
	border-radius: 10px;
	background: var(--ds-surface);
	color: var(--ds-text);
	font-family: var(--ds-font-sans);
	font-size: 16px;
	padding: 0.56rem 0.68rem;
	transition: border-color 160ms ease, box-shadow 160ms ease;
}

body:not(.woocommerce):not(.woocommerce-page) #main-content textarea {
	min-height: 128px;
}

body:not(.woocommerce):not(.woocommerce-page) #main-content input[type="text"]:focus,
body:not(.woocommerce):not(.woocommerce-page) #main-content input[type="email"]:focus,
body:not(.woocommerce):not(.woocommerce-page) #main-content input[type="tel"]:focus,
body:not(.woocommerce):not(.woocommerce-page) #main-content input[type="number"]:focus,
body:not(.woocommerce):not(.woocommerce-page) #main-content input[type="search"]:focus,
body:not(.woocommerce):not(.woocommerce-page) #main-content select:focus,
body:not(.woocommerce):not(.woocommerce-page) #main-content textarea:focus {
	border-color: var(--ds-primary);
	box-shadow: 0 0 0 2px rgb(74 125 78 / 0.16);
	outline: none;
}

/* Front featured product card grid is centralized in assets/css/components/product-card.css */

/* Front-page FAQ style refresh */
body.home .faq-section {
	padding: clamp(2.5rem, 5vw, 4rem) 0;
}

body.home .faq-section .section-header {
	text-align: center;
	margin-bottom: 1.2rem;
}

body.home .faq-section .section-header h2 {
	margin: 0;
	font-family: var(--ds-font-display);
	font-weight: 800;
	font-size: clamp(2rem, 3.2vw, 2.75rem);
	letter-spacing: -0.02em;
	color: var(--ds-text);
}

body.home .faq-section .section-header p {
	margin-top: 0.5rem;
	font-size: 1rem;
	line-height: 1.6;
	color: var(--ds-muted);
	max-width: 680px;
	margin-left: auto;
	margin-right: auto;
}

body.home .faq-accordion {
	display: flex;
	flex-direction: column;
	gap: 0.9rem;
	max-width: 920px;
	margin: 0 auto;
}

body.home .faq-item {
	border: 1px solid var(--ds-border);
	border-radius: 14px;
	background: var(--ds-surface);
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.04);
	overflow: hidden;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

body.home .faq-item:hover {
	border-color: var(--ds-primary);
	box-shadow: 0 10px 28px rgba(0, 0, 0, 0.06);
}

body.home .faq-item.active {
	border-color: var(--ds-primary);
}

body.home .faq-question {
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 16px;
	background: transparent;
	border: 0;
	color: var(--ds-text);
	font-weight: 700;
	text-align: left;
	cursor: pointer;
	letter-spacing: -0.01em;
}

body.home .faq-question:focus-visible {
	outline: 2px solid var(--ds-primary);
	outline-offset: 2px;
}

body.home .faq-question-text {
	font-family: var(--ds-font-display);
	font-weight: 700;
	font-size: clamp(1.1rem, 1.25vw, 1.25rem);
	line-height: 1.25;
	color: var(--ds-text);
}

body.home .faq-icon {
	width: 20px;
	height: 20px;
	transition: transform 0.2s ease;
	color: var(--ds-primary);
}

body.home .faq-item.active .faq-icon {
	transform: rotate(180deg);
}

body.home .faq-answer {
	padding: 0 16px 16px;
	color: var(--ds-muted);
	font-size: 0.98rem;
	line-height: 1.6;
	overflow: hidden;
	max-height: 0;
	transition: max-height 0.25s ease;
}

body.home .faq-item.active .faq-answer {
	max-height: 640px;
}

body.home .faq-answer p {
	margin: 0;
	font-size: 1rem;
	line-height: 1.55;
	color: var(--ds-text);
}

@media (max-width: 768px) {
	body.home .faq-accordion {
		gap: 0.8rem;
	}

	body.home .faq-question {
		padding: 12px 14px;
	}

	body.home .faq-answer {
		padding: 0 14px 14px;
	}

	body.home .faq-item.active .faq-answer {
		max-height: 640px;
	}
}

/* FAQ page (page-faq shortcode) */
.ds-faq-page .card-base + .card-base {
	margin-top: 1rem;
}

.ds-faq-page .faq-accordion {
	display: flex;
	flex-direction: column;
	gap: 0.9rem;
	max-width: 920px;
	margin: 0 auto;
}

.ds-faq-page .faq-item {
	border: 1px solid var(--ds-border);
	border-radius: 14px;
	background: var(--ds-surface);
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.04);
	overflow: hidden;
	transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.18s ease;
}

.ds-faq-page .faq-item:hover {
	border-color: var(--ds-primary);
	box-shadow: 0 10px 28px rgba(0, 0, 0, 0.06);
	transform: translateY(-2px);
}

.ds-faq-page .faq-question {
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	padding: 16px 18px;
	background: transparent;
	border: 0;
	color: var(--ds-text);
	font-weight: 700;
	text-align: left;
	cursor: pointer;
	letter-spacing: -0.01em;
}

.ds-faq-page .faq-question:focus-visible {
	outline: 2px solid var(--ds-primary);
	outline-offset: 2px;
}

.ds-faq-page .faq-index {
	background: rgba(var(--ds-primary-rgb), 0.08);
	color: var(--ds-primary);
	border: 1px solid rgba(var(--ds-primary-rgb), 0.14);
}

.ds-faq-page .faq-icon {
	width: 20px;
	height: 20px;
	transition: transform 0.2s ease;
	color: var(--ds-primary);
}

.ds-faq-page .faq-item.active .faq-icon {
	transform: rotate(180deg);
}

.ds-faq-page .faq-answer {
	padding: 0 16px 16px;
	color: var(--ds-muted);
	font-size: 0.98rem;
	line-height: 1.6;
	overflow: hidden;
	max-height: 0;
	opacity: 0;
	transition: max-height 0.25s ease, opacity 0.2s ease;
}

.ds-faq-page .faq-answer p {
	margin: 0;
	color: var(--ds-text);
}

.ds-faq-page .faq-item.active .faq-answer {
	max-height: 640px;
	opacity: 1;
}

/* Branded alerts (Woo notices and general) */
.ds-alert-list {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	margin: 0 0 1rem;
}

.ds-alert {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 12px 14px;
	border: 1px solid var(--ds-border);
	border-radius: 12px;
	background: var(--ds-bg);
	color: var(--ds-text);
	box-shadow: 0 6px 18px rgb(34 34 59 / 0.06);
}

.ds-alert__icon {
	color: var(--ds-primary);
	margin-top: 2px;
	display: inline-flex;
}

.ds-alert__content {
	font-size: 0.95rem;
	line-height: 1.55;
}

.ds-alert--success {
	border-color: rgb(var(--ds-primary-rgb) / 0.4);
	background: rgb(var(--ds-primary-rgb) / 0.08);
}

.ds-alert--error {
	border-color: rgb(220 53 69 / 0.4);
	background: rgb(220 53 69 / 0.05);
	color: rgb(108 29 29);
}
.ds-alert--error .ds-alert__icon {
	color: rgb(211 47 47);
}

.ds-alert--info {
	border-color: rgb(var(--ds-primary-rgb) / 0.35);
	background: rgb(var(--ds-primary-rgb) / 0.06);
}

/* Trust badges: keep mobile alignment clean and left-aligned. */
.ds-trust-badges__item {
	min-width: 0;
}

.ds-trust-badges__item > div {
	min-width: 0;
}

@media (max-width: 767px) {
	.ds-trust-badges__list {
		align-items: stretch !important;
	}

	.ds-trust-badges__item {
		width: 100%;
		padding: 0.2rem 0;
		align-items: flex-start !important;
	}

	.ds-trust-badges__item .text-sm {
		line-height: 1.35;
	}
}

/* ── Home page: hero flush with header ──────────────────────────────────────
   Removes the global #main-content padding-top on the front page so the hero
   background fills flush behind the frosted header. The .hero element takes
   over the header-clearance offset so text content stays below the header.
   All other pages are completely unaffected (body.home selector only).
   ─────────────────────────────────────────────────────────────────────────── */
body.home #main-content {
	padding-top: 0;
	padding-bottom: 0;
}

body.home #main-content > *:first-child {
	margin-top: 0;
}

/* Neutralise any Elementor section/container spacing before the hero */
body.home .elementor-top-section:first-of-type:not(.hero),
body.home .e-con:first-of-type:not(.hero) {
	padding-top: 0 !important;
	margin-top: 0 !important;
}

/* Hero takes over the header-clearance offset */
body.home .hero {
	padding-top: calc(var(--ds-banner-height, 0px) + var(--ds-header-height, 60px)) !important;
	margin-top: 0 !important;
}

/* Home hero + trust badges: consistent content bounds and clean badge layout */
body.home .hero > .container,
body.home .ds-trust-badges > .container {
	width: min(1600px, calc(100% - 2rem)) !important;
	max-width: min(1600px, calc(100% - 2rem)) !important;
	margin-left: auto !important;
	margin-right: auto !important;
	padding-left: 1rem !important;
	padding-right: 1rem !important;
}

body.home .ds-trust-badges {
	padding-bottom: 0.75rem !important;
}

body.home .ds-trust-badges .ds-trust-badges__list {
	display: grid !important;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 1rem !important;
	align-items: stretch !important;
}

body.home .ds-trust-badges .ds-trust-badges__item {
	min-height: 76px;
	padding: 0.7rem 0.95rem !important;
	align-items: center !important;
	overflow: visible !important;
}

body.home .ds-trust-badges .ds-trust-badges__item .text-sm {
	line-height: 1.4 !important;
	margin-top: 0.1rem;
}

@media (max-width: 980px) {
	body.home .hero > .container,
	body.home .ds-trust-badges > .container {
		width: min(1600px, calc(100% - 1.5rem)) !important;
		max-width: min(1600px, calc(100% - 1.5rem)) !important;
		padding-left: 0.75rem !important;
		padding-right: 0.75rem !important;
	}

	body.home .ds-trust-badges .ds-trust-badges__list {
		grid-template-columns: 1fr !important;
	}

	body.home .ds-trust-badges .ds-trust-badges__item {
		min-height: 0;
	}
}


/* ═══════════════════════════════════════════════════════════════════════════
   TRUST BADGES - Interactive trust indicators
   ═══════════════════════════════════════════════════════════════════════════ */

/* Trust badge link styling */
.ds-trust-badge-link {
	text-decoration: none;
	color: inherit;
	cursor: pointer;
	transition: all 0.25s ease;
}

.ds-trust-badge-link:hover {
	background: rgb(var(--ds-primary-rgb) / 0.05);
	transform: translateY(-1px);
}

.ds-trust-badge-link:hover .shrink-0 {
	background: var(--ds-primary);
	color: var(--ds-surface);
	transform: scale(1.08);
	transition: all 0.25s ease;
}

/* Trust badge item with tooltip support */
.ds-trust-badge-item {
	position: relative;
}

.ds-trust-badge-item[data-tooltip] {
	cursor: help;
}

/* Tooltip styling */
.ds-trust-badge-item[data-tooltip]::before {
	content: attr(data-tooltip);
	position: absolute;
	bottom: 100%;
	left: 50%;
	transform: translateX(-50%) translateY(-8px);
	padding: 0.5rem 0.75rem;
	background: var(--ds-text);
	color: var(--ds-surface);
	font-size: 0.75rem;
	line-height: 1.4;
	white-space: nowrap;
	border-radius: 8px;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s ease, transform 0.2s ease;
	z-index: 1000;
	box-shadow: 0 4px 12px rgb(var(--ds-text-rgb) / 0.2);
}

.ds-trust-badge-item[data-tooltip]::after {
	content: "";
	position: absolute;
	bottom: 100%;
	left: 50%;
	transform: translateX(-50%) translateY(-2px);
	width: 0;
	height: 0;
	border-left: 6px solid transparent;
	border-right: 6px solid transparent;
	border-top: 6px solid var(--ds-text);
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s ease, transform 0.2s ease;
	z-index: 1000;
}

.ds-trust-badge-item[data-tooltip]:hover::before,
.ds-trust-badge-item[data-tooltip]:hover::after {
	opacity: 1;
	transform: translateX(-50%) translateY(-12px);
}

.ds-trust-badge-item[data-tooltip]:hover::after {
	transform: translateX(-50%) translateY(-6px);
}

/* Ensure badges wrap on small screens */
.ds-trust-badges .flex {
	flex-wrap: wrap;
}

@media (max-width: 640px) {
	.ds-trust-badge-item[data-tooltip]::before {
		white-space: normal;
		max-width: 200px;
		text-align: center;
	}
}

/* ---------------------------------------------------------------------------
   Mid-page newsletter CTA section [ds_newsletter_cta]
   Green gradient band with two-column layout (content left, form right).
   Reuses the same AJAX newsletter form infrastructure as the footer.
   --------------------------------------------------------------------------- */
.ds-newsletter-cta-section {
	padding: clamp(2.5rem, 5vw, 4rem) 0;
	background: linear-gradient(135deg, var(--ds-primary) 0%, var(--ds-primary-dark) 100%);
	color: #fff;
}

.ds-newsletter-cta-inner {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: clamp(1.5rem, 3vw, 2.5rem);
	align-items: center;
}

.ds-newsletter-cta-content .ds-section-kicker {
	border-color: rgba(230, 255, 230, 0.35);
	background: rgba(255, 255, 255, 0.15);
	color: rgba(230, 255, 220, 0.95);
}

.ds-newsletter-cta-heading {
	margin: 0.4rem 0 0.5rem;
	font-size: clamp(1.4rem, 2.8vw, 2.1rem);
	font-weight: 800;
	line-height: 1.15;
	color: #fff;
}

.ds-newsletter-cta-sub {
	margin: 0;
	font-size: 1rem;
	line-height: 1.6;
	color: rgba(255, 255, 255, 0.88);
}

.ds-newsletter-cta-fields {
	display: flex;
	gap: 0.5rem;
	margin-bottom: 0.65rem;
}

.ds-newsletter-cta-fields input[type="email"] {
	flex: 1 1 0;
	min-height: 46px;
	padding: 0.6rem 0.85rem;
	border: 1.5px solid rgba(255, 255, 255, 0.3);
	border-radius: 9px;
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
	font-size: 0.97rem;
}

.ds-newsletter-cta-fields input[type="email"]::placeholder {
	color: rgba(255, 255, 255, 0.6);
}

.ds-newsletter-cta-fields input[type="email"]:focus {
	outline: none;
	border-color: rgba(255, 255, 255, 0.7);
	background: rgba(255, 255, 255, 0.18);
}

/* Submit button: inverted — white background, green text */
.ds-newsletter-cta-form .ds-newsletter-cta-submit {
	background: #fff;
	color: var(--ds-primary);
	border-color: #fff;
	white-space: nowrap;
	flex-shrink: 0;
}

.ds-newsletter-cta-form .ds-newsletter-cta-submit:hover,
.ds-newsletter-cta-form .ds-newsletter-cta-submit:focus-visible {
	background: rgba(255, 255, 255, 0.9);
	color: var(--ds-primary-dark);
	border-color: rgba(255, 255, 255, 0.9);
}

.ds-newsletter-cta-consent {
	display: flex;
	align-items: flex-start;
	gap: 0.45rem;
	font-size: 0.82rem;
	color: rgba(255, 255, 255, 0.8);
	cursor: pointer;
}

.ds-newsletter-cta-consent input[type="checkbox"] {
	margin-top: 2px;
	flex-shrink: 0;
}

/* Tablet / mobile: stack content + form vertically */
@media (max-width: 980px) {
	.ds-newsletter-cta-inner {
		grid-template-columns: 1fr;
		text-align: center;
	}

	.ds-newsletter-cta-content .ds-section-kicker {
		margin-inline: auto;
	}

	.ds-newsletter-cta-consent {
		justify-content: center;
	}
}

/* Mobile: stack email + button vertically */
@media (max-width: 480px) {
	.ds-newsletter-cta-fields {
		flex-direction: column;
	}

	.ds-newsletter-cta-fields .ds-newsletter-cta-submit {
		width: 100%;
	}
}

/* ---------------------------------------------------------------------------
   FAQ page: reorder "Still Need Help?" sidebar above accordions on mobile
   Uses CSS order to promote the sidebar without changing DOM order.
   .ds-faq-page wrapper is confirmed at shortcodes/page-faq.php:81
   --------------------------------------------------------------------------- */
@media (max-width: 980px) {
	.ds-faq-page .grid {
		display: flex;
		flex-direction: column;
	}

	.ds-faq-page .grid > div:first-child {
		order: 2; /* FAQ accordions move below sidebar on mobile */
	}

	.ds-faq-page .grid > div:last-child {
		order: 1; /* Sidebar moves above FAQ on mobile */
	}
}
