/**
 * WooCommerce product pages in Scribigo CI (all products, subscriptions included since 2026-10-20).
 * Tokens mirror scribigo-login-card.css (cream stage, floating card, orange primary).
 * Scope: body.scribigo-woo-product for the visual CI (every product page), body.scribigo-woo-qty-locked for the quantity lock
 * (subscriptions + Buchsatz; see includes/scribigo-woo-product-ui.php).
 * Sale-badge hide also applies on shop/archive (stylesheet loads there too).
 */

body.scribigo-woo-product {
	--sgwp-bg: var(--ast-global-color-5, #f7f3ec);
	--sgwp-card: #fffdf8;
	--sgwp-fg: var(--ast-global-color-2, #2b2418);
	--sgwp-muted: var(--ast-global-color-3, #74695c);
	--sgwp-primary: var(--ast-global-color-0, #e06a1a);
	--sgwp-primary-fg: #fffdf8;
	--sgwp-border: color-mix(in srgb, var(--sgwp-fg) 14%, #f3eee6);
	--sgwp-radius: 20px;
	--sgwp-shadow: 0 22px 50px -32px color-mix(in srgb, var(--sgwp-fg) 28%, transparent);

	background:
		radial-gradient(1200px 480px at 50% -10%, color-mix(in srgb, var(--sgwp-primary) 10%, transparent), transparent 70%),
		linear-gradient(180deg, var(--sgwp-bg) 0%, #f3eee6 48%, #efe8dc 100%);
}

body.scribigo-woo-product #content,
body.scribigo-woo-product .site-content,
body.scribigo-woo-product .ast-woocommerce-container {
	background: transparent;
}

/* 1 — No product photo: gallery, lightbox link, sticky-bar thumbnail. */
body.scribigo-woo-product div.product div.images,
body.scribigo-woo-product .woocommerce-product-gallery,
body.scribigo-woo-product .woocommerce-product-gallery__wrapper,
body.scribigo-woo-product .woocommerce-product-gallery__image,
body.scribigo-woo-product .woocommerce-product-gallery__trigger,
body.scribigo-woo-product .flex-control-thumbs,
body.scribigo-woo-product .ast-woo-single-product-gallery-wrap,
body.scribigo-woo-product .ast-sticky-add-to-cart-title-wrap > img {
	display: none !important;
}

/* Sale badge: Woo/Astra “Angebot!” (span.onsale.circle). PHP unhooks first;
   this hides leftovers on the product card, related loops, shop and archives. */
body.scribigo-woo-product span.onsale,
body.scribigo-woo-product .onsale.circle,
body.scribigo-woo-product .ast-onsale-card,
body.scribigo-woo-product [data-notification="default"].onsale,
body.scribigo-woo-subscription-product span.onsale,
body.scribigo-woo-subscription-product .onsale.circle,
body.woocommerce span.onsale,
body.woocommerce-page span.onsale,
body.woocommerce .onsale.circle,
body.woocommerce-page .onsale.circle,
body.woocommerce .ast-onsale-card,
body.woocommerce-page .ast-onsale-card,
body.woocommerce-shop span.onsale,
body.archive.woocommerce span.onsale,
.wc-block-grid__product-onsale {
	display: none !important;
}

/* Astra reserves 46% for the summary next to the image column. */
body.scribigo-woo-product.woocommerce div.product div.summary,
body.scribigo-woo-product.woocommerce-page div.product div.summary,
body.scribigo-woo-product.woocommerce #content div.product div.summary,
body.scribigo-woo-product.woocommerce-page #content div.product div.summary {
	float: none !important;
	clear: both !important;
	width: 100% !important;
	max-width: 46rem;
	margin: 0 auto 2em !important;
	box-sizing: border-box;
	padding: clamp(20px, 3vw, 34px);
	border: 1px solid var(--sgwp-border);
	border-radius: var(--sgwp-radius);
	background: var(--sgwp-card);
	box-shadow:
		var(--sgwp-shadow),
		0 1px 0 color-mix(in srgb, #fff 70%, transparent);
	color: var(--sgwp-fg);
}

body.scribigo-woo-product div.product .product_title.entry-title {
	margin: 0 0 6px;
	font-family: Outfit, ui-sans-serif, system-ui, sans-serif;
	font-size: clamp(1.9rem, 1.2rem + 1.8vw, 2.5rem);
	font-weight: 600;
	line-height: 1.05;
	letter-spacing: -0.02em;
	color: var(--sgwp-fg);
}

body.scribigo-woo-product div.product .summary > p.price,
body.scribigo-woo-product div.product .summary > p.price .woocommerce-Price-amount {
	color: var(--sgwp-primary);
	font-size: 1.5rem;
	font-weight: 600;
	line-height: 1.2;
}

body.scribigo-woo-product div.product .summary > p.price {
	margin: 0 0 1.25em;
}

body.scribigo-woo-product div.product .summary .woocommerce-product-details__short-description {
	color: var(--sgwp-muted);
}

/* 2 — Quantity: subscriptions and Buchsatz are sold individually (hidden input
   + empty Astra -/+ chrome). Other one-off products keep a working picker, so
   this must not use the standard product class. */
body.scribigo-woo-qty-locked form.cart .quantity,
body.scribigo-woo-qty-locked form.cart .ast-qty-placeholder,
body.scribigo-woo-qty-locked .ast-sticky-add-to-cart form.cart .quantity,
body.scribigo-woo-subscription-product form.cart .quantity,
body.scribigo-woo-subscription-product form.cart .ast-qty-placeholder,
body.scribigo-woo-subscription-product .ast-sticky-add-to-cart form.cart .quantity {
	display: none !important;
}

body.scribigo-woo-product div.product form.cart {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 12px;
	margin-bottom: 0;
}

/* Visible picker (non-subscription products): the Astra -/+ links and the input
   become one bordered stepper, so only the group carries border, radius and
   focus ring. Astra lays the row out with a 38px negative-margin overlap and
   puts a border on each link (astra_add_to_cart_quantity_btn_enabled CSS),
   both reset here. */
body.scribigo-woo-product form.cart .quantity {
	display: inline-flex;
	box-sizing: border-box;
	overflow: hidden;
	min-height: 44px;
	border: 1px solid var(--sgwp-border);
	border-radius: 12px;
	background: #fff;
	box-shadow: 0 1px 2px color-mix(in srgb, var(--sgwp-fg) 5%, transparent);
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
	align-items: stretch;
}

body.scribigo-woo-product form.cart .quantity:focus-within {
	border-color: var(--sgwp-primary);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--sgwp-primary) 16%, transparent);
}

body.scribigo-woo-product form.cart .quantity input.qty {
	width: 3.25em;
	max-width: none;
	min-height: 0;
	margin: 0;
	padding: 0 4px;
	border: 0;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
	color: var(--sgwp-fg);
	font-weight: 600;
	text-align: center;
}

body.scribigo-woo-product form.cart .quantity input.qty:focus {
	box-shadow: none;
	outline: none;
}

body.scribigo-woo-product form.cart .quantity .minus,
body.scribigo-woo-product form.cart .quantity .plus {
	display: flex;
	flex: 0 0 auto;
	width: 38px;
	margin: 0;
	padding: 0;
	border: 0 solid var(--sgwp-border);
	border-radius: 0;
	background: transparent;
	color: var(--sgwp-muted);
	font-size: 1.05rem;
	font-weight: 500;
	line-height: 1;
	text-decoration: none;
	transition: background-color 0.15s ease, color 0.15s ease;
	align-items: center;
	justify-content: center;
}

body.scribigo-woo-product form.cart .quantity .minus {
	border-right-width: 1px;
}

body.scribigo-woo-product form.cart .quantity .plus {
	border-left-width: 1px;
}

body.scribigo-woo-product form.cart .quantity .minus:hover,
body.scribigo-woo-product form.cart .quantity .minus:focus,
body.scribigo-woo-product form.cart .quantity .plus:hover,
body.scribigo-woo-product form.cart .quantity .plus:focus {
	background: color-mix(in srgb, var(--sgwp-primary) 10%, #fff);
	color: var(--sgwp-primary);
}

body.scribigo-woo-product div.product form.cart .single_add_to_cart_button {
	width: 100%;
	padding: 14px 24px;
	border: 0;
	border-radius: 14px;
	background-color: var(--sgwp-primary);
	color: var(--sgwp-primary-fg);
	font-family: Outfit, ui-sans-serif, system-ui, sans-serif;
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.2;
	text-transform: none;
	transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

body.scribigo-woo-product div.product form.cart .single_add_to_cart_button:hover,
body.scribigo-woo-product div.product form.cart .single_add_to_cart_button:focus {
	background-color: color-mix(in srgb, var(--sgwp-primary) 88%, #000);
	box-shadow: 0 14px 28px -18px color-mix(in srgb, var(--sgwp-primary) 80%, transparent);
	transform: translateY(-1px);
}

/* 3 — Reviews are off; description stays but loses the tab chrome. */
body.scribigo-woo-product #reviews,
body.scribigo-woo-product .woocommerce-Reviews,
body.scribigo-woo-product .woocommerce-Tabs-panel--reviews,
body.scribigo-woo-product .woocommerce-tabs li.reviews_tab,
body.scribigo-woo-product .woocommerce-product-rating {
	display: none !important;
}

/* Single remaining tab (Beschreibung) — the bar carries no information. */
body.scribigo-woo-product .woocommerce-tabs ul.tabs:not(:has(li + li)) {
	display: none !important;
}

body.scribigo-woo-product div.product .woocommerce-tabs {
	padding-top: 0;
	margin-bottom: 2.5em;
}

/* Astra styles the panel as `.woocommerce div.product .woocommerce-tabs .panel`. */
body.scribigo-woo-product.woocommerce div.product .woocommerce-tabs .woocommerce-Tabs-panel,
body.scribigo-woo-product.woocommerce-page div.product .woocommerce-tabs .woocommerce-Tabs-panel {
	max-width: 46rem !important;
	margin: 0 auto !important;
	box-sizing: border-box;
	padding: clamp(20px, 3vw, 34px) !important;
	border: 1px solid var(--sgwp-border);
	border-radius: var(--sgwp-radius);
	background: var(--sgwp-card);
	box-shadow: var(--sgwp-shadow);
	color: var(--sgwp-fg);
}

body.scribigo-woo-product .woocommerce-Tabs-panel > :first-child {
	margin-top: 0;
}

body.scribigo-woo-product .woocommerce-Tabs-panel > :last-child {
	margin-bottom: 0;
}

body.scribigo-woo-product .woocommerce-Tabs-panel strong {
	color: var(--sgwp-fg);
}

/* 4 — Busy state (variation form, AJAX add-to-cart): jQuery blockUI writes its
   overlay colours inline, so the cream wash and the round spinner need !important. */
body.scribigo-woo-product .blockUI.blockOverlay {
	border-radius: inherit;
	background: color-mix(in srgb, var(--sgwp-card) 74%, transparent) !important;
	opacity: 1 !important;
	cursor: progress !important;
	-webkit-backdrop-filter: blur(2px);
	backdrop-filter: blur(2px);
}

/* Woo paints its dark loader.svg disc here (`.woocommerce .blockUI.blockOverlay::before`). */
body.scribigo-woo-product .woocommerce .blockUI.blockOverlay::before,
body.scribigo-woo-product.woocommerce .blockUI.blockOverlay::before,
body.scribigo-woo-product.woocommerce-page .blockUI.blockOverlay::before,
body.scribigo-woo-product.woocommerce .loader::before,
body.scribigo-woo-product.woocommerce-page .loader::before {
	content: "";
	display: block;
	box-sizing: border-box;
	position: absolute;
	top: 50%;
	left: 50%;
	width: 30px;
	height: 30px;
	margin: -15px 0 0 -15px;
	border: 2px solid color-mix(in srgb, var(--sgwp-primary) 28%, var(--sgwp-card));
	border-top-color: var(--sgwp-primary);
	border-radius: 50%;
	background: none;
	transform: none;
	animation: scribigo-woo-spin 0.7s linear infinite;
}

body.scribigo-woo-product .blockUI.blockMsg {
	padding: 22px 26px !important;
	border: 1px solid var(--sgwp-border) !important;
	border-radius: 16px !important;
	background-color: var(--sgwp-card) !important;
	background-image: none !important;
	box-shadow: var(--sgwp-shadow);
	color: var(--sgwp-fg) !important;
	font-family: Outfit, ui-sans-serif, system-ui, sans-serif;
}

@keyframes scribigo-woo-spin {
	to {
		rotate: 360deg;
	}
}

@media (prefers-reduced-motion: reduce) {
	body.scribigo-woo-product .woocommerce .blockUI.blockOverlay::before,
	body.scribigo-woo-product.woocommerce .blockUI.blockOverlay::before,
	body.scribigo-woo-product.woocommerce-page .blockUI.blockOverlay::before,
	body.scribigo-woo-product.woocommerce .loader::before,
	body.scribigo-woo-product.woocommerce-page .loader::before {
		animation: none;
	}
}

@media (max-width: 921px) {
	body.scribigo-woo-product.woocommerce div.product div.summary,
	body.scribigo-woo-product.woocommerce-page div.product div.summary {
		margin-bottom: 1.5em !important;
	}
}

/* 5 — Subscription tariffs (Hobby/Author/Unlimited, monthly + yearly) share the
   card since 2026-10-20. The amount stays primary; the billing period
   ("pro Monat" / "per month" / "par mois", "/ Jahr") reads as a quieter suffix. */
body.scribigo-woo-product.scribigo-woo-subscription-product div.product .summary > p.price {
	color: var(--sgwp-muted);
	font-size: 1rem;
	font-weight: 500;
}

body.scribigo-woo-product.scribigo-woo-subscription-product div.product .summary > p.price .woocommerce-Price-amount {
	color: var(--sgwp-primary);
	font-size: 1.5rem;
	font-weight: 600;
}

body.scribigo-woo-product.scribigo-woo-subscription-product div.product .summary .subscription-details,
body.scribigo-woo-product.scribigo-woo-subscription-product div.product .summary .fsb-subscription-details {
	color: var(--sgwp-muted);
	font-size: 1rem;
	font-weight: 500;
}

/* Quantity-locked products (subscriptions, Buchsatz) get a -16px left margin on
   the button from the theme once the stepper is hidden; keep it flush with the card. */
body.scribigo-woo-product.scribigo-woo-qty-locked div.product form.cart .single_add_to_cart_button {
	margin-left: 0 !important;
	margin-right: 0 !important;
}
