/* Quote store: cart (quote list), checkout (request form), confirmation and product options.
   Plain CSS so it works without rebuilding Tailwind. Colors follow tailwind.config.js. */

:root {
	--mi-accent: #F76D57;
	--mi-text: #2C3E50;
	--mi-muted: #8798A4;
	--mi-blue: #4787C7;
	--mi-bg: #F4F7FA;
	--mi-border: #E2E8F0;
}

/* Header quote count */
.mi-cart-link {
	position: relative;
	/* flex, not inline-block: an inline image sits on the text baseline and the space
	   under it pushed the bag a few pixels above the search and account icons. */
	display: flex;
}

.mi-cart-count {
	position: absolute;
	top: -8px;
	right: -10px;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	border-radius: 9px;
	background: var(--mi-accent);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	line-height: 18px;
	text-align: center;
}

/* Buttons */
.mi-quote-button,
.woocommerce-checkout #place_order {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 45px;
	padding: 0 24px;
	border: 1px solid var(--mi-accent);
	border-radius: 5px;
	background: var(--mi-accent);
	color: #fff;
	font-size: 14px;
	font-weight: 700;
	text-decoration: none;
	cursor: pointer;
}

.mi-quote-button:hover,
.woocommerce-checkout #place_order:hover {
	filter: brightness(0.95);
	color: #fff;
}

.mi-quote-button--outline {
	background: #fff;
	color: var(--mi-accent);
}

.mi-quote-button--outline:hover {
	color: var(--mi-accent);
}

.mi-quote-button:disabled,
.mi-quote-button[disabled] {
	opacity: 0.5;
	cursor: default;
}

/* Tables (cart, checkout review, thank-you) */
.mi-quote-table {
	width: 100%;
	border-collapse: collapse;
	color: var(--mi-text);
}

.mi-quote-table th {
	padding: 12px;
	border-bottom: 2px solid var(--mi-border);
	font-size: 14px;
	text-align: left;
}

.mi-quote-table td {
	padding: 16px 12px;
	border-bottom: 1px solid var(--mi-border);
	vertical-align: top;
}

.mi-quote-table .product-name a {
	color: var(--mi-text);
	font-weight: 600;
}

.mi-quote-table .product-thumbnail {
	width: 90px;
}

.mi-quote-table .product-thumbnail img {
	width: 72px;
	height: auto;
	border-radius: 4px;
}

.mi-quote-table .product-quantity {
	width: 120px;
}

.mi-quote-table .product-quantity .qty {
	width: 80px;
	height: 40px;
	padding: 0 8px;
	border: 1px solid var(--mi-border);
	border-radius: 5px;
}

.mi-quote-table .product-remove {
	width: 40px;
	text-align: center;
}

.mi-quote-table .product-remove .remove {
	color: var(--mi-muted);
	font-size: 24px;
	line-height: 1;
	text-decoration: none;
}

.mi-quote-table .product-remove .remove:hover {
	color: var(--mi-accent);
}

.mi-quote-table td.actions {
	border-bottom: 0;
	text-align: right;
}

/* Line options (variation, logo, date, no rush) */
.mi-quote-table dl.variation,
.mi-quote-table .wc-item-meta {
	margin: 8px 0 0;
	padding: 0;
	color: var(--mi-muted);
	font-size: 13px;
	list-style: none;
}

.mi-quote-table dl.variation dt {
	float: left;
	clear: left;
	margin-right: 4px;
	font-weight: 600;
}

.mi-quote-table dl.variation dd {
	margin: 0 0 4px;
}

.mi-quote-table dl.variation dd p,
.mi-quote-table .wc-item-meta p {
	display: inline;
	margin: 0;
}

.mi-quote-table .wc-item-meta li {
	margin-bottom: 4px;
}

.mi-quote-table .wc-item-meta-label {
	font-weight: 600;
}

.mi-logo-thumb {
	background: #fff;
	border-radius: 4px;
}

/* Cart: request box */
.cart-collaterals {
	margin-top: 30px;
}

.mi-quote-submit-box {
	max-width: 420px;
	margin-left: auto;
	padding: 24px;
	border-radius: 8px;
	background: var(--mi-bg);
	color: var(--mi-text);
}

