/**
 * FLUXX — the product page.
 *
 * Includes the gallery layout. WooCommerce's own stylesheets are dequeued, and
 * they are what position the flexslider gallery — without this the main image
 * collapses to nothing and the thumbnails render as a numbered list.
 */

.fx-pdp {
	padding-top: 12px;
}

/* ---------------------------------------------------------------- layout */

.fx-product__layout {
	display: grid;
	grid-template-columns: 1fr;
	gap: 24px;
	align-items: start;
}

@media (min-width: 900px) {
	.fx-product__layout {
		/* Gallery takes the larger share: on a clothing site the photograph is
		   the product, and the buy column only needs enough room to be read. */
		grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
		gap: 48px;
	}

	.fx-product__summary {
		position: sticky;
		/* Clear the sticky header plus a little breathing room. */
		top: calc(var(--fx-header-h-md) + 20px);
	}
}

/* --------------------------------------------------------------- gallery */

.woocommerce-product-gallery {
	position: relative;
}

.woocommerce-product-gallery__wrapper {
	margin: 0;
	padding: 0;
	list-style: none;
}

.woocommerce-product-gallery__image {
	margin: 0;
	list-style: none;
}

.woocommerce-product-gallery__image img {
	width: 100%;
	height: auto;
	aspect-ratio: var(--fx-product-ratio);
	object-fit: cover;
	background: var(--fx-media-ground);
	display: block;
}

/*
 * Without JavaScript, or before flexslider initialises, every gallery image is
 * in the document at once. Show only the first: a column of five full-size
 * photographs is not a gallery, it is a scroll.
 */
.woocommerce-product-gallery:not(.flex-container) .woocommerce-product-gallery__wrapper > *:not(:first-child) {
	display: none;
}

/* The zoom trigger WooCommerce injects. */
.woocommerce-product-gallery__trigger {
	position: absolute;
	top: 12px;
	inset-inline-end: 12px;
	z-index: 2;
	width: 38px;
	height: 38px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: var(--fx-paper);
	color: var(--fx-ink);
	border: 1px solid var(--fx-border);
	font-size: 0;
}

