/* IH Shop-Feinschliff 0.5.1 – Vereinsfarben für Shop, Produkt, Warenkorb und Kasse (überschreibt OceanWP-Akzent) */
body.ih-sf {
	--ih-blau: #003C78;
	--ih-blau-dunkel: #002a55;
	--ih-rot: #E30F42;
	--ih-grau: #5a6270;
}

/* ---------- Buttons ---------- */
body.ih-sf .woocommerce .button,
body.ih-sf .woocommerce a.button,
body.ih-sf .woocommerce button.button,
body.ih-sf .woocommerce input.button,
body.ih-sf .woocommerce ul.products li.product .button,
body.ih-sf.woocommerce ul.products li.product .button,
body.ih-sf .single_add_to_cart_button,
body.ih-sf .checkout-button,
body.ih-sf #place_order,
body.ih-sf .woocommerce-message .button,
body.ih-sf .wc-proceed-to-checkout .button {
	background-color: var(--ih-blau) !important;
	border: 1px solid var(--ih-blau) !important;
	color: #fff !important;
	border-radius: 3px;
	transition: background-color .2s ease, border-color .2s ease;
}
body.ih-sf .woocommerce .button:hover,
body.ih-sf .woocommerce a.button:hover,
body.ih-sf .woocommerce button.button:hover,
body.ih-sf .woocommerce input.button:hover,
body.ih-sf .woocommerce ul.products li.product .button:hover,
body.ih-sf.woocommerce ul.products li.product .button:hover,
body.ih-sf .single_add_to_cart_button:hover,
body.ih-sf .checkout-button:hover,
body.ih-sf #place_order:hover,
body.ih-sf .woocommerce-message .button:hover,
body.ih-sf .wc-proceed-to-checkout .button:hover {
	background-color: var(--ih-blau-dunkel) !important;
	border-color: var(--ih-blau-dunkel) !important;
	color: #fff !important;
}
body.ih-sf .woocommerce .button:focus-visible,
body.ih-sf .single_add_to_cart_button:focus-visible,
body.ih-sf #place_order:focus-visible {
	outline: 3px solid var(--ih-rot);
	outline-offset: 2px;
}
/* „Warenkorb aktualisieren“ ist ohne Änderung inaktiv */
body.ih-sf .woocommerce button.button:disabled,
body.ih-sf .woocommerce button.button[disabled],
body.ih-sf .single_add_to_cart_button.disabled {
	opacity: .45;
	cursor: not-allowed;
}

/* ---------- Preise ---------- */
body.ih-sf .price,
body.ih-sf .price .amount,
body.ih-sf .woocommerce-Price-amount,
body.ih-sf .woocommerce ul.products li.product .price,
body.ih-sf .woocommerce div.product p.price,
body.ih-sf .woocommerce div.product span.price {
	color: var(--ih-blau) !important;
}
body.ih-sf .price del,
body.ih-sf .price del .woocommerce-Price-amount {
	color: var(--ih-grau) !important;
}
body.ih-sf .woocommerce-price-suffix,
body.ih-sf .includes_tax,
body.ih-sf .includes_tax .woocommerce-Price-amount {
	color: var(--ih-grau) !important;
	font-size: .8em;
}

/* OceanWP-Leiste beim Scrollen (dunkler Hintergrund) */
body.ih-sf .owp-floating-bar .price,
body.ih-sf .owp-floating-bar .woocommerce-Price-amount,
body.ih-sf .owp-floating-bar .woocommerce-price-suffix {
	color: #fff !important;
}

/* Desktop: Leiste steht oben → unter dem fixierten Menü statt darüber (Höhe setzt das Skript) */
@media (min-width: 768px) {
	body.ih-sf.single-product .owp-floating-bar { top: var(--ih-sf-kopf, 0px) !important; }
}

/* ---------- Elementor-Kasse mobil: Spalte nicht breiter als der Bildschirm ----------
   Elementor setzt einspaltig „1fr“ (= minmax(auto, 1fr)); die Mindestbreite der Bestellübersicht
   (Großbuchstaben-Kopfzellen mit Sperrung + 20 px Innenabstand) blähte die Spalte auf ~405 px auf. */
