/*
 * Wielandshöhe – Shop (WooCommerce, klassischer Warenkorb und Kasse, Germanized).
 * Baut auf den Variablen in theme.css auf.
 */

/* ---------- 1. Buttons ---------- */
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #respond input#submit,
.woocommerce a.button.alt,
.woocommerce button.button.alt,
.woocommerce input.button.alt,
.woocommerce #respond input#submit.alt {
	background-color: var(--whs-accent);
	color: #fff;
	border: 0;
	border-radius: var(--whs-radius);
	font-weight: 600;
	font-size: 1rem;
	line-height: 1.3;
	min-height: var(--whs-control-height);
	padding: 0.75em 1.4em;
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.4em;
}

.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover,
.woocommerce a.button.alt:hover,
.woocommerce button.button.alt:hover,
.woocommerce input.button.alt:hover,
.woocommerce #respond input#submit:hover {
	background-color: var(--whs-button-hover);
	color: #fff;
}

/* Zweitrangige Buttons (z. B. „Warenkorb aktualisieren“) als Umriss */
.woocommerce button.button[name="update_cart"],
.woocommerce .coupon button.button,
.woocommerce a.button.wc-backward {
	background-color: transparent;
	color: var(--whs-accent);
	box-shadow: inset 0 0 0 2px var(--whs-accent);
}

.woocommerce button.button[name="update_cart"]:hover,
.woocommerce .coupon button.button:hover,
.woocommerce a.button.wc-backward:hover {
	background-color: var(--whs-accent);
	color: #fff;
}

.woocommerce button.button:disabled,
.woocommerce button.button:disabled[disabled] {
	opacity: 0.55;
	padding: 0.75em 1.4em;
}

/* ---------- 2. Produktübersicht (Karten) ---------- */
.woocommerce ul.products {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(15.5rem, 1fr));
	gap: var(--whs-gap);
	margin: 0 0 2rem;
}

/* Woo-Clearfix stört das Raster */
.woocommerce ul.products::before,
.woocommerce ul.products::after {
	display: none;
}

.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product {
	width: auto;
	float: none;
	margin: 0;
	display: flex;
	flex-direction: column;
	background: var(--whs-surface);
	border: 1px solid var(--whs-border);
	border-radius: var(--whs-radius);
	padding: 0 0 1.25rem;
	overflow: hidden;
	text-align: left;
}

.woocommerce ul.products li.product a img {
	margin: 0 0 1rem;
	border-radius: 0;
	aspect-ratio: 4 / 3;
	object-fit: cover;
}

.woocommerce ul.products li.product .woocommerce-loop-product__title {
	font-family: var(--whs-font-head);
	font-size: 1.375rem;
	font-weight: 600;
	color: var(--whs-text);
	padding: 0 1.25rem;
	margin-bottom: 0.5rem;
}

.woocommerce ul.products li.product .woocommerce-LoopProduct-link {
	text-decoration: none;
	color: inherit;
}

.woocommerce ul.products li.product .price {
	color: var(--whs-text);
	font-size: 1.0625rem;
	font-weight: 600;
	padding: 0 1.25rem;
	margin-bottom: 1rem;
}

.woocommerce ul.products li.product .button {
	margin: auto 1.25rem 0;
	align-self: flex-start;
}

/* Germanized-Hinweise unter dem Preis */
.woocommerce ul.products li.product .wc-gzd-additional-info,
.woocommerce ul.products li.product p.wc-gzd-additional-info {
	color: var(--whs-muted);
	font-size: 0.9375rem;
	padding: 0 1.25rem;
	margin-bottom: 0.75rem;
}

.woocommerce span.onsale {
	background-color: var(--whs-accent);
	color: #fff;
	font-weight: 600;
}

/* ---------- 3. Produktseite ---------- */
.woocommerce div.product div.images img {
	border-radius: var(--whs-radius);
}

.woocommerce div.product .product_title {
	margin-bottom: 0.5rem;
}

.woocommerce div.product p.price,
.woocommerce div.product span.price {
	color: var(--whs-text);
	font-size: 1.5rem;
	font-weight: 600;
}

.woocommerce div.product .woocommerce-product-details__short-description {
	margin: 1rem 0 1.5rem;
}

