/*
 * British Dragon Store Core: product page buy box (BD Product Page widget).
 * Scoped to .bdsc-pdp. Elementor Pro's single-product template wraps the page
 * in a `div.product`, so WooCommerce's layout rules (`div.product div.images`
 * / `div.summary`, 48% columns) and bd-woo-product-card's single-product
 * rules reach inside. Every rule here carries `:not(#bdsc-pdp)` (matches
 * always, adds ID-level specificity) to win without !important. The one
 * exception is bd-woo-product-card's !important button colours (ink, accent
 * on hover), which are the site's existing button design and are kept.
 */

.bdsc-ui.bdsc-pdp:not(#bdsc-pdp) {
	--bdsc-a: var(--bdsc-pdp-accent, #ec4899);
	--bdsc-a-text: var(--bdsc-pdp-accent-text, #be185d);
	--bdsc-ink: #0f1117;
	--bdsc-text: #333;
	--bdsc-muted: #5f6b7a;
	--bdsc-line: rgba(15, 17, 23, 0.1);
	--bdsc-font-display: "SF pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	box-sizing: border-box;
	display: block;
	width: 100%;
	margin: 0 0 56px;
	color: var(--bdsc-text);
}

.bdsc-ui.bdsc-pdp:not(#bdsc-pdp) *,
.bdsc-ui.bdsc-pdp:not(#bdsc-pdp) *::before,
.bdsc-ui.bdsc-pdp:not(#bdsc-pdp) *::after {
	box-sizing: border-box;
}

.bdsc-pdp:not(#bdsc-pdp) .bdsc-pdp__grid {
	display: grid;
	grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
	gap: 40px;
	align-items: start;
}

/* ------------------------------------------------------------ Gallery */

.bdsc-pdp:not(#bdsc-pdp) .bdsc-pdp__media {
	position: sticky;
	top: 24px;
}

.bdsc-pdp:not(#bdsc-pdp) .bdsc-pdp__gallery {
	position: relative;
	padding: 28px;
	border: 1px solid var(--bdsc-line);
	border-radius: 28px;
	background: #fff;
	background: radial-gradient(120% 90% at 50% 18%, color-mix(in srgb, var(--bdsc-a) 16%, #fff) 0%, #fff 72%);
	overflow: hidden;
}

/* The card above draws the frame; neutralise WooCommerce's 48% column and the product-card gallery frame. */
.bdsc-pdp:not(#bdsc-pdp) .woocommerce-product-gallery {
	position: relative;
	float: none;
	width: 100%;
	max-width: none;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: none;
}

.bdsc-pdp:not(#bdsc-pdp) .woocommerce-product-gallery__wrapper {
	margin: 0;
	padding: 0;
}

.bdsc-pdp:not(#bdsc-pdp) .woocommerce-product-gallery__image {
	margin: 0;
}

/* Before the slider starts, show only the first image (no stacked images / layout shift). */
.bdsc-pdp:not(#bdsc-pdp) .woocommerce-product-gallery:not(:has(.flex-viewport)) .woocommerce-product-gallery__image:nth-child(n+2) {
	display: none;
}

.bdsc-pdp:not(#bdsc-pdp) .woocommerce-product-gallery__image a {
	display: block;
}

.bdsc-pdp:not(#bdsc-pdp) .woocommerce-product-gallery__image img {
	display: block;
	width: 100%;
	height: auto;
	max-height: 560px;
	margin: 0 auto;
	object-fit: contain;
}

.bdsc-pdp:not(#bdsc-pdp) .flex-viewport {
	border-radius: 18px;
}

.bdsc-pdp:not(#bdsc-pdp) .flex-control-thumbs {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 18px 0 0;
	padding: 0;
	list-style: none;
}

.bdsc-pdp:not(#bdsc-pdp) .flex-control-thumbs li {
	width: 68px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.bdsc-pdp:not(#bdsc-pdp) .flex-control-thumbs img {
	display: block;
	width: 100%;
	height: auto;
	padding: 4px;
	border: 2px solid transparent;
	border-radius: 14px;
	background: #fff;
	opacity: 0.65;
	cursor: pointer;
	transition: opacity 0.2s ease, border-color 0.2s ease;
}

.bdsc-pdp:not(#bdsc-pdp) .flex-control-thumbs img:hover,
.bdsc-pdp:not(#bdsc-pdp) .flex-control-thumbs img.flex-active {
	border-color: var(--bdsc-a);
	opacity: 1;
}

.bdsc-pdp:not(#bdsc-pdp) .woocommerce-product-gallery__trigger {
	position: absolute;
	top: 6px;
	right: 6px;
	z-index: 9;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 6px 18px rgba(15, 17, 23, 0.12);
	font-size: 16px;
	line-height: 1;
	text-decoration: none;
}

.bdsc-pdp:not(#bdsc-pdp) .woocommerce-product-gallery__trigger img.emoji {
	width: 16px;
	height: 16px;
}

.bdsc-pdp:not(#bdsc-pdp) .bdsc-pdp__facts {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 14px 0 0;
}

.bdsc-pdp:not(#bdsc-pdp) .bdsc-pdp__facts > div {
	display: inline-flex;
	align-items: baseline;
	gap: 6px;
	padding: 7px 12px;
	border: 1px solid var(--bdsc-line);
	border-radius: 999px;
	background: #fff;
	font-size: 12px;
	line-height: 1.3;
}

.bdsc-pdp:not(#bdsc-pdp) .bdsc-pdp__facts dt {
	margin: 0;
	font-size: 10px;
	font-weight: 800;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--bdsc-muted);
}

.bdsc-pdp:not(#bdsc-pdp) .bdsc-pdp__facts dd {
	margin: 0;
	font-weight: 700;
	color: var(--bdsc-ink);
}

/* ------------------------------------------------------------- Summary */

.bdsc-pdp:not(#bdsc-pdp) .bdsc-pdp__summary {
	display: flex;
	flex-direction: column;
	gap: 18px;
	width: auto;
	float: none;
	margin: 0;
	padding: 4px 0 0;
}

.bdsc-pdp:not(#bdsc-pdp) .bdsc-pdp__eyebrow {
	margin: 0 0 -8px;
	font-size: 12px;
	font-weight: 800;
	line-height: 1.4;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--bdsc-a-text);
}

.bdsc-ui.bdsc-pdp:not(#bdsc-pdp) .bdsc-pdp__title {
	margin: 0;
	font-family: var(--bdsc-font-display);
	font-size: clamp(32px, 3.6vw, 48px);
	font-weight: 700;
	line-height: 1.06;
	letter-spacing: -0.02em;
	color: var(--bdsc-ink);
}

.bdsc-pdp:not(#bdsc-pdp) .bdsc-pdp__excerpt {
	font-size: 15px;
	line-height: 1.65;
	color: var(--bdsc-muted);
}

.bdsc-pdp:not(#bdsc-pdp) .bdsc-pdp__excerpt > :first-child {
	margin-top: 0;
}

.bdsc-pdp:not(#bdsc-pdp) .bdsc-pdp__excerpt > :last-child {
	margin-bottom: 0;
}

.bdsc-pdp:not(#bdsc-pdp) .bdsc-pdp__excerpt p {
	margin: 0 0 10px;
}

.bdsc-pdp:not(#bdsc-pdp) .bdsc-pdp__excerpt ul {
	margin: 10px 0 0;
	padding-left: 18px;
}

.bdsc-pdp:not(#bdsc-pdp) .bdsc-pdp__excerpt li {
	margin: 0 0 4px;
}

.bdsc-pdp:not(#bdsc-pdp) .bdsc-pdp__excerpt strong {
	color: var(--bdsc-ink);
}

.bdsc-pdp:not(#bdsc-pdp) .bdsc-pdp__links {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
	gap: 10px;
}

.bdsc-ui.bdsc-pdp:not(#bdsc-pdp) .bdsc-pdp__link {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	min-height: 46px;
	padding: 10px 16px;
	border: 1px solid rgba(15, 17, 23, 0.14);
	border-radius: 12px;
	background: #fff;
	color: var(--bdsc-ink);
	font-size: 13px;
	font-weight: 600;
	line-height: 1.3;
	text-decoration: none;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.bdsc-ui.bdsc-pdp:not(#bdsc-pdp) .bdsc-pdp__link:hover {
	border-color: var(--bdsc-ink);
	box-shadow: 0 6px 16px rgba(15, 17, 23, 0.08);
}

.bdsc-pdp:not(#bdsc-pdp) .bdsc-pdp__link-icon {
	color: var(--bdsc-muted);
}

.bdsc-pdp:not(#bdsc-pdp) .bdsc-pdp__status {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px 16px;
	padding: 14px 0 0;
	border-top: 1px solid var(--bdsc-line);
}

.bdsc-pdp:not(#bdsc-pdp) .bdsc-pdp__stock {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	font-size: 14px;
	font-weight: 700;
	color: var(--bdsc-ink);
}

.bdsc-pdp:not(#bdsc-pdp) .bdsc-pdp__stock-dot {
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: #16a34a;
	box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.15);
}

.bdsc-pdp:not(#bdsc-pdp) .bdsc-pdp__stock--out .bdsc-pdp__stock-dot {
	background: #dc2626;
	box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.15);
}

.bdsc-pdp:not(#bdsc-pdp) .bdsc-pdp__stock--backorder .bdsc-pdp__stock-dot {
	background: #d97706;
	box-shadow: 0 0 0 4px rgba(217, 119, 6, 0.15);
}

.bdsc-ui.bdsc-pdp:not(#bdsc-pdp) .bdsc-pdp__price {
	margin: 0;
	font-family: var(--bdsc-font-display);
	font-size: 30px;
	font-weight: 700;
	line-height: 1.1;
	color: var(--bdsc-ink);
}

/* Variation price HTML arrives wrapped in span.price, which WooCommerce colours olive. */
.bdsc-ui.bdsc-pdp:not(#bdsc-pdp) .bdsc-pdp__price .price,
.bdsc-ui.bdsc-pdp:not(#bdsc-pdp) .bdsc-pdp__price .amount {
	font-size: inherit;
	color: inherit;
}

.bdsc-ui.bdsc-pdp:not(#bdsc-pdp) .bdsc-pdp__price del {
	margin-right: 6px;
	font-size: 0.6em;
	font-weight: 500;
	color: var(--bdsc-muted);
}

.bdsc-ui.bdsc-pdp:not(#bdsc-pdp) .bdsc-pdp__price ins {
	text-decoration: none;
}

/* Latest certificate on record */

.bdsc-pdp:not(#bdsc-pdp) .bdsc-pdp__batch {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 14px 16px;
	border: 1px solid color-mix(in srgb, var(--bdsc-a) 30%, #fff);
	border-radius: 16px;
	background: color-mix(in srgb, var(--bdsc-a) 7%, #fff);
}

.bdsc-pdp:not(#bdsc-pdp) .bdsc-pdp__batch-icon {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 12px;
	background: #fff;
	color: var(--bdsc-a-text);
}

.bdsc-pdp:not(#bdsc-pdp) .bdsc-pdp__batch-text {
	flex: 1 1 auto;
	min-width: 0;
}

.bdsc-pdp:not(#bdsc-pdp) .bdsc-pdp__batch-label {
	margin: 0;
	font-size: 11px;
	font-weight: 800;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--bdsc-a-text);
}

.bdsc-pdp:not(#bdsc-pdp) .bdsc-pdp__batch-value {
	margin: 2px 0 0;
	font-size: 16px;
	font-weight: 700;
	color: var(--bdsc-ink);
}

.bdsc-pdp:not(#bdsc-pdp) .bdsc-pdp__batch-lab {
	font-size: 13px;
	font-weight: 500;
	color: var(--bdsc-muted);
}

.bdsc-ui.bdsc-pdp:not(#bdsc-pdp) .bdsc-pdp__batch-link {
	flex: 0 0 auto;
	padding: 8px 14px;
	border: 1px solid rgba(15, 17, 23, 0.16);
	border-radius: 999px;
	background: #fff;
	color: var(--bdsc-ink);
	font-size: 13px;
	font-weight: 700;
	text-decoration: none;
}

.bdsc-ui.bdsc-pdp:not(#bdsc-pdp) .bdsc-pdp__batch-link:hover {
	border-color: var(--bdsc-ink);
}

/* ------------------------------------------- WooCommerce add-to-cart form */

.bdsc-pdp:not(#bdsc-pdp) form.cart {
	margin: 0;
}

.bdsc-pdp:not(#bdsc-pdp) table.variations {
	display: block;
	width: 100%;
	margin: 0 0 14px;
	border: 0;
}

.bdsc-pdp:not(#bdsc-pdp) table.variations tbody {
	display: grid;
	gap: 12px;
}

.bdsc-pdp:not(#bdsc-pdp) table.variations tr {
	display: grid;
	grid-template-columns: minmax(0, 150px) minmax(0, 1fr);
	gap: 12px;
	/* Top-aligned: WooCommerce reserves space for the hidden "Clear" link under the select. */
	align-items: start;
}

/* Label centred on the 48px select. */
.bdsc-pdp:not(#bdsc-pdp) table.variations th {
	padding-top: 15px;
}

.bdsc-pdp:not(#bdsc-pdp) table.variations th,
.bdsc-pdp:not(#bdsc-pdp) table.variations td {
	display: block;
	padding: 0;
	border: 0;
	background: none;
	text-align: left;
}

.bdsc-pdp:not(#bdsc-pdp) table.variations th label {
	margin: 0;
	font-size: 12px;
	font-weight: 800;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--bdsc-ink);
}

.bdsc-ui.bdsc-pdp:not(#bdsc-pdp) table.variations select {
	display: block;
	width: 100%;
	min-width: 0;
	max-width: 100%;
	height: 48px;
	margin: 0;
	padding: 0 40px 0 14px;
	border: 1px solid rgba(15, 17, 23, 0.18);
	border-radius: 12px;
	background-color: #fff;
	color: var(--bdsc-ink);
	font-size: 15px;
	font-weight: 600;
}

.bdsc-ui.bdsc-pdp:not(#bdsc-pdp) table.variations select:focus {
	border-color: var(--bdsc-ink);
	outline: 3px solid color-mix(in srgb, var(--bdsc-a) 35%, transparent);
	outline-offset: 1px;
}

.bdsc-ui.bdsc-pdp:not(#bdsc-pdp) .reset_variations {
	display: inline-block;
	margin-top: 6px;
	font-size: 12px;
	color: var(--bdsc-muted);
}

/* The price lives in the header row and on the button. */
.bdsc-pdp:not(#bdsc-pdp) .single_variation .woocommerce-variation-price {
	display: none;
}

.bdsc-pdp:not(#bdsc-pdp) .single_variation .woocommerce-variation-availability p,
.bdsc-pdp:not(#bdsc-pdp) .single_variation .woocommerce-variation-description p {
	margin: 0 0 10px;
	font-size: 14px;
}

.bdsc-pdp:not(#bdsc-pdp) form.cart:not(.variations_form):not(.grouped_form),
.bdsc-pdp:not(#bdsc-pdp) .woocommerce-variation-add-to-cart {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	align-items: stretch;
}

.bdsc-ui.bdsc-pdp:not(#bdsc-pdp) .quantity {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	height: 54px;
	margin: 0;
	padding: 0 4px;
	border: 1px solid rgba(15, 17, 23, 0.18);
	border-radius: 999px;
	background: #fff;
}

.bdsc-ui.bdsc-pdp:not(#bdsc-pdp) .quantity .qty {
	width: 44px;
	height: 44px;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--bdsc-ink);
	font-size: 16px;
	font-weight: 700;
	text-align: center;
	-moz-appearance: textfield;
	appearance: textfield;
}

.bdsc-ui.bdsc-pdp:not(#bdsc-pdp) .quantity .qty::-webkit-outer-spin-button,
.bdsc-ui.bdsc-pdp:not(#bdsc-pdp) .quantity .qty::-webkit-inner-spin-button {
	margin: 0;
	-webkit-appearance: none;
}

.bdsc-ui.bdsc-pdp:not(#bdsc-pdp) .quantity .bdsc-qty__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--bdsc-ink);
	font-size: 20px;
	font-weight: 500;
	line-height: 1;
	cursor: pointer;
}

.bdsc-ui.bdsc-pdp:not(#bdsc-pdp) .quantity .bdsc-qty__btn:hover {
	background: #f2f3f5;
	color: var(--bdsc-ink);
}

.bdsc-ui.bdsc-pdp.product:not(#bdsc-pdp) form.cart .single_add_to_cart_button {
	display: inline-flex;
	flex: 1 1 220px;
	align-items: center;
	justify-content: center;
	min-height: 54px;
	margin: 0;
	padding: 14px 26px;
	border: 0;
	border-radius: 999px;
	background: var(--bdsc-ink);
	color: #fff;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	cursor: pointer;
	transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.bdsc-ui.bdsc-pdp.product:not(#bdsc-pdp) form.cart .single_add_to_cart_button:hover,
.bdsc-ui.bdsc-pdp.product:not(#bdsc-pdp) form.cart .single_add_to_cart_button:focus-visible {
	background: var(--bdsc-a-text);
	color: #fff;
	box-shadow: 0 10px 24px rgba(15, 17, 23, 0.18);
	transform: translateY(-1px);
}

.bdsc-ui.bdsc-pdp.product:not(#bdsc-pdp) form.cart .single_add_to_cart_button.disabled,
.bdsc-ui.bdsc-pdp.product:not(#bdsc-pdp) form.cart .single_add_to_cart_button:disabled {
	opacity: 0.45;
	cursor: not-allowed;
	box-shadow: none;
	transform: none;
}

.bdsc-ui.bdsc-pdp.product:not(#bdsc-pdp) form.cart .single_add_to_cart_button.loading {
	opacity: 0.8;
	pointer-events: none;
}

.bdsc-ui.bdsc-pdp.product:not(#bdsc-pdp) form.cart .single_add_to_cart_button.loading::after {
	content: "";
	width: 14px;
	height: 14px;
	margin-left: 10px;
	border: 2px solid rgba(255, 255, 255, 0.45);
	border-top-color: #fff;
	border-radius: 50%;
	animation: bdsc-spin 0.7s linear infinite;
}

.bdsc-pdp:not(#bdsc-pdp) .bdsc-atc-price {
	margin-left: 4px;
	font-weight: 600;
	letter-spacing: 0;
	text-transform: none;
}

.bdsc-pdp:not(#bdsc-pdp) .bdsc-pdp__notice {
	padding: 12px 16px;
	border: 1px solid #fecaca;
	border-radius: 12px;
	background: #fef2f2;
	color: #991b1b;
	font-size: 14px;
	line-height: 1.5;
}

.bdsc-pdp:not(#bdsc-pdp) .bdsc-pdp__notice p {
	margin: 0;
}

.bdsc-pdp:not(#bdsc-pdp) .bdsc-pdp__notice p + p {
	margin-top: 6px;
}

.bdsc-ui.bdsc-pdp:not(#bdsc-pdp) a:focus-visible,
.bdsc-ui.bdsc-pdp:not(#bdsc-pdp) button:focus-visible,
.bdsc-ui.bdsc-pdp.product:not(#bdsc-pdp) form.cart .single_add_to_cart_button:focus-visible {
	outline: 3px solid var(--bdsc-a-text);
	outline-offset: 3px;
}

@keyframes bdsc-spin {
	to {
		transform: rotate(360deg);
	}
}

/* ---------------------------------------------------------- Responsive */

@media (max-width: 1024px) {
	.bdsc-pdp:not(#bdsc-pdp) .bdsc-pdp__grid {
		gap: 28px;
	}

	.bdsc-pdp:not(#bdsc-pdp) .bdsc-pdp__gallery {
		padding: 20px;
	}
}

@media (max-width: 880px) {
	.bdsc-pdp:not(#bdsc-pdp) .bdsc-pdp__grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.bdsc-pdp:not(#bdsc-pdp) .bdsc-pdp__media {
		position: static;
	}

	.bdsc-ui.bdsc-pdp:not(#bdsc-pdp) {
		margin-bottom: 40px;
	}
}

@media (max-width: 520px) {
	.bdsc-pdp:not(#bdsc-pdp) .bdsc-pdp__gallery {
		padding: 14px;
		border-radius: 22px;
	}

	.bdsc-pdp:not(#bdsc-pdp) table.variations tr {
		grid-template-columns: minmax(0, 1fr);
		gap: 6px;
	}

	.bdsc-pdp:not(#bdsc-pdp) table.variations th {
		padding-top: 0;
	}

	.bdsc-ui.bdsc-pdp:not(#bdsc-pdp) .bdsc-pdp__price {
		font-size: 26px;
	}

	.bdsc-ui.bdsc-pdp.product:not(#bdsc-pdp) form.cart .single_add_to_cart_button {
		flex-basis: 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.bdsc-ui.bdsc-pdp.product:not(#bdsc-pdp) form.cart .single_add_to_cart_button,
	.bdsc-ui.bdsc-pdp:not(#bdsc-pdp) .bdsc-pdp__link,
	.bdsc-pdp:not(#bdsc-pdp) .flex-control-thumbs img {
		transition: none;
	}

	.bdsc-ui.bdsc-pdp.product:not(#bdsc-pdp) form.cart .single_add_to_cart_button:hover {
		transform: none;
	}
}
