/* ==========================================================================
   FARE PRODUCTS - landing grid, product page, swatches, enquiry popup.
   Loaded only on /products/ and product pages (functions/products/products.php).
   Fonts and colours come from the Customizer (site-styles.php); this file only uses
   inherit / currentColor so it follows them.
   ========================================================================== */

/* Shared type */
.fare-product-label,
.fare-product-card-title {
	font-size: 11px;
	font-weight: bold;
	letter-spacing: 3px;
	text-transform: uppercase;
	margin: 0;
}
.fare-product-small {
	font-size: 14px;
	line-height: 1.5;
	margin: 0;
}
.fare-product-small p { margin: 0 0 0.75em; }

/* Plain text buttons - the theme styles buttons with #bth-site-wrap selectors and !important,
   so these need an ID too (#fare-enquiry for the popup, which sits outside the site wrapper) */
html body #bth-site-wrap .fare-bare-button,
html body #bth-site-wrap .fare-bare-button:hover,
html body #bth-site-wrap .fare-bare-button:focus,
html body #fare-enquiry .fare-bare-button,
html body #fare-enquiry .fare-bare-button:hover,
html body #fare-enquiry .fare-bare-button:focus {
	background: none !important;
	border: 0 none !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	padding: 0 !important;
	margin: 0;
	min-width: 0 !important;
	min-height: 0 !important;
	height: auto !important;
	width: auto !important;
	color: inherit !important;
	font-family: inherit !important;
	text-transform: none !important;
	letter-spacing: normal !important;
	line-height: 1.2 !important;
	cursor: pointer;
}
html body #bth-site-wrap .fare-bare-button:before,
html body #bth-site-wrap .fare-bare-button:after,
html body #fare-enquiry .fare-bare-button:before,
html body #fare-enquiry .fare-bare-button:after { display: none !important; }
html body .fare-bare-button:focus-visible { outline: 1px solid currentColor; outline-offset: 4px; }

/* Image ratio used in the grid and the slider (mockup is slightly taller than square) */
.fare-product-ratio {
	height: 0;
	padding-bottom: 107%;
}
.fare-product-placeholder { background-color: rgba(39, 39, 39, 0.06); }

/* ------------------------------------------------------------------ */
/* Landing page grid (2 x 2)                                            */
/* ------------------------------------------------------------------ */
.fare-products-grid {
	max-width: 900px;
	margin-left: auto;
	margin-right: auto;
}
.fare-product-card-meta {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 20px;
	padding-top: 14px;
}
.fare-product-card-meta .fare-product-card-title { line-height: 1.3; }
.fare-product-card-price {
	font-size: 12px;
	line-height: 1.3;
	white-space: nowrap;
	margin: 0;
}
.fare-product-card .fare-product-ratio > div:first-child { transition: opacity 0.4s ease; }
.fare-product-card:hover .fare-product-ratio > div:first-child { opacity: 0.9; }

/* ------------------------------------------------------------------ */
/* Product page                                                         */
/* ------------------------------------------------------------------ */
/* Own two-column grid rather than the theme's column-group, whose gutter classes clash on mobile */
.fare-product-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	column-gap: 100px;
	align-items: start;
}
.fare-product-layout > * { min-width: 0; }
@media (max-width: 1020px) {
	.fare-product-layout { column-gap: 40px; }
}
@media (max-width: 767px) {
	.fare-product-layout {
		grid-template-columns: minmax(0, 1fr);
		row-gap: 40px;
	}
}
.fare-product-title {
	font-size: 20px;
	font-weight: bold;
	letter-spacing: 3px;
	text-transform: uppercase;
	margin: 0;
}
.fare-product-description {
	font-size: 15px;
	line-height: 1.5;
}
.fare-product-arrows {
	display: flex;
	justify-content: space-between;
	padding-top: 16px;
}
.fare-arrow svg { display: block; }
.fare-arrow { opacity: 0.8; }
.fare-arrow:hover { opacity: 1; }

