/**
 * Knight Fencing — front-end styles.
 *
 * Loaded only where it's needed: product pages (the made-to-measure form)
 * and the order-pay page (a customer settling a priced quote). Both are
 * places where the theme's own layout doesn't quite fit what the plugin
 * puts on the page.
 */

/* ------------------------------------------------------------------
   Made-to-measure: Calculate price
   ------------------------------------------------------------------
   Enfold styles .button with float:left. A floated-only child collapses
   its wrapper to zero height, so the quantity box and add-to-cart button
   — floats themselves, and next in the form — rode up alongside the
   Calculate button and shared its row. Clearfixing the wrappers gives
   them height again, which puts Calculate on a row of its own and pushes
   the add-to-cart row below it.
   ------------------------------------------------------------------ */

.kf-mtm-form {
	clear: both;
	display: block;
	width: 100%;
	margin-bottom: 2em;
}

.kf-mtm-form::after,
.kf-mtm-actions::after {
	content: "";
	display: table;
	clear: both;
}

.kf-mtm-actions {
	clear: both;
	display: block;
	margin: 1.75em 0 0;
}

.kf-mtm-actions .kf-mtm-calculate {
	margin: 0;
}

/* The result sits below the button with room to breathe, and takes up no
   space at all until there's something to say. */
.kf-mtm-result {
	clear: both;
	display: block;
	margin: 1.5em 0 0;
}

.kf-mtm-result:empty {
	display: none;
	margin: 0;
}

.kf-mtm-price {
	display: block;
	font-size: 1.2em;
	font-weight: 700;
	line-height: 1.3;
}

.kf-mtm-note {
	display: block;
	margin-top: 0.4em;
	font-size: 0.95em;
	opacity: 0.75;
}

/* No `clear` on the quantity or add-to-cart button: the clearfix above
   already gives .kf-mtm-form its full height, so they start below it on
   their own. Clearing them individually would also break them apart from
   each other, and those two belong side by side. */

/* ------------------------------------------------------------------
   Order-pay: a customer settling a priced quote
   ------------------------------------------------------------------
   Without column widths the total column claimed roughly half the table
   and the product column was squeezed. table-layout:fixed plus widths on
   the two narrow columns lets the product name take whatever is left.
   ------------------------------------------------------------------ */

body.woocommerce-order-pay table.shop_table {
	width: 100%;
	table-layout: fixed;
}

body.woocommerce-order-pay table.shop_table th,
body.woocommerce-order-pay table.shop_table td {
	padding: 12px 14px;
	vertical-align: top;
}

body.woocommerce-order-pay table.shop_table .product-name {
	width: auto;
	text-align: left;
	word-wrap: break-word;
}

/* Width on the header cells only: with table-layout:fixed the first row
   decides the columns, and .product-quantity is also the class on a
   <strong> inside the cell, which shouldn't be sized. */
body.woocommerce-order-pay table.shop_table th.product-quantity {
	width: 5em;
}

body.woocommerce-order-pay table.shop_table th.product-total {
	width: 9em;
}

body.woocommerce-order-pay table.shop_table .product-quantity {
	text-align: center;
}

/* Core's form-pay template uses .product-total on the header and the
   footer totals, but .product-subtotal on the line-item cell. Align all
   three or the amounts don't line up under their own heading. */
body.woocommerce-order-pay table.shop_table .product-total,
body.woocommerce-order-pay table.shop_table .product-subtotal {
	text-align: right;
}

body.woocommerce-order-pay table.shop_table tfoot th {
	text-align: left;
}

body.woocommerce-order-pay table.shop_table tfoot td {
	text-align: right;
}

/* Line-item meta (Width, Height, Price Quoted, Estimated price) renders as
   a definition-style list where every key and value takes its own line,
   which made the product cell several times taller than it needed to be.
   Keep each pair on one line. */
body.woocommerce-order-pay .wc-item-meta {
	list-style: none;
	margin: 0.5em 0 0;
	padding: 0;
	font-size: 0.9em;
}

body.woocommerce-order-pay .wc-item-meta li {
	margin: 0 0 0.2em;
	padding: 0;
}

body.woocommerce-order-pay .wc-item-meta li strong {
	display: inline;
	font-weight: 600;
}

body.woocommerce-order-pay .wc-item-meta li p {
	display: inline;
	margin: 0;
	padding: 0;
}
