﻿/* 1170px + 15px gutters is the Elementor kit container the header, breadcrumb
   and footer use, so the cart lines up with the rest of the site. The
   configurator pages stay full width - this only scopes the cart. */
.cabina-cart-page {
	width: 100% !important;
	max-width: 1170px !important;
	margin: 0 auto;
	padding: 0 15px;
	color: #050505;
	font-family: inherit;
	box-sizing: border-box;
}

.cabina-cart-page h1 {
	margin: 0 0 22px;
	font-size: 30px;
	font-weight: 800;
	line-height: 1.1;
}

.cabina-cart-form {
	margin: 0;
}

.cabina-cart-table {
	width: 100%;
	border: 0;
	border-collapse: collapse;
	table-layout: fixed !important;
	font-size: 12px;
}

/* The client design centres every column heading and keeps the header band
   shallow - 7px top and bottom made it noticeably deeper than the reference. */
.cabina-cart-table th {
	padding: 3px 8px;
	background: #eeeeee;
	border: 0;
	color: #000;
	font-size: 11px;
	font-weight: 800;
	text-align: center !important;
	vertical-align: middle;
}

.cabina-cart-table td {
	padding: 18px 8px;
	border: 0;
	border-bottom: 1px solid #111;
	vertical-align: top;
	text-align: left !important;
}

/* Values sit centred under their centred headings. Item Description stays left
   aligned - centring a paragraph of product copy reads badly. */
.cabina-cart-table td.cabina-cart-sn,
.cabina-cart-table td.cabina-cart-image,
.cabina-cart-table td.cabina-cart-article,
.cabina-cart-table td.cabina-cart-quantity,
.cabina-cart-table td.cabina-cart-price,
.cabina-cart-table td.cabina-cart-total,
.cabina-cart-table td.cabina-cart-actions {
	text-align: center !important;
}

/* Centred down the row as well as across it. The rows are tall - a vanity
   carries two products and a comments box - and these single values were
   sitting up at the top, far from the line they belong to.
   Article No is excluded: each of its lines is centred against its own product
   block by cart-quotation.js, which a middle alignment here would fight. */
.cabina-cart-table td.cabina-cart-sn,
.cabina-cart-table td.cabina-cart-quantity,
.cabina-cart-table td.cabina-cart-price,
.cabina-cart-table td.cabina-cart-total,
.cabina-cart-table td.cabina-cart-actions {
	vertical-align: middle;
}

/* !important throughout: WooCommerce's shop_table rules and the theme both set
   widths on these cells. */
.cabina-cart-table th.cabina-cart-col-sn {
	width: 40px !important;
	text-align: center;
}

.cabina-cart-table th.cabina-cart-col-image {
	width: 168px !important;
}

.cabina-cart-table th.cabina-cart-col-article {
	width: 108px !important;
}

/* Wide enough for the whole minus/input/plus control - at 78px it overflowed
   into the Unit Price column and hid the QAR prefix. */
.cabina-cart-table th.cabina-cart-col-qty {
	width: 112px !important;
}

.cabina-cart-table th.cabina-cart-col-price,
.cabina-cart-table th.cabina-cart-col-total {
	width: 120px !important;
}

.cabina-cart-table th.cabina-cart-col-actions {
	width: 44px !important;
}

.cabina-cart-sn {
	text-align: center;
}

/* Matches the large product render in the client design. The configurator
   plugins each ship a 150px rule for their own preview class; keep them in
   step here so all three rows are the same size. */
.cabina-cart-image img,
.cabina-cart-image img.vmkc-cart-preview-image,
.cabina-cart-image img.vmwc-cart-preview-image,
.cabina-cart-image img.vmvc-cart-preview-image {
	width: 150px !important;
	max-width: 150px !important;
	height: 124px !important;
	margin: 0 auto;
	object-fit: contain;
	display: block;
}

/* 600 rather than 800: the client asked for less weight on the article number
   and the product name, which were reading heavier than the reference. */
.cabina-cart-article {
	font-size: 11px;
	font-weight: 600;
	line-height: 1.3;
	word-break: break-word;
}