/* Swatches */
.fare-swatch-row {
	border: 0;
	margin: 0;
	padding: 0 0 24px;
	min-width: 0;
}
.fare-swatch-heading {
	display: flex;
	align-items: baseline;
	gap: 40px;
	padding: 0 0 10px;
	margin: 0;
}
html body .fare-swatch-selected {
	font-size: 13px;
	font-style: italic;
	letter-spacing: 0 !important;
	text-transform: lowercase;
}
/* Keep the line's height when the name is cleared (the other fabric row was picked), so the rows below don't jump */
.fare-swatch-selected:empty:before { content: "\200b"; }
.fare-swatch-list {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	list-style: none;
	margin: 0;
	padding: 0;
}
.fare-swatch-list li {
	margin: 0;
	padding: 0;
}
.fare-swatch {
	display: block;
	cursor: pointer;
}
.fare-swatch-chip {
	display: block;
	width: 52px;
	height: 52px;
	background-color: rgba(39, 39, 39, 0.1);
	background-size: cover;
	background-position: center;
	outline: 1px solid transparent;
	outline-offset: 0;
	transition: outline-color 0.2s ease;
}
.fare-swatch:hover .fare-swatch-chip { outline-color: rgba(39, 39, 39, 0.35); }
.fare-swatch input:checked + .fare-swatch-chip { outline: 2px solid currentColor; }
.fare-swatch input:focus-visible + .fare-swatch-chip {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

/* Extra Covers: which piece the cover is for (tick one or more) */
.fare-cover-list {
	list-style: none;
	margin: 0;
	padding: 0;
}
.fare-cover-list li {
	margin: 0;
	padding: 0 0 8px;
}
.fare-cover-option {
	display: inline-flex;
	align-items: baseline;
	gap: 12px;
	font-size: 15px;
	line-height: 1.4;
	cursor: pointer;
}
.fare-cover-box {
	flex: none;
	align-self: center;
	width: 14px;
	height: 14px;
	outline: 1px solid rgba(39, 39, 39, 0.5);
	transition: background-color 0.2s ease, outline-color 0.2s ease;
}
.fare-cover-option:hover .fare-cover-box { outline-color: currentColor; }
.fare-cover-option input:checked + .fare-cover-box {
	background-color: currentColor;
	outline-color: currentColor;
	box-shadow: inset 0 0 0 3px #f9f8f6;
}
.fare-cover-option input:focus-visible + .fare-cover-box {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}
.fare-cover-price {
	font-size: 13px;
	font-variant-numeric: tabular-nums;
}

/* Price + enquire */
.fare-product-buy {
	display: flex;
	align-items: baseline;
	gap: 40px;
}
.fare-product-price {
	font-size: 17px;
	line-height: 1.2;
	margin: 0;
	font-variant-numeric: tabular-nums; /* equal-width digits, so "enquire here" doesn't shift when the price changes */
}
html body #bth-site-wrap .fare-product-enquire {
	font-size: 15px !important;
	font-weight: bold;
}
/* Underline drawn as a background line on the inner span - the theme strips borders/decoration from buttons */
.fare-product-enquire span {
	background-image: linear-gradient(currentColor, currentColor);
	background-position: 0 100%;
	background-size: 100% 1px;
	background-repeat: no-repeat;
	padding-bottom: 3px;
}

/* ------------------------------------------------------------------ */
/* Enquiry popup                                                        */
/* ------------------------------------------------------------------ */
.fare-enquiry {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}
.fare-enquiry[hidden] { display: none; }
.fare-enquiry-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(39, 39, 39, 0.5);
}
.fare-enquiry-panel {
	position: relative;
	width: 100%;
	max-width: 560px;
	max-height: calc(100vh - 40px);
	overflow-y: auto;
	padding: 50px 40px 40px;
	background-color: #f9f8f6;
}
.fare-enquiry-close {
	position: absolute;
	top: 14px;
	right: 18px;
	font-size: 28px;
	line-height: 1;
}
html.fare-enquiry-open,
html.fare-enquiry-open body { overflow: hidden; }

/* The Product / Fabric / Timber / Price fields are filled in by products.js and shown in the
   summary line above the form, so they're visually hidden (still submitted and emailed) */
#fare-enquiry .fare-option-field {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}
#fare-enquiry .fare-enquiry-summary { font-size: 15px; }

/* Submit - same look as "enquire here" */
html body #fare-enquiry .esp-form input[type="submit"],
html body #fare-enquiry .esp-form button[type="submit"] {
	background: none !important;
	border: 0 none !important;
	padding: 0 !important;
	margin-top: 10px;
	color: inherit !important;
	font-family: inherit !important;
	font-size: 15px !important;
	font-weight: bold;
	letter-spacing: normal !important;
	text-transform: lowercase !important;
	text-decoration: underline !important;
	text-underline-offset: 4px;
	cursor: pointer;
}
#fare-enquiry .form-message { margin-bottom: 20px; font-style: italic; }

@media (max-width: 767px) {
	.fare-product-title { font-size: 17px; }
	.fare-enquiry-panel { padding: 50px 20px 30px; }
	.fare-swatch-chip { width: 46px; height: 46px; }
}
