/**
 * AF Commerce — single product.
 *
 * WooCommerce's own markup is kept and restyled rather than replaced, which is
 * what keeps the theme compatible with variation scripts, gateway plugins and
 * extensions that hook into the summary. The layout is a two-column grid over
 * `div.product`; everything else is spacing and type.
 */

/* -------------------------------------------------------------------------
 * 1. Layout
 * ---------------------------------------------------------------------- */

.af-single-product {
	padding-block-end: var(--af-space-xxl);
}

.single-product div.product {
	display: grid;
	gap: var(--af-space-xl);
	align-items: start;
}

@media (min-width: 992px) {
	.single-product div.product {
		grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
	}

	/*
	 * Only when the store asks for it. The summary follows the gallery so the
	 * price and add to cart stay reachable beside a tall set of images, which
	 * is not what every shop wants, so it is a setting.
	 *
	 * align-self is what makes it work at all: a grid item stretches to the row
	 * height by default, and an element as tall as its container has no room to
	 * stick.
	 */
	.af-sticky-summary div.product .summary {
		position: sticky;
		inset-block-start: var(--af-sticky-offset, 96px);
		align-self: start;
	}

	/* Everything below the fold spans both columns. */
	.single-product div.product > .woocommerce-tabs,
	.single-product div.product > .af-section,
	.single-product div.product > .up-sells,
	.single-product div.product > .related,
	.single-product div.product > .af-fbt,
	.single-product div.product > .af-link-clusters {
		grid-column: 1 / -1;
	}
}

/* -------------------------------------------------------------------------
 * 2. Gallery
 * ---------------------------------------------------------------------- */

.af-gallery,
.af-product__gallery-col {
	position: relative;
	min-width: 0;
}

/*
 * Cursor zoom scales the image inside its own frame. The frame clips, so the
 * scaled image never overlaps the summary column.
 */
.af-zoomable {
	overflow: hidden;
	cursor: zoom-in;
}

.af-zoomable img {
	transition: transform 0.25s ease;
	will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
	.af-zoomable img {
		transition: none;
	}
}

/*
 * WooCommerce's product-image.php hard-codes `opacity: 0` on this element and
 * fades it in from wc-single-product.js. The theme dequeues that script because
 * it replaces the slider, so without this the gallery is present, correct, and
 * completely invisible. It has to beat an inline style, hence !important.
 */
.woocommerce-product-gallery {
	position: relative;
	margin: 0;
	opacity: 1 !important;
}

.woocommerce-product-gallery__wrapper {
	margin: 0;
}

.woocommerce-product-gallery__image img {
	width: 100%;
	border-radius: var(--af-radius-image);
	background: var(--af-surface);
}

/* --------------------------------------------------------------------------
   Gallery images

   These selectors are longer than they look like they need to be. WooCommerce's
   own stylesheet ships this, for stores whose slider never starts:

       .woocommerce div.product div.images
       .woocommerce-product-gallery__image:nth-child(n + 2) {
           width: 25%;
           display: inline-block;
       }

   which turns every image after the first into a quarter-width thumbnail. The
   theme's slider never starts either — that is the point — so the rule applies
   to every product page and outweighs anything shorter. Matching its weight is
   the only way to size these images without !important.
   -------------------------------------------------------------------------- */

/* Every image, full size: the default style. */

.af-gallery--grid .woocommerce-product-gallery__wrapper {
	display: grid;
	gap: var(--af-space-sm);
}

.af-gallery--grid .woocommerce-product-gallery.images .woocommerce-product-gallery__wrapper .woocommerce-product-gallery__image,
.af-gallery--grid .woocommerce-product-gallery.images .woocommerce-product-gallery__wrapper .woocommerce-product-gallery__image:nth-child(n + 2) {
	display: block;
	width: 100%;
	float: none;
	margin: 0;
}

/* One stage and a rail, built by assets/js/gallery.js. */

