/**
 * Wiederverwendbare UI-Komponenten.
 * Diese Klassen werden theme-weit genutzt: in Homepage-Template-Parts,
 * im WooCommerce-Produktkarten-Override und in den Hook-Ausgaben.
 */

/* -----------------------------------------------------------------
 * Buttons
 * --------------------------------------------------------------- */
.btn,
a.button,
button.button,
.woocommerce #respond input#submit,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--space-sm);
	font-family: var(--font-body);
	font-weight: 500;
	font-size: var(--font-size-sm);
	line-height: 1;
	padding: 0.9rem 1.75rem;
	border-radius: var(--radius-pill);
	border: none;
	cursor: pointer;
	transition: background-color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
	white-space: nowrap;
}

.btn--primary,
.woocommerce #respond input#submit,
.woocommerce a.button.alt,
.woocommerce button.button.alt,
.woocommerce input.button.alt,
.woocommerce #payment #place_order {
	background: var(--color-primary);
	color: var(--color-text-on-dark);
}

.btn--primary:hover,
.woocommerce #respond input#submit:hover,
.woocommerce a.button.alt:hover,
.woocommerce button.button.alt:hover,
.woocommerce #payment #place_order:hover {
	background: var(--color-primary-dark);
	color: var(--color-text-on-dark);
	transform: translateY(-2px);
	box-shadow: var(--shadow-soft);
	text-decoration: none;
}

.btn--secondary,
.woocommerce a.button:not(.alt),
.woocommerce button.button:not(.alt) {
	background: transparent;
	color: var(--color-text);
	border: 1.5px solid var(--color-text);
}

.btn--secondary:hover,
.woocommerce a.button:not(.alt):hover,
.woocommerce button.button:not(.alt):hover {
	background: rgba(43, 36, 32, 0.06);
	color: var(--color-text);
	text-decoration: none;
}

.btn--outline-light {
	background: transparent;
	color: var(--color-text-on-dark);
	border: 1.5px solid var(--color-text-on-dark);
}

.btn--outline-light:hover {
	background: rgba(255, 255, 255, 0.15);
	color: var(--color-text-on-dark);
	text-decoration: none;
}

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

.btn:active {
	transform: scale(0.98);
}

/* -----------------------------------------------------------------
 * Badges
 * --------------------------------------------------------------- */
.badge {
	display: inline-flex;
	align-items: center;
	font-size: var(--font-size-xs);
	font-weight: 600;
	padding: 0.3rem 0.8rem;
	border-radius: var(--radius-pill);
	line-height: 1.2;
}

.badge--bestseller { background: var(--color-accent); color: var(--color-accent-dark); }
.badge--new { background: var(--color-highlight); color: var(--color-text-on-dark); }
.badge--sale { background: var(--color-primary); color: var(--color-text-on-dark); }
.badge--sustainable { background: var(--color-secondary); color: var(--color-text-on-dark); }

/* -----------------------------------------------------------------
 * Section Header (wiederkehrender Titel + Subline ueber Sections)
 * --------------------------------------------------------------- */
.section-header {
	text-align: center;
	max-width: 640px;
	margin: 0 auto var(--space-2xl);
}

.section-header p {
	color: var(--color-text-muted);
	margin-bottom: 0;
}

.section-header--left {
	text-align: left;
	margin-inline: 0;
}

/* -----------------------------------------------------------------
 * Cards (generisch, z.B. fuer Inspiration/Editorial)
 * --------------------------------------------------------------- */
.card {
	background: var(--color-surface);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-medium);
	overflow: hidden;
}

/* -----------------------------------------------------------------
 * Kategorie-Karten (Shop nach Anlass / Shop by Style)
 * --------------------------------------------------------------- */
.category-card {
	position: relative;
	display: block;
	border-radius: var(--radius-medium);
	overflow: hidden;
	aspect-ratio: 1 / 1;
	color: var(--color-text-on-dark);
	background-color: var(--color-secondary);
}

.category-card__image {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform var(--transition-slow);
}

.category-card:hover .category-card__image {
	transform: scale(1.06);
}

.category-card__label {
	position: absolute;
	bottom: var(--space-md);
	left: var(--space-md);
	background: rgba(251, 246, 239, 0.92);
	color: var(--color-text);
	padding: 0.5rem 0.9rem;
	border-radius: var(--radius-pill);
	font-size: var(--font-size-sm);
	font-weight: 600;
	display: flex;
	align-items: center;
	gap: 0.4rem;
}

/* -----------------------------------------------------------------
 * Produktkarten (siehe woocommerce/content-product.php)
 * --------------------------------------------------------------- */