.woocommerce div.product form.cart {
	margin: 1.5rem 0;
	padding: 1.25rem;
	background: var(--whs-soft);
	border-radius: var(--whs-radius);
}

.woocommerce div.product form.cart .button {
	min-width: 14rem;
}

.woocommerce .quantity .qty {
	width: 4.5em;
	min-height: var(--whs-control-height);
	text-align: center;
}

/* Gutscheine sind virtuell – Artikelnummer/Kategorie sind für Kunden unwichtig */
.woocommerce div.product .product_meta {
	display: none;
}

/* Reiter (Beschreibung) */
.woocommerce div.product .woocommerce-tabs ul.tabs {
	padding: 0;
}

.woocommerce div.product .woocommerce-tabs ul.tabs::before {
	border-bottom-color: var(--whs-border);
}

.woocommerce div.product .woocommerce-tabs ul.tabs li {
	background: var(--whs-soft);
	border-color: var(--whs-border);
	border-radius: var(--whs-radius) var(--whs-radius) 0 0;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li.active {
	background: var(--whs-bg);
	border-bottom-color: var(--whs-bg);
}

.woocommerce div.product .woocommerce-tabs ul.tabs li a {
	color: var(--whs-text);
	font-weight: 600;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li::before,
.woocommerce div.product .woocommerce-tabs ul.tabs li::after {
	display: none;
}

/* ---------- 4. Hinweise ---------- */
.woocommerce-message,
.woocommerce-info,
.woocommerce-error,
.woocommerce-noreviews,
p.no-comments {
	background-color: var(--whs-accent);
	color: var(--whs-gold);
	border-top: 0;
	border-left: 4px solid var(--whs-gold);
	border-radius: var(--whs-radius);
}

/* Wie auf der bisherigen Seite: blauer Hinweis, goldene Schrift */
.woocommerce-message::before,
.woocommerce-info::before { color: var(--whs-gold); }

.woocommerce-message a:not(.button),
.woocommerce-info a:not(.button),
.woocommerce-error a:not(.button) {
	color: #fff;
}

/* Fehler bleiben eindeutig rot umrandet und hell – besser erkennbar */
.woocommerce-error {
	background-color: var(--whs-surface);
	color: var(--whs-text);
	border-left-color: var(--whs-error);
	box-shadow: 0 0 0 1px var(--whs-border);
}
.woocommerce-error::before { color: var(--whs-error); }

/* Button innerhalb eines blauen Hinweises: gold mit blauer Schrift */
.woocommerce-message .button,
.woocommerce-info .button {
	background-color: var(--whs-gold) !important;
	color: var(--whs-accent-dark) !important;
}

.woocommerce-message .button,
.woocommerce-info .button {
	float: right;
}

/* ---------- 5. Formulare (Kasse, Konto, Gutscheinfelder) ---------- */
.woocommerce form .form-row {
	margin-bottom: 1rem;
}

.woocommerce form .form-row label {
	font-weight: 600;
	margin-bottom: 0.3rem;
	line-height: 1.4;
}

.woocommerce form .form-row .input-text,
.woocommerce form .form-row select,
.woocommerce form .form-row textarea {
	border: 1px solid var(--whs-control);
	border-radius: var(--whs-radius);
	min-height: var(--whs-control-height);
	padding: 0.55em 0.8em;
	background: var(--whs-surface);
	color: var(--whs-text);
}

.woocommerce form .form-row .required {
	color: var(--whs-error);
	text-decoration: none;
	border: 0;
}

.woocommerce form .form-row.woocommerce-invalid .input-text,
.woocommerce form .form-row.woocommerce-invalid select {
	border-color: var(--whs-error);
	border-width: 2px;
}

.woocommerce form .form-row.woocommerce-invalid label {
	color: var(--whs-error);
}

/* Checkboxen (AGB, Widerruf/Verzicht digitale Inhalte, Kostenübernahme) */
.woocommerce form .form-row label.checkbox,
.woocommerce form .form-row .woocommerce-form__label-for-checkbox {
	display: flex;
	gap: 0.6rem;
	align-items: flex-start;
	font-weight: 400;
}

.woocommerce form .form-row label.checkbox input,
.woocommerce form .form-row .woocommerce-form__label-for-checkbox input {
	flex: 0 0 auto;
	margin-top: 0.2rem;
}

/* Select2 (Länderauswahl) */
.select2-container--default .select2-selection--single {
	border: 1px solid var(--whs-control);
	border-radius: var(--whs-radius);
	height: var(--whs-control-height);
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
	line-height: calc(var(--whs-control-height) - 2px);
	color: var(--whs-text);
	padding-left: 0.8em;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
	height: calc(var(--whs-control-height) - 2px);
}

/* ---------- 6. Warenkorb ---------- */
.woocommerce table.shop_table {
	background: var(--whs-surface);
	border: 1px solid var(--whs-border);
	border-radius: var(--whs-radius);
	border-collapse: separate;
}

.woocommerce table.shop_table th,
.woocommerce table.shop_table td {
	border-color: var(--whs-border);
	padding: 0.9rem 1rem;
}

.woocommerce table.shop_table th {
	font-weight: 600;
}

.woocommerce a.remove {
	color: var(--whs-error) !important;
	font-size: 1.5rem;
	width: 2rem;
	height: 2rem;
	line-height: 1.9rem;
}

.woocommerce a.remove:hover {
	background: var(--whs-error);
	color: #fff !important;
}

.woocommerce .cart-collaterals .cart_totals h2,
.woocommerce-checkout h3 {
	font-size: 1.5rem;
}

.woocommerce .wc-proceed-to-checkout a.checkout-button {
	display: flex;
	width: 100%;
	font-size: 1.125rem;
	padding: 1em;
}

/* ---------- 7. Kasse ---------- */
.woocommerce-checkout #customer_details,
.woocommerce-checkout #order_review {
	background: var(--whs-surface);
	border: 1px solid var(--whs-border);
	border-radius: var(--whs-radius);
	padding: clamp(1rem, 3vw, 1.75rem);
	margin-bottom: 1.5rem;
}

.woocommerce-checkout #payment {
	background: var(--whs-soft);
	border-radius: var(--whs-radius);
}