.af-gallery--enhanced .woocommerce-product-gallery.images .woocommerce-product-gallery__wrapper .woocommerce-product-gallery__image,
.af-gallery--enhanced .woocommerce-product-gallery.images .woocommerce-product-gallery__wrapper .woocommerce-product-gallery__image:nth-child(n + 2) {
	display: none;
	width: 100%;
	float: none;
	margin: 0;
}

.af-gallery--enhanced .woocommerce-product-gallery.images .woocommerce-product-gallery__wrapper .woocommerce-product-gallery__image.is-active {
	display: block;
}

/* The stage carries the arrows, so it has to be the positioning context. */
.af-gallery--enhanced .woocommerce-product-gallery__wrapper {
	position: relative;
}

.af-gallery--enhanced .woocommerce-product-gallery__wrapper:focus-visible {
	outline: 2px solid var(--af-primary);
	outline-offset: 3px;
}

.af-gallery__nav {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 var(--af-space-sm);
	/* The arrows are clickable; the strip between them must not swallow the
	   zoom and lightbox clicks on the image behind it. */
	pointer-events: none;
}

.af-gallery__arrow {
	pointer-events: auto;
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 1px solid var(--af-border);
	border-radius: 50%;
	background: var(--af-surface);
	color: var(--af-text);
	cursor: pointer;
	opacity: 0;
	transition: opacity 0.15s ease, background-color 0.15s ease;
}

.af-gallery__arrow span {
	width: 9px;
	height: 9px;
	border-top: 2px solid currentcolor;
	border-inline-end: 2px solid currentcolor;
}

.af-gallery__arrow--prev span {
	transform: rotate(-135deg);
	margin-inline-start: 3px;
}

.af-gallery__arrow--next span {
	transform: rotate(45deg);
	margin-inline-end: 3px;
}

/* Revealed on hover for pointers, always there for touch and keyboards. */
.woocommerce-product-gallery__wrapper:hover .af-gallery__arrow,
.af-gallery__arrow:focus-visible {
	opacity: 1;
}

@media (hover: none) {
	.af-gallery__arrow {
		opacity: 1;
	}
}

.af-gallery__thumbs {
	display: grid;
	gap: var(--af-space-sm);
	grid-auto-flow: column;
	grid-auto-columns: 72px;
	margin: var(--af-space-sm) 0 0;
	padding: 0;
	overflow-x: auto;
	list-style: none;
	scrollbar-width: thin;
	overscroll-behavior-inline: contain;
}

.af-gallery__thumb {
	display: block;
	width: 100%;
	padding: 0;
	border: 1px solid var(--af-border);
	border-radius: var(--af-radius-sm);
	background: var(--af-surface);
	cursor: pointer;
	overflow: hidden;
	transition: border-color 0.15s ease, opacity 0.15s ease;
	opacity: 0.75;
}

/*
 * Thumbnails are cropped to the same portrait shape rather than left at their
 * own proportions, so the rail reads as one column instead of a ragged stack.
 */
.af-gallery__thumb img {
	display: block;
	width: 100%;
	height: 100%;
	aspect-ratio: 3 / 4;
	object-fit: cover;
}

.af-gallery__thumb:hover,
.af-gallery__thumb:focus-visible {
	opacity: 1;
}

.af-gallery__thumb.is-active {
	border-color: var(--af-primary);
	opacity: 1;
}

.woocommerce-product-gallery .flex-control-thumbs {
	display: grid;
	gap: var(--af-space-sm);
	grid-template-columns: repeat(5, minmax(0, 1fr));
	margin: var(--af-space-sm) 0 0;
	padding: 0;
	list-style: none;
}

.woocommerce-product-gallery .flex-control-thumbs img {
	width: 100%;
	border: 1px solid transparent;
	border-radius: var(--af-radius-sm);
	cursor: pointer;
	opacity: 0.7;
	transition: opacity 0.15s ease, border-color 0.15s ease;
}

