/*
 * Produktseite – Angebot-Formular (Lightbox des Plugins "Offers for WooCommerce")
 *
 * Das Plugin rendert das "Angebot machen"-Formular als Lightbox
 * (#lightbox_custom_ofwc_offer_form) mit eigenem Stylesheet
 * (offers-for-woocommerce/public/assets/css/public.css). Das Markup kommt aus
 * dem Plugin und ist nicht mit Elementor-Controls erreichbar, daher wird es
 * hier im Look der Produktseite (Schibsted Grotesk, eckig, Akzent #00a2ff)
 * überschrieben. Plugin-Dateien bleiben unangetastet, so überlebt das Design
 * Plugin-Updates.
 *
 * Die Selektoren hängen an #lightbox_custom_ofwc_offer_form, weil das
 * Plugin-CSS mit bis zu zwei IDs arbeitet (z. B. #woocommerce-make-offer-form
 * + #woocommerce-make-offer-form-price-each) – nur so gewinnt dieses
 * Stylesheet unabhängig von der Ladereihenfolge.
 * Geladen nur auf Einzelprodukt-Seiten (functions.php).
 */

#lightbox_custom_ofwc_offer_form {
	--hk-font: "Schibsted Grotesk", sans-serif;
	--hk-ink: #1a1815;
	--hk-body: #33312c;
	--hk-muted: #6b6862;
	--hk-label: #9b978f;
	--hk-accent: #00a2ff;
	--hk-accent-hover: #0090e3;
	--hk-border: #e6e3dd;
	--hk-border-strong: #d8d4cc;
	--hk-divider: #edeae4;
	--hk-bg: #f6f5f3;
	--hk-green: #1f9d55;
	--hk-danger: #e0562e;
}

/* ---------------------------------------------------------------- Grundzustand (versteckt)
 * Das Plugin blendet Lightbox und Hinweise per eigenem Stylesheet aus und
 * per jQuery (show/hide/slideToggle → Inline-Style) wieder ein. Fehlt dessen
 * CSS (Cache, Minify, Ladereihenfolge), stünden alle Meldungen offen auf der
 * Produktseite. Der Grundzustand wird deshalb hier selbst gesetzt; Inline-Styles
 * des Plugin-JS gewinnen weiterhin. */
#lightbox_custom_ofwc_offer_form,
#lightbox_custom_ofwc_offer_form_close_btn,
#lightbox_custom_ofwc_offer_form > #tab_custom_ofwc_offer_tab_alt_message,
#lightbox_custom_ofwc_offer_form > #tab_custom_ofwc_offer_tab_alt_message_2,
#lightbox_custom_ofwc_offer_form > #tab_custom_ofwc_offer_tab_alt_message_3,
#lightbox_custom_ofwc_offer_form > #tab_custom_ofwc_offer_tab_alt_message_custom,
#lightbox_custom_ofwc_offer_form > #tab_custom_ofwc_offer_tab_alt_message_success {
	display: none;
}

#lightbox_custom_ofwc_offer_form {
	position: fixed;
	z-index: 999999;
	inset: 0;
}

#lightbox_custom_ofwc_offer_form_close_btn {
	position: fixed;
	z-index: 99;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
}

#lightbox_custom_ofwc_offer_form > #tab_custom_ofwc_offer_tab_inner {
	display: block;
}

/* ---------------------------------------------------------------- Overlay + Dialog */
#lightbox_custom_ofwc_offer_form_close_btn {
	background: #0b0e13;
	opacity: 0.55;
	cursor: pointer;
}

#lightbox_custom_ofwc_offer_form {
	box-sizing: border-box;
	width: calc(100% - 32px);
	max-width: 540px;
	min-height: 0;
	height: fit-content;
	max-height: calc(100vh - 48px);
	padding: 0;
	margin: auto;
	overflow-x: hidden;
	overflow-y: auto;
	background: #fff;
	border: 0;
	border-radius: 0;
	box-shadow: 0 24px 64px rgba(11, 14, 19, 0.28);
	font-family: var(--hk-font);
	color: var(--hk-body);
	-webkit-font-smoothing: antialiased;
	scrollbar-width: thin;
	scrollbar-color: var(--hk-border-strong) transparent;
}

#lightbox_custom_ofwc_offer_form *,
#lightbox_custom_ofwc_offer_form *::before,
#lightbox_custom_ofwc_offer_form *::after {
	box-sizing: border-box;
}

