/**
 * Sportsafe mini cart interior.
 *
 * Bricks owns the panel shell: position, off-canvas direction, width, background
 * and the close button, all set on the element in the builder. Everything here
 * is the contents WooCommerce renders into div.widget_shopping_cart_content.
 *
 * Two things worth knowing before editing:
 *
 *  - Bricks' own mini cart CSS lives inside `@layer bricks`, so unlayered rules
 *    here win on any property they declare regardless of specificity.
 *  - uploads/bricks/css/post-<id>.min.css is NOT layered, uses #brxe- IDs and
 *    loads after this file, so anything set on the element in the builder still
 *    wins. That is deliberate: width, padding and button colours stay with
 *    whoever is editing the header.
 *
 * Compactness comes from tightening spacing, not from shrinking type. Token
 * values are fluid clamps: --space-s is ~20px on desktop and --text-xs ~9.6px,
 * so check global-variables.min.css before reaching for one by name.
 */

/* ------------------------------------------------------------- structure -- */

/**
 * Bricks lays the container out as a flex column. The item list takes the free
 * space and scrolls; the footer block is pinned to the bottom so the totals,
 * minimum-order bar and buttons are always reachable without scrolling.
 */
.widget_shopping_cart_content {
	position: relative;
	justify-content: flex-start;
	gap: 0;
}

.cart-detail.off-canvas .widget_shopping_cart_content {
	height: 100%;
}

/* --------------------------------------------------------------- header -- */

/**
 * Rendered by sportsafe-commerce on woocommerce_before_mini_cart. Sticky, so
 * the panel reads as header / scrolling items / pinned footer. The right padding
 * leaves room for Bricks' close icon, which is absolutely positioned in the
 * panel and sits above this bar.
 */