.woocommerce-product-gallery .flex-control-thumbs img:hover,
.woocommerce-product-gallery .flex-control-thumbs .flex-active {
	border-color: var(--af-primary);
	opacity: 1;
}

/* Thumbnails beside the stage on wide screens. */
@media (min-width: 992px) {
	.af-gallery--thumbs-left .woocommerce-product-gallery {
		display: grid;
		grid-template-columns: 84px minmax(0, 1fr);
		gap: var(--af-space-sm);
	}

	.af-gallery--thumbs-left .woocommerce-product-gallery__wrapper {
		order: 2;
	}

	.af-gallery--thumbs-left .flex-control-thumbs {
		order: 1;
		grid-template-columns: minmax(0, 1fr);
		grid-auto-rows: max-content;
		margin: 0;
		max-height: 620px;
		overflow-y: auto;
		scrollbar-width: thin;
	}

	/*
	 * Every image is already on screen in this style, so WooCommerce's own
	 * thumbnail strip would only repeat what the visitor can see.
	 */
	.af-gallery--grid .flex-control-thumbs {
		display: none;
	}

	/* The theme gallery mirrors those arrangements with its own rail. */
	.af-gallery--thumbs-left.af-gallery--enhanced .woocommerce-product-gallery {
		display: grid;
		grid-template-columns: 96px minmax(0, 1fr);
		gap: var(--af-space-md);
		align-items: start;
	}

	/*
	 * The rail scrolls independently and is capped near the height of the
	 * stage, so a twelve image product does not stretch the column.
	 */
	.af-gallery--thumbs-left.af-gallery--enhanced .af-gallery__thumbs {
		grid-auto-flow: row;
		grid-auto-columns: auto;
		grid-template-columns: minmax(0, 1fr);
		margin: 0;
		max-height: 680px;
		overflow-x: visible;
		overflow-y: auto;
		scroll-behavior: smooth;
	}
}

.woocommerce-product-gallery__trigger {
	position: absolute;
	inset-block-start: var(--af-space-sm);
	inset-inline-end: var(--af-space-sm);
	z-index: 3;
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: color-mix(in srgb, var(--af-background) 90%, transparent);
	color: var(--af-primary);
	font-size: 0;
	text-decoration: none;
}

.woocommerce-product-gallery__trigger::before {
	content: "⤢";
	font-size: 18px;
}

/*
 * Built-in lightbox, used only when PhotoSwipe is absent. It is a plain
 * full-screen dialog rather than a carousel: arrow keys move between images
 * and the close button takes focus on open.
 */
.af-lightbox {
	position: fixed;
	inset: 0;
	z-index: 300;
	display: grid;
	place-items: center;
	padding: var(--af-space-lg);
	background: rgba(12, 14, 18, 0.92);
}

.af-lightbox__image {
	max-width: min(100%, 1100px);
	max-height: 90vh;
	object-fit: contain;
}

.af-lightbox__close {
	position: absolute;
	inset-block-start: var(--af-space-md);
	inset-inline-end: var(--af-space-md);
	width: 44px;
	height: 44px;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
}

.af-lightbox__close:hover,
.af-lightbox__close:focus-visible {
	background: rgba(255, 255, 255, 0.24);
}

/* -------------------------------------------------------------------------
 * 3. Summary
 * ---------------------------------------------------------------------- */

.single-product div.product .summary {
	display: flex;
	flex-direction: column;
	gap: var(--af-space-md);
	min-width: 0;
}

.single-product div.product .summary > * {
	margin: 0;
}

.af-product__brand {
	color: var(--af-muted);
	font-size: var(--af-fs-caption);
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.af-product__brand-link {
	color: inherit;
	text-decoration: none;
}

.af-product__brand-link:hover {
	color: var(--af-accent);
}

.af-product__title {
	font-size: var(--af-fs-h2);
}

.af-product__rating-line {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--af-space-md);
	color: var(--af-muted);
	font-size: var(--af-fs-caption);
}