#lightbox_custom_ofwc_offer_form div.tab_custom_ofwc_offer_tab_inner_content {
	padding: 0;
}

#lightbox_custom_ofwc_offer_form > div.tab_custom_ofwc_offer_tab_inner_content {
	padding-left: 40px;
	padding-right: 40px;
}

#lightbox_custom_ofwc_offer_form > #tab_custom_ofwc_offer_tab_inner {
	padding-top: 40px;
	padding-bottom: 40px;
}

/* ---------------------------------------------------------------- Schließen */
#lightbox_custom_ofwc_offer_form #aeofwc-close-lightbox-link {
	position: sticky;
	top: 0;
	z-index: 5;
	height: 0;
}

#lightbox_custom_ofwc_offer_form #aeofwc-close-lightbox-link a {
	position: absolute;
	top: 14px;
	right: 14px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	font-size: 22px;
	font-weight: 400;
	line-height: 1;
	color: var(--hk-ink);
	background: #fff;
	border: 1px solid var(--hk-border);
	text-decoration: none;
	box-shadow: none;
	transition: border-color 0.15s ease, color 0.15s ease;
}

#lightbox_custom_ofwc_offer_form #aeofwc-close-lightbox-link a:hover,
#lightbox_custom_ofwc_offer_form #aeofwc-close-lightbox-link a:focus-visible {
	color: var(--hk-accent);
	border-color: var(--hk-accent);
}

/* ---------------------------------------------------------------- Kopf */
#lightbox_custom_ofwc_offer_form fieldset {
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	box-shadow: none;
}

#lightbox_custom_ofwc_offer_form .make-offer-form-intro {
	padding: 0 40px 24px 0;
	margin: 0 0 28px;
	border-bottom: 1px solid var(--hk-divider);
	color: var(--hk-muted);
	text-shadow: none;
}

#lightbox_custom_ofwc_offer_form .make-offer-form-intro h2 {
	margin: 0 0 10px;
	font-family: var(--hk-font);
	font-size: 28px;
	font-weight: 700;
	line-height: 1.1;
	letter-spacing: -0.8px;
	color: var(--hk-ink);
}

#lightbox_custom_ofwc_offer_form .make-offer-form-intro .make-offer-form-intro-text {
	margin: 0;
	font-size: 15px;
	line-height: 1.5;
	color: var(--hk-muted);
}

#lightbox_custom_ofwc_offer_form .make-offer-form-outro {
	padding: 0;
	color: var(--hk-muted);
	text-shadow: none;
}

#lightbox_custom_ofwc_offer_form .make-offer-form-outro-text:empty {
	display: none;
}

/* ---------------------------------------------------------------- Formular */
#lightbox_custom_ofwc_offer_form fieldset form#woocommerce-make-offer-form {
	margin: 0;
}

#lightbox_custom_ofwc_offer_form #woocommerce-make-offer-form .woocommerce-make-offer-form-section {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0 16px;
	width: 100%;
	margin: 0 0 18px;
	padding: 0;
	clear: both;
}

#lightbox_custom_ofwc_offer_form #woocommerce-make-offer-form .woocommerce-make-offer-form-part-left {
	float: none;
	width: auto;
	margin: 0;
	min-width: 0;
}

#lightbox_custom_ofwc_offer_form #woocommerce-make-offer-form .woocommerce-make-offer-form-part-full {
	float: none;
	grid-column: 1 / -1;
	width: 100%;
	margin: 0;
	min-width: 0;
}

#lightbox_custom_ofwc_offer_form #woocommerce-make-offer-form .woocommerce-make-offer-form-section label {
	display: block;
	float: none;
	position: static;
	margin: 0 0 8px;
	padding: 0;
	font-family: var(--hk-font);
	font-size: 13px;
	font-weight: 600;
	line-height: 1.3;
	color: var(--hk-ink);
}