.product-card {
	position: relative;
	background: var(--color-surface);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-medium);
	overflow: hidden;
	transition: transform var(--transition-base), box-shadow var(--transition-base);
	height: 100%;
	display: flex;
	flex-direction: column;
}

.product-card:hover {
	transform: translateY(-4px);
	box-shadow: var(--shadow-soft);
}

.product-card__image-wrap {
	position: relative;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	background: var(--color-background-alt-cool);
}

.product-card__image,
.product-card__image-hover {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: opacity var(--transition-base);
}

.product-card__image-hover {
	opacity: 0;
}

.product-card:hover .product-card__image-hover {
	opacity: 1;
}

.product-card__badges {
	position: absolute;
	top: var(--space-sm);
	left: var(--space-sm);
	display: flex;
	flex-direction: column;
	gap: var(--space-xs);
	z-index: 2;
}

.product-card__fav {
	position: absolute;
	top: var(--space-sm);
	right: var(--space-sm);
	z-index: 2;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.92);
	border: none;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: transform var(--transition-fast);
}

.product-card__fav:hover {
	transform: scale(1.08);
}

.product-card__fav svg {
	width: 18px;
	height: 18px;
	fill: none;
	stroke: var(--color-text);
	stroke-width: 1.75;
}

.product-card__fav[aria-pressed="true"] svg {
	fill: var(--color-primary);
	stroke: var(--color-primary);
}

.product-card__body {
	padding: var(--space-md);
	display: flex;
	flex-direction: column;
	gap: var(--space-xs);
	flex-grow: 1;
}

.product-card__title {
	font-family: var(--font-body);
	font-weight: 500;
	font-size: var(--font-size-md);
	margin: 0;
}

.product-card__title a {
	color: var(--color-text);
}

.product-card__title a:hover {
	color: var(--color-primary);
	text-decoration: none;
}

.product-card__meta {
	font-size: var(--font-size-xs);
	color: var(--color-text-faint);
}

.product-card__price {
	font-weight: 600;
	color: var(--color-text);
	margin-top: auto;
}

.product-card__price .woocommerce-Price-amount {
	font-weight: 600;
}