.mi-quote-submit-box p {
	margin: 0 0 16px;
}

.mi-quote-submit-box .mi-quote-button {
	width: 100%;
}

/* Checkout */
.mi-quote-intro {
	margin: 0 0 24px;
	color: var(--mi-muted);
}

.mi-quote-checkout {
	display: grid;
	gap: 32px;
	margin-bottom: 60px;
}

@media (min-width: 1024px) {
	.mi-quote-checkout {
		grid-template-columns: 1fr 1fr;
		align-items: start;
	}
}

/* WooCommerce adds the validation errors as the form's first child: give them their own full-width row. */
.mi-quote-checkout > .woocommerce-NoticeGroup {
	grid-column: 1 / -1;
}

.mi-quote-checkout h3 {
	margin: 0 0 16px;
	color: var(--mi-text);
	font-size: 20px;
	font-weight: 600;
}

.mi-quote-checkout .form-row {
	margin: 0 0 16px;
}

.mi-quote-checkout .form-row label {
	display: block;
	margin-bottom: 6px;
	color: var(--mi-text);
	font-size: 14px;
	font-weight: 600;
}

.mi-quote-checkout .form-row .input-text,
.mi-quote-checkout .form-row textarea {
	width: 100%;
	min-height: 45px;
	padding: 10px 12px;
	border: 1px solid var(--mi-border);
	border-radius: 5px;
	background: #fff;
}

.mi-quote-checkout .form-row textarea {
	min-height: 110px;
}

.mi-quote-checkout .required {
	color: var(--mi-accent);
	text-decoration: none;
}

.mi-quote-checkout__review {
	padding: 24px;
	border-radius: 8px;
	background: var(--mi-bg);
}

/* There's a single "gateway" that only records the request, so its picker is noise. */
.mi-quote-checkout .wc_payment_methods {
	display: none;
}

.mi-quote-checkout #payment {
	margin-top: 24px;
}

.mi-quote-checkout #place_order {
	width: 100%;
	margin-top: 8px;
}

.mi-quote-edit-link {
	margin: 12px 0 0;
	font-size: 14px;
}

.mi-quote-edit-link a,
.mi-quote-thankyou a {
	color: var(--mi-blue);
}

/* Thank-you */
.mi-quote-thankyou {
	margin-bottom: 60px;
	color: var(--mi-text);
}

.mi-quote-thankyou__message {
	margin-bottom: 32px;
	padding: 24px;
	border-left: 4px solid var(--mi-accent);
	border-radius: 4px;
	background: var(--mi-bg);
}

.mi-quote-thankyou__message h2 {
	margin: 0 0 8px;
	font-size: 22px;
	font-weight: 600;
}

.mi-quote-thankyou__message p {
	margin: 0;
}

.mi-quote-details h2 {
	margin: 0 0 12px;
	font-size: 18px;
	font-weight: 600;
}

.mi-quote-note {
	margin-top: 16px;
}

/* Product page: logo upload and quick quote */
.mi-logo-field input[type="file"] {
	display: block;
	width: 100%;
	margin-top: 6px;
	padding: 8px;
	border: 1px dashed var(--mi-border);
	border-radius: 5px;
	background: #fff;
	font-size: 14px;
}

.mi-logo-field small {
	display: block;
	margin-top: 4px;
	color: var(--mi-muted);
	font-size: 12px;
}

.mi-logo-field label span {
	color: var(--mi-muted);
	font-weight: 400;
}

#cotizacion-rapida-wrapper textarea {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid var(--mi-border);
	border-radius: 5px;
}

