/* ==========================================================================
   Squidgy Promo Displays: product page
   ========================================================================== */

.single-product {
	--sqpd-ink: #253530;
	--sqpd-ink-soft: #66736d;
	--sqpd-green: #395b50;
	--sqpd-mint: #ecf5ee;
	--sqpd-dark: #1f2c28;
	--sqpd-gold: #e9b949;
	--sqpd-line: #ddd5c7;
}

/* --------------------------------------------------------------------------
   Code price tag
   -------------------------------------------------------------------------- */

.sqpd-price-tag {
	display: inline-block;
	padding: 7px 12px;
	border-radius: 6px;
	background: #000;
	color: #e9b949;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.3;
	vertical-align: middle;
}

.woocommerce div.product .woocommerce-variation-price:has(.sqpd-price-tag) {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 14px;
	margin-bottom: 12px;
}

.woocommerce div.product .woocommerce-variation-price:has(.sqpd-price-tag) .price {
	margin: 0;
}

/* Main price + tag, between divider lines. */
.sqpd-price-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 14px;
	min-height: 66px; /* Room for the tag, so nothing moves when it appears. */
	margin: 14px 0 18px;
	padding: 14px 0;
	border-top: 1px solid var(--sqpd-line);
	border-bottom: 1px solid var(--sqpd-line);
	box-sizing: border-box;
}

.woocommerce div.product .sqpd-price-row .price {
	margin: 0;
}

/* Discounted (or sale) price first, then the original crossed through. */
.sqpd-price-row .price:has(> del) {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0 8px;
}

.woocommerce div.product .sqpd-price-row .price ins {
	background: none;
	color: inherit;
	text-decoration: none;
}

.woocommerce div.product .sqpd-price-row .price del {
	order: 1;
	color: #8a8f8c;
	opacity: 1;
	text-decoration: line-through;
}

.woocommerce div.product .sqpd-price-row .price del .woocommerce-Price-amount {
	color: inherit;
	font-size: 18px;
	font-weight: 400;
}

/* --------------------------------------------------------------------------
   Size cards
   -------------------------------------------------------------------------- */

.sqpd-sizes {
	display: none;
}

.sqpd-js .sqpd-sizes {
	display: grid;
	/* Five to a row at most; fewer keep the same width. */
	grid-template-columns: repeat(auto-fill, minmax(max(116px, (100% - 40px) / 5), 1fr));
	gap: 10px;
	margin: 2px 0 0;
}

/* The dropdown still holds the value; the cards are the control. */
.sqpd-js .variations td.value:has(.sqpd-sizes) > select {
	display: none !important;
}

.woocommerce div.product form.cart .variations .sqpd-size {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
	min-width: 0;
	min-height: 117px;
	margin: 0;
	padding: 12px 6px 9px;
	border: 2px solid var(--sqpd-line);
	border-radius: 10px;
	background: #fff;
	color: var(--sqpd-ink);
	font-size: 16px;
	font-weight: 400;
	line-height: 1.25;
	text-align: center;
	cursor: pointer;
	transition: border-color 0.15s ease, background-color 0.15s ease;
}

.woocommerce div.product form.cart .variations .sqpd-size[hidden] {
	display: none;
}

.woocommerce div.product form.cart .variations .sqpd-size:hover {
	border-color: var(--sqpd-green);
}

.woocommerce div.product form.cart .variations .sqpd-size.is-selected {
	border-color: var(--sqpd-green);
	background: var(--sqpd-mint);
}

.woocommerce div.product form.cart .variations .sqpd-size:focus-within:has(:focus-visible) {
	outline: 3px solid var(--sqpd-gold);
	outline-offset: 2px;
}

.sqpd-size__input[type="radio"] {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: 0;
	opacity: 0;
	pointer-events: none;
}

.sqpd-size__name {
	max-width: 100%;
	font-size: 17px;
	font-weight: 700;
	overflow-wrap: anywhere;
}

/* Multibuy / sale: quiet plain text, so promo tags never read as one of these. */
.sqpd-size__deal {
	min-height: 16px;
	color: var(--sqpd-ink-soft);
	font-size: 12px;
}

.woocommerce div.product .sqpd-size .sqpd-size__price .amount {
	color: inherit;
	font-weight: 400;
}

.sqpd-size__stock {
	color: var(--sqpd-ink-soft);
	font-size: 12px;
}

.sqpd-size.is-out .sqpd-size__name,
.sqpd-size.is-out .sqpd-size__price {
	color: var(--sqpd-ink-soft);
}

.sqpd-size__tag {
	display: flex;
	flex-direction: column;
	margin-top: 4px;
	padding: 3px 7px;
	border-radius: 4px;
	background: var(--sqpd-mint);
	color: var(--sqpd-green);
	font-size: 13px;
	font-weight: 700;
	line-height: 1.25;
}

