/**
 * WC Quick Order - estilos propios, neutros respecto al tema activo.
 */

.wcqo-container {
	max-width: 720px;
	margin: 0 auto;
	font-size: 16px;
	line-height: 1.5;
	box-sizing: border-box;
}

.wcqo-container *,
.wcqo-container *::before,
.wcqo-container *::after {
	box-sizing: inherit;
}

.wcqo-search-input {
	width: 100%;
	padding: 10px 14px;
	font-size: 16px;
	border: 1px solid #ccc;
	border-radius: 4px;
}

.wcqo-results {
	margin-top: 12px;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.wcqo-result-row {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px;
	border: 1px solid #e2e2e2;
	border-radius: 4px;
	background: #fff;
	transition: opacity 0.2s ease;
}

.wcqo-result-row.is-in-list {
	opacity: 0.5;
}

.wcqo-result-image {
	width: 48px;
	height: 48px;
	object-fit: cover;
	border-radius: 3px;
	flex-shrink: 0;
}

.wcqo-result-info {
	flex-grow: 1;
	min-width: 0;
}

.wcqo-result-name {
	font-weight: 600;
	overflow-wrap: break-word;
}

.wcqo-result-sku {
	font-size: 0.85em;
	opacity: 0.7;
}

.wcqo-result-price {
	font-size: 0.9em;
}

.wcqo-result-action {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	gap: 6px;
}

.wcqo-add-btn,
.wcqo-add-all-btn {
	cursor: pointer;
	padding: 8px 14px;
	border: none;
	border-radius: 4px;
	background: #2c6e49;
	color: #fff;
	font-size: 0.95em;
	white-space: nowrap;
}

.wcqo-add-btn:hover:not(:disabled),
.wcqo-add-all-btn:hover:not(:disabled) {
	background: #234f37;
}

.wcqo-add-all-btn:disabled {
	background: #a9a9a9;
	cursor: not-allowed;
}

.wcqo-add-btn:disabled,
.wcqo-add-btn.is-in-list {
	background: #1e3d2b;
	opacity: 0.85;
	cursor: not-allowed;
}

.wcqo-out-of-stock {
	font-size: 0.85em;
	color: #b32d2e;
	font-weight: 600;
	white-space: nowrap;
}

.wcqo-variation-selector {
	display: flex;
	flex-direction: column;
	gap: 6px;
	align-items: flex-end;
}

.wcqo-variation-select {
	max-width: 220px;
}

.wcqo-load-more {
	display: block;
	margin: 12px auto 0;
	padding: 8px 20px;
	cursor: pointer;
	border: 1px solid #2c6e49;
	border-radius: 4px;
	background: transparent;
	color: #2c6e49;
}

.wcqo-load-more[hidden] {
	display: none;
}

.wcqo-load-more-end {
	display: block;
	margin: 12px auto 0;
	text-align: center;
}

.wcqo-load-more-end[hidden] {
	display: none;
}

.wcqo-no-results,
.wcqo-error,
.wcqo-list-empty,
.wcqo-load-more-end {
	opacity: 0.75;
	font-style: italic;
}

.wcqo-list-wrapper {
	margin-top: 32px;
	padding-top: 20px;
	border-top: 2px solid #e2e2e2;
}

.wcqo-list-title {
	margin-bottom: 12px;
}

.wcqo-list {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.wcqo-list-row {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 8px 10px;
	border: 1px solid #e2e2e2;
	border-radius: 4px;
}

.wcqo-list-name {
	flex-grow: 1;
	min-width: 0;
	overflow-wrap: break-word;
}

.wcqo-list-qty {
	display: flex;
	align-items: center;
	gap: 4px;
	flex-shrink: 0;
}

.wcqo-qty-decrease,
.wcqo-qty-increase {
	width: 28px;
	height: 28px;
	cursor: pointer;
	border: 1px solid #ccc;
	border-radius: 3px;
	background: #f6f6f6;
}

.wcqo-qty-input {
	width: 48px;
	text-align: center;
	padding: 4px;
	border: 1px solid #ccc;
	border-radius: 3px;
}

.wcqo-remove-btn {
	flex-shrink: 0;
	cursor: pointer;
	padding: 6px 10px;
	border: 1px solid #b32d2e;
	border-radius: 4px;
	background: transparent;
	color: #b32d2e;
	font-size: 0.85em;
}

.wcqo-list-actions {
	margin-top: 16px;
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
}

.wcqo-success-message {
	color: #2c6e49;
	font-weight: 600;
	margin: 0;
}

.wcqo-reorder-notice:not([hidden]) {
	display: block;
	margin: 0 0 12px;
	padding: 10px 14px;
	border: 1px solid #dba617;
	border-radius: 4px;
	background: #fcf9e8;
	color: #674d00;
	font-size: 0.9em;
}

.wcqo-reorder-detail {
	margin-top: 16px;
}

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

.wcqo-modal-overlay[hidden] {
	display: none;
}

.wcqo-modal {
	background: #fff;
	border-radius: 6px;
	padding: 24px;
	max-width: 420px;
	width: 90%;
	box-shadow: 0 4px 24px rgba( 0, 0, 0, 0.2 );
}

.wcqo-modal-title {
	margin: 0 0 12px;
}

.wcqo-modal-body {
	margin: 0 0 20px;
}

.wcqo-modal-actions {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.wcqo-modal-btn {
	cursor: pointer;
	padding: 10px 14px;
	border: none;
	border-radius: 4px;
	font-size: 0.95em;
}

.wcqo-modal-btn-merge {
	background: #2c6e49;
	color: #fff;
}

.wcqo-modal-btn-merge:hover {
	background: #234f37;
}

.wcqo-modal-btn-replace {
	background: #b32d2e;
	color: #fff;
}

.wcqo-modal-btn-replace:hover {
	background: #8f2423;
}

.wcqo-modal-btn-cancel {
	background: transparent;
	border: 1px solid #ccc;
}

@media ( max-width: 480px ) {
	.wcqo-result-row,
	.wcqo-list-row {
		flex-wrap: wrap;
	}

	.wcqo-result-action {
		width: 100%;
		justify-content: flex-end;
	}
}
