/*
Theme Name: Wunschstoff Divi Child
Theme URI: https://wunschstoff.shop/
Description: Child Theme für Divi – eigene Anpassungen, Hero/Swiper etc. bleiben beim Parent-Update erhalten.
Author: Textilveredelung Wunstorf
Template: Divi
Version: 1.0.3
*/

/* Eigene Ergänzungen unterhalb – Hauptstyles kommen von Divi */

/* Wunschstoff-Menue: kleines Logo-Icon links vor den Begriffen. */
.et_pb_menu #menu-main-menu > li:not(.wunschstoff-menu-action) > a,
.et_pb_menu .et_mobile_menu > li:not(.wunschstoff-menu-action) > a {
	display: inline-flex;
	align-items: center;
	gap: 0.42em;
}

.et_pb_menu #menu-main-menu > li:not(.wunschstoff-menu-action) > a::before,
.et_pb_menu .et_mobile_menu > li:not(.wunschstoff-menu-action) > a::before {
	content: "";
	display: inline-block;
	width: 0.95em;
	height: 0.95em;
	flex: 0 0 0.95em;
	background: url("assets/ws-icon.png") center / contain no-repeat;
}

/* Wunschstoff-Menue: eigene Cart-/Konto-Icons statt Divi-Standardwarenkorb. */
.et_pb_menu .et_pb_menu__cart-button {
	display: none !important;
}

.et_pb_menu #menu-main-menu > li.wunschstoff-menu-action,
.et_pb_menu .et_mobile_menu > li.wunschstoff-menu-action {
	padding-right: 0;
}

.et_pb_menu #menu-main-menu > li.wunschstoff-menu-action + li.wunschstoff-menu-action {
	margin-left: 1rem;
}

.et_pb_menu #menu-main-menu > li.wunschstoff-menu-action > a,
.et_pb_menu .et_mobile_menu > li.wunschstoff-menu-action > a {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.15rem;
	height: 2.15rem;
	padding: 0;
	border: 1px solid rgba(32, 42, 52, 0.16);
	border-radius: 999px;
	color: #202a34;
	background: #ffffff;
	box-shadow: 0 0.12rem 0.35rem rgba(32, 42, 52, 0.14);
	text-decoration: none;
	transition: background 0.18s ease, transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.et_pb_menu #menu-main-menu > li.wunschstoff-menu-action > a {
	top: 1.25rem;
}

.et_pb_menu #menu-main-menu > li.wunschstoff-menu-action > a:hover,
.et_pb_menu #menu-main-menu > li.wunschstoff-menu-action > a:focus-visible,
.et_pb_menu .et_mobile_menu > li.wunschstoff-menu-action > a:hover,
.et_pb_menu .et_mobile_menu > li.wunschstoff-menu-action > a:focus-visible {
	background: rgba(255, 255, 255, 0.16);
	border-color: rgba(255, 255, 255, 0.34);
	transform: translateY(-1px);
	opacity: 1;
}

.et_pb_menu #menu-main-menu > li.wunschstoff-menu-action > a:hover,
.et_pb_menu #menu-main-menu > li.wunschstoff-menu-action > a:focus-visible,
.et_pb_menu .et_mobile_menu > li.wunschstoff-menu-action > a:hover,
.et_pb_menu .et_mobile_menu > li.wunschstoff-menu-action > a:focus-visible {
	background: #f5f5f5;
	border-color: rgba(32, 42, 52, 0.34);
	box-shadow: 0 0.18rem 0.45rem rgba(32, 42, 52, 0.18);
}

.wunschstoff-menu-action__icon {
	display: block;
	width: 1.18rem;
	height: 1.18rem;
	background: currentColor;
}