.woocommerce-product-gallery__trigger::after {
	content: "";
	width: 16px;
	height: 16px;
	background: currentColor;
	/* The search glyph from the theme's icon set, as a mask so it inherits colour. */
	mask: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30' fill='none' stroke='%23000' stroke-width='1.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m26.25 26.25-5.425-5.425m2.925-7.075c0 5.523-4.477 10-10 10s-10-4.477-10-10 4.477-10 10-10 10 4.477 10 10Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Thumbnails: a row under the main image, not a numbered list beside it. */
.flex-control-thumbs {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: 72px;
	gap: 6px;
	margin: 6px 0 0;
	padding: 0;
	list-style: none;
	overflow-x: auto;
	scrollbar-width: none;
}

.flex-control-thumbs::-webkit-scrollbar {
	display: none;
}

.flex-control-thumbs li {
	margin: 0;
	list-style: none;
}

.flex-control-thumbs img {
	width: 100%;
	aspect-ratio: var(--fx-product-ratio);
	object-fit: cover;
	cursor: pointer;
	opacity: .55;
	background: var(--fx-media-ground);
	transition: opacity var(--fx-dur) var(--fx-ease);
}

.flex-control-thumbs img:hover,
.flex-control-thumbs img.flex-active {
	opacity: 1;
}

/* flexslider's own scaffolding, which lived in the stylesheet we dequeued. */
.flex-viewport {
	overflow: hidden;
}

.woocommerce-product-gallery .flex-direction-nav {
	display: none;
}

/* --------------------------------------------------------------- summary */

.fx-product__title {
	margin-bottom: 10px;
}

.fx-product__price {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 10px;
	font-size: 18px;
}

.fx-product__price .fx-price,
.fx-product__price .price {
	font-size: 18px;
}

.fx-product__tax-note {
	margin-top: 4px;
	color: var(--fx-text-muted);
}

.fx-product__summary .woocommerce-product-rating {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 10px 0 0;
	font-size: 12px;
}

/* ---------------------------------------------------------------- offers */

.fx-offers {
	margin-top: 18px;
	padding: 14px;
	background: var(--fx-sand);
}

.fx-offers__title {
	margin-bottom: 8px;
}

.fx-offers__list {
	display: grid;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.fx-offer {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 12px;
}

.fx-offer__code {
	flex-shrink: 0;
	padding: 5px 9px;
	border: 1px dashed var(--fx-ink);
	background: var(--fx-paper);
	font-size: 11px;
	font-weight: var(--fx-weight-bold);
	letter-spacing: var(--fx-tracking-badge);
	text-transform: uppercase;
	cursor: pointer;
}

.fx-offer__code:hover {
	background: var(--fx-ink);
	color: var(--fx-text-on-dark);
}

.fx-offer__text {
	color: var(--fx-text-muted);
}

/* --------------------------------------------------------------- colours */

.fx-product__colours {
	margin-top: 22px;
}

.fx-product__colours-head {
	display: flex;
	align-items: baseline;
	gap: 8px;
	margin-bottom: 10px;
}

.fx-product__colour-name {
	color: var(--fx-text-muted);
}

.fx-product__colour-list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

/*
 * A colourway is a photograph with a colour dot on it, not a bare dot.
 *
 * A row of coloured circles asks the customer to imagine the garment; a row of
 * thumbnails shows it. The dot stays as the label for anyone who has images off.
 */
.fx-colour {
	position: relative;
	display: block;
	width: 52px;
	border: 1px solid transparent;
	background: var(--fx-media-ground);
	transition: border-color var(--fx-dur) var(--fx-ease);
}

.fx-colour img {
	width: 100%;
	aspect-ratio: var(--fx-product-ratio);
	object-fit: cover;
	display: block;
}

.fx-colour__dot {
	position: absolute;
	bottom: 4px;
	inset-inline-end: 4px;
	width: 12px;
	height: 12px;
	border-radius: var(--fx-radius-round);
	border: 1px solid rgba(255, 255, 255, .85);
	background-color: var(--fx-swatch-colour, transparent);
	box-shadow: 0 0 0 1px rgba(0, 0, 0, .18);
}

.fx-colour.is-selected {
	border-color: var(--fx-ink);
}

.fx-colour.is-soldout img {
	opacity: .4;
}

.fx-colour.is-soldout::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(to top left, transparent calc(50% - 1px), var(--fx-border-control), transparent calc(50% + 1px));
}

/* ---------------------------------------------------- variations and sizes */

.fx-product__summary .variations {
	width: 100%;
	margin: 22px 0 0;
	border: 0;
}

.fx-product__summary .variations th,
.fx-product__summary .variations td {
	display: block;
	padding: 0;
	border: 0;
	text-align: start;
}

.fx-product__summary .variations .label {
	margin-bottom: 10px;
}

.fx-product__summary .variations label {
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: var(--fx-tracking-nav);
}

.fx-product__summary .reset_variations {
	display: inline-block;
	margin-top: 10px;
	font-size: 11px;
	text-decoration: underline;
	text-underline-offset: 0.25em;
}

/*
 * The size row, rendered by the swatch plugin.
 *
 * Targeted on the plugin's own element classes rather than through a body
 * class, because the body class is not guaranteed to be present and a selector
 * that silently stops matching leaves the plugin's default pill styling in
 * place — which belongs to a different design entirely.
 *
 * `!important` is used sparingly and deliberately: the plugin ships inline
 * width and height on these elements from its settings screen.
 */
.variable-items-wrapper {
	display: flex !important;
	flex-wrap: wrap;
	gap: 0;
	margin: 0;
	padding: 0;
	list-style: none;
}

.variable-items-wrapper .variable-item {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	width: auto !important;
	min-width: 48px !important;
	height: var(--fx-control-md) !important;
	padding: 0 12px !important;
	/* Collapse shared borders so the row reads as one connected strip. */
	margin: 0 0 0 -1px !important;
	border: 1px solid var(--fx-border-control) !important;
	border-radius: var(--fx-radius-none) !important;
	background: var(--fx-paper) !important;
	box-shadow: none !important;
	font-size: 12px;
	cursor: pointer;
	transition: border-color var(--fx-dur) var(--fx-ease), background-color var(--fx-dur) var(--fx-ease);
}

.variable-items-wrapper .variable-item:first-child {
	margin-inline-start: 0 !important;
}

.variable-items-wrapper .variable-item:hover {
	background: var(--fx-surface) !important;
}

.variable-items-wrapper .variable-item.selected {
	position: relative;
	z-index: 1;
	border-color: var(--fx-ink) !important;
	background: var(--fx-paper) !important;
	box-shadow: none !important;
}

.variable-items-wrapper .variable-item-contents,
.variable-items-wrapper .variable-item-span {
	line-height: 1;
}

/* Sold out: struck through and faded, but still clickable for "notify me". */
.variable-items-wrapper .variable-item.disabled,
.variable-items-wrapper .variable-item.out-of-stock,
.variable-items-wrapper .variable-item[aria-disabled="true"] {
	opacity: .3;
	text-decoration: line-through;
}

/* The plugin's tooltip is a black box on hover; the label is already visible. */
.variable-items-wrapper .variable-item::before,
.variable-items-wrapper .variable-item::after {
	display: none !important;
}

/* Flashed when the sticky bar is tapped before a size is chosen. */
.fx-attention {
	animation: fx-attention .6s var(--fx-ease) 2;
}

@keyframes fx-attention {
	0%, 100% { opacity: 1; }
	50%      { opacity: .35; }
}

.fx-size-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 10px;
}