.af-product__sku span {
	color: var(--af-text);
}

.single-product div.product p.price,
.single-product div.product span.price {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: var(--af-space-sm);
	color: var(--af-heading);
	font-family: var(--af-font-price);
	font-size: var(--af-fs-h3);
	font-weight: 700;
}

.single-product div.product p.price del {
	color: var(--af-muted);
	font-size: 0.65em;
	font-weight: 400;
}

.single-product div.product p.price ins {
	color: var(--af-sale);
	text-decoration: none;
}

.af-product__discount {
	margin: 0;
}

.af-product__rewards {
	color: var(--af-accent);
	font-size: var(--af-fs-small);
}

.single-product .stock.in-stock {
	color: var(--af-success);
	font-size: var(--af-fs-small);
	font-weight: 600;
}

.single-product .stock.out-of-stock {
	color: var(--af-error);
	font-weight: 600;
}

.woocommerce-product-details__short-description {
	color: var(--af-secondary);
	font-size: var(--af-fs-small);
}

/* -------------------------------------------------------------------------
 * 4. Add to cart
 * ---------------------------------------------------------------------- */

.single-product form.cart {
	display: grid;
	gap: var(--af-space-md);
	margin: 0;
}

.single-product form.cart .variations {
	width: 100%;
	margin: 0;
	border: 0;
}

.single-product form.cart .variations tr {
	display: grid;
	gap: 6px;
}

.single-product form.cart .variations th,
.single-product form.cart .variations td {
	display: block;
	padding: 0;
	border: 0;
}

.single-product form.cart .variations th {
	font-size: var(--af-fs-small);
	font-weight: 600;
}

.single-product form.cart .variations + .single_variation_wrap {
	margin-top: var(--af-space-sm);
}

.single-product .reset_variations {
	display: inline-block;
	margin-top: 6px;
	color: var(--af-muted);
	font-size: var(--af-fs-caption);
}

.single-product form.cart .quantity,
.af-qty {
	display: inline-flex;
	align-items: stretch;
	border: 1px solid var(--af-border);
	border-radius: var(--af-radius-button);
	overflow: hidden;
}

.af-qty__btn {
	display: grid;
	place-items: center;
	width: 42px;
	border: 0;
	background: var(--af-surface);
	color: var(--af-text);
	font-size: 1rem;
	line-height: 1;
}

.af-qty__btn:hover {
	background: var(--af-border);
}

.af-qty__input,
.single-product form.cart .quantity input.qty {
	width: 58px;
	min-height: 44px;
	border: 0;
	border-radius: 0;
	background: transparent;
	text-align: center;
	font-variant-numeric: tabular-nums;
	-moz-appearance: textfield;
	appearance: textfield;
}

.af-qty__input::-webkit-outer-spin-button,
.af-qty__input::-webkit-inner-spin-button,
.single-product form.cart .quantity input.qty::-webkit-inner-spin-button {
	margin: 0;
	-webkit-appearance: none;
	appearance: none;
}

.af-qty--compact .af-qty__btn {
	width: 32px;
}

.af-qty--compact .af-qty__input {
	width: 42px;
	min-height: 34px;
}

.single-product form.cart .single_add_to_cart_button,
.af-buy-now {
	flex: 1 1 auto;
	min-height: 52px;
	padding-inline: var(--af-space-xl);
	border: 1px solid transparent;
	border-radius: var(--af-radius-button);
	background: var(--af-button-bg);
	color: var(--af-button-color);
	font-family: var(--af-font-button);
	font-size: var(--af-fs-base);
	font-weight: var(--af-button-weight);
	text-transform: var(--af-button-case);
}

.single-product form.cart .single_add_to_cart_button:hover {
	background: var(--af-button-bg-hover);
	color: var(--af-button-color-hover);
}

.single-product form.cart .single_add_to_cart_button.disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