/* A vanity lists two articles under one SN - countertop then storage carcass.
   Each line is centred against its own block in the Item Description column;
   the offsets come from cart-quotation.js, which measures the blocks. A fixed
   34px margin was the old approximation and drifted as soon as a title wrapped
   onto a different number of lines. */
.cabina-cart-article-line {
	display: flex;
	align-items: center;
	justify-content: center;
}

.cabina-cart-component + .cabina-cart-component {
	margin-top: 10px;
}

.cabina-cart-title {
	margin: 0 0 6px;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.25;
	text-align: left !important;
}

.cabina-cart-title a {
	color: inherit;
	text-decoration: none;
}

.cabina-cart-detail-rows {
	display: grid;
	row-gap: 5px;
	margin: 0 0 12px;
	max-width: 430px;
	font-size: 12px;
	line-height: 1.35;
	text-align: left !important;
}

.cabina-cart-detail-row {
	display: grid;
	grid-template-columns: 88px minmax(0, 1fr);
	column-gap: 10px;
	align-items: center;
}

.cabina-cart-detail-label {
	margin: 0;
	font-style: italic;
	font-weight: 500;
}

.cabina-cart-detail-value {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-width: 0;
	color: #333;
}

.cabina-cart-swatch {
	width: 24px;
	height: 24px;
	flex: 0 0 24px;
	display: inline-block;
	border: 1px solid #d8d8d8;
	background-position: center;
	background-repeat: no-repeat;
	background-size: cover;
}

.cabina-cart-swatch-empty {
	background: #f1f1f1;
}

.cabina-cart-note {
	display: grid;
	grid-template-columns: 64px minmax(0, 300px);
	align-items: start;
	gap: 8px;
	margin-top: 12px;
	font-size: 12px;
}

.cabina-cart-note label {
	margin: 7px 0 0;
	font-style: italic;
	font-weight: 500;
}

/* The border is drawn at rest, not only on focus - the client asked for the
   comment box to read as a field the customer can type into. */
.cabina-cart-note textarea {
	width: 100%;
	min-height: 34px;
	padding: 7px 8px;
	border: 1px solid #cfcfcf;
	background: #fff;
	color: #333;
	font-size: 12px;
	font-style: italic;
	line-height: 1.35;
	resize: vertical;
}

.cabina-cart-note textarea::placeholder {
	color: #b7b7b7;
}

.cabina-cart-note textarea:focus {
	border-color: #111;
	background: #fff;
	outline: 0;
}

/* Sits flush with the left edge of the cell so the control lines up under the
   "Qty" column heading. overflow:hidden stops the theme's wider .quantity box
   painting over the Unit Price cell and hiding the QAR prefix. */
.cabina-cart-quantity {
	text-align: center !important;
	overflow: hidden;
}

/* Background lives on the individual controls, not the wrapper - any residual
   width on the wrapper would otherwise show as a grey slab over the next cell. */
.cabina-cart-quantity .quantity {
	display: inline-flex !important;
	align-items: center;
	width: auto !important;
	min-width: 0 !important;
	max-width: 100% !important;
	margin: 0 !important;
	padding: 0 !important;
	float: none !important;
	background: transparent !important;
	white-space: nowrap;
}

/* The theme hides this label with .screen-reader-text, but as a flex child it
   can still claim space in the row. */
.cabina-cart-quantity .quantity label.screen-reader-text {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
}

/* The theme outputs data-count buttons, not .minus/.plus. */
.cabina-cart-quantity .quantity .minus,
.cabina-cart-quantity .quantity .plus,
.cabina-cart-quantity .quantity button[data-count] {
	width: 28px !important;
	height: 28px !important;
	min-width: 0 !important;
	padding: 0 !important;
	margin: 0 !important;
	flex: 0 0 28px;
	border: 1px solid #eeeeee;
	border-radius: 0;
	background: #f5f5f5;
	color: #111;
	font-size: 13px;
	font-weight: 800;
	line-height: 1;
	text-align: center;
	float: none !important;
}