#lightbox_custom_ofwc_offer_form #woocommerce-make-offer-form .woocommerce-make-offer-form-section input[type="text"],
#lightbox_custom_ofwc_offer_form #woocommerce-make-offer-form .woocommerce-make-offer-form-section input[type="email"],
#lightbox_custom_ofwc_offer_form #woocommerce-make-offer-form .woocommerce-make-offer-form-section input[type="tel"],
#lightbox_custom_ofwc_offer_form #woocommerce-make-offer-form .woocommerce-make-offer-form-section textarea#angelleye-offer-notes {
	display: block;
	float: none;
	width: 100%;
	max-width: 100%;
	height: auto;
	margin: 0;
	padding: 12px 14px;
	font-family: var(--hk-font);
	font-size: 15px;
	line-height: 1.4;
	color: var(--hk-ink);
	background: #fff;
	border: 1px solid var(--hk-border-strong);
	border-radius: 0;
	box-shadow: none;
	outline: none;
	-webkit-appearance: none;
	appearance: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

#lightbox_custom_ofwc_offer_form #woocommerce-make-offer-form .woocommerce-make-offer-form-section textarea#angelleye-offer-notes {
	min-height: 120px;
	resize: vertical;
}

#lightbox_custom_ofwc_offer_form #woocommerce-make-offer-form .woocommerce-make-offer-form-section input[type="text"]:focus,
#lightbox_custom_ofwc_offer_form #woocommerce-make-offer-form .woocommerce-make-offer-form-section input[type="email"]:focus,
#lightbox_custom_ofwc_offer_form #woocommerce-make-offer-form .woocommerce-make-offer-form-section input[type="tel"]:focus,
#lightbox_custom_ofwc_offer_form #woocommerce-make-offer-form .woocommerce-make-offer-form-section textarea#angelleye-offer-notes:focus {
	border-color: var(--hk-accent);
	box-shadow: 0 0 0 3px rgba(0, 162, 255, 0.14);
}

/* Vorbelegte, gesperrte Felder (Gegenangebot) */
#lightbox_custom_ofwc_offer_form #woocommerce-make-offer-form .woocommerce-make-offer-form-section input[type="text"]:disabled,
#lightbox_custom_ofwc_offer_form #woocommerce-make-offer-form .woocommerce-make-offer-form-section input[type="email"]:disabled,
#lightbox_custom_ofwc_offer_form #woocommerce-make-offer-form .woocommerce-make-offer-form-section input[type="tel"]:disabled {
	color: var(--hk-muted);
	background: var(--hk-bg);
	border: 1px solid var(--hk-border);
	cursor: not-allowed;
}

/* ---------------------------------------------------------------- Preisfelder mit €-Vorsatz */
#lightbox_custom_ofwc_offer_form .angelleye-input-group {
	display: flex;
	align-items: stretch;
	width: 100%;
}

#lightbox_custom_ofwc_offer_form .angelleye-input-group .angelleye-input-group-addon {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: auto;
	padding: 0 14px;
	font-family: var(--hk-font);
	font-size: 15px;
	font-weight: 600;
	line-height: 1;
	color: var(--hk-muted);
	background: var(--hk-bg);
	border: 1px solid var(--hk-border-strong);
	border-right: 0;
	border-radius: 0;
}

#lightbox_custom_ofwc_offer_form #woocommerce-make-offer-form .woocommerce-make-offer-form-section .angelleye-input-group input[type="text"] {
	flex: 1 1 auto;
	width: 100%;
	min-width: 0;
	border-left: 0;
}

#lightbox_custom_ofwc_offer_form #woocommerce-make-offer-form .woocommerce-make-offer-form-section .angelleye-input-group input#woocommerce-make-offer-form-total {
	color: var(--hk-ink);
	font-weight: 600;
	background: var(--hk-bg);
	border: 1px solid var(--hk-border);
	border-left: 0;
	cursor: not-allowed;
}

/* ---------------------------------------------------------------- Absenden */
#lightbox_custom_ofwc_offer_form #woocommerce-make-offer-form .woocommerce-make-offer-form-section-submit {
	display: block;
	margin: 8px 0 0;
}

#lightbox_custom_ofwc_offer_form #woocommerce-make-offer-form input#woocommerce-make-offer-form-submit-button {
	display: block;
	float: none;
	width: 100%;
	margin: 0;
	padding: 16px 28px;
	font-family: var(--hk-font);
	font-size: 15px;
	font-weight: 600;
	line-height: 1;
	text-align: center;
	color: #fff;
	background: var(--hk-accent);
	border: 0;
	border-radius: 0;
	box-shadow: none;
	text-shadow: none;
	cursor: pointer;
	transition: background-color 0.2s ease;
}