.woocommerce-checkout #payment div.payment_box {
	background: var(--whs-surface);
	color: var(--whs-text);
}

.woocommerce-checkout #payment div.payment_box::before {
	border-bottom-color: var(--whs-surface);
}

.woocommerce-checkout #payment ul.payment_methods {
	border-bottom-color: var(--whs-border);
}

.woocommerce-checkout #payment ul.payment_methods li {
	padding: 0.4rem 0;
}

.woocommerce-checkout #payment ul.payment_methods li label {
	font-weight: 600;
}

/* „Zahlungspflichtig bestellen“ – groß und eindeutig */
.woocommerce #payment #place_order,
.woocommerce-page #payment #place_order,
.woocommerce-checkout #place_order {
	width: 100%;
	float: none;
	font-size: 1.1875rem;
	padding: 1em;
	margin-top: 1rem;
}

.woocommerce-checkout .woocommerce-terms-and-conditions-wrapper,
.woocommerce-checkout .wc-gzd-checkbox-placeholder {
	font-size: 1rem;
}

/* ---------- 8. Mein Konto ---------- */
.woocommerce-account .woocommerce-MyAccount-navigation ul {
	list-style: none;
	margin: 0 0 1.5rem;
	padding: 0;
	border: 1px solid var(--whs-border);
	border-radius: var(--whs-radius);
	background: var(--whs-surface);
}

.woocommerce-account .woocommerce-MyAccount-navigation li a {
	display: block;
	padding: 0.75rem 1rem;
	text-decoration: none;
	border-bottom: 1px solid var(--whs-border);
}

.woocommerce-account .woocommerce-MyAccount-navigation li:last-child a {
	border-bottom: 0;
}

.woocommerce-account .woocommerce-MyAccount-navigation li.is-active a {
	color: var(--whs-text);
	font-weight: 600;
	box-shadow: inset 4px 0 0 var(--whs-ochre);
}

/* Downloads (PDF-Anleitung) */
.woocommerce-account .woocommerce-MyAccount-downloads .download-file a.button {
	white-space: nowrap;
}