@media (max-width: 1024px) {
	body.ih-sf .e-checkout__container { grid-template-columns: minmax(0, 1fr) !important; }
	body.ih-sf .e-checkout__column { min-width: 0; max-width: 100%; }
}
@media (max-width: 767px) {
	body.ih-sf .elementor-widget-woocommerce-checkout-page .woocommerce-checkout-review-order-table { width: 100%; }
	body.ih-sf .elementor-widget-woocommerce-checkout-page .woocommerce-checkout-review-order-table th,
	body.ih-sf .elementor-widget-woocommerce-checkout-page .woocommerce-checkout-review-order-table td {
		padding: 12px 10px !important;
		/* Silbentrennung statt Abschneiden; „anywhere“ nur als Rückfall für überlange Wörter */
		-webkit-hyphens: auto;
		hyphens: auto;
		overflow-wrap: anywhere;
	}
	body.ih-sf .elementor-widget-woocommerce-checkout-page .woocommerce-checkout-review-order-table th {
		letter-spacing: 0 !important;
	}
	body.ih-sf .elementor-widget-woocommerce-checkout-page .woocommerce-checkout-review-order-table thead th {
		font-size: 13px !important;
	}
	body.ih-sf .elementor-widget-woocommerce-checkout-page .woocommerce-checkout-review-order-table .product-total,
	body.ih-sf .elementor-widget-woocommerce-checkout-page .woocommerce-checkout-review-order-table tfoot td { text-align: right; }
}

/* Links in Hinweisen (z. B. Gutschein) */
body.ih-sf .woocommerce-info a,
body.ih-sf .showcoupon,
body.ih-sf .woocommerce-form-coupon-toggle a,
body.ih-sf .e-show-coupon-form {
	color: var(--ih-blau) !important;
	text-decoration: underline;
}