.sqpd-size__tag[hidden] {
	display: none;
}

.sqpd-sizes .sqpd-size .sqpd-size__tag--top {
	background: var(--sqpd-dark);
	color: var(--sqpd-gold);
}

/* No promo tags to make room for: centre what's left. */
.sqpd-sizes:not(:has(.sqpd-size__tag:not([hidden]))) .sqpd-size {
	justify-content: center;
}

/* Keeps names and prices level when only some sizes say "Out of stock". */
.sqpd-sizes:not(:has(.sqpd-size__tag:not([hidden]))):has(.sqpd-size.is-out) .sqpd-size:not(.is-out)::after {
	content: "";
	height: 15px;
}

/* --------------------------------------------------------------------------
   Quantity + Add to basket row
   -------------------------------------------------------------------------- */

.sqpd-options div.product form.cart table.variations {
	margin: 0 0 4px;
	border: 0;
}

.sqpd-options div.product form.cart table.variations tr,
.sqpd-options div.product form.cart table.variations th,
.sqpd-options div.product form.cart table.variations td {
	border: 0;
}

/* Picking another card does the job of "Clear". */
.sqpd-js .sqpd-options div.product form.cart td.value:has(.sqpd-sizes) .reset_variations {
	display: none !important;
}

/* The main price shows the selected size's price instead. */
.sqpd-options form.cart.sqpd-price-moved .woocommerce-variation-price,
.sqpd-options form.cart .woocommerce-variation-availability[hidden] {
	display: none !important;
}

.sqpd-options div.product form.cart .variations_button,
.sqpd-options div.product form.cart:not(.variations_form) {
	display: flex;
	flex-wrap: wrap;
	align-items: stretch;
	gap: 14px;
	margin-top: 14px;
}

.sqpd-options div.product form.cart .variations_button::before,
.sqpd-options div.product form.cart .variations_button::after,
.sqpd-options div.product form.cart:not(.variations_form)::before,
.sqpd-options div.product form.cart:not(.variations_form)::after {
	content: none;
}

/* Anything else in the row (payment buttons, product options) gets its own line. */
.sqpd-options div.product form.cart .variations_button > :not(.quantity, .single_add_to_cart_button, input),
.sqpd-options div.product form.cart:not(.variations_form) > :not(.quantity, .single_add_to_cart_button, input) {
	flex: 1 0 100%;
}

.sqpd-options div.product form.cart .quantity:has(> input.qty:not([type="hidden"])) {
	display: flex;
	flex: 0 0 142px;
	align-items: stretch;
	float: none;
	width: 142px;
	height: auto;
	min-height: 58px;
	margin: 0;
	overflow: hidden;
	border: 1px solid #d6cdbd;
	border-radius: 10px;
	background: #fff;
}

.sqpd-options div.product form.cart .quantity:has(> input.qty:not([type="hidden"])) .minus,
.sqpd-options div.product form.cart .quantity:has(> input.qty:not([type="hidden"])) .plus {
	display: flex;
	flex: 1 1 0;
	align-items: center;
	justify-content: center;
	width: auto;
	height: auto;
	margin: 0;
	border: 0;
	background: transparent;
	color: var(--sqpd-ink);
	font-size: 24px;
	line-height: 1;
	text-decoration: none;
}

/* A true minus sign: the theme prints a hyphen. */
.sqpd-options div.product form.cart .quantity:has(> input.qty:not([type="hidden"])) .minus {
	font-size: 0;
}

.sqpd-options div.product form.cart .quantity:has(> input.qty:not([type="hidden"])) .minus::before {
	content: "\2212";
	font-size: 24px;
}

.sqpd-options div.product form.cart .quantity:has(> input.qty:not([type="hidden"])) .minus:hover,
.sqpd-options div.product form.cart .quantity:has(> input.qty:not([type="hidden"])) .plus:hover {
	background: var(--sqpd-mint) !important; /* Over the theme's orange. */
	color: var(--sqpd-ink) !important;
}

.sqpd-options div.product form.cart .quantity:has(> input.qty:not([type="hidden"])) .minus:focus-visible,
.sqpd-options div.product form.cart .quantity:has(> input.qty:not([type="hidden"])) .plus:focus-visible {
	outline: 2px solid var(--sqpd-green);
	outline-offset: -3px;
}

.sqpd-options div.product form.cart .quantity:has(> input.qty:not([type="hidden"])) input.qty {
	flex: 0 0 44px;
	width: 44px;
	height: auto;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--sqpd-ink);
	font-size: 18px;
	font-weight: 700;
	text-align: center;
	appearance: textfield;
	-moz-appearance: textfield;
}

