/**
 * Sticky "add to cart" bar - see inc/sticky-add-to-cart.php
 *
 * Colours, fonts and the button all come from Impreza's generated custom properties and its
 * .us-btn-style_1 rules, so the bar follows the site's colour scheme with nothing hard coded.
 * Breakpoints match Theme Options > Responsive (tablets 1024px, mobiles 600px).
 */

.basildon-satc {
	position: fixed;
	z-index: 100; /* over .w-toplink (99) and the fixed header, under .l-popup (1001) */
	right: 0;
	bottom: 0;
	left: 0;
	visibility: hidden;
	transform: translate3d(0, 100%, 0);
	transition: transform 0.3s ease, visibility 0.3s;
	background: var(--color-content-bg, #fff);
	color: var(--color-content-text, #303640);
	border-top: 1px solid var(--color-content-border, #e1e5e8);
	box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
	padding-bottom: env(safe-area-inset-bottom, 0px);
	}

	.basildon-satc.is-visible {
		visibility: visible;
		transform: translate3d(0, 0, 0);
		}

	.basildon-satc-h {
		display: flex;
		align-items: center;
		gap: 1.5rem;
		margin: 0 auto;
		padding: 0.7rem 1.5rem;
		width: 100%;
		max-width: var(--site-content-width, 1140px);
		}

/* Product identity
   ========================================================================== */
.basildon-satc-product {
	display: flex;
	align-items: center;
	gap: 0.8rem;
	flex: 1 1 auto;
	min-width: 0; /* lets the title actually truncate */
	}

	.basildon-satc .basildon-satc-thumb {
		flex: 0 0 auto;
		width: 3rem;
		height: 3rem;
		object-fit: contain;
		border-radius: 0.3em;
		}

	.basildon-satc-title {
		font-weight: 600;
		line-height: 1.3;
		overflow: hidden;
		display: -webkit-box;
		-webkit-line-clamp: 2;
		-webkit-box-orient: vertical;
		}

/* Price
   ========================================================================== */
.basildon-satc-price {
	flex: 0 0 auto;
	font-size: 1.3rem;
	font-weight: 700;
	line-height: 1.2;
	white-space: nowrap;
	}

	.basildon-satc-tax {
		display: block;
		font-size: 0.62em;
		font-weight: 400;
		color: var(--color-content-faded, #7c8491);
		}

	.basildon-satc-amount del {
		margin-right: 0.4em;
		font-size: 0.75em;
		font-weight: 400;
		opacity: 0.6;
		}

	.basildon-satc-amount ins {
		text-decoration: none;
		background: none;
		}

	.basildon-satc-amount .woocommerce-price-suffix,
	.basildon-satc-amount small {
		display: block;
		font-size: 0.6em;
		font-weight: 400;
		color: var(--color-content-faded, #7c8491);
		}

/* Quantity and button
   ========================================================================== */
.basildon-satc-actions {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	flex: 0 0 auto;
	}

	/* Keeps the native spinner, like the real quantity field on the product page. Impreza's
	   -webkit-appearance:none on number inputs is left alone - it only flattens the field's
	   own chrome, not its shadow spin button - so the field still takes the theme's border
	   and radius. Chrome fades the spinner in on hover/focus, which on a bar that comes and
	   goes reads as "no arrows", hence the forced opacity. */
	.basildon-satc .basildon-satc-qty {
		width: 4.5em;
		padding: 0.5em 0.3em 0.5em 0.5em;
		text-align: center;
		}

	.basildon-satc .basildon-satc-qty::-webkit-inner-spin-button,
	.basildon-satc .basildon-satc-qty::-webkit-outer-spin-button {
		opacity: 1;
		margin: 0;
		}

	.basildon-satc .basildon-satc-button {
		padding-top: 0.8em;
		padding-bottom: 0.8em;
		white-space: nowrap;
		}

	.basildon-satc .basildon-satc-button[disabled] {
		opacity: 0.5;
		cursor: not-allowed;
		}

/* Keep the last of the footer reachable once the bar can appear. Reserved permanently rather
   than added on show, so revealing the bar never shifts the page under the reader. */
body.basildon-satc-active .l-footer {
	padding-bottom: var(--basildon-satc-height, 0px);
	}

/* Responsive
   ========================================================================== */
@media (max-width: 1024px) {
	.basildon-satc-h {
		gap: 1rem;
		padding: 0.6rem 1rem;
		}
	.basildon-satc-title {
		-webkit-line-clamp: 1;
		}
	}

@media (max-width: 600px) {
	/* Only what was asked for fits on a phone: the price and the button. */
	.basildon-satc-product {
		display: none;
		}
	.basildon-satc-price {
		flex: 1 1 auto;
		font-size: 1.15rem;
		}
	.basildon-satc .basildon-satc-button {
		padding-left: 1.2em;
		padding-right: 1.2em;
		}
	}

@media (prefers-reduced-motion: reduce) {
	.basildon-satc {
		transition: none;
		}
	}

@media print {
	.basildon-satc {
		display: none;
		}
	}