.wunschstoff-menu-action--cart .wunschstoff-menu-action__icon {
	-webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7 18.5A1.5 1.5 0 1 0 7 21.5 1.5 1.5 0 0 0 7 18.5ZM17 18.5A1.5 1.5 0 1 0 17 21.5 1.5 1.5 0 0 0 17 18.5ZM6.2 6 7.1 14.2c.1.7.7 1.3 1.4 1.3h8.4c.7 0 1.3-.5 1.4-1.2l1.1-6.8H7.5L7.2 4.8C7.1 4 6.4 3.5 5.7 3.5H3.5V5h2.2c.2 0 .4.2.5.5L6.2 6ZM8 9h9.6l-.8 5H8.6L8 9Z'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7 18.5A1.5 1.5 0 1 0 7 21.5 1.5 1.5 0 0 0 7 18.5ZM17 18.5A1.5 1.5 0 1 0 17 21.5 1.5 1.5 0 0 0 17 18.5ZM6.2 6 7.1 14.2c.1.7.7 1.3 1.4 1.3h8.4c.7 0 1.3-.5 1.4-1.2l1.1-6.8H7.5L7.2 4.8C7.1 4 6.4 3.5 5.7 3.5H3.5V5h2.2c.2 0 .4.2.5.5L6.2 6ZM8 9h9.6l-.8 5H8.6L8 9Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.wunschstoff-menu-action--account .wunschstoff-menu-action__icon {
	-webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 12.2A4.1 4.1 0 1 0 12 4a4.1 4.1 0 0 0 0 8.2ZM12 5.7a2.4 2.4 0 1 1 0 4.8 2.4 2.4 0 0 1 0-4.8ZM4.5 20c.7-3.5 3.6-5.8 7.5-5.8s6.8 2.3 7.5 5.8H17.7c-.7-2.5-2.8-4.1-5.7-4.1S7 17.5 6.3 20H4.5Z'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 12.2A4.1 4.1 0 1 0 12 4a4.1 4.1 0 0 0 0 8.2ZM12 5.7a2.4 2.4 0 1 1 0 4.8 2.4 2.4 0 0 1 0-4.8ZM4.5 20c.7-3.5 3.6-5.8 7.5-5.8s6.8 2.3 7.5 5.8H17.7c-.7-2.5-2.8-4.1-5.7-4.1S7 17.5 6.3 20H4.5Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.wunschstoff-menu-action__count {
	position: absolute;
	top: -0.42rem;
	right: -0.5rem;
	min-width: 1.15rem;
	height: 1.15rem;
	padding: 0 0.26rem;
	border: 1px solid rgba(32, 42, 52, 0.18);
	border-radius: 999px;
	background: #ffffff;
	color: #202a34;
	font-size: 0.68rem;
	font-weight: 700;
	line-height: 1.05rem;
	text-align: center;
}

/* Shortcode [wunschstoff_header_icons]: gleiche Bubbles wie im Menü, aber ohne .et_pb_menu. */
.wunschstoff-header-icons-menu {
	display: inline-flex;
	flex-wrap: nowrap;
	align-items: center;
	list-style: none;
	margin: 0;
	padding: 0;
	gap: 1rem;
}

/* Divi Text/Zeile clippt oft Kinder — Badge sitzt absolut und ragt raus, Kreis+Icon werden abgeschnitten. */
.et_pb_text .et_pb_text_inner:has(.wunschstoff-header-icons-menu),
.et_pb_text:has(.wunschstoff-header-icons-menu),
.et_pb_column:has(.wunschstoff-header-icons-menu) {
	overflow: visible !important;
}

.wunschstoff-header-icons-menu > li.wunschstoff-menu-action {
	padding: 0;
	margin: 0;
}