/* ---------- 9. Klein-Bildschirm ---------- */
@media (max-width: 768px) {
	.woocommerce div.product form.cart .button {
		width: 100%;
		min-width: 0;
	}

	.woocommerce-message .button,
	.woocommerce-info .button {
		float: none;
		display: flex;
		margin-top: 0.75rem;
	}
}

/* =========================================================
   10. Block-Warenkorb und Block-Kasse
   WooCommerce-Blöcke an Farben, Schrift und Formen des Themes anpassen.
   ========================================================= */

/* Überschriften der Kassen-Schritte und Zusammenfassungen */
.wc-block-components-title.wc-block-components-title,
.wc-block-components-checkout-step__title,
.wc-block-cart__totals-title,
.wp-block-woocommerce-checkout-order-summary-block .wc-block-components-checkout-order-summary__title-text {
	font-family: var(--whs-font-head);
	font-weight: 600;
	font-size: 1.5rem;
	color: var(--whs-accent);
	text-transform: none;
	letter-spacing: 0;
}

.wc-block-components-checkout-step__description {
	color: var(--whs-muted);
}

/* Nummerierte Schritte der Kasse */
.wc-block-components-checkout-step--with-step-number .wc-block-components-checkout-step__title::before {
	color: var(--whs-accent);
}

.wc-block-components-checkout-step--with-step-number .wc-block-components-checkout-step__container::after {
	background-color: var(--whs-border);
}

/* Buttons: Bestellen, Zur Kasse, Gutschein anwenden */
.wc-block-components-button:not(.is-link),
.wc-block-cart__submit-button,
.wc-block-components-checkout-place-order-button {
	background-color: var(--whs-accent);
	color: #fff;
	border: 0;
	border-radius: var(--whs-radius);
	font-family: var(--whs-font-body);
	font-weight: 600;
	min-height: var(--whs-control-height);
	text-decoration: none;
	box-shadow: none;
}

.wc-block-components-button:not(.is-link):hover,
.wc-block-components-button:not(.is-link):focus,
.wc-block-cart__submit-button:hover,
.wc-block-components-checkout-place-order-button:hover {
	background-color: var(--whs-button-hover);
	color: #fff;
}

.wc-block-components-button:not(.is-link):focus-visible {
	outline: 3px solid var(--whs-focus);
	outline-offset: 3px;
}

.wc-block-components-checkout-place-order-button,
.wc-block-cart__submit-button {
	width: 100%;
	font-size: 1.125rem;
	min-height: 3.25rem;
}

.wc-block-components-button.is-link,
.wc-block-components-checkout-return-to-cart-button {
	color: var(--whs-accent);
}

/* Eingabefelder (schwebende Beschriftung) */
.wc-block-components-text-input input[type="text"],
.wc-block-components-text-input input[type="email"],
.wc-block-components-text-input input[type="tel"],
.wc-block-components-text-input input[type="number"],
.wc-block-components-text-input input[type="password"],
.wc-block-components-textarea,
.wc-block-components-combobox .wc-block-components-combobox-control input.components-combobox-control__input,
.wc-blocks-components-select .wc-blocks-components-select__select {
	background-color: var(--whs-surface);
	color: var(--whs-text);
	border: 1px solid var(--whs-control);
	border-radius: var(--whs-radius);
	font-family: var(--whs-font-body);
}

.wc-block-components-text-input input:focus,
.wc-block-components-textarea:focus,
.wc-block-components-combobox .wc-block-components-combobox-control input.components-combobox-control__input:focus,
.wc-blocks-components-select .wc-blocks-components-select__select:focus {
	border-color: var(--whs-text);
	box-shadow: 0 0 0 1px var(--whs-text);
	outline: none;
}

.wc-block-components-text-input label,
.wc-block-components-combobox .wc-block-components-combobox-control label,
.wc-blocks-components-select .wc-blocks-components-select__label {
	color: var(--whs-muted);
}

.wc-block-components-text-input.has-error input,
.wc-block-components-validation-error {
	border-color: var(--whs-error);
	color: var(--whs-error);
}

