/*
 * Fase 5.2 — Estilos mínimos para el botón/modal "Enviar propuesta" en la
 * vista de solicitud. Estilística deliberadamente ligera: hereda tipografía
 * y color de listinghive; solo resuelve estructura (modal overlay, spacing).
 * Reglas de override de plantilla del tema padre siguen yendo en
 * listinghive-child; esto es JS/CSS propio de una funcionalidad de negocio
 * (formulario + AJAX), no una skin de un template de HivePress.
 */

.ms-proposal-action {
	margin-top: 1em;
}

/*
 * Fase 5.8 (2nd iteration) — root cause: the "Continue"/"Confirm and send"
 * buttons carry HiveTheme's `.hp-button`/`.button` classes, whose author CSS
 * `display` rules win over the low-priority user-agent rule
 * `[hidden] { display: none }`, so plain `.prop('hidden', true)` from
 * proposal-form.js does not actually hide them. Force it here for any
 * descendant of the proposal block that gets the `hidden` attribute
 * (buttons, but also covers any other element relying on it).
 *
 * Fase 5.8 (4th iteration) — `.ms-proposal-modal` is now moved to `<body>`
 * at runtime by proposal-form.js (to escape the sticky sidebar's `transform`,
 * which otherwise breaks its `position: fixed` overlay), so it is no longer
 * a descendant of `.ms-proposal-action`. Add an explicit selector for the
 * relocated modal so its inner `[hidden]` elements (Continue/Confirm and
 * send buttons, form fields, success banner, no-contact hint) keep being
 * hidden correctly.
 */
.ms-proposal-action [hidden],
.ms-proposal-modal [hidden] {
	display: none !important;
}

.ms-proposal-cost {
	font-size: 1em;
	font-weight: 600;
	margin-bottom: 0.25em;
}

.ms-proposal-quota {
	font-size: 0.9em;
	opacity: 0.75;
	margin-bottom: 0.5em;
}

.ms-proposal-blocked {
	font-size: 0.9em;
	color: #a94442;
}

.ms-proposal-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.5);
}

.ms-proposal-modal[hidden] {
	display: none;
}

.ms-proposal-modal-inner {
	position: relative;
	background: #fff;
	color: #1a1a1a;
	max-width: 480px;
	width: 92%;
	max-height: 90vh;
	overflow-y: auto;
	padding: 2em;
	border-radius: 6px;
}

.ms-proposal-modal-close {
	position: absolute;
	top: 0.5em;
	right: 0.75em;
	background: none;
	border: none;
	font-size: 1.5em;
	cursor: pointer;
	line-height: 1;
}

.ms-proposal-field {
	display: flex;
	flex-direction: column;
	gap: 0.35em;
	margin-bottom: 1em;
}

.ms-proposal-field textarea {
	resize: vertical;
}

.ms-proposal-no-contact-hint {
	font-size: 0.85em;
	opacity: 0.75;
}

.ms-proposal-errors:empty {
	display: none;
}

.ms-proposal-errors {
	color: #a94442;
	margin-bottom: 1em;
}

.ms-proposal-confirmation {
	background: #f6f6f6;
	border-radius: 4px;
	padding: 1em;
	margin-bottom: 1em;
}

.ms-proposal-confirmation[hidden] {
	display: none;
}

.ms-proposal-confirmation-insufficient {
	color: #a94442;
	font-weight: 600;
}

.ms-proposal-confirmation-insufficient[hidden] {
	display: none;
}

.ms-proposal-confirmation-insufficient a {
	text-decoration: underline;
}

/*
 * Fase 5.8 (2nd iteration), point C — the listing card's link replacing the
 * native "Make an Offer" anchor keeps the same HivePress classes for
 * icon/position, no extra rules needed beyond this marker (kept for any
 * future targeted override without touching the theme).
 */
.ms-proposal-listing-link {
	cursor: pointer;
}

/*
 * Fase 5.9 — client's "proposals received" list on their own request page.
 */
.ms-proposals-received {
	margin-top: 2em;
	padding-top: 1.5em;
	border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.ms-proposals-received-heading {
	margin-bottom: 0.75em;
}

.ms-proposals-received-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 1em;
}

.ms-proposals-received-item {
	background: rgba(0, 0, 0, 0.03);
	border-radius: 4px;
	padding: 1em;
}

.ms-proposals-received-vendor {
	font-weight: 600;
	margin-bottom: 0.35em;
}

.ms-proposals-received-message {
	white-space: pre-wrap;
	margin-bottom: 0.5em;
}

.ms-proposals-received-price {
	font-weight: 600;
	margin-bottom: 0.5em;
}

/*
 * Fase 5.11 (2nd iteration) — chat link + review button side by side, same
 * row, both HivePress-styled buttons. `.ms-review-action` (review-form.css)
 * wraps the review button plus its modal (the modal is reparented to
 * `<body>` at runtime by review-form.js, so by the time it matters it is no
 * longer a flex sibling here) — `display: contents` lifts its direct child
 * button into this flex row instead of the wrapper div itself, so both
 * buttons get equal-width flex columns.
 */
.ms-proposals-received-actions {
	display: flex;
	gap: 0.5em;
	align-items: stretch;
	flex-wrap: wrap;
	margin-top: 0.75em;
}

.ms-proposals-received-actions > .ms-proposals-received-chat-button,
.ms-proposals-received-actions > .ms-review-action {
	flex: 1 1 auto;
}

.ms-proposals-received-actions > .ms-review-action {
	display: contents;
}

.ms-proposals-received-actions .ms-review-open-button {
	width: 100%;
}

@media (max-width: 480px) {
	.ms-proposals-received-item {
		padding: 0.75em;
	}

	.ms-proposals-received-actions {
		flex-direction: column;
	}
}