.fx-size-chart-link {
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: var(--fx-tracking-nav);
	text-decoration: underline;
	text-underline-offset: 0.25em;
	cursor: pointer;
}

/* ------------------------------------------------------------ add to cart */

.fx-product__summary form.cart {
	margin: 20px 0 0;
}

.fx-product__summary .single_variation_wrap {
	margin-top: 16px;
}

.fx-product__summary .woocommerce-variation-price {
	margin-bottom: 12px;
	font-size: 16px;
}

.fx-product__summary .quantity {
	display: inline-flex;
	align-items: center;
	height: var(--fx-control-cta);
	border: 1px solid var(--fx-border-control);
	margin-inline-end: 8px;
}

.fx-product__summary .quantity input.qty {
	width: 56px;
	height: 100%;
	border: 0;
	text-align: center;
	background: none;
	font-size: 14px;
	-moz-appearance: textfield;
}

.fx-product__summary .quantity input::-webkit-outer-spin-button,
.fx-product__summary .quantity input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.fx-product__summary button.single_add_to_cart_button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: var(--fx-control-cta);
	/* Fills whatever the quantity box leaves. The buy button is the one thing
	   on the page that should never be ambiguous. */
	flex: 1 1 auto;
	min-width: 200px;
	padding-inline: 24px;
	border: 0;
	border-radius: var(--fx-radius-none);
	background: var(--fx-ink);
	color: var(--fx-text-on-dark);
	font-size: 14px;
	font-weight: var(--fx-weight-bold);
	letter-spacing: var(--fx-tracking-cta);
	text-transform: uppercase;
	cursor: pointer;
	transition: background-color var(--fx-dur) var(--fx-ease);
}

.fx-product__summary button.single_add_to_cart_button:hover {
	background: var(--fx-ink-hover);
}

/*
 * Before a size is chosen WooCommerce disables the button.
 *
 * Left alone that is a flat grey slab in the most important position on the
 * page, and it reads as a broken site rather than as an instruction. An outline
 * button says "not yet" without saying "broken", and the label is swapped to
 * "Select a size" in fluxx.js.
 */
.fx-product__summary button.single_add_to_cart_button.disabled,
.fx-product__summary button.single_add_to_cart_button.wc-variation-selection-needed {
	background: transparent;
	color: var(--fx-text-muted);
	border: 1px dashed var(--fx-border-control);
	opacity: 1;
	cursor: default;
}

.fx-product__summary button.single_add_to_cart_button.disabled:hover,
.fx-product__summary button.single_add_to_cart_button.wc-variation-selection-needed:hover {
	background: transparent;
}