/* Checkboxen und Auswahlknöpfe (Zahlungsarten) */
.wc-block-components-checkbox .wc-block-components-checkbox__input[type="checkbox"] {
	border: 1px solid var(--whs-control);
	border-radius: 3px;
	background: var(--whs-surface);
	width: 1.25rem;
	height: 1.25rem;
}

.wc-block-components-checkbox .wc-block-components-checkbox__input[type="checkbox"]:checked {
	background: var(--whs-accent);
	border-color: var(--whs-accent);
}

.wc-block-components-checkbox .wc-block-components-checkbox__mark {
	fill: #fff;
}

.wc-block-components-checkbox__label {
	color: var(--whs-text);
	line-height: 1.5;
}

.wc-block-components-radio-control__input {
	border-color: var(--whs-control);
}

.wc-block-components-radio-control__input:checked {
	border-color: var(--whs-accent);
}

.wc-block-components-radio-control__input:checked::before {
	background: var(--whs-accent);
}

.wc-block-components-radio-control-accordion-option,
.wc-block-components-radio-control--highlight-checked .wc-block-components-radio-control-accordion-option--checked-option-highlighted {
	border-color: var(--whs-border);
}

.wc-block-components-radio-control--highlight-checked .wc-block-components-radio-control-accordion-option--checked-option-highlighted {
	box-shadow: inset 0 0 0 2px var(--whs-accent);
}

/* Bestellübersicht und Summen */
.wp-block-woocommerce-checkout-order-summary-block,
.wc-block-cart .wc-block-cart__sidebar .wc-block-components-sidebar-layout,
.wc-block-components-sidebar .wc-block-components-panel {
	border-color: var(--whs-border);
}

.wp-block-woocommerce-checkout-order-summary-block {
	background: var(--whs-surface);
	border-radius: var(--whs-radius);
}

.wc-block-components-totals-item__label,
.wc-block-components-totals-item__value {
	color: var(--whs-text);
}

.wc-block-components-totals-footer-item .wc-block-components-totals-item__value,
.wc-block-components-totals-footer-item .wc-block-components-totals-item__label {
	font-weight: 700;
	font-size: 1.125rem;
}

.wc-block-components-order-summary-item__description .wc-block-components-product-metadata,
.wc-block-components-product-details {
	color: var(--whs-muted);
	font-size: 0.9375rem;
}

/* Gutschein-Angaben (Betrag, Für, Text) im Warenkorb gut lesbar */
.wc-block-components-product-details__name {
	font-weight: 600;
	color: var(--whs-text);
}

.wc-block-components-product-details__value {
	white-space: pre-line;
}

/* Warenkorb-Tabelle */
.wc-block-cart-items {
	border-color: var(--whs-border);
}

.wc-block-components-product-name.wc-block-components-product-name {
	font-family: var(--whs-font-head);
	font-size: 1.25rem;
	font-weight: 600;
	color: var(--whs-accent);
	text-decoration: none;
}

.wc-block-cart-item__remove-link {
	color: var(--whs-error) !important;
}

.wc-block-components-quantity-selector {
	border: 1px solid var(--whs-control);
	border-radius: var(--whs-radius);
}

.wc-block-components-quantity-selector::after {
	border: 0;
}

/* Hinweise der Block-Kasse */
.wc-block-components-notice-banner {
	border-radius: var(--whs-radius);
	color: var(--whs-text);
	background: var(--whs-surface);
}

.wc-block-components-notice-banner.is-error {
	border-color: var(--whs-error);
}

.wc-block-components-notice-banner.is-error > svg {
	background-color: var(--whs-error);
}

.wc-block-components-notice-banner.is-success {
	border-color: var(--whs-success);
}

.wc-block-components-notice-banner.is-success > svg {
	background-color: var(--whs-success);
}

.wc-block-components-notice-banner.is-info {
	border-color: var(--whs-accent);
}

.wc-block-components-notice-banner.is-info > svg {
	background-color: var(--whs-accent);
}

/* Rechtstexte unter dem Bestell-Button */
.wc-block-checkout__terms,
.wc-block-components-checkout-policies {
	color: var(--whs-muted);
	font-size: 0.9375rem;
}

/* Leerer Warenkorb */
.wc-block-cart__empty-cart__title {
	font-family: var(--whs-font-head);
	color: var(--whs-accent);
}