.cabina-cart-quantity input.qty {
	width: 36px !important;
	height: 28px !important;
	min-width: 0 !important;
	padding: 0 !important;
	margin: 0 !important;
	flex: 0 0 36px;
	border: 0;
	border-radius: 0;
	background: #f5f5f5;
	color: #111;
	font-size: 12px;
	text-align: center;
	-moz-appearance: textfield;
}

.cabina-cart-quantity input.qty::-webkit-outer-spin-button,
.cabina-cart-quantity input.qty::-webkit-inner-spin-button {
	margin: 0;
	-webkit-appearance: none;
}

.cabina-cart-price,
.cabina-cart-total {
	white-space: nowrap;
	font-size: 12px;
}

/* Must stay a table-cell - display:flex on a <td> drops it out of the table
   layout, which threw the fixed column widths off across the whole row. */
.cabina-cart-actions {
	white-space: nowrap;
}

.cabina-cart-actions > * {
	vertical-align: middle;
}

.cabina-cart-remove,
.cabina-cart-edit {
	width: 20px;
	height: 20px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 0;
	background: transparent;
	font-size: 17px;
	line-height: 1;
	text-decoration: none;
	box-shadow: none !important;
}

.cabina-cart-remove:hover,
.cabina-cart-edit:hover {
	background: transparent;
	text-decoration: none;
}

.cabina-cart-remove {
	color: #ff5b62;
}

.cabina-cart-edit {
	color: #111;
	font-size: 14px;
}

.cabina-cart-footer {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 390px;
	gap: 36px;
	align-items: start;
	margin-top: 20px;
}

/*
 * Update Cart is submitted by cart-quotation.js when a quantity changes, so the
 * input has to stay in the form - but the client removed it from the design.
 * Hidden without display:none, which would stop some browsers submitting it.
 */
.cabina-cart-update {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	border: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
}

.cabina-cart-summary {
	font-size: 12px;
	line-height: 1.55;
}

/* Total Order / Due Payment / Balance sit close together as a small statement,
   with TOTAL DUE pulled out below the rule. */
.cabina-summary-line {
	display: grid;
	grid-template-columns: 1fr auto;
	align-items: baseline;
	gap: 24px;
	margin-bottom: 6px;
	font-weight: 600;
}

/* The client asked for TOTAL DUE in bold - both halves of the line, not just
   the amount, so the label carries the same weight. */
.cabina-total-due {
	margin-top: 14px;
	padding-top: 16px;
	border-top: 1px solid #111;
	font-size: 22px;
	font-weight: 800;
}

.cabina-total-due span,
.cabina-total-due strong {
	font-weight: 800;
}

.cabina-cart-copy {
	margin: 18px 0;
	color: #111;
}

.cabina-terms {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	margin: 18px 0;
	font-size: 12px;
}

.cabina-terms input {
	width: 14px;
	height: 14px;
	margin: 0;
}

.cabina-terms a {
	color: #c60000;
	text-decoration: underline;
}

.cabina-checkout-button,
.cabina-quotation-button {
	width: 100%;
	height: 42px;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-top: 10px;
	border: 1px solid #111;
	font-size: 12px;
	font-weight: 800;
	text-align: center;
	text-decoration: none;
}

/*
 * Hover, matching the home page SHOP NOW button: the fill sweeps in from the
 * left edge - full height, so it arrives from the top-left and bottom-left
 * corners together - and the button inverts. Dark with white text becomes white
 * with dark text, and the reverse for the secondary button.
 *
 * isolation + z-index:-1 keeps the sweeping block above the button's own
 * background but behind its label, which is a bare text node and so cannot be
 * lifted with a z-index of its own.
 */
.cabina-checkout-button,
.cabina-quotation-button {
	position: relative;
	overflow: hidden;
	isolation: isolate;
	transition: color 0.45s ease, border-color 0.45s ease;
}

.cabina-checkout-button::before,
.cabina-quotation-button::before {
	content: "";
	position: absolute;
	z-index: -1;
	left: 0;
	top: 0;
	width: 0;
	height: 100%;
	transition: width 0.45s ease;
}