#lightbox_custom_ofwc_offer_form #woocommerce-make-offer-form input#woocommerce-make-offer-form-submit-button:hover,
#lightbox_custom_ofwc_offer_form #woocommerce-make-offer-form input#woocommerce-make-offer-form-submit-button:focus-visible {
	color: #fff;
	background: var(--hk-accent-hover);
}

#lightbox_custom_ofwc_offer_form #woocommerce-make-offer-form input#woocommerce-make-offer-form-submit-button:disabled {
	opacity: 0.6;
	cursor: wait;
}

#lightbox_custom_ofwc_offer_form #woocommerce-make-offer-form .woocommerce-make-offer-form-section-submit .offer-submit-loader {
	float: none;
	height: auto;
	margin-top: 12px;
	padding: 6px 0 6px 45px;
	line-height: 22px;
	font-size: 14px;
	font-style: normal;
	color: var(--hk-muted);
}

/* ---------------------------------------------------------------- reCAPTCHA */
#lightbox_custom_ofwc_offer_form .g-recaptcha {
	grid-column: 1 / -1;
	max-width: 100%;
	overflow: hidden;
}

/* ---------------------------------------------------------------- Hinweise (Fehler / Erfolg / Mindestpreis) */
#lightbox_custom_ofwc_offer_form ul.woocommerce-error,
#lightbox_custom_ofwc_offer_form ul.woocommerce-message,
#lightbox_custom_ofwc_offer_form .woocommerce-info {
	margin: 0 0 20px;
	padding: 14px 16px;
	font-family: var(--hk-font);
	font-size: 14px;
	line-height: 1.5;
	list-style: none;
	color: var(--hk-ink);
	background: var(--hk-bg);
	border: 0;
	border-left: 3px solid var(--hk-accent);
	border-radius: 0;
	box-shadow: none;
	word-wrap: break-word;
}

#lightbox_custom_ofwc_offer_form ul.woocommerce-error {
	background: #fdf0ec;
	border-left-color: var(--hk-danger);
}

#lightbox_custom_ofwc_offer_form ul.woocommerce-message {
	background: #e7f6ec;
	border-left-color: var(--hk-green);
}

#lightbox_custom_ofwc_offer_form ul.woocommerce-error::before,
#lightbox_custom_ofwc_offer_form ul.woocommerce-message::before,
#lightbox_custom_ofwc_offer_form .woocommerce-info::before {
	display: none;
}

#lightbox_custom_ofwc_offer_form ul.woocommerce-error li,
#lightbox_custom_ofwc_offer_form ul.woocommerce-message li {
	margin: 0;
	padding: 0;
	list-style: none;
}

/* Erfolg: Formular ist ausgeblendet, Dialog bleibt oben bündig */
#lightbox_custom_ofwc_offer_form > #tab_custom_ofwc_offer_tab_alt_message_success,
#lightbox_custom_ofwc_offer_form > #tab_custom_ofwc_offer_tab_alt_message,
#lightbox_custom_ofwc_offer_form > #tab_custom_ofwc_offer_tab_alt_message_2,
#lightbox_custom_ofwc_offer_form > #tab_custom_ofwc_offer_tab_alt_message_custom,
#lightbox_custom_ofwc_offer_form > #tab_custom_ofwc_offer_tab_alt_message_3 {
	padding-top: 60px; /* unter dem Schließen-Knopf */
	padding-bottom: 0;
}

/* ---------------------------------------------------------------- Mobil */
@media (max-width: 767px) {
	#lightbox_custom_ofwc_offer_form {
		width: calc(100% - 24px);
		max-height: calc(100vh - 24px);
	}

	#lightbox_custom_ofwc_offer_form > div.tab_custom_ofwc_offer_tab_inner_content {
		padding-left: 20px;
		padding-right: 20px;
	}

	#lightbox_custom_ofwc_offer_form > #tab_custom_ofwc_offer_tab_inner {
		padding-top: 28px;
		padding-bottom: 28px;
	}

	#lightbox_custom_ofwc_offer_form .make-offer-form-intro {
		padding-right: 36px;
		margin-bottom: 22px;
	}

	#lightbox_custom_ofwc_offer_form .make-offer-form-intro h2 {
		font-size: 24px;
		letter-spacing: -0.6px;
	}

	#lightbox_custom_ofwc_offer_form #aeofwc-close-lightbox-link a {
		top: 10px;
		right: 10px;
	}
}