.ss-mini-cart__head {
	position: sticky;
	top: 0;
	z-index: 3;
	display: flex;
	align-items: baseline;
	gap: var(--space-3xs, .25rem);
	margin: 0 0 var(--space-2xs, .5rem);
	padding: 0 2.25rem var(--space-2xs, .5rem) 0;
	border-bottom: 1px solid var(--border, #e5e7eb);
	background: #fff;
}

.ss-mini-cart__title {
	font-size: var(--text-m, 1rem);
	font-weight: 600;
	line-height: 1.2;
	color: var(--text-strong, #111827);
}

.ss-mini-cart__count {
	font-size: var(--text-s, .875rem);
	font-weight: 500;
	color: var(--text-muted, #6b7280);
	font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------- promo -- */

.ss-mini-cart__promo {
	display: flex;
	flex-direction: column;
	gap: var(--space-4xs, .15rem);
	margin: 0 0 var(--space-2xs, .5rem);
	padding: var(--space-2xs, .5rem);
	border-radius: var(--radius-s, 6px);
	border-left: 3px solid var(--brand, #cd1619);
	background: var(--neutral-100, #eef0f5);
}

/* The stored dimensions are enforced on save, so the aspect ratio is known and
   the box is reserved before the image loads. */
img.ss-mini-cart__promo-image {
	display: block;
	width: 100%;
	height: auto;
	margin: 0 0 var(--space-3xs, .25rem);
	border-radius: var(--radius-s, 6px);
}

.ss-mini-cart__promo-heading {
	font-size: var(--text-s, .875rem);
	font-weight: 600;
	line-height: 1.3;
	color: var(--text-strong, #111827);
}

.ss-mini-cart__promo-message {
	font-size: var(--text-s, .875rem);
	line-height: 1.4;
	color: var(--text-muted, #6b7280);
}

.ss-mini-cart__promo-message a {
	color: var(--brand, #cd1619);
	text-decoration: underline;
}

a.ss-mini-cart__promo-link {
	align-self: flex-start;
	margin-top: var(--space-4xs, .15rem);
	font-size: var(--text-s, .875rem);
	font-weight: 600;
	color: var(--brand, #cd1619);
	text-decoration: underline;
	text-underline-offset: 2px;
}

/* ---------------------------------------------------------------- items -- */

ul.ss-mini-cart.cart_list {
	flex: 1 1 auto;
	min-height: 0; /* without this a flex child refuses to shrink and never scrolls */
	overflow-y: auto;
	overscroll-behavior: contain;
	margin: 0;
	padding: 0 var(--space-3xs, .25rem) 0 0;
	list-style: none;
}

/* A restrained scrollbar; the default is heavy in a 400px drawer. */
ul.ss-mini-cart.cart_list {
	scrollbar-width: thin;
	scrollbar-color: var(--neutral-300, #cbd2e0) transparent;
}

ul.ss-mini-cart.cart_list::-webkit-scrollbar {
	width: 6px;
}

ul.ss-mini-cart.cart_list::-webkit-scrollbar-thumb {
	background: var(--neutral-300, #cbd2e0);
	border-radius: 999px;
}

ul.ss-mini-cart.cart_list li.woocommerce-mini-cart-item {
	position: relative;
	display: grid;
	grid-template-columns: 56px 1fr;
	gap: var(--space-2xs, .5rem);
	align-items: start;
	margin: 0;
	padding: var(--space-2xs, .5rem) 0;
	border-bottom: 1px solid var(--border, #e5e7eb);
	overflow: visible;
}

ul.ss-mini-cart.cart_list li.woocommerce-mini-cart-item:first-child {
	padding-top: 0;
}

ul.ss-mini-cart.cart_list li.woocommerce-mini-cart-item:last-child {
	border-bottom: 0;
}

/* Remove: a proper round hit area, quiet until hovered. */
ul.ss-mini-cart.cart_list li.woocommerce-mini-cart-item a.remove {
	position: absolute;
	top: var(--space-2xs, .5rem);
	right: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	padding: 0;
	border-radius: 50%;
	font-size: 15px;
	line-height: 1;
	text-decoration: none;
	color: var(--text-muted, #6b7280);
	opacity: 1;
	transition: background-color .15s ease, color .15s ease;
}

ul.ss-mini-cart.cart_list li.woocommerce-mini-cart-item:first-child a.remove {
	top: 0;
}

ul.ss-mini-cart.cart_list li.woocommerce-mini-cart-item a.remove:hover,
ul.ss-mini-cart.cart_list li.woocommerce-mini-cart-item a.remove:focus-visible {
	background: var(--neutral-100, #eef0f5);
	color: var(--brand, #cd1619);
	opacity: 1;
}

.ss-mini-cart__media img {
	display: block;
	width: 56px;
	height: 56px;
	object-fit: contain;
	border: 1px solid var(--border, #e5e7eb);
	border-radius: var(--radius-s, 6px);
	background: #fff;
}

.ss-mini-cart__body {
	min-width: 0;
	padding-right: 26px; /* clearance for the remove control */
}

a.ss-mini-cart__name,
span.ss-mini-cart__name {
	display: block;
	font-size: var(--text-s, .875rem);
	font-weight: 500;
	line-height: 1.35;
	color: var(--text-strong, #111827);
	text-decoration: none;
	margin: 0 0 var(--space-3xs, .25rem);

	/* Long product names are the norm here, so cap at two lines. */
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

a.ss-mini-cart__name:hover {
	color: var(--brand, #cd1619);
}

/* Variation / add-on data WooCommerce prints under the name. */
.ss-mini-cart__body dl.variation {
	margin: 0 0 var(--space-3xs, .25rem);
	font-size: var(--text-xs, .7rem);
	color: var(--text-muted, #6b7280);
}

.ss-mini-cart__body dl.variation dt,
.ss-mini-cart__body dl.variation dd {
	display: inline;
	margin: 0;
	font-weight: 400;
	line-height: 1.4;
}

.ss-mini-cart__body dl.variation dd::after {
	content: '';
	display: block;
}

.ss-mini-cart__row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-2xs, .5rem);
	margin-top: var(--space-3xs, .25rem);
}

.ss-mini-cart__line {
	font-size: var(--text-s, .875rem);
	font-weight: 600;
	color: var(--text-strong, #111827);
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

/* -------------------------------------------------------------- stepper -- */

/**
 * A segmented control: one border around the group, dividers between the parts,
 * and a single focus ring on whichever segment has focus. Fixed 32px height so
 * the row never changes height as quantities change.
 */
.ss-qty {
	display: inline-flex;
	align-items: stretch;
	height: 32px;
	border: 1px solid var(--border, #e5e7eb);
	border-radius: var(--radius-s, 6px);
	overflow: hidden;
	background: #fff;
	flex: 0 0 auto;
}

.ss-qty__btn {
	appearance: none;
	-webkit-appearance: none;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	padding: 0;
	margin: 0;
	border: 0;
	background: transparent;
	cursor: pointer;
	font-size: 15px;
	font-weight: 500;
	line-height: 1;
	color: var(--text-strong, #111827);
	transition: background-color .12s ease;
	-webkit-user-select: none;
	user-select: none;
}

.ss-qty__btn:hover {
	background: var(--neutral-100, #eef0f5);
}

.ss-qty__btn:active {
	background: var(--neutral-200, #dfe3ec);
}

.ss-qty__btn:focus-visible {
	outline: 2px solid var(--accent, #2563eb);
	outline-offset: -2px;
}

.ss-qty__input {
	width: 38px;
	height: 100%;
	min-height: 0;
	padding: 0;
	margin: 0;
	border: 0;
	border-left: 1px solid var(--border, #e5e7eb);
	border-right: 1px solid var(--border, #e5e7eb);
	border-radius: 0;
	background: transparent;
	text-align: center;
	font-size: var(--text-s, .875rem);
	font-weight: 600;
	line-height: 1;
	color: var(--text-strong, #111827);
	box-shadow: none;
	font-variant-numeric: tabular-nums;
}

.ss-qty__input:focus,
.ss-qty__input:focus-visible {
	outline: 2px solid var(--accent, #2563eb);
	outline-offset: -2px;
	box-shadow: none;
	background: #fff;
}

/* Native spinners would sit under the +/- buttons. */
.ss-qty__input::-webkit-outer-spin-button,
.ss-qty__input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.ss-qty__input[type='number'] {
	-moz-appearance: textfield;
	appearance: textfield;
}

/* --------------------------------------------------------------- footer -- */

/**
 * Pinned to the bottom of the panel. margin-top:auto does the work in the flex
 * column; the border and inset shadow make it read as a fixed shelf once the
 * item list above it starts scrolling.
 */
.ss-mini-cart__footer {
	flex: 0 0 auto;
	margin-top: auto;
	padding-top: var(--space-xs, .75rem);
	border-top: 1px solid var(--border, #e5e7eb);
	background: #fff;
}

.widget_shopping_cart_content p.woocommerce-mini-cart__total {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: var(--space-2xs, .5rem);
	margin: 0;
	padding: 0;
	border: 0;
	font-size: var(--text-m, 1rem);
	font-variant-numeric: tabular-nums;
}

.widget_shopping_cart_content p.woocommerce-mini-cart__total strong {
	font-weight: 600;
}

/* --text-xs is ~9.6px here, unreadable beside a 1rem subtotal, so these rows
   use --text-s and lean on colour and weight for hierarchy. */
.ss-mini-cart__vat,
.ss-mini-cart__incvat {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: var(--space-2xs, .5rem);
	margin: var(--space-4xs, .15rem) 0 0;
	font-size: var(--text-s, .875rem);
	color: var(--text-muted, #6b7280);
	font-variant-numeric: tabular-nums;
}

.ss-mini-cart__incvat {
	margin-top: var(--space-3xs, .25rem);
	padding-top: var(--space-3xs, .25rem);
	border-top: 1px solid var(--border, #e5e7eb);
	color: var(--text-strong, #111827);
	font-weight: 600;
}

.ss-mini-cart__note {
	margin: var(--space-3xs, .25rem) 0 0;
	font-size: var(--text-xs, .7rem);
	color: var(--text-muted, #6b7280);
}

/* ------------------------------------------- minimum order progress bar -- */

/**
 * Rendered by sportsafe-commerce into woocommerce_widget_shopping_cart_before_buttons.
 * Styled here rather than in checkout-controls.css because that stylesheet only
 * loads on cart/checkout, and the mini cart is in the header on every page.
 */
.widget_shopping_cart_content .sdr-mcm {
	margin: var(--space-2xs, .5rem) 0 0;
	padding: var(--space-2xs, .5rem) var(--space-2xs, .5rem) calc(var(--space-2xs, .5rem) + 2px);
	border-radius: var(--radius-s, 6px);
	background: var(--neutral-100, #eef0f5);
}

.widget_shopping_cart_content .sdr-mcm__text {
	margin: 0 0 var(--space-3xs, .25rem);
	font-size: var(--text-s, .875rem);
	line-height: 1.35;
	color: var(--text-muted, #6b7280);
}

.widget_shopping_cart_content .sdr-mcm__text .amount {
	color: var(--text-strong, #111827);
	font-weight: 600;
}

.widget_shopping_cart_content .sdr-mcm__track {
	overflow: hidden;
	width: 100%;
	height: 6px;
	border-radius: 999px;
	background: #fff;
}

.widget_shopping_cart_content .sdr-mcm__track span {
	display: block;
	height: 100%;
	min-width: 4px;
	border-radius: inherit;
	background: var(--brand, #cd1619);
	transition: width .35s ease;
}

/* -------------------------------------------------------------- buttons -- */

.widget_shopping_cart_content p.woocommerce-mini-cart__buttons {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: var(--space-2xs, .5rem);
	margin: var(--space-xs, .75rem) 0 0;
}

.widget_shopping_cart_content p.woocommerce-mini-cart__buttons a.button {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 42px;
	margin: 0;
	padding: 0 var(--space-2xs, .5rem);
	width: 100%;
	border-radius: var(--radius-s, 6px);
	font-size: var(--text-s, .875rem);
	font-weight: 600;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
}

/**
 * Two identical solid buttons compete, and the one that matters is Checkout.
 * View basket is demoted to an outline so there is a single obvious next step.
 * The primary button's colours come from the element settings in the builder,
 * so they are deliberately untouched.
 */
.widget_shopping_cart_content p.woocommerce-mini-cart__buttons a.button:not(.checkout) {
	background: #fff;
	color: var(--text-strong, #111827);
	border: 1px solid var(--neutral-300, #cbd2e0);
}

.widget_shopping_cart_content p.woocommerce-mini-cart__buttons a.button:not(.checkout):hover {
	background: var(--neutral-100, #eef0f5);
	color: var(--text-strong, #111827);
	border-color: var(--neutral-400, #aab3c5);
}

.widget_shopping_cart_content p.woocommerce-mini-cart__buttons a.button:focus-visible {
	outline: 2px solid var(--accent, #2563eb);
	outline-offset: 2px;
}

/* -------------------------------------------------------- save / quote -- */

/**
 * Rendered by CartWorkflowsModule on woocommerce_widget_shopping_cart_after_buttons.
 * Quiet text actions, not buttons: Checkout must stay the only prominent CTA.
 */
.ss-mini-cart__actions {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: var(--space-2xs, .5rem);
	margin: var(--space-2xs, .5rem) 0 0;
}

.ss-mini-cart__actions .ss-mini-cart__action {
	appearance: none;
	border: 0;
	background: none;
	padding: 0;
	cursor: pointer;
	font-size: var(--text-s, .875rem);
	font-weight: 500;
	line-height: 1.3;
	color: var(--text-muted, #6b7280);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.ss-mini-cart__actions .ss-mini-cart__action:hover {
	color: var(--brand, #cd1619);
}

.ss-mini-cart__actions .ss-mini-cart__action:focus-visible {
	outline: 2px solid var(--accent, #2563eb);
	outline-offset: 2px;
	border-radius: 2px;
}

/* A middot between the two, drawn rather than typed so it never ends up in
   copied text or read out by a screen reader. */
.ss-mini-cart__actions .ss-mini-cart__action + .ss-mini-cart__action::before {
	content: '·';
	display: inline-block;
	margin-right: var(--space-2xs, .5rem);
	color: var(--neutral-300, #b6bccd);
	text-decoration: none;
}

.ss-mini-cart__actions-msg {
	margin: var(--space-3xs, .25rem) 0 0;
	font-size: var(--text-s, .875rem);
	line-height: 1.35;
	text-align: center;
	color: var(--text-muted, #6b7280);
	word-break: break-word;
}

.ss-mini-cart__actions-msg:empty {
	display: none;
}

.ss-mini-cart__actions-msg a {
	color: var(--brand, #cd1619);
	text-decoration: underline;
}

/* ----------------------------------------------------------- stock note -- */

.ss-mini-cart__stock {
	display: block;
	margin: 0 0 var(--space-4xs, .15rem);
	font-size: var(--text-s, .875rem);
	font-weight: 500;
	line-height: 1.3;
}

.ss-mini-cart__stock--low {
	color: #b45309; /* amber 700: readable on white, not alarming */
}

.ss-mini-cart__stock--back {
	color: var(--text-muted, #6b7280);
}

.ss-mini-cart__stock--out {
	color: var(--brand, #cd1619);
}

/* --------------------------------------------------- recently added line -- */

/**
 * Marked by the script when the panel opens straight after an add to cart, so
 * the shopper can see which line is the one they just added. Fades out on its
 * own; nothing to clean up.
 */
ul.ss-mini-cart.cart_list li.woocommerce-mini-cart-item.is-just-added {
	animation: ss-mini-cart-flash 2.2s ease-out 1;
}

@keyframes ss-mini-cart-flash {
	0%   { background-color: rgba(205, 22, 25, .10); }
	60%  { background-color: rgba(205, 22, 25, .06); }
	100% { background-color: transparent; }
}

@media (prefers-reduced-motion: reduce) {
	ul.ss-mini-cart.cart_list li.woocommerce-mini-cart-item.is-just-added {
		animation: none;
		box-shadow: inset 3px 0 0 0 var(--brand, #cd1619);
	}
}

/* ----------------------------------------------------------------- foot -- */

.widget_shopping_cart_content p.ss-mini-cart__foot {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: var(--space-2xs, .5rem);
	margin: var(--space-2xs, .5rem) 0 0;
	font-size: var(--text-xs, .7rem);
	color: var(--text-muted, #6b7280);
}

.widget_shopping_cart_content a.ss-mini-cart__empty-link {
	color: var(--text-muted, #6b7280);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.widget_shopping_cart_content a.ss-mini-cart__empty-link:hover,
.widget_shopping_cart_content a.ss-mini-cart__empty-link[data-armed='1'] {
	color: var(--brand, #cd1619);
}

.widget_shopping_cart_content a.ss-mini-cart__empty-link[data-armed='1'] {
	font-weight: 600;
}

/* ---------------------------------------------------------------- empty -- */

.ss-mini-cart__empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: var(--space-s, 1rem);
	min-height: 180px;
	padding: var(--space-l, 1.5rem) var(--space-s, 1rem);
	text-align: center;
}

.ss-mini-cart__empty .woocommerce-mini-cart__empty-message {
	margin: 0;
	color: var(--text-muted, #6b7280);
	font-size: var(--text-s, .875rem);
}

.ss-mini-cart__empty a.ss-mini-cart__empty-cta {
	min-height: 42px;
	display: inline-flex;
	align-items: center;
	border-radius: var(--radius-s, 6px);
	font-size: var(--text-s, .875rem);
	font-weight: 600;
}

/* ----------------------------------------------------------------- busy -- */

.ss-mini-cart--busy {
	pointer-events: none;
}

.ss-mini-cart--busy::after {
	content: '';
	position: absolute;
	inset: 0;
	z-index: 2;
	background: rgba(255, 255, 255, .55);
}

/* -------------------------------------------------------------- z-index -- */

/**
 * Bricks gives the open panel z-index 999, which loses to sticky headers,
 * chat widgets and cookie banners. Raise it just below the WordPress admin bar
 * (#wpadminbar is z-index 99999) so the panel covers the site but an admin can
 * still reach their toolbar, and inset the drawer below the bar so it is not
 * hidden underneath it.
 */
.brxe-woocommerce-mini-cart.show-cart-details .cart-detail {
	z-index: 99990;
}

.brxe-woocommerce-mini-cart.show-cart-details .off-canvas-overlay {
	z-index: 99989;
}

body.admin-bar .cart-detail.off-canvas.right,
body.admin-bar .cart-detail.off-canvas.left {
	top: 32px;
}

@media screen and (max-width: 782px) {
	body.admin-bar .cart-detail.off-canvas.right,
	body.admin-bar .cart-detail.off-canvas.left {
		top: 46px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.widget_shopping_cart_content .sdr-mcm__track span,
	ul.ss-mini-cart.cart_list li.woocommerce-mini-cart-item a.remove,
	.ss-qty__btn {
		transition: none;
	}
}
