
.ah-color-swatches {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--ah-swatch-gap, 0.4rem);
	margin: 0;
}

.ah-color-swatch {
	position: relative;
	display: inline-flex;
	width: var(--ah-swatch-size, 0.875rem);
	height: var(--ah-swatch-size, 0.875rem);
	padding: 0.125rem;
	border: 0.0625rem solid #F1D277;
	border-radius: 999rem;
	box-sizing: content-box;
	background: #fff !important;
	transition: transform .2s ease, border-color .2s ease;
}

.ah-color-swatch > span {
	display: block !important;
	width: 100% !important;
	height: 100% !important;
	border-radius: inherit !important;
	box-shadow:
		inset 0 0 0 0.0625rem rgba(45, 43, 61, 0.10);
	transition: opacity .2s ease;
}

.ah-color-swatch:hover,
.ah-color-swatch:focus-visible {
	transform: translateY(-0.0625rem);
	border-color: #D9B85F;
	outline: none;
}

/* Ausverkauft: Rand bleibt Alpakahof-Gelb, nur die Farbe selbst wird abgeschwächt. */
.ah-color-swatch.is-out-of-stock {
	opacity: 1;
}

.ah-color-swatch.is-out-of-stock > span {
	opacity: .42;
}

.ah-color-swatch.is-out-of-stock::after {
	content: "";
	position: absolute;
	left: 0.08rem;
	right: 0.08rem;
	top: 50%;
	height: 0.0625rem;
	background: #2d2b3d;
	transform: rotate(-45deg);
	transform-origin: center;
	pointer-events: none;
	opacity: .55;
}


/* =========================================================
   PRODUKTDETAIL – HAUPTKATEGORIE / EYEBROW
   ========================================================= */

.ah-product-main-category {
	display: inline-flex;
	align-items: center;
	color: #2d2b3d;
	font-size: 0.75rem;
	font-weight: 600;
	line-height: 1rem;
	letter-spacing: 0.09375rem;
	text-decoration: none;
	text-transform: uppercase;
}

a.ah-product-main-category:hover,
a.ah-product-main-category:focus-visible {
	color: #2d2b3d;
	text-decoration: underline;
	text-underline-offset: 0.2em;
}