.wunschstoff-header-icons-menu > li.wunschstoff-menu-action > a {
	position: relative;
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	width: 2.15rem !important;
	height: 2.15rem !important;
	min-width: 2.15rem !important;
	min-height: 2.15rem !important;
	max-width: none !important;
	box-sizing: border-box !important;
	padding: 0;
	border: 1px solid rgba(32, 42, 52, 0.16);
	border-radius: 999px;
	color: #202a34 !important;
	background: #ffffff !important;
	box-shadow: 0 0.12rem 0.35rem rgba(32, 42, 52, 0.14);
	text-decoration: none !important;
	overflow: visible !important;
	transition: background 0.18s ease, transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.wunschstoff-header-icons-menu > li.wunschstoff-menu-action > a:hover,
.wunschstoff-header-icons-menu > li.wunschstoff-menu-action > a:focus-visible {
	background: #f5f5f5;
	border-color: rgba(32, 42, 52, 0.34);
	box-shadow: 0 0.18rem 0.45rem rgba(32, 42, 52, 0.18);
	transform: translateY(-1px);
}

/*
 * Theme Builder / Divi Text: globale Link-Styles setzen oft color transparent oder !important —
 * Icons sind Masken auf background: currentColor und werden unsichtbar; die Zahl hat eigene Farben.
 */
.wunschstoff-header-icons-menu a.wunschstoff-menu-action__link {
	color: #202a34 !important;
}

/*
 * Im Theme Builder kann CSS-Mask auf Spans inside Text flaken — Icons als eingebettetes SVG (fill).
 */
.wunschstoff-header-icons-menu .wunschstoff-menu-action__icon {
	flex-shrink: 0;
	display: block !important;
	width: 1.18rem !important;
	height: 1.18rem !important;
	min-width: 1.18rem !important;
	min-height: 1.18rem !important;
	font-size: 0 !important;
	line-height: 0 !important;
	opacity: 1 !important;
	visibility: visible !important;
	-webkit-mask: none !important;
	mask: none !important;
	background-color: transparent !important;
	background-repeat: no-repeat !important;
	background-position: center !important;
	background-size: contain !important;
}

.wunschstoff-header-icons-menu .wunschstoff-menu-action--cart .wunschstoff-menu-action__icon {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23202a34' d='M7 18.5A1.5 1.5 0 1 0 7 21.5 1.5 1.5 0 0 0 7 18.5ZM17 18.5A1.5 1.5 0 1 0 17 21.5 1.5 1.5 0 0 0 17 18.5ZM6.2 6 7.1 14.2c.1.7.7 1.3 1.4 1.3h8.4c.7 0 1.3-.5 1.4-1.2l1.1-6.8H7.5L7.2 4.8C7.1 4 6.4 3.5 5.7 3.5H3.5V5h2.2c.2 0 .4.2.5.5L6.2 6ZM8 9h9.6l-.8 5H8.6L8 9Z'/%3E%3C/svg%3E") !important;
}

.wunschstoff-header-icons-menu .wunschstoff-menu-action--account .wunschstoff-menu-action__icon {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23202a34' d='M12 12.2A4.1 4.1 0 1 0 12 4a4.1 4.1 0 0 0 0 8.2ZM12 5.7a2.4 2.4 0 1 1 0 4.8 2.4 2.4 0 0 1 0-4.8ZM4.5 20c.7-3.5 3.6-5.8 7.5-5.8s6.8 2.3 7.5 5.8H17.7c-.7-2.5-2.8-4.1-5.7-4.1S7 17.5 6.3 20H4.5Z'/%3E%3C/svg%3E") !important;
}

/*
 * Herz vor Button-Text: Advanced → Attributes → Name class, Wert wunschstoff-btn-with-heart.
 * Divi 5: Zielelement „Module“ = Klasse am äußeren Modul; innerer Link hat oft keine et_pb_button-Klasse.
 */
.et_pb_button_module_wrapper:has(.wunschstoff-btn-with-heart) {
	overflow: visible !important;
}

.et_pb_button_module_wrapper a.et_pb_button.et_pb_module.wunschstoff-btn-with-heart,
.et_pb_button_module_wrapper a.et_pb_button.et_flex_module.wunschstoff-btn-with-heart,
a.et_pb_button.et_pb_module.wunschstoff-btn-with-heart,
a.et_pb_button.et_flex_module.wunschstoff-btn-with-heart,
.et_pb_button.wunschstoff-btn-with-heart,
.et_pb_button_module_wrapper.wunschstoff-btn-with-heart .et_pb_button,
.wunschstoff-btn-with-heart .et_pb_button,
.wunschstoff-btn-with-heart a {
	display: inline-flex !important;
	align-items: center;
	gap: 0.42em;
}

.et_pb_button_module_wrapper a.et_pb_button.et_pb_module.wunschstoff-btn-with-heart::before,
.et_pb_button_module_wrapper a.et_pb_button.et_flex_module.wunschstoff-btn-with-heart::before,
a.et_pb_button.et_pb_module.wunschstoff-btn-with-heart::before,
a.et_pb_button.et_flex_module.wunschstoff-btn-with-heart::before,
.et_pb_button.wunschstoff-btn-with-heart::before,
a.et_pb_button.wunschstoff-btn-with-heart::before,
.et_pb_button_module_wrapper.wunschstoff-btn-with-heart .et_pb_button::before,
.et_pb_button_module_wrapper.wunschstoff-btn-with-heart a.et_pb_button::before,
.wunschstoff-btn-with-heart a.et_pb_button::before,
.et_pb_module.wunschstoff-btn-with-heart .et_pb_module_inner a::before,
.wunschstoff-btn-with-heart a::before {
	content: "" !important;
	display: inline-block !important;
	width: 0.95em !important;
	height: 0.95em !important;
	flex: 0 0 0.95em !important;
	background: url("assets/ws-icon.png") center / contain no-repeat !important;
}

/*
 * Einzelner Button mit eigenem Icon (nicht Herz): PNG/SVG nach assets/wunschstoff-btn-custom-icon.png legen.
 * Divi: Button-Icon deaktivieren, nur diese Klasse setzen — nicht zusammen mit wunschstoff-btn-with-heart.
 */
.et_pb_button.wunschstoff-btn-with-icon-custom,
.et_pb_button_module_wrapper.wunschstoff-btn-with-icon-custom .et_pb_button,
.wunschstoff-btn-with-icon-custom .et_pb_button,
.wunschstoff-btn-with-icon-custom a {
	display: inline-flex !important;
	align-items: center;
	gap: 0.42em;
}

.et_pb_button.wunschstoff-btn-with-icon-custom::before,
a.et_pb_button.wunschstoff-btn-with-icon-custom::before,
.et_pb_button_module_wrapper.wunschstoff-btn-with-icon-custom .et_pb_button::before,
.et_pb_button_module_wrapper.wunschstoff-btn-with-icon-custom a.et_pb_button::before,
.wunschstoff-btn-with-icon-custom a.et_pb_button::before,
.et_pb_module.wunschstoff-btn-with-icon-custom .et_pb_module_inner a::before,
.wunschstoff-btn-with-icon-custom a::before {
	content: "" !important;
	display: inline-block !important;
	width: 0.95em !important;
	height: 0.95em !important;
	flex: 0 0 0.95em !important;
	background: url("assets/wunschstoff-btn-custom-icon.png") center / contain no-repeat !important;
}

@media (max-width: 980px) {
	.et_pb_menu .et_mobile_menu > li.wunschstoff-menu-action {
		display: inline-flex;
		margin: 0.75rem 0.35rem 0.25rem 0;
	}

	.et_pb_menu .et_mobile_menu > li.wunschstoff-menu-action > a {
		width: 2.35rem;
		height: 2.35rem;
	}

	.wunschstoff-header-icons-menu > li.wunschstoff-menu-action > a {
		width: 2.35rem !important;
		height: 2.35rem !important;
		min-width: 2.35rem !important;
		min-height: 2.35rem !important;
	}
}

/* Wunschstoff-Warenkorb: Divi-Template enthaelt nur Summen, Produktliste wird serverseitig ergaenzt. */
body.woocommerce-cart,
body.woocommerce-checkout {
	--wunschstoff-page-gutter: clamp(1rem, 6vw, 60px);
}

body.woocommerce-cart #main-content .container {
	width: 100%;
	max-width: none;
	padding-inline: 0;
}

