/*
 * Pretzo theme — components.css
 * Algemene, herbruikbare componenten (buttons, cards). Nog geen
 * WooCommerce-productcard — dat komt pas met de shop-fase.
 */

/* ---------- Buttons ---------- */

.pretzo-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5em;
	min-height: 44px;
	padding: 0.75em 1.5em;
	border: 2px solid transparent;
	border-radius: var(--wp--custom--radius--md, 10px);
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--base);
	font-weight: 600;
	line-height: 1;
	text-decoration: none;
	cursor: pointer;
	transition:
		background-color 0.15s ease,
		color 0.15s ease,
		border-color 0.15s ease,
		transform 0.15s ease;
}

.pretzo-btn:disabled,
.pretzo-btn[aria-disabled="true"] {
	cursor: not-allowed;
	opacity: 0.55;
	transform: none;
}

/*
 * Elke variant stelt kleur/achtergrond expliciet vast voor :link, :visited,
 * :hover, :focus-visible én :active — niet alleen de basisklasse. Sommige
 * mobiele WebKit-renderers passen anders een eigen (blauwachtige)
 * linkkleur toe op :visited/:active die de globale theme.json-linkkleur
 * (`a { color: blue }`) zou laten doorschemeren op de primary-button-tekst.
 * `-webkit-text-fill-color` erbij: WebKit gebruikt dat vóór `color` voor de
 * daadwerkelijke tekstkleur als het los is gezet door een heuristiek.
 */

.pretzo-btn--primary,
.pretzo-btn--primary:link,
.pretzo-btn--primary:visited {
	background: var(--wp--preset--color--blue, #007bff);
	color: var(--wp--preset--color--white, #fff);
	-webkit-text-fill-color: var(--wp--preset--color--white, #fff);
}

.pretzo-btn--primary:hover:not(:disabled):not([aria-disabled="true"]),
.pretzo-btn--primary:focus-visible,
.pretzo-btn--primary:active {
	background: color-mix(in srgb, var(--wp--preset--color--blue, #007bff) 85%, black);
	color: var(--wp--preset--color--white, #fff);
	-webkit-text-fill-color: var(--wp--preset--color--white, #fff);
}

.pretzo-btn--primary:hover:not(:disabled):not([aria-disabled="true"]) {
	transform: translateY(-1px);
}

.pretzo-btn--secondary,
.pretzo-btn--secondary:link,
.pretzo-btn--secondary:visited {
	background: var(--wp--preset--color--accent, #ffb347);
	color: var(--wp--preset--color--navy, #111827);
	-webkit-text-fill-color: var(--wp--preset--color--navy, #111827);
}

.pretzo-btn--secondary:hover:not(:disabled):not([aria-disabled="true"]),
.pretzo-btn--secondary:focus-visible,
.pretzo-btn--secondary:active {
	background: color-mix(in srgb, var(--wp--preset--color--accent, #ffb347) 85%, black);
	color: var(--wp--preset--color--navy, #111827);
	-webkit-text-fill-color: var(--wp--preset--color--navy, #111827);
}

.pretzo-btn--secondary:hover:not(:disabled):not([aria-disabled="true"]) {
	transform: translateY(-1px);
}

.pretzo-btn--outline,
.pretzo-btn--outline:link,
.pretzo-btn--outline:visited {
	background: transparent;
	border-color: currentColor;
	color: var(--wp--preset--color--navy, #111827);
	-webkit-text-fill-color: var(--wp--preset--color--navy, #111827);
}

.pretzo-btn--outline:hover:not(:disabled):not([aria-disabled="true"]),
.pretzo-btn--outline:focus-visible,
.pretzo-btn--outline:active {
	background: var(--wp--preset--color--navy, #111827);
	color: var(--wp--preset--color--white, #fff);
	-webkit-text-fill-color: var(--wp--preset--color--white, #fff);
}

.pretzo-btn--lg {
	min-height: 52px;
	padding: 0.9em 2.25em;
	font-size: var(--wp--preset--font-size--h4);
}

@media (prefers-reduced-motion: reduce) {
	.pretzo-btn {
		transition: none;
	}
}

/* ---------- Cards (algemene basis) ---------- */

.pretzo-card {
	background: var(--wp--preset--color--white, #fff);
	border: 1px solid var(--wp--preset--color--border, #e2e5ea);
	border-radius: var(--wp--custom--radius--lg, 16px);
	padding: var(--wp--preset--spacing--md, 1.5rem);
}

/*
 * ---------- Productcard ----------
 * Gedeeld component (Fase 4B): gebruikt door zowel de homepage-
 * productpreview (.products__grid .product-card, home.css) als de
 * WooCommerce-shoparchief (ul.products .product-card, shop.css +
 * woocommerce/content-product.php). Bewust hier in components.css i.p.v.
 * gedupliceerd in beide paginaspecifieke stylesheets.
 */

.product-card {
	display: flex;
	flex-direction: column;
	height: 100%;
	background: var(--wp--preset--color--white, #fff);
	border: 1px solid var(--wp--preset--color--border, #e2e5ea);
	border-radius: var(--wp--custom--radius--lg, 16px);
	overflow: hidden;
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.product-card:hover {
	box-shadow: 0 16px 32px -18px rgba(17, 24, 39, 0.3);
	transform: translateY(-2px);
}

.product-card:focus-within {
	box-shadow: 0 0 0 2px var(--wp--preset--color--blue, #007bff);
}

.product-card__media {
	display: block;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	background: var(--wp--preset--color--surface, #f5f6f8);
}

.product-card__image {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.product-card__body {
	display: flex;
	flex-direction: column;
	gap: 0.5em;
	padding: var(--wp--preset--spacing--lg, 2.5rem) var(--wp--preset--spacing--md, 1.5rem);
	flex: 1;
}

.product-card__title {
	font-size: var(--wp--preset--font-size--h3);
	font-weight: 700;
	margin: 0;
}

.product-card__title a {
	color: var(--wp--preset--color--navy, #111827);
	text-decoration: none;
}

.product-card__title a:hover {
	color: var(--wp--preset--color--blue, #007bff);
}

.product-card__meta {
	margin: 0;
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--muted, #4b5563);
}

.product-card__price {
	margin: 0.1em 0 0.5em;
	font-size: var(--wp--preset--font-size--h3);
	font-weight: 700;
	color: var(--wp--preset--color--navy, #111827);
}

.product-card__cta {
	margin-top: auto;
	align-self: stretch;
	text-align: center;
}

@media (prefers-reduced-motion: reduce) {
	.product-card {
		transition: none;
	}
}

/*
 * <= 600px: i.p.v. de desktopkaart 100% breed te schalen (afbeelding
 * bovenaan, vierkant, ± volledig scherm hoog) wordt de kaart een
 * compacte horizontale rij: kleine vaste-breedte thumbnail links,
 * content rechts.
 */
@media (max-width: 600px) {
	.product-card {
		flex-direction: row;
		align-items: stretch;
	}

	.product-card__media {
		width: 110px;
		flex: 0 0 110px;
		aspect-ratio: auto;
	}

	.product-card__body {
		padding: 0.75rem 0.875rem;
		gap: 0.2em;
	}

	.product-card__title {
		font-size: 1rem;
		line-height: 1.25;
	}

	.product-card__meta {
		font-size: 0.75rem;
	}

	.product-card__price {
		font-size: 1.0625rem;
		margin: 0.05em 0 0.35em;
	}

	.product-card__cta {
		min-height: 38px;
		padding: 0.45em 1em;
		font-size: 0.875rem;
	}
}
