/*
 Request for Quote page (template dokan/dokan-request-quote-shortcode-page.php, inc/modules/request-quote.php).
 Loaded on that page only. The form in three white cards on the left, "Your quote" on the right and in
 view while scrolling; on tablets and phones one column with Your quote first and the button last.
 Fields keep Woodmart's input style. The products list is Dokan's quote-table template, laid out as rows.
*/

/* Layout */
.afm-quote {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 400px;
	gap: 40px;
	align-items: start;
}
.afm-quote__fields {
	display: flex;
	flex-direction: column;
	gap: 24px;
	min-width: 0;
}

/* Cards */
.afm-quote-card,
.afm-quote__side {
	border-radius: 10px;
	background: var(--bgcolor-white, #fff);
	box-shadow: 0 0 4px rgba(0, 0, 0, 0.18);
}
.afm-quote-card {
	display: flex;
	flex-direction: column;
	gap: 22px;
	padding: 28px;
}
.afm-quote-card__head {
	display: flex;
	align-items: center;
	gap: 14px;
}
.afm-quote-card__num {
	display: flex;
	flex: 0 0 32px;
	align-items: center;
	justify-content: center;
	height: 32px;
	border-radius: 50%;
	background: #EAF2EC;
	font-size: 14px;
	font-weight: 700;
	color: var(--wd-primary-color);
}
.afm-quote-card h2,
.afm-quote__items h2 {
	margin: 0;
	font-size: 18px;
	font-weight: 600;
	color: var(--wd-title-color);
}
.afm-quote-card__head p {
	margin: 2px 0 0;
	font-size: 13px;
	color: #767676;
}

/* Fields: two columns, label above the field */
.afm-quote-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px 20px;
}
.afm-quote .afm-quote-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin: 0;
}
.afm-quote-field--wide {
	grid-column: 1 / -1;
}
.afm-quote-field label {
	margin: 0;
	padding: 0;
	font-size: 13px;
	font-weight: 600;
	color: #3A3A3A;
}
.afm-quote-field .required {
	color: #B42318;
	border: 0;
	text-decoration: none;
}
.afm-quote-field :is(input, select, textarea) {
	width: 100%;
}
.afm-quote-field textarea {
	min-height: 130px;
}
.afm-quote .quote-datepicker {
	padding-inline-end: 40px;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23767676' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 2v4M16 2v4M5 4h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2ZM3 10h18'/%3E%3C/svg%3E") no-repeat right 14px center / 16px;
}

/* Your quote: one card that stays in view */
.afm-quote__side {
	position: sticky;
	top: var(--wd-sticky-offset, 100px);
	display: flex;
	flex-direction: column;
	gap: 20px;
	padding: 24px;
}
.afm-quote__items {
	display: flex;
	flex-direction: column;
	gap: 14px;
}
.afm-quote__store {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding-top: 16px;
	border-top: 1px solid #EFECE6;
	font-size: 13px;
	font-weight: 600;
	color: var(--wd-title-color);
}
.afm-quote__store svg {
	flex: 0 0 16px;
	color: var(--wd-primary-color);
}