/* Quantity and the primary button share a row; secondary actions sit below. */
.single-product form.cart > .quantity {
	grid-column: 1;
}

@media (min-width: 480px) {
	.single-product form.cart:not(.variations_form):not(.grouped_form) {
		grid-template-columns: auto minmax(0, 1fr);
		align-items: center;
	}
}

/* Anything a plugin or the shop owner drops into the summary widget area. */
.af-product__widgets {
	display: grid;
	gap: var(--af-space-sm);
}

.af-product__secondary-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--af-space-sm);
}

.af-product__size-guide a,
.af-link-icon {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--af-secondary);
	font-size: var(--af-fs-small);
}

/* -------------------------------------------------------------------------
 * 5. Swatches
 * ---------------------------------------------------------------------- */

.af-swatches {
	display: grid;
	gap: 6px;
}

/*
 * The native select stays in the DOM and keeps working; it is only hidden from
 * sight. That is what allows WooCommerce's variation script to remain the
 * single source of truth for which combination is selected.
 */
.af-swatches__select {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
}

.af-swatches__options {
	display: flex;
	flex-wrap: wrap;
	gap: var(--af-space-xs);
	margin: 0;
	padding: 0;
	list-style: none;
}

.af-swatch {
	position: relative;
	display: grid;
	place-items: center;
	min-width: 40px;
	min-height: 40px;
	padding: 4px 10px;
	border: 1px solid var(--af-border);
	border-radius: var(--af-radius-sm);
	background: var(--af-background);
	color: var(--af-text);
	font-size: var(--af-fs-small);
}

.af-swatch:hover {
	border-color: var(--af-primary);
}

.af-swatch[aria-pressed="true"],
.af-swatch.is-selected {
	border-color: var(--af-primary);
	box-shadow: inset 0 0 0 1px var(--af-primary);
}

.af-swatch.is-unavailable {
	opacity: 0.4;
	/* Struck through as well as faded: colour alone is not a status. */
	text-decoration: line-through;
}

.af-swatch--color,
.af-swatch--image {
	width: 40px;
	padding: 0;
	border-radius: 50%;
	background-size: cover;
	background-position: center;
}

.af-swatch--color[aria-pressed="true"],
.af-swatch--image[aria-pressed="true"] {
	box-shadow: none;
	outline: 2px solid var(--af-primary);
	outline-offset: 2px;
}

/* The visible label inside a text swatch — size codes, fits, lengths. */
.af-swatch__text {
	display: block;
	line-height: 1;
}

.af-swatch__tooltip {
	position: absolute;
	inset-block-end: calc(100% + 6px);
	z-index: 3;
	padding: 3px 8px;
	border-radius: var(--af-radius-sm);
	background: var(--af-primary);
	color: #fff;
	font-size: 11px;
	white-space: nowrap;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.15s ease;
}

.af-swatch:hover .af-swatch__tooltip,
.af-swatch:focus-visible .af-swatch__tooltip {
	opacity: 1;
}

/* -------------------------------------------------------------------------
 * 6. Delivery, meta, share, payments
 * ---------------------------------------------------------------------- */

.af-delivery {
	display: grid;
	gap: var(--af-space-sm);
	padding: var(--af-space-md);
	border: 1px solid var(--af-border);
	border-radius: var(--af-radius-md);
	background: var(--af-surface);
}

.af-delivery__item {
	display: flex;
	align-items: flex-start;
	gap: var(--af-space-sm);
}

.af-delivery__icon {
	flex: none;
	color: var(--af-accent);
}

.af-delivery__body {
	min-width: 0;
}

.af-delivery__title {
	margin: 0;
	font-size: var(--af-fs-small);
	font-weight: 600;
}

.af-delivery__text {
	margin: 0;
	color: var(--af-muted);
	font-size: var(--af-fs-caption);
}