body.woocommerce-cart .woocommerce-notices-wrapper .woocommerce-message,
body.woocommerce-cart .woocommerce-notices-wrapper .woocommerce-info,
body.woocommerce-checkout .woocommerce-notices-wrapper .woocommerce-message,
body.woocommerce-checkout .woocommerce-notices-wrapper .woocommerce-info,
body.woocommerce-cart .wc-block-components-notice-banner.is-success,
body.woocommerce-cart .wc-block-components-notice-banner.is-info,
body.woocommerce-checkout .wc-block-components-notice-banner.is-success,
body.woocommerce-checkout .wc-block-components-notice-banner.is-info {
	display: none !important;
}

@supports selector(:has(*)) {
	body.woocommerce-cart .et_pb_row:has(.et_pb_wc_cart_totals) {
		width: calc(100% - (var(--wunschstoff-page-gutter) * 2)) !important;
		max-width: none !important;
		margin-inline: auto !important;
	}

	body.woocommerce-cart .et_pb_row:has(.et_pb_wc_cart_totals) > .et_pb_column:has(.et_pb_wc_cart_totals) {
		width: 100% !important;
		max-width: none !important;
		flex-basis: 100% !important;
		margin-inline: auto !important;
	}

	body.woocommerce-cart .et_pb_row:has(.et_pb_wc_cart_totals) > .et_pb_column_empty {
		display: none !important;
	}
}

