/* ==========================================================================
   Reusable components: buttons, badges, cards, accordion, forms, pagination
   ========================================================================== */

/* --- Buttons -------------------------------------------------------------
   The live site uses a fully rounded green pill with dark text as its one
   primary button, with an optional trailing chevron.
   ---------------------------------------------------------------------- */

.btn,
.wp-block-button__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--s-2);
	min-height: 42px;
	padding: var(--s-3) var(--s-6);
	border: 1px solid transparent;
	border-radius: var(--r-pill);
	background: var(--c-green);
	color: var(--c-green-ink);
	font-family: var(--f-body);
	font-size: var(--fs-sm);
	font-weight: var(--fw-semibold);
	line-height: 1.2;
	text-align: center;
	cursor: pointer;
	transition: background var(--t-base), color var(--t-base), border-color var(--t-base), transform var(--t-fast);
}

.btn:hover,
.btn:focus-visible {
	background: var(--c-green-hover);
	color: var(--c-green-ink);
}

.btn:active {
	transform: translateY(1px);
}

.btn--primary,
.btn--light,
.btn--accent {
	background: var(--c-green);
	color: var(--c-green-ink);
}

.btn--primary:hover,
.btn--light:hover,
.btn--accent:hover {
	background: var(--c-green-hover);
	color: var(--c-green-ink);
}

.btn--dark {
	background: var(--c-green-cart);
	color: var(--c-white);
}

.btn--dark:hover {
	background: #1f3624;
	color: var(--c-white);
}

.btn--outline {
	background: transparent;
	border-color: var(--c-ink);
	color: var(--c-ink);
}

.btn--outline:hover {
	background: var(--c-ink);
	color: var(--c-white);
}

.btn--ghost-light {
	background: transparent;
	border-color: rgba(255, 255, 255, 0.7);
	color: var(--c-white);
}

.btn--ghost-light:hover {
	background: var(--c-white);
	color: var(--c-ink);
}

.btn--lg {
	min-height: 50px;
	padding-inline: var(--s-7);
	font-size: var(--fs-body);
}

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

.btn--wide {
	min-width: 270px;
	justify-content: space-between;
}

.btn-row {
	display: flex;
	flex-wrap: wrap;
	gap: var(--s-3);
}

.btn-row--center {
	justify-content: center;
}

/* --- Badges -------------------------------------------------------------- */

.badge {
	display: inline-flex;
	align-items: center;
	gap: var(--s-1);
	padding: 4px 10px;
	border-radius: var(--r-xs);
	font-family: var(--f-body);
	font-size: 0.6875rem;
	font-weight: var(--fw-bold);
	letter-spacing: 0.08em;
	line-height: 1.4;
	text-transform: uppercase;
}

.badge--stock {
	background: var(--c-green-badge);
	color: var(--c-white);
}

.badge--out {
	background: var(--c-line);
	color: var(--c-dark-3);
}

/* --- Generic card -------------------------------------------------------- */

.card {
	display: flex;
	flex-direction: column;
	height: 100%;
	overflow: hidden;
	background: var(--c-white);
	border: 1px solid var(--c-line-soft);
	border-radius: var(--r-lg);
	transition: border-color var(--t-base), box-shadow var(--t-base), transform var(--t-base);
}

.card:hover {
	border-color: var(--c-line);
	box-shadow: var(--shadow-md);
	transform: translateY(-2px);
}

.card__media {
	position: relative;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	background: var(--c-surface-alt);
}

.card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform var(--t-slow);
}

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

.card__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: var(--s-3);
	padding: var(--s-5);
}

.card__title {
	margin: 0;
	font-size: var(--fs-h5);
}

.card__text {
	margin: 0;
	color: var(--c-muted-2);
	font-size: var(--fs-sm);
	line-height: var(--lh-loose);
}

.card__cta {
	margin-top: auto;
	display: inline-flex;
	align-items: center;
	gap: var(--s-2);
	font-family: var(--f-display);
	font-size: var(--fs-sm);
	font-weight: var(--fw-semibold);
	color: var(--c-ink);
}

.card__cta .icon {
	width: 18px;
	height: 18px;
	transition: transform var(--t-fast);
}

.card:hover .card__cta .icon {
	transform: translateX(3px);
}

/* Whole-card link overlay. */
.card__link::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
}

.card--linked {
	position: relative;
}

/* --- Feature / trust items ----------------------------------------------- */

.feature {
	display: flex;
	flex-direction: column;
	gap: var(--s-3);
}

.feature__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	border-radius: var(--r-pill);
	background: var(--c-surface-alt);
	color: var(--c-ink);
}

.feature__title {
	margin: 0;
	font-size: var(--fs-h5);
}

.feature__text {
	margin: 0;
	color: var(--c-muted-2);
	font-size: var(--fs-sm);
	line-height: var(--lh-loose);
}