/* Honeypot: visually hidden, still in the form for bots. */
.mi-qq-website {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* Small screens: the cart table stacks */
@media (max-width: 640px) {
	.mi-quote-table thead {
		display: none;
	}

	.mi-quote-table.cart tr.cart_item {
		display: grid;
		grid-template-columns: 72px 1fr 32px;
		gap: 8px 12px;
		padding: 16px 0;
		border-bottom: 1px solid var(--mi-border);
	}

	.mi-quote-table.cart tr.cart_item td {
		padding: 0;
		border: 0;
	}

	.mi-quote-table.cart .product-thumbnail {
		grid-row: span 2;
		width: auto;
	}

	.mi-quote-table.cart .product-quantity {
		grid-column: 2;
		width: auto;
	}

	.mi-quote-table.cart .product-remove {
		grid-column: 3;
		grid-row: 1;
	}

	.mi-quote-table.cart td.actions {
		display: block;
		padding-top: 16px;
	}

	.mi-quote-table.cart td.actions .mi-quote-button {
		width: 100%;
	}

	.mi-quote-submit-box {
		max-width: none;
	}
}

/* Customer quote page (priced table and accept/reject) */
.mi-quote-response {
	margin-bottom: 60px;
	color: var(--mi-text);
}

.mi-quote-response .entry-header {
	margin-bottom: 24px;
}

.mi-quote-priced .product-price,
.mi-quote-priced .product-subtotal,
.mi-quote-priced tfoot td {
	text-align: right;
	white-space: nowrap;
}

.mi-quote-priced tfoot th {
	padding: 10px 12px;
	text-align: right;
}

.mi-quote-priced tfoot td {
	padding: 10px 12px;
}

.mi-quote-priced tfoot tr:last-child th,
.mi-quote-priced tfoot tr:last-child td {
	border-top: 2px solid var(--mi-border);
	font-size: 18px;
	font-weight: 700;
}

.mi-quote-validity {
	margin: 20px 0 0;
}

.mi-quote-respond {
	max-width: 560px;
	margin-top: 32px;
	padding: 24px;
	border-radius: 8px;
	background: var(--mi-bg);
}

.mi-quote-respond label {
	display: block;
	margin-bottom: 6px;
	font-size: 14px;
	font-weight: 600;
}

.mi-quote-respond textarea {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid var(--mi-border);
	border-radius: 5px;
}

.mi-quote-respond__buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 16px;
}

@media (max-width: 640px) {
	.mi-quote-priced thead {
		display: none;
	}

	.mi-quote-priced,
	.mi-quote-priced tbody {
		display: block;
	}

	.mi-quote-priced tfoot {
		display: table;
		width: 100%;
	}

	.mi-quote-priced tbody tr {
		display: block;
		padding: 12px 0;
		border-bottom: 1px solid var(--mi-border);
	}

	.mi-quote-priced tbody td {
		display: flex;
		justify-content: space-between;
		gap: 12px;
		padding: 4px 0;
		border: 0;
		text-align: right;
	}

	.mi-quote-priced tbody td.product-name {
		display: block;
		text-align: left;
	}

	.mi-quote-priced tbody td.product-quantity {
		width: auto;
	}

	.mi-quote-priced tbody td:not(.product-name)::before {
		content: attr(data-title);
		font-weight: 600;
		text-align: left;
	}

	.mi-quote-priced tfoot th {
		padding-left: 0;
	}

	.mi-quote-respond__buttons .mi-quote-button {
		flex: 1 1 100%;
	}
}

/* Product card "Agregar a cotización" (WooCommerce AJAX add to cart) */
.product-card-actions .add_to_cart_button.loading {
	opacity: 0.6;
	pointer-events: none;
}

.product-card-actions .added_to_cart {
	display: block;
	margin-top: -2px;
	color: var(--mi-blue);
	font-size: 12px;
	font-weight: 600;
	text-align: center;
	text-decoration: underline;
}

/* After a quote request: WhatsApp button and PDF link (inc/quote/quote-whatsapp.php) */
.mi-quote-thankyou__actions,
.mi-quote-notice-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px 20px;
	margin-top: 16px;
}

.mi-quote-notice-actions {
	margin-top: 10px;
}

.mi-whatsapp-button {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	height: 44px;
	padding: 0 18px;
	border-radius: 7px;
	background: #25D366;
	color: #fff !important;
	font-size: 14px;
	font-weight: 700;
	text-decoration: none !important;
}

.mi-whatsapp-button:hover {
	background: #1EBE5A;
}

.mi-whatsapp-button img {
	width: 20px;
	height: 20px;
}

.mi-quote-pdf-link {
	color: var(--mi-blue, #4787C7) !important;
	font-size: 14px;
	text-decoration: underline;
}