/* Produktdetail: technische Struktur für Größenbuttons. */
.ah-size-select-hidden {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

.avada-select-parent.ah-size-select-hidden {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	overflow: hidden !important;
}

.ah-variation-row-onesize {
	display: none !important;
}

/* =========================================================
   PRODUKTDETAIL – GRÖSSENBUTTONS
   ---------------------------------------------------------
   Die Buttons werden in product-variation-ui.js aus dem
   originalen WooCommerce-Größen-Select erzeugt.

   Zustände:
   .ah-size-button             = normal / verfügbar
   .ah-size-button.is-selected = aktuell gewählt
   .ah-size-button.is-disabled = für die gewählte Farbe nicht verfügbar
   ========================================================= */

.ah-size-buttons {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
	margin: 0;
}

.ah-size-button {
	appearance: none;
	-webkit-appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 4rem;
	min-height: 2.5rem;
	padding: 0.5rem 0.75rem;
	box-sizing: border-box;
	border: 0.0625rem solid #D8D7DC;
	border-radius: 0.25rem;
	background: #fff;
	box-shadow: none;
	color: #2D2B3D;
	font: inherit;
	font-size: 0.875rem;
	font-weight: 400;
	line-height: 1;
	text-transform: none;
	cursor: pointer;
	transition:
		border-color .2s ease,
		box-shadow .2s ease,
		background-color .2s ease,
		color .2s ease;
}

.ah-size-button:hover:not(:disabled):not(.is-disabled),
.ah-size-button:focus-visible {
	border-color: #F1D277;
	background: #fff;
	color: #2D2B3D;
}

.ah-size-button:focus-visible {
	outline: none;
	box-shadow: 0 0 0 0.125rem rgba(241, 210, 119, 0.28);
}

.ah-size-button.is-selected,
.ah-size-button[aria-pressed="true"] {
	border-color: #F1D277;
	box-shadow: inset 0 0 0 0.0625rem #F1D277;
	background: #fff;
	color: #2D2B3D;
}

/* Echte ausverkaufte Variation: sichtbar, durchgestrichen, aber bewusst
   weiterhin anklickbar. So kann die konkrete Variation gewählt und ein
   Back-in-Stock-/Notify-Me-Formular geladen werden. */
.ah-size-button.is-out-of-stock {
	border-color: #E4E3E7;
	background: #fff;
	color: #8E8C95;
	text-decoration: line-through;
	cursor: pointer;
	opacity: 0.72;
}

.ah-size-button.is-out-of-stock:hover,
.ah-size-button.is-out-of-stock:focus-visible,
.ah-size-button.is-out-of-stock.is-selected {
	border-color: #F1D277;
	box-shadow: inset 0 0 0 0.0625rem #F1D277;
}

/* Nicht existente Kombination: wirklich deaktiviert. */
.ah-size-button.is-disabled,
.ah-size-button:disabled {
	border-color: #E4E3E7;
	background: #F7F7F8;
	color: #9A98A1;
	text-decoration: line-through;
	cursor: not-allowed;
	opacity: 0.55;
}

/* =========================================================
   PRODUKTDETAIL – FARBBUTTONS / VERFÜGBARKEIT
   ---------------------------------------------------------
   Ab v0.9.6 spiegelt die Shop Engine auch die Farbauswahl
   selbst. Grundlage bleibt der originale WooCommerce-Select.

   Wichtig für UX:
   - alle am Produkt vorhandenen Farben bleiben sichtbar
   - nicht verfügbare Farben sind deaktiviert + durchgestrichen
   - aktive Farbe erhält den Alpakahof-gelben Rahmen
   ========================================================= */

.ah-color-select-hidden,
.avada-select-parent.ah-color-select-hidden {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

/* Avadas native Farbswatches werden ausschließlich auf der Farbzeile ersetzt.
   Der WooCommerce-Select selbst bleibt technisch im DOM. */
.avada-select-wrapper.ah-color-native-replaced .avada-button-select {
	display: none !important;
}

/* v0.9.9: Avada rendert die sichtbare Farbauswahl innerhalb des
   .avada-select-wrapper. Da die Shop Engine ihre eigene vollständige
   Farbliste direkt daneben ausgibt, wird der komplette native Wrapper
   nur visuell aus dem Layout genommen. Der WooCommerce-Select bleibt
   im DOM und wird von WooCommerce weiterhin für Auswahl, Variation-ID,
   Bestand, Preis und Warenkorb verwendet. */
.avada-select-wrapper.ah-color-native-replaced {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	clip-path: inset(50%) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

/* v0.9.8: robuste Variante für Avada-Layouts, bei denen der
   .avada-select-wrapper nicht der Vorfahr des echten Woo-Selects ist.
   Die komplette Farb-Variationszeile wird von JS markiert, dadurch
   bleiben auch von Avada nachträglich neu erzeugte native Swatches
   verborgen. Unsere .ah-color-button-Elemente sind davon nicht betroffen. */
.ah-color-row-replaced .avada-button-select {
	display: none !important;
}

.ah-color-buttons {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
	margin: 0;
}

.ah-color-button {
	appearance: none;
	-webkit-appearance: none;
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.5rem;
	height: 2.5rem;
	padding: 0.3125rem;
	box-sizing: border-box;
	border: 0.0625rem solid #D8D7DC;
	border-radius: 0.25rem;
	background: #fff;
	box-shadow: none;
	cursor: pointer;
	transition:
		border-color .2s ease,
		box-shadow .2s ease,
		background-color .2s ease;
}

.ah-color-button > span {
	display: block;
	width: 100%;
	height: 100%;
	border-radius: 0.25rem;
	box-shadow: inset 0 0 0 0.0625rem rgba(45, 43, 61, 0.08);
}

.ah-color-button:hover:not(:disabled):not(.is-disabled),
.ah-color-button:focus-visible {
	border-color: #F1D277;
	background: #fff;
}

.ah-color-button:focus-visible {
	outline: none;
	box-shadow: 0 0 0 0.125rem rgba(241, 210, 119, 0.28);
}

.ah-color-button.is-selected,
.ah-color-button[aria-pressed="true"] {
	border-color: #F1D277;
	box-shadow: inset 0 0 0 0.0625rem #F1D277;
}

.ah-color-button.is-disabled,
.ah-color-button:disabled {
	border-color: #E4E3E7;
	background: #F7F7F8;
	cursor: not-allowed;
	opacity: 1;
}

/* Echte ausverkaufte Farbe: sichtbar + durchgestrichen, aber anklickbar.
   Nur nicht existente Attributkombinationen erhalten disabled. */
.ah-color-button.is-out-of-stock {
	border-color: #E4E3E7;
	background: #fff;
	cursor: pointer;
	opacity: 1;
}

.ah-color-button.is-out-of-stock > span {
	opacity: .42;
}

.ah-color-button.is-out-of-stock::after {
	content: "";
	position: absolute;
	left: 0.25rem;
	right: 0.25rem;
	top: 50%;
	height: 0.0625rem;
	background: #2D2B3D;
	transform: rotate(-45deg);
	transform-origin: center;
	pointer-events: none;
	opacity: .55;
}

.ah-color-button.is-out-of-stock:hover,
.ah-color-button.is-out-of-stock:focus-visible,
.ah-color-button.is-out-of-stock.is-selected {
	border-color: #F1D277;
	box-shadow: inset 0 0 0 0.0625rem #F1D277;
}

/* Nicht existente Kombination: nicht anklickbar. */
.ah-color-button.is-disabled,
.ah-color-button:disabled {
	border-color: #E4E3E7;
	background: #F7F7F8;
	cursor: not-allowed;
	opacity: 0.55;
}

.ah-color-button.is-disabled > span,
.ah-color-button:disabled > span {
	opacity: .30;
}

.ah-color-button.is-disabled::after,
.ah-color-button:disabled::after {
	content: "";
	position: absolute;
	left: 0.25rem;
	right: 0.25rem;
	top: 50%;
	height: 0.0625rem;
	background: #2D2B3D;
	transform: rotate(-45deg);
	transform-origin: center;
	pointer-events: none;
	opacity: .35;
}



/* =========================================================
   PRODUKTDETAIL – VARIANTENPREIS
   ---------------------------------------------------------
   Der konkrete Variantenpreis wird durch die Shop Engine auf
   den primären Preis oberhalb der Auswahl synchronisiert.
   WooCommerces zusätzliche Preiszeile innerhalb der
   single_variation wird deshalb nur visuell ausgeblendet.

   WICHTIG:
   .woocommerce-variation-availability bleibt unangetastet,
   damit "Vorrätig" / "Nicht vorrätig" und Back-in-Stock-
   Plugins weiterhin normal funktionieren.
   ========================================================= */
form.variations_form .woocommerce-variation-price {
	display: none !important;
}


/* =========================================================
   PRODUKTDETAIL – ACF PRODUKTINFORMATIONEN / ACCORDIONS
   ---------------------------------------------------------
   Ausgabe über [ah_product_details]. Native <details>-Elemente:
   kein zusätzliches JavaScript, vollständig im HTML vorhanden
   und per Tastatur bedienbar.
   ========================================================= */

.ah-product-details {
	width: 100%;
	margin-top: 1.5rem;
	border-top: 0.0625rem solid #E4E3E7;
}

.ah-product-details__item {
	margin: 0;
	border-bottom: 0.0625rem solid #E4E3E7;
}

.ah-product-details__summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 1rem 0;
	color: #2D2B3D;
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.4;
	cursor: pointer;
	list-style: none;
}

.ah-product-details__summary:hover .ah-product-details__icon,
.ah-product-details__item[open] .ah-product-details__icon {
	color: #F1D277;
}

.ah-product-details__summary::-webkit-details-marker {
	display: none;
}

.ah-product-details__summary::marker {
	content: "";
}

.ah-product-details__summary:focus-visible {
	outline: 0.125rem solid rgba(241, 210, 119, 0.65);
	outline-offset: 0.25rem;
}

.ah-product-details__icon {
	position: relative;
	flex: 0 0 1rem;
	width: 1rem;
	height: 1rem;
	margin-left: auto;
	color: #2D2B3D;
	transition: color .2s ease;
}

.ah-product-details__icon::before,
.ah-product-details__icon::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 0.75rem;
	height: 0.0625rem;
	background: currentColor;
	transform: translate(-50%, -50%);
	transition: transform .2s ease;
}

.ah-product-details__icon::after {
	transform: translate(-50%, -50%) rotate(90deg);
}

.ah-product-details__item[open] .ah-product-details__icon::after {
	transform: translate(-50%, -50%) rotate(0deg);
}

.ah-product-details__content {
	padding: 0 0 1rem;
	color: #2D2B3D;
	font-size: 0.9375rem;
	line-height: 1.6;
}

.ah-product-details__section + .ah-product-details__section {
	margin-top: 1rem;
}

.ah-product-details__section h4 {
	margin: 0 0 0.375rem;
	color: #F1D277;
	font-size: 0.875rem;
	font-weight: 600;
	line-height: 1.4;
}

.ah-product-details__section p {
	margin: 0;
}

.ah-product-details__line + .ah-product-details__line {
	margin-top: 0.125rem;
}

.ah-product-details__list {
	margin: 0 !important;
	padding-left: 1rem;
}

.ah-product-details__list li {
	margin: 0 !important;
	padding: 0;
}

.ah-product-details__list li + li {
	margin-top: 0 !important;
}

@media (max-width: 640px) {
	.ah-product-details {
		margin-top: 1.25rem;
	}

	.ah-product-details__summary {
		padding: 0.9rem 0;
	}
}

/* =========================================================
   PRODUKTDETAIL – OUT-OF-STOCK KAUF-CONTROLS
   ---------------------------------------------------------
   Wird eine konkrete ausverkaufte Variation gewählt, setzt
   product-variation-ui.js die Klasse
   .ah-selected-variation-out-of-stock auf das Variationsformular.

   Nur Mengenfeld und Kaufbutton werden ausgeblendet.
   Lagerstatus und Back-in-Stock-/Notify-Me-Formular bleiben
   sichtbar und technisch vollständig unangetastet.
   ========================================================= */
form.variations_form.ah-selected-variation-out-of-stock .quantity,
form.variations_form.ah-selected-variation-out-of-stock .single_add_to_cart_button,
.single-product .product.ah-selected-variation-out-of-stock form.cart .quantity,
.single-product .product.ah-selected-variation-out-of-stock form.cart .single_add_to_cart_button,
.single-product .product.ah-selected-variation-out-of-stock .quantity,
.single-product .product.ah-selected-variation-out-of-stock .single_add_to_cart_button {
	display: none !important;
}