/* --- Accordion ----------------------------------------------------------- */

.accordion {
	border-top: 1px solid var(--c-line);
}

/* Twice the room under a FAQ list before whatever follows it: the imported
   band rhythm left the closing line sitting 16px off the last question. */
.accordion:not(:last-child) {
	margin-bottom: var(--s-6);
}

.accordion__item {
	border-bottom: 1px solid var(--c-line);
}

/* No rule under the last question: the list closes on the answer, not on a line
   hanging above whatever follows. */
.accordion__item:last-child {
	border-bottom: 0;
}

.accordion__heading,
.entry-content .accordion__item > .accordion__heading {
	/* Imported accordions sit inside a band, whose heading rhythm was adding
	   48px above every question on top of the row's own padding. */
	margin: 0;
	font-size: inherit;
}

.accordion__trigger {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--s-4);
	width: 100%;
	/* One row rhythm for every accordion on the site. The imported ones carry
	   their own measured height in --acc-row — 48px on one page against the
	   homepage's 108 — which is what made the FAQs read differently from one
	   page to the next, so it is no longer used. */
	min-height: 0;
	/* Live runs a 128px pitch per closed question — measured off its own FAQ
	   page — with the question sitting near the top of the row and the rest of
	   the space beneath it. Opening one takes that space back for the answer. */
	align-items: flex-start;
	padding: 26px 0 78px;
	background: none;
	border: 0;
	color: var(--c-ink);
	font-family: var(--f-body);
	font-size: 1.0625rem;
	font-weight: var(--fw-regular);
	line-height: 1.4;
	text-align: left;
}

.accordion__trigger[aria-expanded="true"] {
	padding-bottom: var(--s-4);
}

/* The last row's trailing space is row rhythm, not section rhythm: left in, it
   stacks on top of whatever padding the section below already pays. */
.accordion__item:last-child .accordion__trigger[aria-expanded="false"] {
	padding-bottom: 26px;
}

.accordion__trigger:hover {
	color: var(--c-accent);
}

.accordion__icon {
	position: relative;
	flex: 0 0 auto;
	width: 20px;
	height: 20px;
}

.accordion__icon::before,
.accordion__icon::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 9px;
	height: 9px;
	border-right: 1.6px solid currentColor;
	border-bottom: 1.6px solid currentColor;
	transform: translate(-50%, -70%) rotate(45deg);
	transition: transform var(--t-fast);
}

.accordion__icon::after {
	content: none;
}

.accordion__trigger[aria-expanded="true"] .accordion__icon::before {
	transform: translate(-50%, -30%) rotate(-135deg);
}

.accordion__panel[hidden] {
	display: none;
}

.accordion__body {
	padding: 0 0 var(--s-6);
	color: var(--c-body);
	font-size: var(--fs-sm);
	line-height: var(--lh-loose);
	/* The live answer runs the full column width; a measure cap changes the
	   line count and therefore every row position below it. */
	max-width: none;
}

/* --- Forms --------------------------------------------------------------- */

/* One field shape for the whole site: the pill the checkout already used, on a
   tinted fill with no border, so the newsletter, contact form, coupon box,
   checkout and the account gate all look like the same product. */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="password"],
input[type="search"],
input[type="number"],
select,
textarea {
	width: 100%;
	min-height: var(--field-h);
	padding: var(--field-pad-y) var(--field-pad-x);
	background: var(--field-bg);
	border: 1px solid transparent;
	border-radius: var(--r-pill);
	color: var(--c-ink);
	transition: background var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast);
}

textarea {
	min-height: 140px;
	border-radius: var(--r-lg);
	resize: vertical;
}

input::placeholder,
textarea::placeholder {
	color: var(--c-muted);
}

input:focus,
select:focus,
textarea:focus {
	background: var(--field-bg-focus);
	border-color: var(--c-line);
	outline: none;
	box-shadow: 0 0 0 3px rgba(12, 12, 12, 0.06);
}

label {
	display: inline-block;
	margin-bottom: var(--s-2);
	font-size: var(--fs-sm);
	font-weight: var(--fw-medium);
}

/* --- Notices ------------------------------------------------------------- */

.notice {
	padding: var(--s-4) var(--s-5);
	border: 1px solid var(--c-line);
	border-left-width: 3px;
	border-radius: var(--r-sm);
	background: var(--c-surface-alt);
	font-size: var(--fs-sm);
}

.notice--success {
	border-left-color: var(--c-success);
}

.notice--error {
	border-left-color: var(--c-accent);
}

/* --- Pagination ---------------------------------------------------------- */

.pagination {
	display: flex;
	justify-content: center;
	margin-top: var(--s-8);
}

.pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	height: 44px;
	padding-inline: var(--s-3);
	border: 1px solid var(--c-line);
	border-radius: var(--r-sm);
	color: var(--c-ink);
	font-size: var(--fs-sm);
	font-weight: var(--fw-medium);
}