/* Genuinely unavailable, rather than merely not-yet-chosen. */
.fx-product__summary button.single_add_to_cart_button.wc-variation-is-unavailable {
	border-style: solid;
	color: var(--fx-danger);
}

.fx-product__summary form.cart:not(.variations_form) .quantity,
.fx-product__summary .woocommerce-variation-add-to-cart {
	display: flex;
	align-items: stretch;
	gap: 8px;
}

/* --------------------------------------------------------------- delivery */

.fx-delivery {
	margin-top: 24px;
	padding-top: 20px;
	border-top: 1px solid var(--fx-border);
}

.fx-delivery__field {
	display: flex;
	align-items: center;
	gap: 8px;
	height: var(--fx-control-lg);
	margin-top: 10px;
	padding-inline: 12px;
	border: 1px solid var(--fx-border-control);
}

.fx-delivery__input {
	flex: 1 1 auto;
	min-width: 0;
	border: 0;
	background: none;
	font-size: 14px;
	outline: none;
}

.fx-delivery__submit {
	flex-shrink: 0;
	font-size: 11px;
	font-weight: var(--fx-weight-bold);
	text-transform: uppercase;
	letter-spacing: var(--fx-tracking-nav);
	text-decoration: underline;
	text-underline-offset: 0.25em;
}

.fx-delivery__result {
	margin: 8px 0 0;
	font-size: 12px;
	min-height: 1em;
}

.fx-delivery__result.is-ok {
	color: var(--fx-success);
}

.fx-delivery__result.is-bad {
	color: var(--fx-danger);
}

/* ------------------------------------------------------------ assurances */

.fx-assurances {
	display: grid;
	gap: 10px;
	margin: 20px 0 0;
	padding: 16px 0 0;
	border-top: 1px solid var(--fx-border);
	list-style: none;
}

.fx-assurance {
	display: flex;
	align-items: center;
	gap: 10px;
	color: var(--fx-text-muted);
}

/* ------------------------------------------------------------ accordions */

/*
 * Left-aligned under the gallery, not centred.
 *
 * A max-width inside a centring container floats the text block into the middle
 * of the page, unrelated to either column above it. Aligning it to the gallery
 * edge keeps the reading line where the eye already is.
 */
.fx-accordions {
	margin-top: 40px;
	max-width: 820px;
	margin-inline-start: 0;
}

.fx-accordion {
	border-bottom: 1px solid var(--fx-border);
}

.fx-accordion:first-child {
	border-top: 1px solid var(--fx-border);
}

.fx-accordion__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 16px 0;
	cursor: pointer;
	list-style: none;
}

.fx-accordion__head::-webkit-details-marker {
	display: none;
}

.fx-accordion__chevron {
	transition: transform var(--fx-dur-exit) var(--fx-ease);
}

.fx-accordion[open] .fx-accordion__chevron {
	transform: rotate(180deg);
}

.fx-accordion__body {
	padding-bottom: 20px;
	font-size: 14px;
	color: var(--fx-text-muted);
}

.fx-specs {
	display: grid;
	gap: 0;
	margin: 0;
}

.fx-spec {
	display: grid;
	grid-template-columns: 140px minmax(0, 1fr);
	gap: 12px;
	padding: 8px 0;
	border-bottom: 1px solid var(--fx-border);
}

.fx-spec:last-child {
	border-bottom: 0;
}

.fx-spec dt {
	font-weight: var(--fx-weight-bold);
	color: var(--fx-text);
}

.fx-spec dd {
	margin: 0;
}

/* ----------------------------------------------------------- size chart */

.fx-sizechart__table {
	width: 100%;
	border-collapse: collapse;
	font-size: 13px;
}

.fx-sizechart__table th,
.fx-sizechart__table td {
	padding: 10px 8px;
	border-bottom: 1px solid var(--fx-border);
	text-align: start;
}

.fx-sizechart__table th {
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: var(--fx-tracking-nav);
}

.fx-sizechart__note {
	margin-top: 14px;
	color: var(--fx-text-muted);
}

/* ------------------------------------------------------ related products */

.related.products,
.up-sells.products {
	margin-top: 48px;
}

.related.products > h2,
.up-sells.products > h2 {
	margin-bottom: 16px;
}

