/**
 * Personalization details and the "Request a quote" form.
 *
 * The price list quotes two figures per item, so the product page shows the
 * plain price the way WooCommerce always does and adds the personalized figure
 * underneath it. The quote form sits inside a <details> panel so it stays out
 * of the way on items that can simply be added to the cart, and opens by
 * default on items that are priced per job.
 *
 * Custom properties come from machis-header-footer.css; each has a fallback so
 * this file also works if only WooCommerce styling is loaded.
 */

/* -------------------------------------------------------------------------
 * Price display
 * ---------------------------------------------------------------------- */

.machis-price-personalized,
.machis-price-quote {
	display: block;
	margin-top: 0.25em;
	font-size: 0.85em;
	font-weight: 500;
	line-height: 1.4;
	color: var(--machis-muted, #5c5c5c);
}

.machis-price-quote {
	font-style: italic;
}

.machis-price-personalized .amount {
	font-weight: 600;
	color: var(--machis-fg, #1a1a1a);
}

/* -------------------------------------------------------------------------
 * Personalization details list
 * ---------------------------------------------------------------------- */

.machis-product-details {
	margin: 1.25rem 0;
	padding: 1rem 1.25rem;
	border: 1px solid var(--machis-line-soft, #e5e5e5);
	border-radius: var(--machis-radius-sm, 6px);
	background: var(--machis-bg-alt, #f7f7f7);
	list-style: none;
	font-size: 0.925rem;
	line-height: 1.6;
}

.machis-product-details li + li {
	margin-top: 0.4rem;
}

.machis-product-details strong {
	font-weight: 600;
}

.machis-product-details__updated {
	margin-top: 0.75rem;
	padding-top: 0.6rem;
	border-top: 1px solid var(--machis-line-soft, #e5e5e5);
	font-size: 0.85em;
	color: var(--machis-muted, #5c5c5c);
}

/* -------------------------------------------------------------------------
 * Quote request
 * ---------------------------------------------------------------------- */

.machis-quote {
	margin: 1.5rem 0;
}

.machis-quote__only {
	margin: 0 0 1rem;
	padding: 0.75rem 1rem;
	border-left: 3px solid var(--machis-accent, #d81b60);
	background: var(--machis-bg-alt, #f7f7f7);
	font-size: 0.95rem;
}

.machis-quote__notice {
	margin: 0 0 1rem;
	padding: 0.75rem 1rem;
	border-radius: var(--machis-radius-sm, 6px);
	font-size: 0.95rem;
}

.machis-quote__notice--ok {
	border: 1px solid #b7dfc0;
	background: #edf8f0;
	color: #14532d;
}

.machis-quote__notice--error {
	border: 1px solid #eec2c2;
	background: #fdf0f0;
	color: #7f1d1d;
}

.machis-quote__panel {
	border: 1px solid var(--machis-line, #d4d4d4);
	border-radius: var(--machis-radius-sm, 6px);
	background: var(--machis-bg, #fff);
}

.machis-quote__toggle {
	padding: 0.85rem 1.15rem;
	font-family: var(--machis-font-heading, inherit);
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
	list-style: none;
}

.machis-quote__toggle::-webkit-details-marker {
	display: none;
}

.machis-quote__toggle::after {
	content: "+";
	float: right;
	font-weight: 400;
	transition: transform 0.2s var(--machis-ease, ease);
}

.machis-quote__panel[open] > .machis-quote__toggle::after {
	content: "\2212";
}

.machis-quote__toggle:focus-visible {
	outline: 2px solid var(--machis-accent, #d81b60);
	outline-offset: -2px;
}

.machis-quote__intro {
	margin: 0;
	padding: 0 1.15rem;
	font-size: 0.925rem;
	color: var(--machis-muted, #5c5c5c);
}

.machis-quote__form {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 0.9rem 1.1rem;
	padding: 1.15rem;
}

.machis-quote__field {
	margin: 0;
}

.machis-quote__field--message,
.machis-quote__submit {
	grid-column: 1 / -1;
}

.machis-quote__field label {
	display: block;
	margin-bottom: 0.3rem;
	font-size: 0.85rem;
	font-weight: 600;
}

.machis-quote__required {
	color: var(--machis-accent, #d81b60);
}

.machis-quote__field input,
.machis-quote__field select,
.machis-quote__field textarea {
	width: 100%;
	padding: 0.55rem 0.7rem;
	border: 1px solid var(--machis-line, #d4d4d4);
	border-radius: var(--machis-radius-sm, 6px);
	background: var(--machis-bg, #fff);
	color: inherit;
	font: inherit;
	font-size: 0.95rem;
}

.machis-quote__field textarea {
	resize: vertical;
}

.machis-quote__field input:focus-visible,
.machis-quote__field select:focus-visible,
.machis-quote__field textarea:focus-visible {
	outline: 2px solid var(--machis-accent, #d81b60);
	outline-offset: 1px;
}

/* The honeypot must stay reachable to scripts but never shown to a person. */
.machis-quote__trap {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.machis-quote__submit {
	margin: 0.25rem 0 0;
}

@media (prefers-reduced-motion: reduce) {
	.machis-quote__toggle::after {
		transition: none;
	}
}

/* -------------------------------------------------------------------------
 * Quantity price breaks
 * ---------------------------------------------------------------------- */

.machis-price-tiered .amount {
	font-weight: 600;
}

.machis-price-tiered__note {
	display: block;
	margin-top: 0.15em;
	font-size: 0.8em;
	font-weight: 400;
	color: var(--machis-muted, #5c5c5c);
}

.machis-tiers {
	width: 100%;
	margin: 1.25rem 0;
	border-collapse: collapse;
	font-size: 0.925rem;
}

.machis-tiers caption {
	margin-bottom: 0.5rem;
	font-family: var(--machis-font-heading, inherit);
	font-size: 0.85rem;
	font-weight: 600;
	letter-spacing: 0.02em;
	text-align: left;
	text-transform: uppercase;
	color: var(--machis-muted, #5c5c5c);
}

.machis-tiers th,
.machis-tiers td {
	padding: 0.45rem 0.7rem;
	border-bottom: 1px solid var(--machis-line-soft, #e5e5e5);
	text-align: left;
}

.machis-tiers thead th {
	border-bottom-width: 2px;
	font-size: 0.8rem;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: var(--machis-muted, #5c5c5c);
}

.machis-tiers tbody th {
	font-weight: 500;
}

.machis-tiers tbody td {
	font-weight: 600;
	white-space: nowrap;
}

.machis-tiers tbody tr:last-child th,
.machis-tiers tbody tr:last-child td {
	border-bottom: none;
}