.af-product-meta {
	display: grid;
	gap: 4px;
	padding-block-start: var(--af-space-md);
	border-top: 1px solid var(--af-border);
	color: var(--af-muted);
	font-size: var(--af-fs-caption);
}

.af-product-meta__row a {
	color: var(--af-secondary);
}

.af-share {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--af-space-sm);
}

.af-share__label {
	color: var(--af-muted);
	font-size: var(--af-fs-caption);
}

.af-share__list {
	display: flex;
	gap: var(--af-space-xs);
	margin: 0;
	padding: 0;
	list-style: none;
}

.af-share__link,
.af-share__copy {
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	border: 1px solid var(--af-border);
	border-radius: 50%;
	background: transparent;
	color: var(--af-secondary);
}

.af-share__link:hover,
.af-share__copy:hover {
	border-color: var(--af-primary);
	color: var(--af-primary);
}

.af-product-payments {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--af-space-sm);
}

.af-product-payments__label {
	color: var(--af-muted);
	font-size: var(--af-fs-caption);
}

/* -------------------------------------------------------------------------
 * 7. Tabs and reviews
 * ---------------------------------------------------------------------- */

.woocommerce-tabs {
	margin-block: var(--af-space-xxl);
}

.woocommerce-tabs ul.tabs {
	display: flex;
	flex-wrap: wrap;
	gap: var(--af-space-lg);
	margin: 0 0 var(--af-space-lg);
	padding: 0 0 0;
	border-bottom: 1px solid var(--af-border);
	list-style: none;
}

.woocommerce-tabs ul.tabs li a {
	display: block;
	padding-block: var(--af-space-sm);
	border-bottom: 2px solid transparent;
	color: var(--af-muted);
	font-size: var(--af-fs-small);
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
}

.woocommerce-tabs ul.tabs li.active a,
.woocommerce-tabs ul.tabs li a:hover {
	border-bottom-color: var(--af-primary);
	color: var(--af-heading);
}

.woocommerce-Tabs-panel {
	max-width: 82ch;
}

.woocommerce-Tabs-panel h2:first-child {
	display: none;
}

.af-rating-summary {
	display: grid;
	gap: var(--af-space-lg);
	align-items: center;
	margin-bottom: var(--af-space-lg);
	padding: var(--af-space-lg);
	border: 1px solid var(--af-border);
	border-radius: var(--af-radius-md);
}

@media (min-width: 600px) {
	.af-rating-summary {
		grid-template-columns: auto minmax(0, 1fr);
	}
}

.af-rating-summary__score {
	text-align: center;
}

.af-rating-summary__average {
	display: block;
}

.af-rating-summary__value {
	font-family: var(--af-font-price);
	font-size: 2.6rem;
	font-weight: 700;
	line-height: 1;
}

/* "5 stars", "4 stars" — the row label beside each distribution bar. */
.af-rating-summary__label {
	color: var(--af-muted);
	white-space: nowrap;
}

.af-rating-summary__out,
.af-rating-summary__count {
	color: var(--af-muted);
	font-size: var(--af-fs-caption);
}

.af-rating-summary__bars {
	display: grid;
	gap: 6px;
}

.af-rating-summary__row {
	display: grid;
	grid-template-columns: 4.5rem minmax(0, 1fr) 2.5rem;
	align-items: center;
	gap: var(--af-space-sm);
	font-size: var(--af-fs-caption);
}

.af-rating-summary__bar {
	height: 8px;
	border-radius: 999px;
	background: var(--af-surface);
	overflow: hidden;
}

.af-rating-summary__fill {
	display: block;
	height: 100%;
	border-radius: inherit;
	background: var(--af-star);
}

.af-rating-summary__number {
	color: var(--af-muted);
	text-align: end;
	font-variant-numeric: tabular-nums;
}

.woocommerce #reviews .commentlist {
	display: grid;
	gap: var(--af-space-lg);
	margin: 0;
	padding: 0;
	list-style: none;
}