body.woocommerce-cart .et_pb_wc_cart_totals .cart_totals {
	width: 100%;
}

.wunschstoff-cart-products {
	margin: 0 0 1.7rem;
	padding: clamp(1rem, 2.5vw, 1.5rem);
	border: 1px solid rgba(32, 42, 52, 0.12);
	background: #ffffff;
}

.wunschstoff-cart-products h2 {
	margin: 0 0 1rem;
	font-size: clamp(1.25rem, 2.4vw, 1.7rem);
	color: #202a34;
}

.wunschstoff-cart-products__list {
	display: grid;
	gap: 1rem;
}

.wunschstoff-cart-item {
	display: grid;
	grid-template-columns: 5.5rem minmax(0, 1fr);
	gap: 1rem;
	align-items: start;
	padding-bottom: 1rem;
	border-bottom: 1px solid rgba(32, 42, 52, 0.1);
}

.wunschstoff-cart-item:last-child {
	border-bottom: 0;
	padding-bottom: 0;
}

.wunschstoff-cart-item__image img {
	width: 5.5rem;
	height: 7rem;
	object-fit: cover;
	object-position: center top;
	border-radius: 6px;
	display: block;
}

.wunschstoff-cart-item__main {
	min-width: 0;
}

.wunschstoff-cart-item__title {
	margin: 0 0 0.35rem;
	font-size: 1rem;
	line-height: 1.25;
}

.wunschstoff-cart-item__title a {
	color: inherit;
	text-decoration: none;
}

.wunschstoff-cart-item__price {
	margin-bottom: 0.7rem;
	font-weight: 600;
	color: #202a34;
}

.wunschstoff-cart-item__quantity .quantity {
	margin: 0 !important;
}

.wunschstoff-cart-item__quantity input.qty {
	min-height: 2.35rem;
}

.wunschstoff-cart-item__side {
	grid-column: 1 / -1;
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 1rem;
}

.wunschstoff-cart-item__subtotal {
	font-weight: 700;
	color: #202a34;
}

.wunschstoff-cart-item__remove {
	color: rgba(32, 42, 52, 0.72);
	font-size: 0.9rem;
	text-decoration: underline;
	text-underline-offset: 0.18em;
}

.wunschstoff-cart-products__actions {
	display: flex;
	justify-content: flex-end;
	margin-top: 1.25rem;
}

.wunschstoff-cart-products__actions .button {
	border-radius: 6px;
}

@media (min-width: 700px) {
	.wunschstoff-cart-item {
		grid-template-columns: 6.5rem minmax(0, 1fr) auto;
		align-items: center;
	}

	.wunschstoff-cart-item__image img {
		width: 6.5rem;
		height: 8rem;
	}

	.wunschstoff-cart-item__side {
		grid-column: auto;
		flex-direction: column;
		align-items: flex-end;
		justify-content: center;
		min-width: 7rem;
	}
}

/* Wunschstoff-Kasse: Woo-Checkout ohne WordPress/Divi-Sidebar, Breite wie Warenkorb. */
body.woocommerce-checkout #main-content .container {
	width: calc(100% - (var(--wunschstoff-page-gutter) * 2));
	max-width: none;
	padding-top: clamp(2rem, 4vw, 3.5rem);
}

body.woocommerce-checkout #main-content .container::before {
	display: none !important;
}

body.woocommerce-checkout #left-area {
	float: none !important;
	width: 100% !important;
	padding-right: 0 !important;
	padding-bottom: clamp(2.5rem, 5vw, 4rem);
}

body.woocommerce-checkout #sidebar {
	display: none !important;
}

body.woocommerce-checkout .entry-title.main_title {
	margin-bottom: 1.25rem;
	color: #202a34;
}

body.woocommerce-checkout .wp-block-woocommerce-checkout {
	margin-left: 0;
	margin-right: 0;
}