.cabina-checkout-button:hover::before,
.cabina-quotation-button:hover::before {
	width: 100%;
}

/* A disabled checkout button must not look interactive. */
.cabina-checkout-button.is-disabled::before {
	display: none;
}

/* Dark for the primary action, light grey for the secondary one, per the
   client's reference - the two were previously mid-grey and white, which read
   as equally weighted. */
.cabina-checkout-button {
	border-color: #221F20;
	background: #221F20;
	color: #fff;
}

/* Dark button, white label -> sweeps to white with a dark label. */
.cabina-checkout-button::before {
	background-color: #fff;
}

.cabina-checkout-button:hover {
	border-color: #221F20;
	color: #221F20;
}

/* Light button, dark label -> the reverse. */
.cabina-quotation-button::before {
	background-color: #221F20;
}

.cabina-quotation-button:hover {
	border-color: #221F20;
	color: #fff;
}

.cabina-checkout-button.is-disabled {
	cursor: not-allowed;
	opacity: 0.55;
}

.cabina-quotation-button {
	border-color: #d9d9d9;
	background: #ececec;
	color: #111;
}

/* --- Guest contact details ----------------------------------------------- */

/*
 * Shown only to visitors without an account, and only once they ask for a
 * quotation. Styled as a plain part of the summary rather than a warning: it is
 * a normal step now, not an error.
 */
.cabina-quotation-details {
	margin-top: 14px;
	padding: 14px;
	border: 1px solid #d9d9d9;
	background: #fafafa;
}

.cabina-quotation-details[hidden] {
	display: none;
}

.cabina-quotation-details-intro {
	margin: 0 0 10px;
	color: #111;
	font-size: 12px;
	font-weight: 600;
}

.cabina-quotation-field {
	margin: 0 0 10px;
}

.cabina-quotation-field:last-child {
	margin-bottom: 0;
}

.cabina-quotation-field label {
	display: block;
	margin-bottom: 4px;
	font-size: 11px;
	font-weight: 600;
}

.cabina-quotation-field .cabina-optional {
	color: #8a8a8a;
	font-weight: 400;
}

.cabina-quotation-field input {
	width: 100%;
	height: 36px;
	padding: 0 10px;
	border: 1px solid #d9d9d9;
	background: #fff;
	font-size: 12px;
}

.cabina-quotation-field input:focus {
	border-color: #111;
	outline: 0;
}

/*
 * The stacked phone layout for this table used to live here as well as in
 * mobile.css. Two definitions of the same cells, in two files whose load order
 * decides the winner, is how the cart ended up with labels floated beside
 * right-aligned values. It is defined once now, in mobile.css, alongside the
 * rest of the phone work.
 */
@media (max-width: 991px) {
	.cabina-cart-footer {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 575px) {
	.cabina-cart-page h1 {
		font-size: 25px;
	}

	.cabina-cart-note {
		grid-template-columns: 1fr;
	}

	.cabina-cart-tools,
	.cabina-cart-tools .coupon {
		align-items: stretch;
		flex-direction: column;
	}

	.cabina-cart-tools input.input-text,
	.cabina-update-cart {
		width: 100%;
	}

	.cabina-total-due {
		font-size: 18px;
	}
}

/* --- Live updates -------------------------------------------------------- */

/*
 * Quantity, note and remove all apply over AJAX now - see cart-ajax.php and
 * cart-quotation.js. The row total is recalculated on screen straight away, so
 * these states only need to say "the server has not confirmed yet"; anything
 * stronger would read as a delay where there is none.
 *
 * The table keeps taking clicks while a request is out. Blocking it would
 * reintroduce the dropped presses that made rapid clicking unreliable before.
 */
.cabina-cart-form.is-updating .cabina-cart-summary {
	opacity: 0.65;
	transition: opacity 120ms ease-out;
}

.cabina-cart-table tr.is-removing {
	opacity: 0.4;
	transition: opacity 120ms ease-out;
}
