/**
 * Kubi Produktoptionen – Produktseiten-Layout im Fischbacher-Stil.
 * Eine Zeile je Produktart: Bild links, Auswahl + Warenkorb rechts.
 */

.kubi-po {
	margin: 24px 0 0;
}

.kubi-po-row {
	border-top: 1px solid rgba(0, 0, 0, 0.12);
	padding: 22px 0;
}

.kubi-po-row:last-child {
	border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}

/* Kopfzeile: Produktart links, "ab …" rechts */
.kubi-po-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 14px;
}

.kubi-po-title {
	margin: 0;
	font-size: 14px;
	line-height: 1.3;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	font-weight: 600;
}

.kubi-po-price {
	flex: 0 1 auto;
	max-width: 55%;
	font-size: 14px;
	line-height: 1.35;
	text-align: right;
}

.kubi-po-price .woocommerce-Price-amount {
	font-weight: 600;
	white-space: nowrap;
}

/* Pflichtangaben (inkl. MwSt. / Versand) klein unter den Betrag. */
.kubi-po-price .woocommerce-price-suffix {
	display: block;
	margin-top: 2px;
	font-size: 11px;
	font-weight: 400;
	opacity: 0.6;
}

/* Körper: Bild + Formular nebeneinander */
.kubi-po-body {
	display: flex;
	align-items: flex-start;
	gap: 22px;
}

.kubi-po-media {
	flex: 0 0 110px;
	max-width: 110px;
	text-align: center;
}

.kubi-po-media:empty {
	display: none;
}

.kubi-po-thumb {
	display: block;
	width: 100%;
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
	appearance: none;
}

button.kubi-po-thumb:hover img,
.kubi-po-details:hover {
	opacity: 0.8;
}

.kubi-po-thumb img {
	display: block;
	width: 100%;
	height: auto;
}

.kubi-po-details {
	display: inline-block;
	margin-top: 10px;
	padding: 0;
	border: 0;
	background: none;
	font: inherit;
	font-size: 11px;
	line-height: 1.3;
	text-decoration: underline;
	cursor: pointer;
	opacity: 0.75;
}

.kubi-po-details:hover {
	opacity: 1;
}

/* Formular */
.kubi-po-form {
	flex: 1 1 auto;
	min-width: 0;
	margin: 0;
}

.kubi-po-form table.variations {
	width: 100%;
	margin: 0 0 10px;
	border: 0;
	background: none;
}

.kubi-po-form table.variations tr,
.kubi-po-form table.variations td {
	display: block;
	width: 100%;
	padding: 0;
	border: 0;
	background: none;
	text-align: left;
}

.kubi-po-form table.variations tr + tr {
	margin-top: 8px;
}

.kubi-po-form table.variations select {
	width: 100%;
	max-width: none;
	height: 42px;
	margin: 0;
}

/*
 * Das Theme ersetzt native Selects durch "Select or Die" (span.sod_select).
 * Die Breite muss dort gesetzt werden, nicht am versteckten <select>.
 */
.kubi-po-form .sod_select {
	display: block;
	width: 100%;
	max-width: none;
	margin: 0;
	text-align: left;
}

.kubi-po-form .sod_select .sod_list_wrapper {
	width: 100%;
}

/* "Select or Die" richtet sein Label rechts aus – hier soll es links stehen. */
.kubi-po-form .sod_select .sod_label,
.kubi-po-form .sod_select .sod_option {
	text-align: left;
}

/* Der Hinweis-Link "Clear" wird pro Zeile nicht gebraucht. */
.kubi-po-form .reset_variations {
	display: none !important;
}

/* Der Preis steht schon in der Kopfzeile. */
.kubi-po-form .woocommerce-variation-price {
	display: none;
}

.kubi-po-form .woocommerce-variation-availability,
.kubi-po-form .woocommerce-variation-description {
	font-size: 12px;
	margin: 0 0 8px;
}

.kubi-po-form .woocommerce-variation-add-to-cart {
	display: flex;
	align-items: stretch;
	gap: 10px;
}

/* Das Theme wickelt die Menge in .kubi-quantity-wrap – das ist das Flex-Kind. */
.kubi-po-form .kubi-quantity-wrap {
	flex: 0 0 116px;
	margin: 0;
	text-align: left;
}

/*
 * Das Theme legt im Mengenfeld ein absolut positioniertes Label "Anzahl" über
 * die Zahl. In der schmalen Zeilenspalte überlappt das. Die Theme-Regel hat
 * Spezifität (0,5,1), deshalb hier bewusst sechs eigene Klassen – so bleibt der
 * Override unabhängig von den Theme-Wrappern und braucht kein !important.
 */
.kubi-po .kubi-po-row .kubi-po-form .single_variation_wrap .woocommerce-variation-add-to-cart .kubi-quantity-wrap label {
	display: none;
}

.kubi-po-form .quantity {
	width: 100%;
	margin: 0;
}

.kubi-po-form .quantity input,
.kubi-po-form .quantity select {
	height: 42px;
	margin: 0;
}

.kubi-po-form .single_add_to_cart_button {
	flex: 1 1 auto;
	height: 42px;
	margin: 0;
	white-space: nowrap;
}

/*
 * Der Deaktiviert-Zustand kommt vom Theme (.single_add_to_cart_button.disabled,
 * von WooCommerce' JS gesetzt) – hier bewusst nichts eigenes drüberlegen, sonst
 * sieht der Button anders aus als auf den übrigen Produktseiten.
 */

@media (max-width: 600px) {
	.kubi-po-body {
		gap: 14px;
	}

	.kubi-po-media {
		flex-basis: 84px;
		max-width: 84px;
	}

	.kubi-po-form .kubi-quantity-wrap {
		flex: 0 0 96px;
	}
}

/* Fallback, falls das Theme .screen-reader-text nicht selbst definiert. */
.kubi-po-form .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}


/* ---------------------------------------------------------------------
 * Panel hinter "Foto und Details"
 * Liegt fertig im HTML und ist nur versteckt – funktioniert damit auch
 * ohne JavaScript (dann als normaler Abschnitt) und bleibt cachebar.
 * ------------------------------------------------------------------ */

.kubi-po-panel[hidden] {
	display: none;
}

.kubi-po-panel {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	background: rgba(0, 0, 0, 0.55);
}

.kubi-po-panel-inner {
	position: relative;
	display: flex;
	gap: 28px;
	width: 100%;
	max-width: 860px;
	max-height: 86vh;
	overflow-y: auto;
	padding: 28px;
	background: #fff;
}

.kubi-po-panel-close {
	position: absolute;
	top: 8px;
	right: 12px;
	padding: 4px 8px;
	border: 0;
	background: none;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	opacity: 0.6;
}

.kubi-po-panel-close:hover {
	opacity: 1;
}

.kubi-po-panel-media {
	flex: 0 0 42%;
	max-width: 42%;
}

.kubi-po-panel-media img {
	display: block;
	width: 100%;
	height: auto;
}

.kubi-po-panel-text {
	flex: 1 1 auto;
	min-width: 0;
}

.kubi-po-panel-title {
	margin: 0 0 14px;
	font-size: 18px;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.kubi-po-panel-body {
	font-size: 14px;
	line-height: 1.65;
}

.kubi-po-panel-body p {
	margin: 0 0 1em;
}

.kubi-po-panel-more {
	margin: 18px 0 0;
	font-size: 13px;
}

@media (max-width: 700px) {
	.kubi-po-panel-inner {
		flex-direction: column;
		gap: 18px;
		padding: 22px 18px;
	}

	.kubi-po-panel-media {
		flex-basis: auto;
		max-width: 100%;
	}
}