.product-card__quickadd {
	margin-top: var(--space-sm);
	opacity: 0;
	transform: translateY(4px);
	transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.product-card:hover .product-card__quickadd,
.product-card:focus-within .product-card__quickadd {
	opacity: 1;
	transform: translateY(0);
}

.product-card__quickadd .btn {
	width: 100%;
	padding: 0.6rem 1rem;
	font-size: var(--font-size-xs);
	background: var(--color-text);
	color: var(--color-text-on-dark);
}

.product-card__quickadd .btn:hover {
	background: var(--color-primary);
}

/* Auf Touch-Geraeten gibt es keinen Hover - Quick-Add dauerhaft sichtbar,
   damit die Funktion dort nicht unerreichbar wird. */
@media (hover: none) {
	.product-card__quickadd {
		opacity: 1;
		transform: none;
	}
}

/* Produktraster: Desktop 4, Tablet 3, Mobile 2 - per Grid statt der
   WooCommerce-eigenen "columns-N" Klassen gesteuert (robuster).
   Gilt fuer JEDE ul.products - Shop-Archiv, Homepage-Bestseller,
   Related/Upsell-Produkte auf der Produktseite. */
ul.products {
	display: grid !important;
	grid-template-columns: repeat(2, 1fr);
	gap: var(--space-lg);
	list-style: none;
	margin: 0 !important;
	padding: 0 !important;
}

ul.products li.product-card-item {
	width: 100% !important;
	margin: 0 !important;
	float: none !important;
}

@media (min-width: 700px) {
	ul.products { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1000px) {
	ul.products { grid-template-columns: repeat(4, 1fr); }
}

/* -----------------------------------------------------------------
 * Formularfelder / Inputs / Dropdowns
 * --------------------------------------------------------------- */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="tel"],
input[type="number"],
input[type="url"],
textarea,
select,
.select2-container .select2-selection--single {
	width: 100%;
	font-family: var(--font-body);
	font-size: var(--font-size-base);
	color: var(--color-text);
	background: var(--color-surface);
	border: 1.5px solid var(--color-border);
	border-radius: var(--radius-small);
	padding: 0.75rem 1rem;
	min-height: 48px;
	transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

textarea {
	min-height: 120px;
}

input:focus,
textarea:focus,
select:focus {
	border-color: var(--color-primary);
	box-shadow: var(--shadow-focus);
	outline: none;
}

label {
	display: block;
	font-size: var(--font-size-sm);
	font-weight: 500;
	margin-bottom: var(--space-xs);
	color: var(--color-text);
}

/* -----------------------------------------------------------------
 * Quantity Controls (+/- Stepper), siehe assets/js/quantity.js
 * --------------------------------------------------------------- */
.quantity {
	display: inline-flex;
	align-items: stretch;
	border: 1.5px solid var(--color-border);
	border-radius: var(--radius-pill);
	overflow: hidden;
	width: fit-content;
}

.quantity .qty {
	border: none;
	min-height: 44px;
	width: 56px;
	text-align: center;
	padding: 0;
	-moz-appearance: textfield;
}

.quantity .qty::-webkit-inner-spin-button,
.quantity .qty::-webkit-outer-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.musterlaune-qty-btn {
	background: transparent;
	border: none;
	width: 44px;
	min-height: 44px;
	font-size: var(--font-size-md);
	cursor: pointer;
	color: var(--color-text);
	transition: background-color var(--transition-fast);
}

.musterlaune-qty-btn:hover {
	background: var(--color-background-alt-warm);
}

/* -----------------------------------------------------------------
 * Notices (WooCommerce-Meldungen im Musterlaune-Look, keine reinen Overrides,
 * nur visuelle Anpassung bestehender Klassen)
 * --------------------------------------------------------------- */
.woocommerce-message,
.woocommerce-error,
.woocommerce-info,
.woocommerce-noreviews,
p.no-comments {
	border-top: none !important;
	border-radius: var(--radius-small);
	padding: var(--space-md) var(--space-lg) !important;
	font-size: var(--font-size-sm);
	list-style: none;
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: var(--space-md);
}

.woocommerce-message {
	background: var(--color-background-alt-cool) !important;
	color: var(--color-secondary-dark, var(--color-secondary));
}

.woocommerce-error {
	background: #FBEAE7 !important;
	color: var(--color-error);
}

.woocommerce-info {
	background: var(--color-background-alt-warm) !important;
	color: var(--color-text);
}

.woocommerce-message::before,
.woocommerce-error::before,
.woocommerce-info::before {
	display: none;
}

/* -----------------------------------------------------------------
 * Breadcrumbs
 * --------------------------------------------------------------- */
.woocommerce-breadcrumb,
.musterlaune-breadcrumbs {
	font-size: var(--font-size-xs);
	color: var(--color-text-faint);
	margin-bottom: var(--space-lg);
}

.woocommerce-breadcrumb a,
.musterlaune-breadcrumbs a {
	color: var(--color-text-muted);
}

.woocommerce-breadcrumb a:hover,
.musterlaune-breadcrumbs a:hover {
	color: var(--color-primary);
}

/* -----------------------------------------------------------------
 * Newsletter-Box
 * --------------------------------------------------------------- */
.newsletter-box {
	background: var(--color-background-alt-warm);
	border-radius: var(--radius-large);
	padding: var(--space-3xl) var(--space-lg);
	text-align: center;
}

.newsletter-box h2 {
	margin-bottom: var(--space-sm);
}

.newsletter-box p {
	color: var(--color-text-muted);
	margin-bottom: var(--space-xl);
}

.newsletter-form {
	display: flex;
	gap: var(--space-md);
	max-width: 460px;
	margin: 0 auto;
	flex-wrap: wrap;
	justify-content: center;
}

.newsletter-form input[type="email"] {
	flex: 1 1 240px;
}

.newsletter-form__consent {
	max-width: 460px;
	margin: var(--space-md) auto 0;
	font-size: var(--font-size-xs);
	color: var(--color-text-faint);
	text-align: left;
	display: flex;
	gap: var(--space-sm);
	align-items: flex-start;
}

.newsletter-form__consent input {
	width: auto;
	min-height: auto;
	margin-top: 3px;
}

/* -----------------------------------------------------------------
 * USP-Elemente
 * --------------------------------------------------------------- */
.usp-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: var(--space-xl);
}

.usp-item {
	text-align: center;
}

.usp-item__icon {
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: var(--color-background-alt-cool);
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0 auto var(--space-md);
	color: var(--color-secondary);
}

.usp-item__icon svg {
	width: 24px;
	height: 24px;
	stroke: currentColor;
	fill: none;
	stroke-width: 1.6;
}

.usp-item h3 {
	font-size: var(--font-size-md);
	margin-bottom: var(--space-xs);
}

.usp-item p {
	font-size: var(--font-size-sm);
	color: var(--color-text-muted);
	margin-bottom: 0;
}

@media (max-width: 899px) {
	.usp-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 599px) {
	.newsletter-form { flex-direction: column; }
	.newsletter-box { padding: var(--space-2xl) var(--space-md); }
}
