/*
 * Falk26 – WooCommerce: Shop-Links, Produktliste, Produktseite, Hinweise,
 * Warenkorb, Kasse, Konto.
 */

/* ---------- Rahmen der Shop-Seiten ---------- */

.woocommerce-page #site-content,
.woocommerce #site-content {
	max-width: var(--falk-inhalt-max);
}

/* Shop-Links anstelle der Breadcrumb (functions.php: falk26_shop_links) */
.falk-shop-links ul {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: var(--falk-space-2);
	margin: 0 0 var(--falk-space-4);
	padding: 0;
	list-style: none;
	font-size: 1.4rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.falk-shop-links li {
	margin: 0;
}

.falk-shop-links a {
	display: block;
	padding: 0.7rem 1.4rem;
	border: 0.15rem solid var(--falk-primary);
	border-radius: var(--falk-radius);
	text-decoration: none;
}

.falk-shop-links a:hover,
.falk-shop-links a:focus {
	border-color: var(--falk-button-bg-hover);
	background: var(--falk-button-bg-hover);
	color: var(--falk-button-text-hover);
}

/* Titel der Shop-Übersicht: linksbündig mit Akzentbalken wie die Seitentitel */
.woocommerce-products-header {
	text-align: left;
}

.woocommerce-products-header__title.page-title {
	margin: 0 0 var(--falk-space-4);
	font-size: var(--falk-step-6);
	font-weight: var(--falk-display-weight);
	text-align: left;
}

.woocommerce-products-header__title.page-title::after {
	content: "";
	display: block;
	width: 7.2rem;
	height: 0.6rem;
	margin-top: var(--falk-space-3);
	background: var(--falk-akzent-linie);
}

.woocommerce-result-count {
	color: var(--falk-text-leise);
	font-size: 1.5rem;
}

/* ---------- Produktliste: Karten ---------- */

ul.products li.product {
	display: flex;
	flex-direction: column;
	box-sizing: border-box;
	padding: var(--falk-space-3);
	border-radius: var(--falk-radius);
	background: var(--falk-karte);
	box-shadow: var(--falk-schatten);
	transition: transform var(--falk-transition), box-shadow var(--falk-transition);
}

ul.products li.product:hover,
ul.products li.product:focus-within {
	transform: translateY(-0.3rem);
}

ul.products li.product .woocommerce-loop-product__link {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	text-decoration: none;
}

ul.products li.product a img {
	margin: 0 0 var(--falk-space-3);
	aspect-ratio: 1;
	object-fit: cover;
	border-radius: var(--falk-radius);
}

ul.products li.product .woocommerce-loop-product__title {
	margin: 0 0 var(--falk-space-2);
	font-size: var(--falk-step-2);
	line-height: 1.1;
	color: var(--falk-heading);
	hyphens: auto;
}

ul.products li.product .price {
	margin: auto 0 var(--falk-space-3);
	color: var(--falk-primary);
	font-size: var(--falk-step-1);
	font-weight: 700;
}

ul.products li.product .price del {
	color: var(--falk-text-leise);
	font-weight: 400;
}

ul.products li.product .button {
	width: 100%;
	margin: 0;
	box-sizing: border-box;
	text-align: center;
}

ul.products li.product .added_to_cart {
	display: block;
	margin-top: var(--falk-space-2);
	font-size: 1.5rem;
	font-weight: 600;
	text-align: center;
}

/* ---------- Produktseite ---------- */

/* Produkttitel kleiner als Seitentitel, damit lange Namen nicht mitten im Wort umbrechen */
.single-product .product_title {
	font-size: var(--falk-step-5);
	overflow-wrap: normal;
	hyphens: auto;
}

.single-product div.product p.price {
	color: var(--falk-primary);
	font-size: var(--falk-step-2);
	font-weight: 700;
}

.single-product div.product .woocommerce-product-gallery img {
	border-radius: var(--falk-radius);
	box-shadow: var(--falk-schatten);
}

.single-product div.product form.cart {
	margin: var(--falk-space-4) 0;
	padding: var(--falk-space-3);
	border-radius: var(--falk-radius);
	background: var(--falk-karte);
	box-shadow: var(--falk-schatten);
}

.single-product .product_meta {
	color: var(--falk-text-leise);
	font-size: 1.5rem;
}

.single-product .related.products > h2,
.single-product .upsells.products > h2,
.woocommerce-tabs .panel > h2:first-child {
	font-size: var(--falk-step-4);
}

/* Farben, die WooCommerce fest auf das Parent-Rot setzt */
.onsale,
a.remove:hover {
	background-color: var(--falk-button-bg);
	color: var(--falk-button-text);
}

.woocommerce-tabs ul li.active a {
	color: var(--falk-link);
	box-shadow: 0 2px 0 var(--falk-link);
}

/* ---------- Hinweise ---------- */

.woocommerce-error,
.woocommerce-info,
.woocommerce-message {
	border: 0;
	border-left: 0.6rem solid var(--falk-primary);
	border-radius: var(--falk-radius);
	background: var(--falk-surface);
	color: var(--falk-text);
}

.woocommerce-error {
	border-left-color: var(--falk-secondary-deep);
}

.woocommerce-checkout form .form-row.woocommerce-invalid input.input-text {
	border-color: var(--falk-secondary-deep);
}

/* Hinweisleiste: Button nicht mitten im Wort umbrechen (mobil „WAREN KORB ANZEIG EN“) */
.woocommerce-message .button,
.woocommerce-info .button,
.woocommerce-error .button {
	white-space: nowrap;
	overflow-wrap: normal;
	word-break: normal;
	hyphens: none;
}

@media (max-width: 599px) {
	.woocommerce-message,
	.woocommerce-info,
	.woocommerce-error {
		flex-direction: column;
		align-items: flex-start;
		gap: var(--falk-space-2);
	}
}

/* Hinweisleiste: Button in Theme-Farben statt WooCommerce-Schwarz */
.woocommerce-error a.button,
.woocommerce-info a.button,
.woocommerce-message a.button {
	background-color: var(--falk-button-bg);
	color: var(--falk-button-text);
}

.woocommerce-error a.button:hover,
.woocommerce-error a.button:focus,
.woocommerce-info a.button:hover,
.woocommerce-info a.button:focus,
.woocommerce-message a.button:hover,
.woocommerce-message a.button:focus {
	background-color: var(--falk-button-bg-hover);
	color: var(--falk-button-text-hover);
}

/* ---------- Warenkorb und Kasse (Blöcke) ---------- */

/*
 * Warenkorb- und Kassenblock: WooCommerce setzt margin 0 und width 100 % nach
 * dem Parent-CSS; hier wieder der Seitenrand des Parents (.alignwide).
 */
.entry-content > .wp-block-woocommerce-cart.alignwide,
.entry-content > .wp-block-woocommerce-checkout.alignwide {
	width: calc(100% - 2 * var(--falk-rand));
	margin-right: auto;
	margin-left: auto;
}

/* Titel von Warenkorb, Kasse und Konto: mittig wie der Block darunter, etwas kleiner */
.woocommerce-cart .entry-header,
.woocommerce-checkout .entry-header,
.woocommerce-account .entry-header {
	padding-bottom: var(--falk-space-5);
	text-align: center;
}

.woocommerce-cart .entry-header .entry-title,
.woocommerce-checkout .entry-header .entry-title,
.woocommerce-account .entry-header .entry-title {
	font-size: var(--falk-step-5);
}

.woocommerce-cart .entry-header .entry-title::after,
.woocommerce-checkout .entry-header .entry-title::after,
.woocommerce-account .entry-header .entry-title::after {
	margin-right: auto;
	margin-left: auto;
}

.wc-block-cart,
.wc-block-checkout,
.wc-block-components-sidebar-layout {
	font-family: var(--falk-font-text);
}

/* Abschnittstitel von Kasse und Warenkorb in der Display-Schrift, etwas kleiner als h2 */
.wc-block-components-title.wc-block-components-title,
.wc-block-cart .wc-block-cart__totals-title.wc-block-cart__totals-title {
	font-family: var(--falk-font-display);
	font-size: var(--falk-step-3);
	font-weight: var(--falk-display-weight);
	letter-spacing: var(--falk-display-spacing);
	color: var(--falk-heading);
}

/* Summenspalte als Karte */
.wc-block-components-sidebar {
	box-sizing: border-box;
	padding: var(--falk-space-3);
	border-radius: var(--falk-radius);
	background: var(--falk-karte);
	box-shadow: var(--falk-schatten);
}

.wc-block-cart-items,
.wc-block-cart-items td,
.wc-block-cart-items th,
.wc-block-components-totals-wrapper,
.wc-block-components-order-summary,
.wc-block-components-panel,
.wc-block-components-totals-coupon,
.wc-block-checkout__actions {
	border-color: var(--falk-border);
}

.wc-block-components-product-name,
.wc-block-cart-item__remove-link,
.wc-block-components-checkout-return-to-cart-button,
.wc-block-checkout__terms a,
.wc-block-components-totals-coupon-link {
	color: var(--falk-link);
}

.wc-block-components-product-name:hover,
.wc-block-components-product-name:focus,
.wc-block-cart-item__remove-link:hover,
.wc-block-cart-item__remove-link:focus,
.wc-block-components-checkout-return-to-cart-button:hover,
.wc-block-components-checkout-return-to-cart-button:focus,
.wc-block-checkout__terms a:hover,
.wc-block-checkout__terms a:focus {
	color: var(--falk-link-hover);
}

/* Hauptschaltflächen der Blöcke („Weiter zur Kasse“, „Bestellung aufgeben“) */
.wc-block-components-button.wc-block-components-button:not(.is-link),
.wc-block-cart__submit-button.wc-block-cart__submit-button {
	border-radius: var(--falk-radius);
	background-color: var(--falk-button-bg);
	color: var(--falk-button-text);
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.wc-block-components-button.wc-block-components-button:not(.is-link):hover,
.wc-block-components-button.wc-block-components-button:not(.is-link):focus,
.wc-block-cart__submit-button.wc-block-cart__submit-button:hover,
.wc-block-cart__submit-button.wc-block-cart__submit-button:focus {
	background-color: var(--falk-button-bg-hover);
	color: var(--falk-button-text-hover);
}

/* Felder der Kasse */
.wc-block-components-text-input input,
.wc-block-components-text-input.is-active input,
.wc-blocks-components-select .wc-blocks-components-select__select,
.wc-block-components-textarea {
	border-color: var(--falk-border-stark);
	border-radius: var(--falk-radius);
	background-color: var(--falk-input-bg);
	color: var(--falk-text);
}

.wc-block-components-text-input input:focus,
.wc-blocks-components-select .wc-blocks-components-select__select:focus,
.wc-block-components-textarea:focus {
	border-color: var(--falk-primary);
	box-shadow: 0 0 0 1px var(--falk-primary);
}

.wc-block-components-checkbox .wc-block-components-checkbox__input[type="checkbox"]:checked,
.wc-block-components-radio-control .wc-block-components-radio-control__input:checked {
	border-color: var(--falk-primary);
}

.wc-block-components-radio-control .wc-block-components-radio-control__input:checked::before {
	background: var(--falk-primary);
}

.wc-block-components-radio-control--highlight-checked .wc-block-components-radio-control-accordion-option--checked-option-highlighted,
.wc-block-components-radio-control--highlight-checked label.wc-block-components-radio-control__option--checked-option-highlighted {
	box-shadow: inset 0 0 0 2px var(--falk-primary);
}

.wc-block-components-quantity-selector {
	border-radius: var(--falk-radius);
	background: var(--falk-input-bg);
}

/* Mengen-Schaltflächen sind <button>: ohne Fläche */
.wc-block-components-quantity-selector .wc-block-components-quantity-selector__button,
.wc-block-components-quantity-selector .wc-block-components-quantity-selector__button:hover,
.wc-block-components-quantity-selector .wc-block-components-quantity-selector__button:focus,
.wc-block-components-panel__button,
.wc-block-components-panel__button:hover,
.wc-block-components-panel__button:focus,
.wc-block-components-button.is-link,
.wc-block-components-button.is-link:hover,
.wc-block-components-button.is-link:focus,
.wc-block-components-address-card__edit,
.wc-block-components-address-card__edit:hover,
.wc-block-components-address-card__edit:focus {
	background-color: transparent;
	color: var(--falk-text);
}

/* ---------- Mein Konto ---------- */

.woocommerce-account .woocommerce-MyAccount-navigation li a,
.woocommerce-account .woocommerce-MyAccount-navigation li.is-active a {
	color: var(--falk-link);
}

.woocommerce-account .woocommerce-MyAccount-navigation li.is-active a {
	box-shadow: inset 0.4rem 0 0 var(--falk-akzent-linie);
}

.woocommerce-account .woocommerce-MyAccount-navigation li a:hover,
.woocommerce-account .woocommerce-MyAccount-navigation li a:focus {
	color: var(--falk-link-hover);
}

/* Anmelden und Registrieren als Karten */
.woocommerce form.login,
.woocommerce form.register,
.woocommerce form.lost_reset_password {
	padding: var(--falk-space-4);
	border: 0;
	border-top: 0.6rem solid var(--falk-primary);
	border-radius: var(--falk-radius);
	background: var(--falk-karte);
	box-shadow: var(--falk-schatten);
}

.woocommerce-account:not(.logged-in) .woocommerce h2 {
	font-size: var(--falk-step-4);
}