/* --------------------------------------------------------- sticky bar */

.fx-sticky-cta__inner {
	display: flex;
	align-items: center;
	gap: 12px;
}

.fx-sticky-cta__price {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.fx-sticky-cta__name {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.fx-sticky-cta__btn {
	flex: 1 1 auto;
	min-width: 140px;
}

/* ----------------------------------------------------------------- reviews */

#reviews {
	margin-top: 48px;
}

.woocommerce-Reviews-title {
	margin-bottom: 16px;
}

.commentlist {
	margin: 0;
	padding: 0;
	list-style: none;
}

.commentlist .comment_container {
	display: grid;
	grid-template-columns: 48px minmax(0, 1fr);
	gap: 14px;
	padding: 18px 0;
	border-bottom: 1px solid var(--fx-border);
}

.commentlist img.avatar {
	width: 48px;
	height: 48px;
	border-radius: var(--fx-radius-round);
}

.woocommerce-review__author {
	font-weight: var(--fx-weight-bold);
}

.woocommerce-review__published-date {
	color: var(--fx-text-muted);
	font-size: 12px;
}

/* Star ratings, whose glyph font also lived in the dequeued stylesheet. */
.star-rating,
.comment-form-rating .stars {
	display: inline-flex;
	gap: 2px;
}

.star-rating {
	position: relative;
	width: 84px;
	height: 14px;
	overflow: hidden;
	font-size: 0;
	background: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='84' height='14' viewBox='0 0 84 14'%3E%3Cg fill='none' stroke='%23B8B8B8' stroke-width='1'%3E%3Cpath d='M7 1.5l1.7 3.5 3.8.6-2.75 2.7.65 3.8L7 10.3l-3.4 1.8.65-3.8L1.5 5.6l3.8-.6z'/%3E%3Cpath d='M24 1.5l1.7 3.5 3.8.6-2.75 2.7.65 3.8L24 10.3l-3.4 1.8.65-3.8L18.5 5.6l3.8-.6z'/%3E%3Cpath d='M41 1.5l1.7 3.5 3.8.6-2.75 2.7.65 3.8L41 10.3l-3.4 1.8.65-3.8L35.5 5.6l3.8-.6z'/%3E%3Cpath d='M58 1.5l1.7 3.5 3.8.6-2.75 2.7.65 3.8L58 10.3l-3.4 1.8.65-3.8L52.5 5.6l3.8-.6z'/%3E%3Cpath d='M75 1.5l1.7 3.5 3.8.6-2.75 2.7.65 3.8L75 10.3l-3.4 1.8.65-3.8L69.5 5.6l3.8-.6z'/%3E%3C/g%3E%3C/svg%3E") repeat-x;
}

.star-rating span {
	position: absolute;
	inset-block-start: 0;
	inset-inline-start: 0;
	height: 14px;
	overflow: hidden;
	font-size: 0;
	background: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='84' height='14' viewBox='0 0 84 14'%3E%3Cg fill='%230B0B0B'%3E%3Cpath d='M7 1.5l1.7 3.5 3.8.6-2.75 2.7.65 3.8L7 10.3l-3.4 1.8.65-3.8L1.5 5.6l3.8-.6z'/%3E%3Cpath d='M24 1.5l1.7 3.5 3.8.6-2.75 2.7.65 3.8L24 10.3l-3.4 1.8.65-3.8L18.5 5.6l3.8-.6z'/%3E%3Cpath d='M41 1.5l1.7 3.5 3.8.6-2.75 2.7.65 3.8L41 10.3l-3.4 1.8.65-3.8L35.5 5.6l3.8-.6z'/%3E%3Cpath d='M58 1.5l1.7 3.5 3.8.6-2.75 2.7.65 3.8L58 10.3l-3.4 1.8.65-3.8L52.5 5.6l3.8-.6z'/%3E%3Cpath d='M75 1.5l1.7 3.5 3.8.6-2.75 2.7.65 3.8L75 10.3l-3.4 1.8.65-3.8L69.5 5.6l3.8-.6z'/%3E%3C/g%3E%3C/svg%3E") repeat-x;
}