/* ---------- Kategorie-Leiste ---------- */
.ih-sf-leiste {
	margin: 0 0 24px;
}
.ih-sf-leiste ul {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.ih-sf-leiste li { margin: 0; }
.ih-sf-leiste a {
	display: inline-block;
	padding: 9px 18px;
	border: 1px solid var(--ih-blau);
	border-radius: 999px;
	color: var(--ih-blau);
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	transition: background-color .2s ease, color .2s ease;
}
.ih-sf-leiste a:hover,
.ih-sf-leiste a.is-aktiv {
	background: var(--ih-blau);
	color: #fff;
}

/* Filter-Knöpfe auf der Shop-Startseite: gewählt = gefüllt + Haken, abgewählt = Umriss */
.ih-sf-filter .ih-sf-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 40px;
	margin: 0;
	padding: 8px 18px;
	border: 1px solid var(--ih-blau) !important;
	border-radius: 999px !important;
	background: #fff !important;
	color: var(--ih-blau) !important;
	font-size: 14px;
	font-weight: 600;
	letter-spacing: 0;
	line-height: 1.2;
	text-transform: none;
	cursor: pointer;
	transition: background-color .2s ease, color .2s ease;
}
.ih-sf-filter .ih-sf-chip::before {
	content: "";
	width: 0;
	height: 10px;
	border: solid currentColor;
	border-width: 0 2px 2px 0;
	opacity: 0;
	transform: rotate(45deg) translateY(-2px);
	transition: width .2s ease, opacity .2s ease;
}
.ih-sf-filter .ih-sf-chip[aria-pressed="true"] {
	background: var(--ih-blau) !important;
	color: #fff !important;
}
.ih-sf-filter .ih-sf-chip[aria-pressed="true"]::before {
	width: 5px;
	opacity: 1;
}
@media (hover: hover) {
	.ih-sf-filter .ih-sf-chip:hover { background: #e8eef5 !important; }
	.ih-sf-filter .ih-sf-chip[aria-pressed="true"]:hover { background: var(--ih-blau-dunkel) !important; }
}
.ih-sf-filter .ih-sf-chip:focus-visible { outline: 3px solid var(--ih-rot); outline-offset: 2px; }

.ih-sf-gruppe[hidden],
.ih-sf-leiste li[hidden] {
	display: none !important;
}
.ih-sf-gruppe + .ih-sf-gruppe .ih-sf-abschnitt { margin-top: 48px; }
.ih-sf-gruppe.ih-sf-rein { animation: ih-sf-rein .28s ease-out both; }
@keyframes ih-sf-rein {
	from { opacity: 0; transform: translateY(8px); }
	to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
	.ih-sf-gruppe.ih-sf-rein { animation: none; }
	.ih-sf-filter .ih-sf-chip, .ih-sf-filter .ih-sf-chip::before { transition: none; }
}

/* ---------- Abschnitte auf der Shop-Startseite ---------- */
.ih-sf-abschnitt {
	clear: both;
	margin: 8px 0 20px;
	padding-bottom: 10px;
	border-bottom: 3px solid var(--ih-rot);
	color: var(--ih-blau);
	font-size: 24px;
	/* Wert setzt das Skript aus der echten Kopfhöhe (+20 px); Fallback für den ersten Sprung */
	scroll-margin-top: var(--ih-sf-sprung, 170px);
}
.woocommerce .products + .ih-sf-abschnitt,
ul.products + .ih-sf-abschnitt {
	margin-top: 48px;
}
/* Sortierung/Ansicht/Blättern ergeben auf der zweigeteilten Startseite keinen Sinn */
body.ih-sf-start .oceanwp-toolbar,
body.ih-sf-start .woocommerce-pagination,
body.ih-sf-start .woocommerce-result-count,
body.ih-sf-start .woocommerce-ordering {
	display: none !important;
}

/* ---------- Ticketseite: Mengenwahl + Box-Office-Felder ---------- */
body.ih-sf .woocommerce-variation-add-to-cart:has(.wc-box-office-ticket-form),
body.ih-sf form.cart:not(.variations_form):has(.wc-box-office-ticket-form) {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 16px;
}
body.ih-sf .wc-box-office-ticket-form {
	order: 2;
	flex: 1 0 100%;
	margin: 0;
}
body.ih-sf .woocommerce-variation-add-to-cart:has(.wc-box-office-ticket-form) .quantity,
body.ih-sf form.cart:has(.wc-box-office-ticket-form) .quantity {
	order: 1;
	margin: 0 !important;
}
body.ih-sf .woocommerce-variation-add-to-cart:has(.wc-box-office-ticket-form) .single_add_to_cart_button,
body.ih-sf form.cart:has(.wc-box-office-ticket-form) .single_add_to_cart_button {
	order: 3;
	margin: 0 !important;
}

/* ---------- Ticket-Produktseite: Logo höchstens 280 px, vollständig und proportional ---------- */
body.ih-sf.single-product div.product.product_cat-tickets .woocommerce-product-gallery__image img {
	display: block;
	width: auto !important;
	max-width: 100%;
	height: auto !important;
	max-height: 280px;
	margin: 0 auto;
	object-fit: contain;
}
@media (max-width: 767px) {
	body.ih-sf.single-product div.product.product_cat-tickets .woocommerce-product-gallery__image img { max-height: 220px; }
}

/* ---------- Produktseiten: Kaufbutton + Mengenfeld einheitlich 48 px ---------- */
body.ih-sf.single-product form.cart .single_add_to_cart_button {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	height: auto !important;
	max-width: 100%;
	padding: 10px 24px !important;
	line-height: 1.25 !important;
	white-space: normal !important;
	text-align: center;
	vertical-align: middle;
	float: none !important;
}
body.ih-sf.single-product form.cart .quantity {
	display: inline-flex !important;
	align-items: stretch;
	height: 48px;
	vertical-align: middle;
	float: none !important;
	margin-right: 12px;
}
body.ih-sf.single-product form.cart .quantity .minus,
body.ih-sf.single-product form.cart .quantity .plus,
body.ih-sf.single-product form.cart .quantity input.qty {
	display: flex !important;
	align-items: center;
	justify-content: center;
	float: none !important;
	box-sizing: border-box;
	height: 48px !important;
	min-height: 48px;
	margin: 0 !important;
	line-height: 1 !important;
	text-align: center;
}
body.ih-sf.single-product form.cart .quantity .minus,
body.ih-sf.single-product form.cart .quantity .plus { width: 40px !important; }
body.ih-sf.single-product form.cart .quantity input.qty { width: 52px !important; padding: 0 !important; }
/* Mengenfeld und Button auf einer Linie (ohne Box-Office-Ticketfelder) */
body.ih-sf.single-product .woocommerce-variation-add-to-cart:not(:has(.wc-box-office-ticket-form)) {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
}
body.ih-sf.single-product .woocommerce-variation-add-to-cart:not(:has(.wc-box-office-ticket-form)) .quantity { margin-right: 0; }
body.ih-sf.single-product form.cart .single_add_to_cart_button.disabled,
body.ih-sf.single-product form.cart .single_add_to_cart_button:disabled {
	opacity: .45;
	cursor: not-allowed;
}
@media (max-width: 767px) {
	body.ih-sf.single-product form.cart .single_add_to_cart_button { flex: 1 1 200px; }
}

/* ---------- Produktkarten in Shop- und Kategorieübersichten ---------- */
body.ih-sf-liste {
	--ih-sf-bild: 200px;
	--ih-sf-spalten: 3;
}
body.ih-sf-liste ul.products {
	display: grid !important;
	grid-template-columns: repeat(var(--ih-sf-spalten), minmax(0, 1fr));
	gap: 40px 28px;
	margin: 0 0 24px !important;
	padding: 0;
}
body.ih-sf-liste ul.products::before,
body.ih-sf-liste ul.products::after {
	content: none !important;
	display: none !important;
}
body.ih-sf-liste ul.products li.product {
	display: flex;
	flex-direction: column;
	float: none !important;
	clear: none !important;
	width: auto !important;
	margin: 0 !important;
	padding: 0 !important;
}
body.ih-sf-liste ul.products li.product .product-inner,
body.ih-sf-liste ul.products li.product ul.woo-entry-inner {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
}
/* Einheitlicher Bildbereich: ganzes Logo/Foto sichtbar, mittig, nicht beschnitten */
body.ih-sf-liste ul.products li.product li.image-wrap .woo-entry-image {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	height: var(--ih-sf-bild);
	margin: 0 0 14px;
}
body.ih-sf-liste ul.products li.product li.image-wrap .woo-entry-image > a.woocommerce-LoopProduct-link {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
}
/* OceanWP-Hoverbild: liegt deckungsgleich darüber und erscheint nur beim Überfahren */
body.ih-sf-liste ul.products li.product li.image-wrap .woo-entry-image img.woo-entry-image-secondary {
	position: absolute;
	inset: 0;
	opacity: 0 !important;
	transition: opacity .3s ease;
	pointer-events: none;
}
@media (hover: hover) {
	body.ih-sf-liste ul.products li.product li.image-wrap .woo-entry-image-swap:hover img.woo-entry-image-secondary { opacity: 1 !important; }
	body.ih-sf-liste ul.products li.product li.image-wrap .woo-entry-image-swap:hover img.woo-entry-image-main { opacity: 0 !important; }
}
body.ih-sf-liste ul.products li.product li.image-wrap .woo-entry-image img.woo-entry-image-main { opacity: 1; transition: opacity .3s ease; }
body.ih-sf-liste ul.products li.product li.image-wrap .woo-entry-image img {
	display: block;
	width: 100% !important;
	height: 100% !important;
	max-width: 100%;
	object-fit: contain;
	object-position: center;
}
/* Titel vollständig, Preis + Button je Zeile auf gleicher Höhe */
body.ih-sf-liste ul.products li.product li.title,
body.ih-sf-liste ul.products li.product li.title h2,
body.ih-sf-liste ul.products li.product li.title a {
	white-space: normal !important;
	overflow: visible !important;
	text-overflow: clip !important;
	-webkit-line-clamp: unset !important;
	height: auto !important;
}
body.ih-sf-liste ul.products li.product li.price-wrap {
	margin-top: auto;
	padding-top: 8px;
}
body.ih-sf-liste ul.products li.product li.btn-wrap {
	margin-top: 4px;
}
body.ih-sf-liste ul.products li.product li.rating:empty { display: none; }
body.ih-sf-liste ul.products li.product li.title { margin-bottom: 8px !important; }
body.ih-sf-liste ul.products li.product li.price-wrap { margin-bottom: 10px !important; }

@media (max-width: 959px) {
	body.ih-sf-liste { --ih-sf-bild: 170px; --ih-sf-spalten: 2; }
	body.ih-sf-liste ul.products { gap: 32px 20px; }
}

@media (max-width: 767px) {
	body.ih-sf-liste { --ih-sf-bild: 150px; --ih-sf-spalten: 1; }
	body.ih-sf-liste ul.products { gap: 28px; }
	body.ih-sf-liste ul.products li.product li.image-wrap .woo-entry-image { margin-bottom: 10px; }
	body.ih-sf-liste ul.products li.product li.image-wrap { margin-bottom: 8px !important; }
	body.ih-sf-liste ul.products li.product li.price-wrap { padding-top: 0; }
	.ih-sf-abschnitt { font-size: 20px; }
	.ih-sf-leiste a { padding: 8px 14px; }
}