.pagination .page-numbers + .page-numbers {
	margin-left: var(--s-2);
}

.pagination .page-numbers.current,
.pagination .page-numbers:hover {
	background: var(--c-ink);
	border-color: var(--c-ink);
	color: var(--c-white);
}

/* --- Breadcrumbs --------------------------------------------------------- */

.breadcrumbs {
	margin-bottom: var(--s-5);
	color: var(--c-muted);
	font-size: var(--fs-xs);
}

.breadcrumbs a {
	color: var(--c-muted);
}

.breadcrumbs a:hover {
	color: var(--c-ink);
}

/* --- Motion ---------------------------------------------------------------
   Small, consistent moves: surfaces lift on hover the way the product card
   does, links draw their underline, controls give under the press. Everything
   here animates transform or opacity only, and the global reduced-motion rule
   in base.css switches all of it off.
   ---------------------------------------------------------------------- */

.trust-card,
.post-card,
.coa-item,
.category-tile,
.cart-card,
.checkout-card {
	transition: transform var(--t-base), box-shadow var(--t-base);
}

.trust-card:hover,
.post-card:hover,
.coa-item:hover,
.category-tile:hover,
.post-card:focus-within,
.category-tile:focus-within {
	transform: translateY(-3px);
	box-shadow: var(--card-shadow);
}

/* Only the header's top-level items draw an underline: it was being drawn under
   the dropdown's items and under every link in the footer columns as well. */
.site-header .nav > .nav__list > .nav__item > .nav__link {
	position: relative;
}

.site-header .nav > .nav__list > .nav__item > .nav__link::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: -4px;
	width: 100%;
	height: 2px;
	background: currentColor;
	transform: scaleX(0);
	transform-origin: left center;
	transition: transform var(--t-base) var(--e-out);
}

.site-header .nav > .nav__list > .nav__item > .nav__link:hover::after,
.site-header .nav > .nav__list > .nav__item > .nav__link:focus-visible::after,
.site-header .nav > .nav__list > .nav__item.current-menu-item > .nav__link::after {
	transform: scaleX(1);
}

/* Presses give a little, on every control the site uses. */
.btn:active,
.minicart__button:active,
.kaia-gate-btn:active,
.woocommerce .button:active,
.woocommerce a.button:active,
.woocommerce button.button:active {
	transform: translateY(1px);
}

.minicart__button,
.kaia-gate-btn,
.woocommerce .button,
.woocommerce a.button,
.woocommerce button.button {
	transition: background var(--t-base), color var(--t-base), transform var(--t-fast);
}

/* The accordion's answer fades up as the panel opens. */
.accordion__panel .accordion__body {
	animation: kaia-fade-up 0.6s 0.12s var(--e-out) both;
}

.accordion__trigger .accordion__icon::before {
	transition: transform var(--t-base) var(--e-out);
}

@keyframes kaia-fade-up {
	from {
		opacity: 0;
		transform: translateY(6px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

/* Cart quantity boxes take the site's field shape too, at their own size. */
.woocommerce .quantity input[type="number"],
.woocommerce .cart-layout .quantity input[type="number"] {
	border-radius: var(--r-pill);
}

/* --- Hover states the audit found missing ---------------------------------
   Every control that looks pressable answers the pointer. */

/* Imported call-to-action buttons carry live's colours inline, and an inline
   background outranks a class rule — so this one needs the flag to land. */
.entry-content a.btn[style]:hover,
.entry-content a.btn[style]:focus-visible {
	background: var(--c-green-hover) !important;
}

.entry-content a.btn[style]:active {
	transform: translateY(1px);
}

/* Carousel dots */
.carousel__dot {
	transition: background var(--t-base), transform var(--t-base);
}

.carousel__dot:hover,
.carousel__dot:focus-visible {
	background: var(--c-green-deep);
	transform: scale(1.25);
}

/* The account gate's tabs */
.kaia-gate-tab:hover,
.kaia-gate-tab:focus-visible {
	color: var(--c-green-deep);
	border-bottom-color: var(--c-line);
}

/* The selected tab and the current dot already wear the hover colours, so they
   answer the pointer with a lift and a tint instead. */
.kaia-gate-tab.is-active:hover,
.kaia-gate-tab.is-active:focus-visible {
	border-bottom-color: var(--c-green-deep);
	background: rgba(55, 94, 63, 0.06);
}

.carousel__dot.is-active:hover,
.carousel__dot.is-active:focus-visible {
	transform: scale(1.3);
}

/* WooCommerce's password reveal */
.woocommerce form .show-password-input {
	transition: opacity var(--t-fast);
}

.woocommerce form .show-password-input:hover,
.woocommerce form .show-password-input:focus-visible {
	opacity: 0.65;
}