.sqpd-options div.product form.cart .quantity:has(> input.qty:not([type="hidden"])) input.qty::-webkit-inner-spin-button,
.sqpd-options div.product form.cart .quantity:has(> input.qty:not([type="hidden"])) input.qty::-webkit-outer-spin-button {
	margin: 0;
	-webkit-appearance: none;
}

.sqpd-options div.product form.cart .single_add_to_cart_button.button {
	flex: 1 1 0;
	float: none;
	width: auto;
	min-width: 0;
	height: auto;
	min-height: 58px;
	margin: 0;
	padding: 10px 16px;
	border-radius: 10px;
	font-size: 19px;
	font-weight: 700;
	line-height: 1.2;
}

.sqpd-button-price {
	white-space: nowrap;
}

.sqpd-button-was {
	margin-left: 4px;
	color: inherit;
	font-size: 0.8em;
	font-weight: 400;
	opacity: 0.8;
	text-decoration: line-through;
}

/* --------------------------------------------------------------------------
   Basket progress panel
   -------------------------------------------------------------------------- */

.sqpd-panel {
	clear: both;
	margin: 22px 0;
	padding: 24px;
	border-radius: 14px;
	background: var(--sqpd-dark);
	color: #fff;
	line-height: 1.4;
}

.sqpd-panel[hidden],
.sqpd-panel [hidden] {
	display: none !important;
}

.sqpd-panel .sqpd-panel__title {
	margin: 0 0 4px;
	color: #fff;
	font-size: 19px;
	font-weight: 700;
	line-height: 1.35;
}

.sqpd-panel .sqpd-panel__total {
	margin: 0;
	color: rgba(255, 255, 255, 0.82);
	font-size: 15px;
}

.sqpd-panel__total strong {
	color: #fff;
}

.sqpd-panel__bar {
	position: relative;
	height: 11px;
	margin: 20px 0 0;
	border-radius: 99px;
	background: rgba(255, 255, 255, 0.18);
}

.sqpd-panel__fill {
	position: absolute;
	inset: 0 auto 0 0;
	width: 0;
	border-radius: inherit;
	background: var(--sqpd-gold);
	transition: width 0.35s ease;
}

.sqpd-panel__pip {
	position: absolute;
	top: -5px;
	bottom: -5px;
	width: 2px;
	margin-left: -1px;
	background: #f5ecdf;
}

.sqpd-panel .sqpd-panel__markers {
	position: relative;
	height: 58px;
	margin: 12px 0 0;
	padding: 0;
	list-style: none;
}

.sqpd-panel__markers li {
	position: absolute;
	top: 0;
	display: flex;
	flex-direction: column;
	margin: 0;
	color: rgba(255, 255, 255, 0.82);
	font-size: 13px;
	line-height: 1.4;
	text-align: center;
	white-space: nowrap;
	transform: translateX(-50%);
}

.sqpd-panel__markers li.is-reached {
	color: var(--sqpd-gold);
}

.sqpd-panel .sqpd-panel__note {
	margin: 14px 0 0;
	color: #e9b949;
	font-size: 15px;
    font-weight: 600;
}

@media (max-width: 544px) {
	.sqpd-js .sqpd-sizes {
		grid-template-columns: repeat(auto-fill, minmax(98px, 1fr));
		gap: 8px;
	}

	.sqpd-options div.product form.cart .variations_button,
	.sqpd-options div.product form.cart:not(.variations_form) {
		gap: 10px;
	}

	.sqpd-options div.product form.cart .quantity:has(> input.qty:not([type="hidden"])) {
		flex-basis: 116px;
		width: 116px;
	}

	.sqpd-options div.product form.cart .quantity:has(> input.qty:not([type="hidden"])) input.qty {
		flex-basis: 36px;
		width: 36px;
	}

	.sqpd-options div.product form.cart .single_add_to_cart_button.button {
		padding: 10px;
		font-size: 17px;
	}

	/* Two prices need their own line here; let them wrap on the smallest phones. */
	.sqpd-button-price:has(.sqpd-button-was) {
		display: block;
		white-space: normal;
	}

	.sqpd-button-dot {
		display: none;
	}

	.sqpd-panel {
		padding: 20px 18px;
	}

	.sqpd-panel .sqpd-panel__title {
		font-size: 17px;
	}

	.sqpd-panel__markers li {
		font-size: 12px;
	}

	/* Keep the far-right label inside the panel. */
	.sqpd-panel__markers li:last-child:not(:first-child) {
		transform: translateX(-62%);
	}
}

@media (prefers-reduced-motion: reduce) {
	.sqpd-panel__fill,
	.sqpd-size {
		transition: none;
	}
}

.sqpd-price-row .woocommerce-Price-amount {
	font-size:26px;
    font-weight:900;
}