.woocommerce #reviews .comment_container {
	display: grid;
	grid-template-columns: 48px minmax(0, 1fr);
	gap: var(--af-space-md);
}

.woocommerce #reviews .avatar {
	border-radius: 50%;
}

.woocommerce #reviews .comment-text {
	min-width: 0;
}

.woocommerce-review__author {
	font-weight: 600;
}

.woocommerce-review__published-date {
	color: var(--af-muted);
	font-size: var(--af-fs-caption);
}

.woocommerce-review__verified,
.af-review__verified {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	color: var(--af-success);
	font-size: var(--af-fs-caption);
	font-style: normal;
}

/* -------------------------------------------------------------------------
 * 8. Frequently bought together
 * ---------------------------------------------------------------------- */

.af-fbt__inner {
	display: grid;
	gap: var(--af-space-lg);
	align-items: center;
	padding: var(--af-space-lg);
	border: 1px solid var(--af-border);
	border-radius: var(--af-radius-md);
}

@media (min-width: 782px) {
	.af-fbt__inner {
		grid-template-columns: minmax(0, 1fr) auto;
	}
}

.af-fbt__items {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--af-space-sm);
}

.af-fbt__plus {
	color: var(--af-muted);
	font-size: 1.2rem;
}

.af-fbt__item {
	width: 130px;
}

.af-fbt__link {
	color: inherit;
	text-decoration: none;
}

.af-fbt__image {
	width: 100%;
	aspect-ratio: 3 / 4;
	border-radius: var(--af-radius-sm);
	object-fit: cover;
	background: var(--af-surface);
}

.af-fbt__name {
	display: block;
	margin-top: 6px;
	font-size: var(--af-fs-caption);
	line-height: 1.35;
}

.af-fbt__price {
	font-size: var(--af-fs-caption);
	font-weight: 600;
}

.af-fbt__summary {
	text-align: center;
}

.af-fbt__total {
	display: block;
	margin-bottom: var(--af-space-sm);
	font-family: var(--af-font-price);
	font-size: var(--af-fs-h4);
	font-weight: 700;
}

.af-fbt__actions {
	display: grid;
	gap: 6px;
}

/* -------------------------------------------------------------------------
 * 9. Sticky add to cart
 * ---------------------------------------------------------------------- */

.af-sticky-cart {
	position: fixed;
	inset-block-end: 0;
	inset-inline: 0;
	z-index: 80;
	padding-block: var(--af-space-sm);
	border-top: 1px solid var(--af-border);
	background: var(--af-background);
	box-shadow: 0 -6px 24px -16px rgba(0, 0, 0, 0.35);
	transform: translateY(100%);
	visibility: hidden;
	transition: transform 0.25s ease, visibility 0.25s;
}

.af-sticky-cart.is-visible {
	transform: none;
	visibility: visible;
}

.af-sticky-cart__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--af-space-md);
}

.af-sticky-cart__product {
	display: flex;
	align-items: center;
	gap: var(--af-space-sm);
	min-width: 0;
}

.af-sticky-cart__image {
	width: 44px;
	height: 56px;
	border-radius: var(--af-radius-sm);
	object-fit: cover;
}

.af-sticky-cart__title {
	display: block;
	overflow: hidden;
	font-size: var(--af-fs-small);
	font-weight: 600;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.af-sticky-cart__price {
	color: var(--af-secondary);
	font-family: var(--af-font-price);
	font-size: var(--af-fs-caption);
}

.af-sticky-cart__actions {
	flex: none;
}

@media (max-width: 600px) {
	.af-sticky-cart__text {
		display: none;
	}

	.af-sticky-cart__actions .af-btn {
		padding-inline: var(--af-space-lg);
	}
}

/* Bottom navigation and the sticky bar must not stack on top of each other. */
.admin-bar .af-sticky-cart {
	inset-block-end: 0;
}

body:has(.af-bottom-nav) .af-sticky-cart {
	inset-block-end: 60px;
}