/* Products (Dokan's quote table) as rows: photo, name and remove, quantity under the name */
body .afm-quote .dokan_quote_table_contents {
	display: block;
	margin: 0;
	border: 0;
}
body .afm-quote .dokan_quote_table_contents :is(thead, tr.woocommerce-cart-form__quote-item ~ tr:not(.woocommerce-cart-form__quote-item)) {
	display: none;
}
body .afm-quote .dokan_quote_table_contents tbody {
	display: flex;
	flex-direction: column;
}
body .afm-quote .dokan_quote_table_contents tr.woocommerce-cart-form__quote-item {
	display: grid;
	grid-template-columns: 64px minmax(0, 1fr) auto;
	grid-template-areas:
		"thumb name remove"
		"thumb qty qty";
	gap: 8px 14px;
	align-items: center;
	padding: 12px 0;
	border: 0;
}
body .afm-quote .dokan_quote_table_contents tr.woocommerce-cart-form__quote-item + tr.woocommerce-cart-form__quote-item {
	border-top: 1px solid #EFECE6;
}
/* With prices shown (a quote rule that doesn't hide them): price and "Offered Price" under the name */
body .afm-quote .dokan_quote_table_contents tr.woocommerce-cart-form__quote-item:has(.offered-price) {
	grid-template-areas:
		"thumb name remove"
		"thumb price price"
		"thumb offer offer"
		"thumb qty qty";
}
body .afm-quote .dokan_quote_table_contents td {
	display: block;
	width: auto;
	padding: 0;
	border: 0;
	text-align: start;
}
body .afm-quote .dokan_quote_table_contents td::before {
	display: none;
}
body .afm-quote .dokan_quote_table_contents td.product-thumbnail {
	grid-area: thumb;
	align-self: start;
}
body .afm-quote .dokan_quote_table_contents td.product-thumbnail img {
	display: block;
	width: 64px;
	height: 64px;
	object-fit: cover;
	border-radius: 8px;
	background: #F4F2EE;
}
body .afm-quote .dokan_quote_table_contents td.product-name {
	grid-area: name;
	font-size: 15px;
	font-weight: 600;
}
body .afm-quote .dokan_quote_table_contents td.product-name > a {
	color: var(--wd-title-color);
}
body .afm-quote .dokan_quote_table_contents td.product-name :is(ul.variation, p) {
	margin: 4px 0 0;
	font-size: 13px;
	font-weight: 400;
	color: #767676;
}
/* The store is named above the list already. */
body .afm-quote .dokan_quote_table_contents .variation-Vendor {
	display: none;
}
body .afm-quote .dokan_quote_table_contents td.product-price {
	grid-area: price;
	font-size: 13px;
}
body .afm-quote .dokan_quote_table_contents td.offered-price {
	grid-area: offer;
}
body .afm-quote .dokan_quote_table_contents td.product-price::before {
	content: attr(data-title) ": ";
	display: inline;
	color: #767676;
}
body .afm-quote .dokan_quote_table_contents td.offered-price input {
	width: 130px;
}
body .afm-quote .dokan_quote_table_contents td.product-quantity {
	grid-area: qty;
}
body .afm-quote .dokan_quote_table_contents td.product-remove {
	grid-area: remove;
}
/* Remove: a bin instead of the × */
body .afm-quote .dokan_quote_table_contents a.remove {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border: 0;
	border-radius: 50%;
	background: none;
	font-size: 0;
	color: #767676;
}
body .afm-quote .dokan_quote_table_contents a.remove::before {
	content: "";
	width: 16px;
	height: 16px;
	background-color: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6h18M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6M10 11v6M14 11v6'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6h18M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6M10 11v6M14 11v6'/%3E%3C/svg%3E") center / contain no-repeat;
}
body .afm-quote .dokan_quote_table_contents a.remove:hover {
	background: #F4F2EE;
	color: var(--wd-title-color);
}

/* Note and button */
.afm-quote__submit {
	display: flex;
	flex-direction: column;
	gap: 14px;
}
.afm-quote__note {
	display: flex;
	gap: 10px;
	margin: 0;
	padding: 12px 14px;
	border-radius: 8px;
	background: #EAF2EC;
	font-size: 13px;
	line-height: 1.5;
	color: #175536;
}
.afm-quote__note svg {
	flex: 0 0 18px;
	margin-top: 1px;
}
.afm-quote .dokan_checkout_place_quote {
	width: 100%;
	min-height: 48px;
}

/* Empty quote: Woodmart's empty block with its cart icon, like the empty cart */
.afm-quote-empty {
	--wd-empty-block-icon: "\f147";
	padding: 40px 0;
}

/* Tablets and phones: one column, Your quote first, the button last */
@media (max-width: 1024px) {
	.afm-quote {
		grid-template-columns: minmax(0, 1fr);
		gap: 16px;
	}
	.afm-quote__fields {
		gap: 16px;
	}
	.afm-quote__side {
		display: contents;
	}
	.afm-quote__items {
		order: -1;
		padding: 20px;
		border-radius: 10px;
		background: var(--bgcolor-white, #fff);
		box-shadow: 0 0 4px rgba(0, 0, 0, 0.18);
	}
	.afm-quote__submit {
		order: 1;
	}
	.afm-quote-card {
		gap: 18px;
		padding: 20px;
	}
}
@media (max-width: 575.98px) {
	.afm-quote-grid {
		grid-template-columns: minmax(0, 1fr);
	}
}
